# unpatched code clones: 2278

[CVE-2021-0430_1.diff] rw_mfc.cc #4
+#include <log/log.h> + uint16_t saved_length; + saved_length = p_mfc->ndef_length; - /* Skip all reserved and lock bytes */ - while ((offset < len) && (p_mfc->work_offset < p_mfc->ndef_length)) + if (!failed && saved_length >= p_mfc->ndef_length) { + /* Skip all reserved and lock bytes */ + while ((offset < len) && (p_mfc->work_offset < p_mfc->ndef_length)) - { - /* Collect the NDEF Message */ - p_mfc->p_ndef_buffer[p_mfc->work_offset] = p[offset]; - p_mfc->work_offset++; - offset++; + { + /* Collect the NDEF Message */ + p_mfc->p_ndef_buffer[p_mfc->work_offset] = p[offset]; + p_mfc->work_offset++; + offset++; + } + } else { + android_errorWriteLog(0x534e4554, "178725766");
/media/esteban/ACOS/ResurrectionX/vendor/nxp/opensource/commonsys/external/libnfc-nci/SN100x/src/nfc/tags/rw_mfc.cc
590
591
592
593
594
595
596
597
598
599
/* The Ndef Message offset may be present in the read 16 bytes */ offset = p_mfc->ndef_start_pos; if (!rw_nfc_decodeTlv(data)) { failed = true; DLOG_IF(INFO, nfc_debug_enabled) << __func__ << " FAILED finding TLV"; } } /* Skip all reserved and lock bytes */
+ show +
600
601
602
603
604
605
606
while ((offset < len) && (p_mfc->work_offset < p_mfc->ndef_length)) { /* Collect the NDEF Message */ p_mfc->p_ndef_buffer[p_mfc->work_offset] = p[offset]; p_mfc->work_offset++; offset++;
+ show +
607
608
609
610
611
612
613
614
615
616
} if (p_mfc->work_offset >= p_mfc->ndef_length) { done = true; p_mfc->ndef_status = MFC_NDEF_READ; } else { /* Read next blocks */ if (rw_mfc_readBlock(p_mfc->next_block.block) != NFC_STATUS_OK) { failed = true; DLOG_IF(INFO, nfc_debug_enabled)
/media/esteban/ACOS/ResurrectionX/vendor/nxp/opensource/commonsys/external/libnfc-nci/src/nfc/tags/rw_mfc.cc
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
/* The Ndef Message offset may be present in the read 16 bytes */ offset = p_mfc->ndef_start_pos; if (!rw_nfc_decodeTlv(data)) { failed = true; DLOG_IF(INFO, nfc_debug_enabled) << __func__ << " FAILED finding TLV"; } } /* Skip all reserved and lock bytes */
+ show +
1047
1048
1049
1050
1051
1052
1053
while ((offset < len) && (p_mfc->work_offset < p_mfc->ndef_length)) { /* Collect the NDEF Message */ p_mfc->p_ndef_buffer[p_mfc->work_offset] = p[offset]; p_mfc->work_offset++; offset++;
+ show +
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
} if (p_mfc->work_offset >= p_mfc->ndef_length) { done = true; p_mfc->ndef_status = MFC_NDEF_READ; } else { /* Read next blocks */ if (rw_mfc_readBlock(p_mfc->next_block.block) != NFC_STATUS_OK) { failed = true; DLOG_IF(INFO, nfc_debug_enabled)
/media/esteban/ACOS/ResurrectionX/system/nfc/src/nfc/tags/rw_mfc.cc
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
offset = p_mfc->ndef_start_pos; if (!rw_nfc_decodeTlv(data)) { failed = true; DLOG_IF(INFO, nfc_debug_enabled) << __func__ << " FAILED finding TLV"; } } if (!failed && saved_length >= p_mfc->ndef_length) { /* Skip all reserved and lock bytes */
+ show +
1041
1042
1043
1044
1045
1046
1047
while ((offset < len) && (p_mfc->work_offset < p_mfc->ndef_length)) { /* Collect the NDEF Message */ p_mfc->p_ndef_buffer[p_mfc->work_offset] = p[offset]; p_mfc->work_offset++; offset++;
+ show +
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
} } else { android_errorWriteLog(0x534e4554, "178725766"); } if (p_mfc->work_offset >= p_mfc->ndef_length) { done = true; p_mfc->ndef_status = MFC_NDEF_READ; } else { /* Read next blocks */

[CVE-2020-0070_1.diff] rw_t2t_ndef.cc #1
- p_t2t->lock_tlv[p_t2t->num_lock_tlvs].num_bits = - p_t2t->tlv_value[1]; - count = p_t2t->tlv_value[1] / 8 + - ((p_t2t->tlv_value[1] % 8 != 0) ? 1 : 0); + /* Note: 0 value in DLA_NbrLockBits means 256 */ + count = p_t2t->tlv_value[1]; + /* Set it to max value that can be stored in lockbytes */ + if (count == 0) { +#if RW_T2T_MAX_LOCK_BYTES > 0x1F + count = UCHAR_MAX; +#else + count = RW_T2T_MAX_LOCK_BYTES * TAG_BITS_PER_BYTE; +#endif + } + p_t2t->lock_tlv[p_t2t->num_lock_tlvs].num_bits = count; + count = count / TAG_BITS_PER_BYTE + + ((count % TAG_BITS_PER_BYTE != 0) ? 1 : 0);
/media/esteban/ACOS/ResurrectionX/vendor/nxp/opensource/commonsys/external/libnfc-nci/SN100x/src/nfc/tags/rw_t2t_ndef.cc
608
609
610
611
612
613
614
615
616
617
/* Lock TLV is collected and buffered in tlv_value, now decode * it */ p_t2t->lock_tlv[p_t2t->num_lock_tlvs].offset = (p_t2t->tlv_value[0] >> 4) & 0x0F; p_t2t->lock_tlv[p_t2t->num_lock_tlvs].offset *= (uint8_t)tags_pow(2, p_t2t->tlv_value[2] & 0x0F); p_t2t->lock_tlv[p_t2t->num_lock_tlvs].offset += p_t2t->tlv_value[0] & 0x0F; p_t2t->lock_tlv[p_t2t->num_lock_tlvs].bytes_locked_per_bit = (uint8_t)tags_pow(2, ((p_t2t->tlv_value[2] & 0xF0) >> 4));
+ show +
618
619
620
621
p_t2t->lock_tlv[p_t2t->num_lock_tlvs].num_bits = p_t2t->tlv_value[1]; count = p_t2t->tlv_value[1] / 8 + ((p_t2t->tlv_value[1] % 8 != 0) ? 1 : 0);
+ show +
622
623
624
625
626
627
628
629
630
631
/* Extract lockbytes info addressed by this Lock TLV */ xx = 0; if (count > RW_T2T_MAX_LOCK_BYTES) { count = RW_T2T_MAX_LOCK_BYTES; android_errorWriteLog(0x534e4554, "112161557"); } while (xx < count) { p_t2t->lockbyte[p_t2t->num_lockbytes].tlv_index = p_t2t->num_lock_tlvs;
/media/esteban/ACOS/ResurrectionX/vendor/nxp/opensource/commonsys/external/libnfc-nci/src/nfc/tags/rw_t2t_ndef.cc
626
627
628
629
630
631
632
633
634
635
/* Lock TLV is collected and buffered in tlv_value, now decode * it */ p_t2t->lock_tlv[p_t2t->num_lock_tlvs].offset = (p_t2t->tlv_value[0] >> 4) & 0x0F; p_t2t->lock_tlv[p_t2t->num_lock_tlvs].offset *= (uint8_t)tags_pow(2, p_t2t->tlv_value[2] & 0x0F); p_t2t->lock_tlv[p_t2t->num_lock_tlvs].offset += p_t2t->tlv_value[0] & 0x0F; p_t2t->lock_tlv[p_t2t->num_lock_tlvs].bytes_locked_per_bit = (uint8_t)tags_pow(2, ((p_t2t->tlv_value[2] & 0xF0) >> 4));
+ show +
636
637
638
639
p_t2t->lock_tlv[p_t2t->num_lock_tlvs].num_bits = p_t2t->tlv_value[1]; count = p_t2t->tlv_value[1] / 8 + ((p_t2t->tlv_value[1] % 8 != 0) ? 1 : 0);
+ show +
640
641
642
643
644
645
646
647
648
649
/* Extract lockbytes info addressed by this Lock TLV */ xx = 0; if (count > RW_T2T_MAX_LOCK_BYTES) { count = RW_T2T_MAX_LOCK_BYTES; android_errorWriteLog(0x534e4554, "112161557"); } while (xx < count) { p_t2t->lockbyte[p_t2t->num_lockbytes].tlv_index = p_t2t->num_lock_tlvs;

[CVE-2020-0071_1.diff] rw_t2t_ndef.cc #1
- p_t2t->lock_tlv[p_t2t->num_lock_tlvs].num_bits = - p_t2t->tlv_value[1]; - count = p_t2t->tlv_value[1] / 8 + - ((p_t2t->tlv_value[1] % 8 != 0) ? 1 : 0); + /* Note: 0 value in DLA_NbrLockBits means 256 */ + count = p_t2t->tlv_value[1]; + /* Set it to max value that can be stored in lockbytes */ + if (count == 0) { +#if RW_T2T_MAX_LOCK_BYTES > 0x1F + count = UCHAR_MAX; +#else + count = RW_T2T_MAX_LOCK_BYTES * TAG_BITS_PER_BYTE; +#endif + } + p_t2t->lock_tlv[p_t2t->num_lock_tlvs].num_bits = count; + count = count / TAG_BITS_PER_BYTE + + ((count % TAG_BITS_PER_BYTE != 0) ? 1 : 0);
/media/esteban/ACOS/ResurrectionX/vendor/nxp/opensource/commonsys/external/libnfc-nci/SN100x/src/nfc/tags/rw_t2t_ndef.cc
608
609
610
611
612
613
614
615
616
617
/* Lock TLV is collected and buffered in tlv_value, now decode * it */ p_t2t->lock_tlv[p_t2t->num_lock_tlvs].offset = (p_t2t->tlv_value[0] >> 4) & 0x0F; p_t2t->lock_tlv[p_t2t->num_lock_tlvs].offset *= (uint8_t)tags_pow(2, p_t2t->tlv_value[2] & 0x0F); p_t2t->lock_tlv[p_t2t->num_lock_tlvs].offset += p_t2t->tlv_value[0] & 0x0F; p_t2t->lock_tlv[p_t2t->num_lock_tlvs].bytes_locked_per_bit = (uint8_t)tags_pow(2, ((p_t2t->tlv_value[2] & 0xF0) >> 4));
+ show +
618
619
620
621
p_t2t->lock_tlv[p_t2t->num_lock_tlvs].num_bits = p_t2t->tlv_value[1]; count = p_t2t->tlv_value[1] / 8 + ((p_t2t->tlv_value[1] % 8 != 0) ? 1 : 0);
+ show +
622
623
624
625
626
627
628
629
630
631
/* Extract lockbytes info addressed by this Lock TLV */ xx = 0; if (count > RW_T2T_MAX_LOCK_BYTES) { count = RW_T2T_MAX_LOCK_BYTES; android_errorWriteLog(0x534e4554, "112161557"); } while (xx < count) { p_t2t->lockbyte[p_t2t->num_lockbytes].tlv_index = p_t2t->num_lock_tlvs;
/media/esteban/ACOS/ResurrectionX/vendor/nxp/opensource/commonsys/external/libnfc-nci/src/nfc/tags/rw_t2t_ndef.cc
626
627
628
629
630
631
632
633
634
635
/* Lock TLV is collected and buffered in tlv_value, now decode * it */ p_t2t->lock_tlv[p_t2t->num_lock_tlvs].offset = (p_t2t->tlv_value[0] >> 4) & 0x0F; p_t2t->lock_tlv[p_t2t->num_lock_tlvs].offset *= (uint8_t)tags_pow(2, p_t2t->tlv_value[2] & 0x0F); p_t2t->lock_tlv[p_t2t->num_lock_tlvs].offset += p_t2t->tlv_value[0] & 0x0F; p_t2t->lock_tlv[p_t2t->num_lock_tlvs].bytes_locked_per_bit = (uint8_t)tags_pow(2, ((p_t2t->tlv_value[2] & 0xF0) >> 4));
+ show +
636
637
638
639
p_t2t->lock_tlv[p_t2t->num_lock_tlvs].num_bits = p_t2t->tlv_value[1]; count = p_t2t->tlv_value[1] / 8 + ((p_t2t->tlv_value[1] % 8 != 0) ? 1 : 0);
+ show +
640
641
642
643
644
645
646
647
648
649
/* Extract lockbytes info addressed by this Lock TLV */ xx = 0; if (count > RW_T2T_MAX_LOCK_BYTES) { count = RW_T2T_MAX_LOCK_BYTES; android_errorWriteLog(0x534e4554, "112161557"); } while (xx < count) { p_t2t->lockbyte[p_t2t->num_lockbytes].tlv_index = p_t2t->num_lock_tlvs;

[CVE-2020-0057_1.diff] btm_inq.cc #3
- if (inq_res_mode == BTM_INQ_RESULT_EXTENDED && (num_resp > 1)) { - BTM_TRACE_ERROR("btm_process_inq_results() extended results (%d) > 1", - num_resp); - return; + if (inq_res_mode == BTM_INQ_RESULT_EXTENDED) { + if (num_resp > 1) { + BTM_TRACE_ERROR("btm_process_inq_results() extended results (%d) > 1", + num_resp); + return; + } + + constexpr uint16_t extended_inquiry_result_size = 254; + if (hci_evt_len - 1 != extended_inquiry_result_size) { + android_errorWriteLog(0x534e4554, "141620271"); + BTM_TRACE_ERROR("%s: can't fit %d results in %d bytes", __func__, + num_resp, hci_evt_len); + return; + } + } else if (inq_res_mode == BTM_INQ_RESULT_STANDARD || + inq_res_mode == BTM_INQ_RESULT_WITH_RSSI) { + constexpr uint16_t inquiry_result_size = 14; + if (hci_evt_len < num_resp * inquiry_result_size) { + android_errorWriteLog(0x534e4554, "141620271"); + BTM_TRACE_ERROR("%s: can't fit %d results in %d bytes", __func__, + num_resp, hci_evt_len); + return; + }
/media/esteban/ACOS/ResurrectionX/vendor/qcom/opensource/commonsys/system/bt/stack/btm/btm_inq.cc
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
BTM_TRACE_DEBUG( "btm_process_inq_results inq_active:0x%x state:%d inqfilt_active:%d", btm_cb.btm_inq_vars.inq_active, btm_cb.btm_inq_vars.state, btm_cb.btm_inq_vars.inqfilt_active); #endif /* Only process the results if the BR inquiry is still active */ if (!(p_inq->inq_active & BTM_BR_INQ_ACTIVE_MASK)) return; STREAM_TO_UINT8(num_resp, p);
+ show +
1712
1713
1714
1715
if (inq_res_mode == BTM_INQ_RESULT_EXTENDED && (num_resp > 1)) { BTM_TRACE_ERROR("btm_process_inq_results() extended results (%d) > 1", num_resp); return;
+ show +
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
} for (xx = 0; xx < num_resp; xx++) { update = false; /* Extract inquiry results */ STREAM_TO_BDADDR(bda, p); STREAM_TO_UINT8(page_scan_rep_mode, p); STREAM_TO_UINT8(page_scan_per_mode, p); if (inq_res_mode == BTM_INQ_RESULT_STANDARD) {

[CVE-2023-40093_1.diff] BUILD.gn #8
- public_configs = [ - ":gmock_config", - ":gtest_config", - ] + public_deps = [ ":gtest" ] + + public_configs = [ ":gmock_config" ]
/media/esteban/ACOS/ResurrectionX/vendor/qcom/opensource/commonsys/system/bt/build/secondary/third_party/googletest/BUILD.gn
61
62
63
64
65
66
67
68
69
70
sources = [ "googlemock/src/gmock-all.cc", ] # This project includes some stuff form gtest's guts. include_dirs = [ "googlemock", "googlemock/include", ]
+ show +
71
72
73
74
public_configs = [ ":gmock_config", ":gtest_config", ]
+ show +
75
76
77
78
79
80
81
82
83
84
} static_library("gmock_main") { testonly = true sources = [ "googlemock/src/gmock_main.cc", ] deps = [ ":gmock", ":gtest",
/media/esteban/ACOS/ResurrectionX/system/bt/build/secondary/third_party/googletest/BUILD.gn
61
62
63
64
65
66
67
68
69
70
sources = [ "googlemock/src/gmock-all.cc", ] # This project includes some stuff form gtest's guts. include_dirs = [ "googlemock", "googlemock/include", ]
+ show +
71
72
73
74
public_configs = [ ":gmock_config", ":gtest_config", ]
+ show +
75
76
77
78
79
80
81
82
83
84
} static_library("gmock_main") { testonly = true sources = [ "googlemock/src/gmock_main.cc", ] deps = [ ":gmock", ":gtest",

[CVE-2018-9545_1.diff] btif_hd.cc #2
- app_info.p_name = (char*)osi_malloc(BTIF_HD_APP_NAME_LEN); - memcpy(app_info.p_name, p_app_param->name, BTIF_HD_APP_NAME_LEN); - app_info.p_description = (char*)osi_malloc(BTIF_HD_APP_DESCRIPTION_LEN); - memcpy(app_info.p_description, p_app_param->description, - BTIF_HD_APP_DESCRIPTION_LEN); - app_info.p_provider = (char*)osi_malloc(BTIF_HD_APP_PROVIDER_LEN); - memcpy(app_info.p_provider, p_app_param->provider, BTIF_HD_APP_PROVIDER_LEN); + if (strlen(p_app_param->name) >= BTIF_HD_APP_NAME_LEN || + strlen(p_app_param->description) >= BTIF_HD_APP_DESCRIPTION_LEN || + strlen(p_app_param->provider) >= BTIF_HD_APP_PROVIDER_LEN) { + android_errorWriteLog(0x534e4554, "113037220"); + } + app_info.p_name = (char*)osi_calloc(BTIF_HD_APP_NAME_LEN); + strlcpy(app_info.p_name, p_app_param->name, BTIF_HD_APP_NAME_LEN); + app_info.p_description = (char*)osi_calloc(BTIF_HD_APP_DESCRIPTION_LEN); + strlcpy(app_info.p_description, p_app_param->description, + BTIF_HD_APP_DESCRIPTION_LEN); + app_info.p_provider = (char*)osi_calloc(BTIF_HD_APP_PROVIDER_LEN); + strlcpy(app_info.p_provider, p_app_param->provider, BTIF_HD_APP_PROVIDER_LEN);
/media/esteban/ACOS/ResurrectionX/vendor/qcom/opensource/commonsys/system/bt/btif/src/btif_hd.cc
392
393
394
395
396
397
398
399
400
401
static bt_status_t register_app(bthd_app_param_t* p_app_param, bthd_qos_param_t* p_in_qos, bthd_qos_param_t* p_out_qos) { BTIF_TRACE_API("%s", __func__); if (btif_hd_cb.app_registered) { BTIF_TRACE_WARNING("%s: application already registered", __func__); return BT_STATUS_BUSY; }
+ show +
402
403
404
405
406
407
408
app_info.p_name = (char*)osi_malloc(BTIF_HD_APP_NAME_LEN); memcpy(app_info.p_name, p_app_param->name, BTIF_HD_APP_NAME_LEN); app_info.p_description = (char*)osi_malloc(BTIF_HD_APP_DESCRIPTION_LEN); memcpy(app_info.p_description, p_app_param->description, BTIF_HD_APP_DESCRIPTION_LEN); app_info.p_provider = (char*)osi_malloc(BTIF_HD_APP_PROVIDER_LEN); memcpy(app_info.p_provider, p_app_param->provider, BTIF_HD_APP_PROVIDER_LEN);
+ show +
409
410
411
412
413
414
415
416
417
418
app_info.subclass = p_app_param->subclass; app_info.descriptor.dl_len = p_app_param->desc_list_len; app_info.descriptor.dsc_list = (uint8_t*)osi_malloc(app_info.descriptor.dl_len); memcpy(app_info.descriptor.dsc_list, p_app_param->desc_list, p_app_param->desc_list_len); in_qos.service_type = p_in_qos->service_type; in_qos.token_rate = p_in_qos->token_rate; in_qos.token_bucket_size = p_in_qos->token_bucket_size;

[CVE-2018-9544_1.diff] btif_hd.cc #2
- app_info.p_name = (char*)osi_malloc(BTIF_HD_APP_NAME_LEN); - memcpy(app_info.p_name, p_app_param->name, BTIF_HD_APP_NAME_LEN); - app_info.p_description = (char*)osi_malloc(BTIF_HD_APP_DESCRIPTION_LEN); - memcpy(app_info.p_description, p_app_param->description, - BTIF_HD_APP_DESCRIPTION_LEN); - app_info.p_provider = (char*)osi_malloc(BTIF_HD_APP_PROVIDER_LEN); - memcpy(app_info.p_provider, p_app_param->provider, BTIF_HD_APP_PROVIDER_LEN); + if (strlen(p_app_param->name) >= BTIF_HD_APP_NAME_LEN || + strlen(p_app_param->description) >= BTIF_HD_APP_DESCRIPTION_LEN || + strlen(p_app_param->provider) >= BTIF_HD_APP_PROVIDER_LEN) { + android_errorWriteLog(0x534e4554, "113037220"); + } + app_info.p_name = (char*)osi_calloc(BTIF_HD_APP_NAME_LEN); + strlcpy(app_info.p_name, p_app_param->name, BTIF_HD_APP_NAME_LEN); + app_info.p_description = (char*)osi_calloc(BTIF_HD_APP_DESCRIPTION_LEN); + strlcpy(app_info.p_description, p_app_param->description, + BTIF_HD_APP_DESCRIPTION_LEN); + app_info.p_provider = (char*)osi_calloc(BTIF_HD_APP_PROVIDER_LEN); + strlcpy(app_info.p_provider, p_app_param->provider, BTIF_HD_APP_PROVIDER_LEN);
/media/esteban/ACOS/ResurrectionX/vendor/qcom/opensource/commonsys/system/bt/btif/src/btif_hd.cc
392
393
394
395
396
397
398
399
400
401
static bt_status_t register_app(bthd_app_param_t* p_app_param, bthd_qos_param_t* p_in_qos, bthd_qos_param_t* p_out_qos) { BTIF_TRACE_API("%s", __func__); if (btif_hd_cb.app_registered) { BTIF_TRACE_WARNING("%s: application already registered", __func__); return BT_STATUS_BUSY; }
+ show +
402
403
404
405
406
407
408
app_info.p_name = (char*)osi_malloc(BTIF_HD_APP_NAME_LEN); memcpy(app_info.p_name, p_app_param->name, BTIF_HD_APP_NAME_LEN); app_info.p_description = (char*)osi_malloc(BTIF_HD_APP_DESCRIPTION_LEN); memcpy(app_info.p_description, p_app_param->description, BTIF_HD_APP_DESCRIPTION_LEN); app_info.p_provider = (char*)osi_malloc(BTIF_HD_APP_PROVIDER_LEN); memcpy(app_info.p_provider, p_app_param->provider, BTIF_HD_APP_PROVIDER_LEN);
+ show +
409
410
411
412
413
414
415
416
417
418
app_info.subclass = p_app_param->subclass; app_info.descriptor.dl_len = p_app_param->desc_list_len; app_info.descriptor.dsc_list = (uint8_t*)osi_malloc(app_info.descriptor.dl_len); memcpy(app_info.descriptor.dsc_list, p_app_param->desc_list, p_app_param->desc_list_len); in_qos.service_type = p_in_qos->service_type; in_qos.token_rate = p_in_qos->token_rate; in_qos.token_bucket_size = p_in_qos->token_bucket_size;

[CVE-2015-3842_1.diff] EffectBundle.cpp #2
- if (pCmdData == NULL|| - cmdSize != sizeof(effect_config_t)|| - pReplyData == NULL|| - *replySize != sizeof(int)){ + if (pCmdData == NULL || cmdSize != sizeof(effect_config_t) || + pReplyData == NULL || replySize == NULL || *replySize != sizeof(int)) {
/media/esteban/ACOS/ResurrectionX/hardware/qcom-caf/msm8996/audio/voice_processing/voice_processing.c
540
541
542
543
544
545
546
547
548
549
switch (cmdCode) { case EFFECT_CMD_INIT: if (pReplyData == NULL || *replySize != sizeof(int)) return -EINVAL; *(int *)pReplyData = 0; break; case EFFECT_CMD_SET_CONFIG: {
+ show +
550
551
552
553
if (pCmdData == NULL|| cmdSize != sizeof(effect_config_t)|| pReplyData == NULL|| *replySize != sizeof(int)) {
+ show +
554
555
556
557
558
559
560
561
562
563
ALOGV("fx_command() EFFECT_CMD_SET_CONFIG invalid args"); return -EINVAL; } *(int *)pReplyData = session_set_config(effect->session, (effect_config_t *)pCmdData); if (*(int *)pReplyData != 0) break; if (effect->state != EFFECT_STATE_ACTIVE) *(int *)pReplyData = effect_set_state(effect, EFFECT_STATE_CONFIG);
/media/esteban/ACOS/ResurrectionX/hardware/qcom-caf/sm8250/audio/voice_processing/voice_processing.c
540
541
542
543
544
545
546
547
548
549
switch (cmdCode) { case EFFECT_CMD_INIT: if (pReplyData == NULL || *replySize != sizeof(int)) return -EINVAL; *(int *)pReplyData = 0; break; case EFFECT_CMD_SET_CONFIG: {
+ show +
550
551
552
553
if (pCmdData == NULL|| cmdSize != sizeof(effect_config_t)|| pReplyData == NULL|| *replySize != sizeof(int)) {
+ show +
554
555
556
557
558
559
560
561
562
563
ALOGV("fx_command() EFFECT_CMD_SET_CONFIG invalid args"); return -EINVAL; } *(int *)pReplyData = session_set_config(effect->session, (effect_config_t *)pCmdData); if (*(int *)pReplyData != 0) break; if (effect->state != EFFECT_STATE_ACTIVE) *(int *)pReplyData = effect_set_state(effect, EFFECT_STATE_CONFIG);
/media/esteban/ACOS/ResurrectionX/hardware/qcom-caf/msm8916/audio/voice_processing/voice_processing.c
524
525
526
527
528
529
530
531
532
533
switch (cmdCode) { case EFFECT_CMD_INIT: if (pReplyData == NULL || *replySize != sizeof(int)) return -EINVAL; *(int *)pReplyData = 0; break; case EFFECT_CMD_SET_CONFIG: {
+ show +
534
535
536
537
if (pCmdData == NULL|| cmdSize != sizeof(effect_config_t)|| pReplyData == NULL|| *replySize != sizeof(int)) {
+ show +
538
539
540
541
542
543
544
545
546
547
ALOGV("fx_command() EFFECT_CMD_SET_CONFIG invalid args"); return -EINVAL; } *(int *)pReplyData = session_set_config(effect->session, (effect_config_t *)pCmdData); if (*(int *)pReplyData != 0) break; if (effect->state != EFFECT_STATE_ACTIVE) *(int *)pReplyData = effect_set_state(effect, EFFECT_STATE_CONFIG);
/media/esteban/ACOS/ResurrectionX/hardware/qcom-caf/msm8952/audio/voice_processing/voice_processing.c
525
526
527
528
529
530
531
532
533
534
switch (cmdCode) { case EFFECT_CMD_INIT: if (pReplyData == NULL || *replySize != sizeof(int)) return -EINVAL; *(int *)pReplyData = 0; break; case EFFECT_CMD_SET_CONFIG: {
+ show +
535
536
537
538
if (pCmdData == NULL|| cmdSize != sizeof(effect_config_t)|| pReplyData == NULL|| *replySize != sizeof(int)) {
+ show +
539
540
541
542
543
544
545
546
547
548
ALOGV("fx_command() EFFECT_CMD_SET_CONFIG invalid args"); return -EINVAL; } *(int *)pReplyData = session_set_config(effect->session, (effect_config_t *)pCmdData); if (*(int *)pReplyData != 0) break; if (effect->state != EFFECT_STATE_ACTIVE) *(int *)pReplyData = effect_set_state(effect, EFFECT_STATE_CONFIG);
/media/esteban/ACOS/ResurrectionX/hardware/qcom-caf/sm8150/audio/voice_processing/voice_processing.c
540
541
542
543
544
545
546
547
548
549
switch (cmdCode) { case EFFECT_CMD_INIT: if (pReplyData == NULL || *replySize != sizeof(int)) return -EINVAL; *(int *)pReplyData = 0; break; case EFFECT_CMD_SET_CONFIG: {
+ show +
550
551
552
553
if (pCmdData == NULL|| cmdSize != sizeof(effect_config_t)|| pReplyData == NULL|| *replySize != sizeof(int)) {
+ show +
554
555
556
557
558
559
560
561
562
563
ALOGV("fx_command() EFFECT_CMD_SET_CONFIG invalid args"); return -EINVAL; } *(int *)pReplyData = session_set_config(effect->session, (effect_config_t *)pCmdData); if (*(int *)pReplyData != 0) break; if (effect->state != EFFECT_STATE_ACTIVE) *(int *)pReplyData = effect_set_state(effect, EFFECT_STATE_CONFIG);
/media/esteban/ACOS/ResurrectionX/hardware/qcom-caf/sdm845/audio/voice_processing/voice_processing.c
540
541
542
543
544
545
546
547
548
549
switch (cmdCode) { case EFFECT_CMD_INIT: if (pReplyData == NULL || *replySize != sizeof(int)) return -EINVAL; *(int *)pReplyData = 0; break; case EFFECT_CMD_SET_CONFIG: {
+ show +
550
551
552
553
if (pCmdData == NULL|| cmdSize != sizeof(effect_config_t)|| pReplyData == NULL|| *replySize != sizeof(int)) {
+ show +
554
555
556
557
558
559
560
561
562
563
ALOGV("fx_command() EFFECT_CMD_SET_CONFIG invalid args"); return -EINVAL; } *(int *)pReplyData = session_set_config(effect->session, (effect_config_t *)pCmdData); if (*(int *)pReplyData != 0) break; if (effect->state != EFFECT_STATE_ACTIVE) *(int *)pReplyData = effect_set_state(effect, EFFECT_STATE_CONFIG);
/media/esteban/ACOS/ResurrectionX/hardware/qcom-caf/msm8998/audio/voice_processing/voice_processing.c
540
541
542
543
544
545
546
547
548
549
switch (cmdCode) { case EFFECT_CMD_INIT: if (pReplyData == NULL || *replySize != sizeof(int)) return -EINVAL; *(int *)pReplyData = 0; break; case EFFECT_CMD_SET_CONFIG: {
+ show +
550
551
552
553
if (pCmdData == NULL|| cmdSize != sizeof(effect_config_t)|| pReplyData == NULL|| *replySize != sizeof(int)) {
+ show +
554
555
556
557
558
559
560
561
562
563
ALOGV("fx_command() EFFECT_CMD_SET_CONFIG invalid args"); return -EINVAL; } *(int *)pReplyData = session_set_config(effect->session, (effect_config_t *)pCmdData); if (*(int *)pReplyData != 0) break; if (effect->state != EFFECT_STATE_ACTIVE) *(int *)pReplyData = effect_set_state(effect, EFFECT_STATE_CONFIG);
/media/esteban/ACOS/ResurrectionX/hardware/qcom-caf/msm8960/audio/voice_processing/voice_processing.c
525
526
527
528
529
530
531
532
533
534
switch (cmdCode) { case EFFECT_CMD_INIT: if (pReplyData == NULL || *replySize != sizeof(int)) return -EINVAL; *(int *)pReplyData = 0; break; case EFFECT_CMD_SET_CONFIG: {
+ show +
535
536
537
538
if (pCmdData == NULL|| cmdSize != sizeof(effect_config_t)|| pReplyData == NULL|| *replySize != sizeof(int)) {
+ show +
539
540
541
542
543
544
545
546
547
548
ALOGV("fx_command() EFFECT_CMD_SET_CONFIG invalid args"); return -EINVAL; } *(int *)pReplyData = session_set_config(effect->session, (effect_config_t *)pCmdData); if (*(int *)pReplyData != 0) break; if (effect->state != EFFECT_STATE_ACTIVE) *(int *)pReplyData = effect_set_state(effect, EFFECT_STATE_CONFIG);
/media/esteban/ACOS/ResurrectionX/hardware/qcom-caf/msm8994/audio/voice_processing/voice_processing.c
524
525
526
527
528
529
530
531
532
533
switch (cmdCode) { case EFFECT_CMD_INIT: if (pReplyData == NULL || *replySize != sizeof(int)) return -EINVAL; *(int *)pReplyData = 0; break; case EFFECT_CMD_SET_CONFIG: {
+ show +
534
535
536
537
if (pCmdData == NULL|| cmdSize != sizeof(effect_config_t)|| pReplyData == NULL|| *replySize != sizeof(int)) {
+ show +
538
539
540
541
542
543
544
545
546
547
ALOGV("fx_command() EFFECT_CMD_SET_CONFIG invalid args"); return -EINVAL; } *(int *)pReplyData = session_set_config(effect->session, (effect_config_t *)pCmdData); if (*(int *)pReplyData != 0) break; if (effect->state != EFFECT_STATE_ACTIVE) *(int *)pReplyData = effect_set_state(effect, EFFECT_STATE_CONFIG);
/media/esteban/ACOS/ResurrectionX/hardware/qcom-caf/msm8974/audio/voice_processing/voice_processing.c
524
525
526
527
528
529
530
531
532
533
switch (cmdCode) { case EFFECT_CMD_INIT: if (pReplyData == NULL || *replySize != sizeof(int)) return -EINVAL; *(int *)pReplyData = 0; break; case EFFECT_CMD_SET_CONFIG: {
+ show +
534
535
536
537
if (pCmdData == NULL|| cmdSize != sizeof(effect_config_t)|| pReplyData == NULL|| *replySize != sizeof(int)) {
+ show +
538
539
540
541
542
543
544
545
546
547
ALOGV("fx_command() EFFECT_CMD_SET_CONFIG invalid args"); return -EINVAL; } *(int *)pReplyData = session_set_config(effect->session, (effect_config_t *)pCmdData); if (*(int *)pReplyData != 0) break; if (effect->state != EFFECT_STATE_ACTIVE) *(int *)pReplyData = effect_set_state(effect, EFFECT_STATE_CONFIG);
/media/esteban/ACOS/ResurrectionX/hardware/qcom/audio/voice_processing/voice_processing.c
533
534
535
536
537
538
539
540
541
542
switch (cmdCode) { case EFFECT_CMD_INIT: if (pReplyData == NULL || *replySize != sizeof(int)) return -EINVAL; *(int *)pReplyData = 0; break; case EFFECT_CMD_SET_CONFIG: {
+ show +
543
544
545
546
if (pCmdData == NULL|| cmdSize != sizeof(effect_config_t)|| pReplyData == NULL|| *replySize != sizeof(int)) {
+ show +
547
548
549
550
551
552
553
554
555
556
ALOGV("fx_command() EFFECT_CMD_SET_CONFIG invalid args"); return -EINVAL; } *(int *)pReplyData = session_set_config(effect->session, (effect_config_t *)pCmdData); if (*(int *)pReplyData != 0) break; if (effect->state != EFFECT_STATE_ACTIVE) *(int *)pReplyData = effect_set_state(effect, EFFECT_STATE_CONFIG);

[CVE-2015-3842_1.diff] EffectReverb.cpp #3
- if (pCmdData == NULL || - cmdSize != sizeof(effect_config_t) || - pReplyData == NULL || - *replySize != sizeof(int)) { + if (pCmdData == NULL || cmdSize != sizeof(effect_config_t) || + pReplyData == NULL || replySize == NULL || *replySize != sizeof(int)) {
/media/esteban/ACOS/ResurrectionX/hardware/qcom-caf/msm8996/audio/voice_processing/voice_processing.c
540
541
542
543
544
545
546
547
548
549
switch (cmdCode) { case EFFECT_CMD_INIT: if (pReplyData == NULL || *replySize != sizeof(int)) return -EINVAL; *(int *)pReplyData = 0; break; case EFFECT_CMD_SET_CONFIG: {
+ show +
550
551
552
553
if (pCmdData == NULL|| cmdSize != sizeof(effect_config_t)|| pReplyData == NULL|| *replySize != sizeof(int)) {
+ show +
554
555
556
557
558
559
560
561
562
563
ALOGV("fx_command() EFFECT_CMD_SET_CONFIG invalid args"); return -EINVAL; } *(int *)pReplyData = session_set_config(effect->session, (effect_config_t *)pCmdData); if (*(int *)pReplyData != 0) break; if (effect->state != EFFECT_STATE_ACTIVE) *(int *)pReplyData = effect_set_state(effect, EFFECT_STATE_CONFIG);
/media/esteban/ACOS/ResurrectionX/hardware/qcom-caf/sm8250/audio/voice_processing/voice_processing.c
540
541
542
543
544
545
546
547
548
549
switch (cmdCode) { case EFFECT_CMD_INIT: if (pReplyData == NULL || *replySize != sizeof(int)) return -EINVAL; *(int *)pReplyData = 0; break; case EFFECT_CMD_SET_CONFIG: {
+ show +
550
551
552
553
if (pCmdData == NULL|| cmdSize != sizeof(effect_config_t)|| pReplyData == NULL|| *replySize != sizeof(int)) {
+ show +
554
555
556
557
558
559
560
561
562
563
ALOGV("fx_command() EFFECT_CMD_SET_CONFIG invalid args"); return -EINVAL; } *(int *)pReplyData = session_set_config(effect->session, (effect_config_t *)pCmdData); if (*(int *)pReplyData != 0) break; if (effect->state != EFFECT_STATE_ACTIVE) *(int *)pReplyData = effect_set_state(effect, EFFECT_STATE_CONFIG);
/media/esteban/ACOS/ResurrectionX/hardware/qcom-caf/msm8916/audio/voice_processing/voice_processing.c
524
525
526
527
528
529
530
531
532
533
switch (cmdCode) { case EFFECT_CMD_INIT: if (pReplyData == NULL || *replySize != sizeof(int)) return -EINVAL; *(int *)pReplyData = 0; break; case EFFECT_CMD_SET_CONFIG: {
+ show +
534
535
536
537
if (pCmdData == NULL|| cmdSize != sizeof(effect_config_t)|| pReplyData == NULL|| *replySize != sizeof(int)) {
+ show +
538
539
540
541
542
543
544
545
546
547
ALOGV("fx_command() EFFECT_CMD_SET_CONFIG invalid args"); return -EINVAL; } *(int *)pReplyData = session_set_config(effect->session, (effect_config_t *)pCmdData); if (*(int *)pReplyData != 0) break; if (effect->state != EFFECT_STATE_ACTIVE) *(int *)pReplyData = effect_set_state(effect, EFFECT_STATE_CONFIG);
/media/esteban/ACOS/ResurrectionX/hardware/qcom-caf/msm8952/audio/voice_processing/voice_processing.c
525
526
527
528
529
530
531
532
533
534
switch (cmdCode) { case EFFECT_CMD_INIT: if (pReplyData == NULL || *replySize != sizeof(int)) return -EINVAL; *(int *)pReplyData = 0; break; case EFFECT_CMD_SET_CONFIG: {
+ show +
535
536
537
538
if (pCmdData == NULL|| cmdSize != sizeof(effect_config_t)|| pReplyData == NULL|| *replySize != sizeof(int)) {
+ show +
539
540
541
542
543
544
545
546
547
548
ALOGV("fx_command() EFFECT_CMD_SET_CONFIG invalid args"); return -EINVAL; } *(int *)pReplyData = session_set_config(effect->session, (effect_config_t *)pCmdData); if (*(int *)pReplyData != 0) break; if (effect->state != EFFECT_STATE_ACTIVE) *(int *)pReplyData = effect_set_state(effect, EFFECT_STATE_CONFIG);
/media/esteban/ACOS/ResurrectionX/hardware/qcom-caf/sm8150/audio/voice_processing/voice_processing.c
540
541
542
543
544
545
546
547
548
549
switch (cmdCode) { case EFFECT_CMD_INIT: if (pReplyData == NULL || *replySize != sizeof(int)) return -EINVAL; *(int *)pReplyData = 0; break; case EFFECT_CMD_SET_CONFIG: {
+ show +
550
551
552
553
if (pCmdData == NULL|| cmdSize != sizeof(effect_config_t)|| pReplyData == NULL|| *replySize != sizeof(int)) {
+ show +
554
555
556
557
558
559
560
561
562
563
ALOGV("fx_command() EFFECT_CMD_SET_CONFIG invalid args"); return -EINVAL; } *(int *)pReplyData = session_set_config(effect->session, (effect_config_t *)pCmdData); if (*(int *)pReplyData != 0) break; if (effect->state != EFFECT_STATE_ACTIVE) *(int *)pReplyData = effect_set_state(effect, EFFECT_STATE_CONFIG);
/media/esteban/ACOS/ResurrectionX/hardware/qcom-caf/sdm845/audio/voice_processing/voice_processing.c
540
541
542
543
544
545
546
547
548
549
switch (cmdCode) { case EFFECT_CMD_INIT: if (pReplyData == NULL || *replySize != sizeof(int)) return -EINVAL; *(int *)pReplyData = 0; break; case EFFECT_CMD_SET_CONFIG: {
+ show +
550
551
552
553
if (pCmdData == NULL|| cmdSize != sizeof(effect_config_t)|| pReplyData == NULL|| *replySize != sizeof(int)) {
+ show +
554
555
556
557
558
559
560
561
562
563
ALOGV("fx_command() EFFECT_CMD_SET_CONFIG invalid args"); return -EINVAL; } *(int *)pReplyData = session_set_config(effect->session, (effect_config_t *)pCmdData); if (*(int *)pReplyData != 0) break; if (effect->state != EFFECT_STATE_ACTIVE) *(int *)pReplyData = effect_set_state(effect, EFFECT_STATE_CONFIG);
/media/esteban/ACOS/ResurrectionX/hardware/qcom-caf/msm8998/audio/voice_processing/voice_processing.c
540
541
542
543
544
545
546
547
548
549
switch (cmdCode) { case EFFECT_CMD_INIT: if (pReplyData == NULL || *replySize != sizeof(int)) return -EINVAL; *(int *)pReplyData = 0; break; case EFFECT_CMD_SET_CONFIG: {
+ show +
550
551
552
553
if (pCmdData == NULL|| cmdSize != sizeof(effect_config_t)|| pReplyData == NULL|| *replySize != sizeof(int)) {
+ show +
554
555
556
557
558
559
560
561
562
563
ALOGV("fx_command() EFFECT_CMD_SET_CONFIG invalid args"); return -EINVAL; } *(int *)pReplyData = session_set_config(effect->session, (effect_config_t *)pCmdData); if (*(int *)pReplyData != 0) break; if (effect->state != EFFECT_STATE_ACTIVE) *(int *)pReplyData = effect_set_state(effect, EFFECT_STATE_CONFIG);
/media/esteban/ACOS/ResurrectionX/hardware/qcom-caf/msm8960/audio/voice_processing/voice_processing.c
525
526
527
528
529
530
531
532
533
534
switch (cmdCode) { case EFFECT_CMD_INIT: if (pReplyData == NULL || *replySize != sizeof(int)) return -EINVAL; *(int *)pReplyData = 0; break; case EFFECT_CMD_SET_CONFIG: {
+ show +
535
536
537
538
if (pCmdData == NULL|| cmdSize != sizeof(effect_config_t)|| pReplyData == NULL|| *replySize != sizeof(int)) {
+ show +
539
540
541
542
543
544
545
546
547
548
ALOGV("fx_command() EFFECT_CMD_SET_CONFIG invalid args"); return -EINVAL; } *(int *)pReplyData = session_set_config(effect->session, (effect_config_t *)pCmdData); if (*(int *)pReplyData != 0) break; if (effect->state != EFFECT_STATE_ACTIVE) *(int *)pReplyData = effect_set_state(effect, EFFECT_STATE_CONFIG);
/media/esteban/ACOS/ResurrectionX/hardware/qcom-caf/msm8994/audio/voice_processing/voice_processing.c
524
525
526
527
528
529
530
531
532
533
switch (cmdCode) { case EFFECT_CMD_INIT: if (pReplyData == NULL || *replySize != sizeof(int)) return -EINVAL; *(int *)pReplyData = 0; break; case EFFECT_CMD_SET_CONFIG: {
+ show +
534
535
536
537
if (pCmdData == NULL|| cmdSize != sizeof(effect_config_t)|| pReplyData == NULL|| *replySize != sizeof(int)) {
+ show +
538
539
540
541
542
543
544
545
546
547
ALOGV("fx_command() EFFECT_CMD_SET_CONFIG invalid args"); return -EINVAL; } *(int *)pReplyData = session_set_config(effect->session, (effect_config_t *)pCmdData); if (*(int *)pReplyData != 0) break; if (effect->state != EFFECT_STATE_ACTIVE) *(int *)pReplyData = effect_set_state(effect, EFFECT_STATE_CONFIG);
/media/esteban/ACOS/ResurrectionX/hardware/qcom-caf/msm8974/audio/voice_processing/voice_processing.c
524
525
526
527
528
529
530
531
532
533
switch (cmdCode) { case EFFECT_CMD_INIT: if (pReplyData == NULL || *replySize != sizeof(int)) return -EINVAL; *(int *)pReplyData = 0; break; case EFFECT_CMD_SET_CONFIG: {
+ show +
534
535
536
537
if (pCmdData == NULL|| cmdSize != sizeof(effect_config_t)|| pReplyData == NULL|| *replySize != sizeof(int)) {
+ show +
538
539
540
541
542
543
544
545
546
547
ALOGV("fx_command() EFFECT_CMD_SET_CONFIG invalid args"); return -EINVAL; } *(int *)pReplyData = session_set_config(effect->session, (effect_config_t *)pCmdData); if (*(int *)pReplyData != 0) break; if (effect->state != EFFECT_STATE_ACTIVE) *(int *)pReplyData = effect_set_state(effect, EFFECT_STATE_CONFIG);
/media/esteban/ACOS/ResurrectionX/hardware/qcom/audio/voice_processing/voice_processing.c
533
534
535
536
537
538
539
540
541
542
switch (cmdCode) { case EFFECT_CMD_INIT: if (pReplyData == NULL || *replySize != sizeof(int)) return -EINVAL; *(int *)pReplyData = 0; break; case EFFECT_CMD_SET_CONFIG: {
+ show +
543
544
545
546
if (pCmdData == NULL|| cmdSize != sizeof(effect_config_t)|| pReplyData == NULL|| *replySize != sizeof(int)) {
+ show +
547
548
549
550
551
552
553
554
555
556
ALOGV("fx_command() EFFECT_CMD_SET_CONFIG invalid args"); return -EINVAL; } *(int *)pReplyData = session_set_config(effect->session, (effect_config_t *)pCmdData); if (*(int *)pReplyData != 0) break; if (effect->state != EFFECT_STATE_ACTIVE) *(int *)pReplyData = effect_set_state(effect, EFFECT_STATE_CONFIG);

[CVE-2023-40093_1.diff] cmspack.c #26
-cmsUInt8Number* Unroll4WordsReverse(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll4WordsReverse(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
562
563
564
565
566
567
568
569
570
571
wIn[2] = *(cmsUInt16Number*) accum; accum+= 2; // Y wIn[3] = *(cmsUInt16Number*) accum; accum+= 2; // K return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
572
573
574
575
cmsUInt8Number* Unroll4WordsReverse(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
576
577
578
579
580
581
582
583
584
585
{ wIn[0] = REVERSE_FLAVOR_16(*(cmsUInt16Number*) accum); accum+= 2; // C wIn[1] = REVERSE_FLAVOR_16(*(cmsUInt16Number*) accum); accum+= 2; // M wIn[2] = REVERSE_FLAVOR_16(*(cmsUInt16Number*) accum); accum+= 2; // Y wIn[3] = REVERSE_FLAVOR_16(*(cmsUInt16Number*) accum); accum+= 2; // K return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2020-0478_1.diff] gtest.cc #149
-// each TestCase and TestInfo object. +// each TestSuite and TestInfo object. -// http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide. -// Returns the number of tests that should run. +// https://github.com/google/googletest/blob/master/googletest/docs/advanced.md +// . Returns the number of tests that should run. - const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? - Int32FromEnvOrDie(kTestTotalShards, -1) : -1; - const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? - Int32FromEnvOrDie(kTestShardIndex, -1) : -1; + const int32_t total_shards = shard_tests == HONOR_SHARDING_PROTOCOL + ? Int32FromEnvOrDie(kTestTotalShards, -1) + : -1; + const int32_t shard_index = shard_tests == HONOR_SHARDING_PROTOCOL + ? Int32FromEnvOrDie(kTestShardIndex, -1) + : -1;
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest.cc
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestCase and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide. // Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
4363
4364
4365
4366
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (size_t i = 0; i < test_cases_.size(); i++) { TestCase* const test_case = test_cases_[i]; const std::string &test_case_name = test_case->name();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestCase and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide. // Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
5940
5941
5942
5943
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (size_t i = 0; i < test_cases_.size(); i++) { TestCase* const test_case = test_cases_[i]; const std::string &test_case_name = test_case->name();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest.cc
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestCase and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // https://github.com/google/googletest/blob/master/googletest/docs/AdvancedGuide.md . // Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
4814
4815
4816
4817
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (size_t i = 0; i < test_cases_.size(); i++) { TestCase* const test_case = test_cases_[i]; const std::string &test_case_name = test_case->name();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestCase and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide. // Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
5940
5941
5942
5943
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (size_t i = 0; i < test_cases_.size(); i++) { TestCase* const test_case = test_cases_[i]; const std::string &test_case_name = test_case->name();
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest.cc
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestSuite and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // https://github.com/google/googletest/blob/master/googletest/docs/advanced.md // . Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
5398
5399
5400
5401
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (auto* test_suite : test_suites_) { const std::string& test_suite_name = test_suite->name(); test_suite->set_should_run(false);
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestCase and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide. // Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
6242
6243
6244
6245
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (size_t i = 0; i < test_cases_.size(); i++) { TestCase* const test_case = test_cases_[i]; const std::string &test_case_name = test_case->name();
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/src/gtest.cc
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestCase and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide. // Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
4410
4411
4412
4413
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (size_t i = 0; i < test_cases_.size(); i++) { TestCase* const test_case = test_cases_[i]; const String &test_case_name = test_case->name();
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest.cc
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestCase and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // https://github.com/google/googletest/blob/master/googletest/docs/advanced.md // . Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
5332
5333
5334
5335
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (size_t i = 0; i < test_cases_.size(); i++) { TestCase* const test_case = test_cases_[i]; const std::string &test_case_name = test_case->name();
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/src/gtest.cc
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestCase and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide. // Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
4348
4349
4350
4351
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (size_t i = 0; i < test_cases_.size(); i++) { TestCase* const test_case = test_cases_[i]; const String &test_case_name = test_case->name();
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest.cc
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestCase and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide. // Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
4790
4791
4792
4793
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (size_t i = 0; i < test_cases_.size(); i++) { TestCase* const test_case = test_cases_[i]; const std::string &test_case_name = test_case->name();
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/gtest.cc
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestCase and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide. // Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
4345
4346
4347
4348
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (size_t i = 0; i < test_cases_.size(); i++) { TestCase* const test_case = test_cases_[i]; const String &test_case_name = test_case->name();
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest.cc
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestCase and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide. // Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
4791
4792
4793
4794
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (size_t i = 0; i < test_cases_.size(); i++) { TestCase* const test_case = test_cases_[i]; const std::string &test_case_name = test_case->name();

[CVE-2020-0470_1.diff] gtest.cc #149
-// each TestCase and TestInfo object. +// each TestSuite and TestInfo object. -// http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide. -// Returns the number of tests that should run. +// https://github.com/google/googletest/blob/master/googletest/docs/advanced.md +// . Returns the number of tests that should run. - const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? - Int32FromEnvOrDie(kTestTotalShards, -1) : -1; - const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? - Int32FromEnvOrDie(kTestShardIndex, -1) : -1; + const int32_t total_shards = shard_tests == HONOR_SHARDING_PROTOCOL + ? Int32FromEnvOrDie(kTestTotalShards, -1) + : -1; + const int32_t shard_index = shard_tests == HONOR_SHARDING_PROTOCOL + ? Int32FromEnvOrDie(kTestShardIndex, -1) + : -1;
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest.cc
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestCase and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide. // Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
4363
4364
4365
4366
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (size_t i = 0; i < test_cases_.size(); i++) { TestCase* const test_case = test_cases_[i]; const std::string &test_case_name = test_case->name();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestCase and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide. // Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
5940
5941
5942
5943
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (size_t i = 0; i < test_cases_.size(); i++) { TestCase* const test_case = test_cases_[i]; const std::string &test_case_name = test_case->name();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest.cc
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestCase and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // https://github.com/google/googletest/blob/master/googletest/docs/AdvancedGuide.md . // Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
4814
4815
4816
4817
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (size_t i = 0; i < test_cases_.size(); i++) { TestCase* const test_case = test_cases_[i]; const std::string &test_case_name = test_case->name();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestCase and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide. // Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
5940
5941
5942
5943
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (size_t i = 0; i < test_cases_.size(); i++) { TestCase* const test_case = test_cases_[i]; const std::string &test_case_name = test_case->name();
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest.cc
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestSuite and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // https://github.com/google/googletest/blob/master/googletest/docs/advanced.md // . Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
5398
5399
5400
5401
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (auto* test_suite : test_suites_) { const std::string& test_suite_name = test_suite->name(); test_suite->set_should_run(false);
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestCase and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide. // Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
6242
6243
6244
6245
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (size_t i = 0; i < test_cases_.size(); i++) { TestCase* const test_case = test_cases_[i]; const std::string &test_case_name = test_case->name();
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/src/gtest.cc
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestCase and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide. // Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
4410
4411
4412
4413
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (size_t i = 0; i < test_cases_.size(); i++) { TestCase* const test_case = test_cases_[i]; const String &test_case_name = test_case->name();
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest.cc
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestCase and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // https://github.com/google/googletest/blob/master/googletest/docs/advanced.md // . Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
5332
5333
5334
5335
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (size_t i = 0; i < test_cases_.size(); i++) { TestCase* const test_case = test_cases_[i]; const std::string &test_case_name = test_case->name();
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/src/gtest.cc
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestCase and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide. // Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
4348
4349
4350
4351
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (size_t i = 0; i < test_cases_.size(); i++) { TestCase* const test_case = test_cases_[i]; const String &test_case_name = test_case->name();
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest.cc
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestCase and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide. // Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
4790
4791
4792
4793
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (size_t i = 0; i < test_cases_.size(); i++) { TestCase* const test_case = test_cases_[i]; const std::string &test_case_name = test_case->name();
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/gtest.cc
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestCase and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide. // Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
4345
4346
4347
4348
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (size_t i = 0; i < test_cases_.size(); i++) { TestCase* const test_case = test_cases_[i]; const String &test_case_name = test_case->name();
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest.cc
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
} // Compares the name of each test with the user-specified filter to // decide whether the test should be run, then records the result in // each TestCase and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see // http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide. // Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+ show +
4791
4792
4793
4794
const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestTotalShards, -1) : -1; const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+ show +
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
// num_runnable_tests are the number of tests that will // run across all shards (i.e., match filter and are not disabled). // num_selected_tests are the number of tests to be run on // this shard. int num_runnable_tests = 0; int num_selected_tests = 0; for (size_t i = 0; i < test_cases_.size(); i++) { TestCase* const test_case = test_cases_[i]; const std::string &test_case_name = test_case->name();

[CVE-2020-0478_1.diff] gtest-death-test.h #3
-// TODO(wan@google.com): make thread-safe death tests search the PATH. -# define ASSERT_EXIT(statement, predicate, regex) \ - GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) +#define ASSERT_EXIT(statement, predicate, regex) \ + GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) -// test case, if any: -# define EXPECT_EXIT(statement, predicate, regex) \ - GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) +// test suite, if any: +#define EXPECT_EXIT(statement, predicate, regex) \ + GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) -# define ASSERT_DEATH(statement, regex) \ - ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) +#define ASSERT_DEATH(statement, regex) \ + ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) -// test case, if any: -# define EXPECT_DEATH(statement, regex) \ - EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) +// test suite, if any: +#define EXPECT_DEATH(statement, regex) \ + EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/gtest-death-test.h
158
159
160
161
162
163
164
165
166
167
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
186
187
188
189
190
191
192
193
194
195
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest-death-test.h
158
159
160
161
162
163
164
165
166
167
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
186
187
188
189
190
191
192
193
194
195
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest-death-test.h
158
159
160
161
162
163
164
165
166
167
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
186
187
188
189
190
191
192
193
194
195
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest-death-test.h
158
159
160
161
162
163
164
165
166
167
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
186
187
188
189
190
191
192
193
194
195
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/gtest-death-test.h
158
159
160
161
162
163
164
165
166
167
// invoke the test program via a path that contains at least one // path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test suite, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test suite, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
186
187
188
189
190
191
192
193
194
195
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/include/gtest/gtest-death-test.h
158
159
160
161
162
163
164
165
166
167
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
186
187
188
189
190
191
192
193
194
195
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/gtest-death-test.h
159
160
161
162
163
164
165
166
167
168
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // FIXME: make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
187
188
189
190
191
192
193
194
195
196
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/include/gtest/gtest-death-test.h
147
148
149
150
151
152
153
154
155
156
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
175
176
177
178
179
180
181
182
183
184
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest-death-test.h
158
159
160
161
162
163
164
165
166
167
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
186
187
188
189
190
191
192
193
194
195
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/include/gtest/gtest-death-test.h
147
148
149
150
151
152
153
154
155
156
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
175
176
177
178
179
180
181
182
183
184
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest-death-test.h
158
159
160
161
162
163
164
165
166
167
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
186
187
188
189
190
191
192
193
194
195
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.

[CVE-2020-0470_1.diff] gtest-death-test.h #3
-// TODO(wan@google.com): make thread-safe death tests search the PATH. -# define ASSERT_EXIT(statement, predicate, regex) \ - GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) +#define ASSERT_EXIT(statement, predicate, regex) \ + GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) -// test case, if any: -# define EXPECT_EXIT(statement, predicate, regex) \ - GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) +// test suite, if any: +#define EXPECT_EXIT(statement, predicate, regex) \ + GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) -# define ASSERT_DEATH(statement, regex) \ - ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) +#define ASSERT_DEATH(statement, regex) \ + ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) -// test case, if any: -# define EXPECT_DEATH(statement, regex) \ - EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) +// test suite, if any: +#define EXPECT_DEATH(statement, regex) \ + EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/gtest-death-test.h
158
159
160
161
162
163
164
165
166
167
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
186
187
188
189
190
191
192
193
194
195
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest-death-test.h
158
159
160
161
162
163
164
165
166
167
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
186
187
188
189
190
191
192
193
194
195
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest-death-test.h
158
159
160
161
162
163
164
165
166
167
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
186
187
188
189
190
191
192
193
194
195
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest-death-test.h
158
159
160
161
162
163
164
165
166
167
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
186
187
188
189
190
191
192
193
194
195
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/gtest-death-test.h
158
159
160
161
162
163
164
165
166
167
// invoke the test program via a path that contains at least one // path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test suite, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test suite, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
186
187
188
189
190
191
192
193
194
195
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/include/gtest/gtest-death-test.h
158
159
160
161
162
163
164
165
166
167
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
186
187
188
189
190
191
192
193
194
195
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/gtest-death-test.h
159
160
161
162
163
164
165
166
167
168
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // FIXME: make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
187
188
189
190
191
192
193
194
195
196
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/include/gtest/gtest-death-test.h
147
148
149
150
151
152
153
154
155
156
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
175
176
177
178
179
180
181
182
183
184
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest-death-test.h
158
159
160
161
162
163
164
165
166
167
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
186
187
188
189
190
191
192
193
194
195
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/include/gtest/gtest-death-test.h
147
148
149
150
151
152
153
154
155
156
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
175
176
177
178
179
180
181
182
183
184
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest-death-test.h
158
159
160
161
162
163
164
165
166
167
// path separator (e.g. path/to/foo_test and // /absolute/path/to/bar_test are fine, but foo_test is not). This // is rarely a problem as people usually don't put the test binary // directory in PATH. // // TODO(wan@google.com): make thread-safe death tests search the PATH. // Asserts that a given statement causes the program to exit, with an // integer exit status that satisfies predicate, and emitting error output // that matches regex.
+ show +
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# define ASSERT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) // Like ASSERT_EXIT, but continues on to successive tests in the // test case, if any: # define EXPECT_EXIT(statement, predicate, regex) \ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) // Asserts that a given statement causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a // signal, and emitting error output that matches regex. # define ASSERT_DEATH(statement, regex) \ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) // Like ASSERT_DEATH, but continues on to successive tests in the // test case, if any: # define EXPECT_DEATH(statement, regex) \ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+ show +
186
187
188
189
190
191
192
193
194
195
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: // Tests that an exit code describes a normal exit with a given exit code. class GTEST_API_ ExitedWithCode { public: explicit ExitedWithCode(int exit_code); bool operator()(int exit_status) const; private: // No implementation - assignment is unsupported.

[CVE-2020-0478_1.diff] gtest-param-test.h #13
-// For example, this instantiates tests from test case BarTest each +// For example, this instantiates tests from test suite BarTest each -// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three")); +// INSTANTIATE_TEST_SUITE_P(NumSequence, +// BarTest, +// Values("one", "two", "three")); -// This instantiates tests from test case BazTest each with values 1, 2, 3.5. +// This instantiates tests from test suite BazTest each with values 1, 2, 3.5. -// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5)); +// INSTANTIATE_TEST_SUITE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5)); -// Currently, Values() supports from 1 to 50 parameters. -template <typename T1> -internal::ValueArray1<T1> Values(T1 v1) { - return internal::ValueArray1<T1>(v1); -} - -template <typename T1, typename T2> -internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) { - return internal::ValueArray2<T1, T2>(v1, v2); -} - -template <typename T1, typename T2, typename T3> -internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) { - return internal::ValueArray3<T1, T2, T3>(v1, v2, v3); -} - -template <typename T1, typename T2, typename T3, typename T4> -internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) { - return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5> -internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5) { - return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6> -internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6) { - return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7> -internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6, T7 v7) { - return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5, - v6, v7); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8> -internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) { - return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4, - v5, v6, v7, v8); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9> -internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { - return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3, - v4, v5, v6, v7, v8, v9); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10> -internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1, - T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) { - return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1, - v2, v3, v4, v5, v6, v7, v8, v9, v10); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11> -internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, - T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11) { - return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, - T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12> -internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12) { - return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13> -internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, - T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13) { - return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14> -internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) { - return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, - v14); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15> -internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, - T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) { - return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, - v13, v14, v15); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16> -internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16) { - return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, - v12, v13, v14, v15, v16); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17> -internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17) { - return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, - v11, v12, v13, v14, v15, v16, v17); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18> -internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, - T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18) { - return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9, - v10, v11, v12, v13, v14, v15, v16, v17, v18); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19> -internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, - T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, - T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) { - return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8, - v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20> -internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) { - return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7, - v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21> -internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) { - return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6, - v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22> -internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22) { - return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4, - v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23> -internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23) { - return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3, - v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24> -internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24) { - return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2, - v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, - v19, v20, v21, v22, v23, v24); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25> -internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1, - T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, - T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, - T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) { - return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1, - v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, - v18, v19, v20, v21, v22, v23, v24, v25); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26> -internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26) { - return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, - v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27> -internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, - T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27) { - return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, - v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28> -internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, - T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28) { - return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, - v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, - v28); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29> -internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29) { - return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, - v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, - v27, v28, v29); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30> -internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, - T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, - T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, - T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) { - return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, - v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, - v26, v27, v28, v29, v30); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31> -internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) { - return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, - v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, - v25, v26, v27, v28, v29, v30, v31); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32> -internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32) { - return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9, - v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33> -internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, - T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33) { - return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8, - v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32, v33); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34> -internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, - T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, - T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, - T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, - T31 v31, T32 v32, T33 v33, T34 v34) { - return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7, - v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, - v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35> -internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, - T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, - T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) { - return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6, - v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, - v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36> -internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, - T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, - T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) { - return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4, - v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, - v34, v35, v36); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37> -internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, - T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, - T37 v37) { - return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3, - v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, - v34, v35, v36, v37); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38> -internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, - T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, - T37 v37, T38 v38) { - return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2, - v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, - v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, - v33, v34, v35, v36, v37, v38); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39> -internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, - T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, - T37 v37, T38 v38, T39 v39) { - return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1, - v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, - v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, - v32, v33, v34, v35, v36, v37, v38, v39); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39, typename T40> -internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1, - T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, - T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, - T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, - T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, - T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) { - return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, - T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, - v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, - v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39, typename T40, - typename T41> -internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, - T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) { - return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, - T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, - v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, - v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39, typename T40, - typename T41, typename T42> -internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, - T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42) { - return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, - T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, - v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, - v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, - v42); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39, typename T40, - typename T41, typename T42, typename T43> -internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, - T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43) { - return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, - T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, - v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, - v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, - v41, v42, v43); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39, typename T40, - typename T41, typename T42, typename T43, typename T44> -internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, - T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44) { - return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, - T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, - v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, - v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, - v40, v41, v42, v43, v44); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39, typename T40, - typename T41, typename T42, typename T43, typename T44, typename T45> -internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, - T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, - T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, - T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, - T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, - T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, - T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) { - return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, - T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, - v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, - v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, - v39, v40, v41, v42, v43, v44, v45); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39, typename T40, - typename T41, typename T42, typename T43, typename T44, typename T45, - typename T46> -internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, - T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, - T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) { - return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, - T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9, - v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, - v38, v39, v40, v41, v42, v43, v44, v45, v46); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39, typename T40, - typename T41, typename T42, typename T43, typename T44, typename T45, - typename T46, typename T47> -internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, - T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, - T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) { - return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, - T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8, - v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, - v38, v39, v40, v41, v42, v43, v44, v45, v46, v47); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39, typename T40, - typename T41, typename T42, typename T43, typename T44, typename T45, - typename T46, typename T47, typename T48> -internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, - T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, - T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, - T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, - T48 v48) { - return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, - T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7, - v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, - v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, - v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39, typename T40, - typename T41, typename T42, typename T43, typename T44, typename T45, - typename T46, typename T47, typename T48, typename T49> -internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, - T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, - T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, - T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, - T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, - T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, - T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, - T47 v47, T48 v48, T49 v49) { - return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, - T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6, - v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, - v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, - v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39, typename T40, - typename T41, typename T42, typename T43, typename T44, typename T45, - typename T46, typename T47, typename T48, typename T49, typename T50> -internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, - T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, - T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, - T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, - T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, - T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) { - return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, - T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4, - v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, - v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, - v48, v49, v50); +template <typename... T> +internal::ValueArray<T...> Values(T... v) { + return internal::ValueArray<T...>(std::move(v)...);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
// // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three")); // // This instantiates tests from test case BazTest each with values 1, 2, 3.5. // The exact type of values will depend on the type of parameter in BazTest. // // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5)); // // Currently, Values() supports from 1 to 50 parameters. //
+ show +
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
template <typename T1> internal::ValueArray1<T1> Values(T1 v1) { return internal::ValueArray1<T1>(v1); } template <typename T1, typename T2> internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) { return internal::ValueArray2<T1, T2>(v1, v2); } template <typename T1, typename T2, typename T3> internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) { return internal::ValueArray3<T1, T2, T3>(v1, v2, v3); } template <typename T1, typename T2, typename T3, typename T4> internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) { return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4); } template <typename T1, typename T2, typename T3, typename T4, typename T5> internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) { return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) { return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) { return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5, v6, v7); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) { return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4, v5, v6, v7, v8); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9> internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3, v4, v5, v6, v7, v8, v9); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10> internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) { return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11> internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11) { return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12> internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12) { return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13> internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13) { return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14> internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) { return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15> internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) { return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16> internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) { return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17> internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17) { return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18> internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18) { return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19> internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) { return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20> internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) { return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21> internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) { return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22> internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) { return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23> internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) { return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24> internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) { return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25> internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) { return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26> internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26) { return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27> internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27) { return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28> internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28) { return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29> internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29) { return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30> internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) { return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31> internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) { return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32> internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) { return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33> internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33) { return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34> internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34) { return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35> internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) { return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36> internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) { return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37> internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37) { return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38> internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) { return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39> internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) { return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40> internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) { return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41> internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) { return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42> internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42) { return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43> internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43) { return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44> internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44) { return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45> internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) { return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46> internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) { return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47> internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) { return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47, typename T48> internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) { return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47, typename T48, typename T49> internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49) { return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47, typename T48, typename T49, typename T50> internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) { return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50);
+ show +
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
} // Bool() allows generating tests with parameters in a set of (false, true). // // Synopsis: // Bool() // - returns a generator producing sequences with elements {false, true}. // // It is useful when testing code that depends on Boolean flags. Combinations // of multiple flags can be tested when several Bool()'s are combined using
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
// // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three")); // // This instantiates tests from test case BazTest each with values 1, 2, 3.5. // The exact type of values will depend on the type of parameter in BazTest. // // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5)); // // Currently, Values() supports from 1 to 50 parameters. //
+ show +
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
template <typename T1> internal::ValueArray1<T1> Values(T1 v1) { return internal::ValueArray1<T1>(v1); } template <typename T1, typename T2> internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) { return internal::ValueArray2<T1, T2>(v1, v2); } template <typename T1, typename T2, typename T3> internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) { return internal::ValueArray3<T1, T2, T3>(v1, v2, v3); } template <typename T1, typename T2, typename T3, typename T4> internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) { return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4); } template <typename T1, typename T2, typename T3, typename T4, typename T5> internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) { return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) { return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) { return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5, v6, v7); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) { return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4, v5, v6, v7, v8); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9> internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3, v4, v5, v6, v7, v8, v9); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10> internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) { return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11> internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11) { return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12> internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12) { return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13> internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13) { return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14> internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) { return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15> internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) { return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16> internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) { return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17> internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17) { return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18> internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18) { return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19> internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) { return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20> internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) { return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21> internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) { return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22> internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) { return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23> internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) { return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24> internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) { return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25> internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) { return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26> internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26) { return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27> internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27) { return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28> internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28) { return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29> internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29) { return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30> internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) { return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31> internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) { return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32> internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) { return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33> internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33) { return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34> internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34) { return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35> internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) { return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36> internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) { return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37> internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37) { return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38> internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) { return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39> internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) { return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40> internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) { return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41> internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) { return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42> internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42) { return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43> internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43) { return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44> internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44) { return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45> internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) { return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46> internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) { return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47> internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) { return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47, typename T48> internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) { return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47, typename T48, typename T49> internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49) { return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47, typename T48, typename T49, typename T50> internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) { return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50);
+ show +
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
} // Bool() allows generating tests with parameters in a set of (false, true). // // Synopsis: // Bool() // - returns a generator producing sequences with elements {false, true}. // // It is useful when testing code that depends on Boolean flags. Combinations // of multiple flags can be tested when several Bool()'s are combined using
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
// // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three")); // // This instantiates tests from test case BazTest each with values 1, 2, 3.5. // The exact type of values will depend on the type of parameter in BazTest. // // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5)); // // Currently, Values() supports from 1 to 50 parameters. //
+ show +
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
template <typename T1> internal::ValueArray1<T1> Values(T1 v1) { return internal::ValueArray1<T1>(v1); } template <typename T1, typename T2> internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) { return internal::ValueArray2<T1, T2>(v1, v2); } template <typename T1, typename T2, typename T3> internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) { return internal::ValueArray3<T1, T2, T3>(v1, v2, v3); } template <typename T1, typename T2, typename T3, typename T4> internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) { return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4); } template <typename T1, typename T2, typename T3, typename T4, typename T5> internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) { return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) { return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) { return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5, v6, v7); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) { return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4, v5, v6, v7, v8); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9> internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3, v4, v5, v6, v7, v8, v9); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10> internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) { return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11> internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11) { return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12> internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12) { return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13> internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13) { return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14> internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) { return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15> internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) { return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16> internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) { return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17> internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17) { return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18> internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18) { return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19> internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) { return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20> internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) { return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21> internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) { return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22> internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) { return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23> internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) { return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24> internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) { return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25> internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) { return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26> internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26) { return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27> internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27) { return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28> internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28) { return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29> internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29) { return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30> internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) { return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31> internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) { return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32> internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) { return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33> internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33) { return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34> internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34) { return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35> internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) { return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36> internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) { return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37> internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37) { return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38> internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) { return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39> internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) { return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40> internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) { return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41> internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) { return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42> internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42) { return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43> internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43) { return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44> internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44) { return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45> internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) { return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46> internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) { return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47> internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) { return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47, typename T48> internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) { return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47, typename T48, typename T49> internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49) { return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47, typename T48, typename T49, typename T50> internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) { return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50);
+ show +
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
} // Bool() allows generating tests with parameters in a set of (false, true). // // Synopsis: // Bool() // - returns a generator producing sequences with elements {false, true}. // // It is useful when testing code that depends on Boolean flags. Combinations // of multiple flags can be tested when several Bool()'s are combined using

[CVE-2020-0470_1.diff] gtest-param-test.h #13
-// For example, this instantiates tests from test case BarTest each +// For example, this instantiates tests from test suite BarTest each -// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three")); +// INSTANTIATE_TEST_SUITE_P(NumSequence, +// BarTest, +// Values("one", "two", "three")); -// This instantiates tests from test case BazTest each with values 1, 2, 3.5. +// This instantiates tests from test suite BazTest each with values 1, 2, 3.5. -// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5)); +// INSTANTIATE_TEST_SUITE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5)); -// Currently, Values() supports from 1 to 50 parameters. -template <typename T1> -internal::ValueArray1<T1> Values(T1 v1) { - return internal::ValueArray1<T1>(v1); -} - -template <typename T1, typename T2> -internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) { - return internal::ValueArray2<T1, T2>(v1, v2); -} - -template <typename T1, typename T2, typename T3> -internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) { - return internal::ValueArray3<T1, T2, T3>(v1, v2, v3); -} - -template <typename T1, typename T2, typename T3, typename T4> -internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) { - return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5> -internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5) { - return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6> -internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6) { - return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7> -internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6, T7 v7) { - return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5, - v6, v7); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8> -internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) { - return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4, - v5, v6, v7, v8); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9> -internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { - return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3, - v4, v5, v6, v7, v8, v9); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10> -internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1, - T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) { - return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1, - v2, v3, v4, v5, v6, v7, v8, v9, v10); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11> -internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, - T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11) { - return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, - T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12> -internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12) { - return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13> -internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, - T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13) { - return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14> -internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) { - return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, - v14); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15> -internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, - T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) { - return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, - v13, v14, v15); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16> -internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16) { - return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, - v12, v13, v14, v15, v16); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17> -internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17) { - return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, - v11, v12, v13, v14, v15, v16, v17); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18> -internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, - T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18) { - return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9, - v10, v11, v12, v13, v14, v15, v16, v17, v18); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19> -internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, - T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, - T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) { - return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8, - v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20> -internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) { - return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7, - v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21> -internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) { - return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6, - v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22> -internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22) { - return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4, - v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23> -internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23) { - return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3, - v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24> -internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24) { - return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2, - v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, - v19, v20, v21, v22, v23, v24); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25> -internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1, - T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, - T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, - T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) { - return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1, - v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, - v18, v19, v20, v21, v22, v23, v24, v25); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26> -internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26) { - return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, - v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27> -internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, - T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27) { - return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, - v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28> -internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, - T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28) { - return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, - v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, - v28); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29> -internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29) { - return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, - v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, - v27, v28, v29); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30> -internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, - T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, - T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, - T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) { - return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, - v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, - v26, v27, v28, v29, v30); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31> -internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) { - return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, - v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, - v25, v26, v27, v28, v29, v30, v31); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32> -internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32) { - return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9, - v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33> -internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, - T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33) { - return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8, - v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32, v33); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34> -internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, - T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, - T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, - T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, - T31 v31, T32 v32, T33 v33, T34 v34) { - return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7, - v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, - v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35> -internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, - T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, - T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) { - return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6, - v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, - v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36> -internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, - T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, - T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) { - return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4, - v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, - v34, v35, v36); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37> -internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, - T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, - T37 v37) { - return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3, - v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, - v34, v35, v36, v37); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38> -internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, - T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, - T37 v37, T38 v38) { - return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2, - v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, - v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, - v33, v34, v35, v36, v37, v38); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39> -internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, - T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, - T37 v37, T38 v38, T39 v39) { - return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1, - v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, - v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, - v32, v33, v34, v35, v36, v37, v38, v39); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39, typename T40> -internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1, - T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, - T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, - T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, - T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, - T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) { - return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, - T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, - v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, - v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39, typename T40, - typename T41> -internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, - T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) { - return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, - T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, - v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, - v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39, typename T40, - typename T41, typename T42> -internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, - T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42) { - return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, - T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, - v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, - v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, - v42); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39, typename T40, - typename T41, typename T42, typename T43> -internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, - T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43) { - return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, - T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, - v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, - v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, - v41, v42, v43); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39, typename T40, - typename T41, typename T42, typename T43, typename T44> -internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, - T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44) { - return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, - T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, - v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, - v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, - v40, v41, v42, v43, v44); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39, typename T40, - typename T41, typename T42, typename T43, typename T44, typename T45> -internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, - T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, - T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, - T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, - T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, - T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, - T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) { - return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, - T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, - v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, - v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, - v39, v40, v41, v42, v43, v44, v45); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39, typename T40, - typename T41, typename T42, typename T43, typename T44, typename T45, - typename T46> -internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, - T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, - T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) { - return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, - T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9, - v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, - v38, v39, v40, v41, v42, v43, v44, v45, v46); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39, typename T40, - typename T41, typename T42, typename T43, typename T44, typename T45, - typename T46, typename T47> -internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, - T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, - T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) { - return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, - T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8, - v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, - v38, v39, v40, v41, v42, v43, v44, v45, v46, v47); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39, typename T40, - typename T41, typename T42, typename T43, typename T44, typename T45, - typename T46, typename T47, typename T48> -internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, - T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, - T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, - T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, - T48 v48) { - return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, - T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7, - v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, - v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, - v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39, typename T40, - typename T41, typename T42, typename T43, typename T44, typename T45, - typename T46, typename T47, typename T48, typename T49> -internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, - T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, - T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, - T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, - T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, - T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, - T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, - T47 v47, T48 v48, T49 v49) { - return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, - T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6, - v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, - v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, - v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49); -} - -template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14, typename T15, - typename T16, typename T17, typename T18, typename T19, typename T20, - typename T21, typename T22, typename T23, typename T24, typename T25, - typename T26, typename T27, typename T28, typename T29, typename T30, - typename T31, typename T32, typename T33, typename T34, typename T35, - typename T36, typename T37, typename T38, typename T39, typename T40, - typename T41, typename T42, typename T43, typename T44, typename T45, - typename T46, typename T47, typename T48, typename T49, typename T50> -internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, - T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, - T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, - T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, - T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, - T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, - T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, - T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) { - return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, - T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, - T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, - T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4, - v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, - v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, - v48, v49, v50); +template <typename... T> +internal::ValueArray<T...> Values(T... v) { + return internal::ValueArray<T...>(std::move(v)...);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
// // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three")); // // This instantiates tests from test case BazTest each with values 1, 2, 3.5. // The exact type of values will depend on the type of parameter in BazTest. // // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5)); // // Currently, Values() supports from 1 to 50 parameters. //
+ show +
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
template <typename T1> internal::ValueArray1<T1> Values(T1 v1) { return internal::ValueArray1<T1>(v1); } template <typename T1, typename T2> internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) { return internal::ValueArray2<T1, T2>(v1, v2); } template <typename T1, typename T2, typename T3> internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) { return internal::ValueArray3<T1, T2, T3>(v1, v2, v3); } template <typename T1, typename T2, typename T3, typename T4> internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) { return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4); } template <typename T1, typename T2, typename T3, typename T4, typename T5> internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) { return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) { return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) { return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5, v6, v7); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) { return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4, v5, v6, v7, v8); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9> internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3, v4, v5, v6, v7, v8, v9); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10> internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) { return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11> internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11) { return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12> internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12) { return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13> internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13) { return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14> internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) { return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15> internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) { return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16> internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) { return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17> internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17) { return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18> internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18) { return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19> internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) { return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20> internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) { return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21> internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) { return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22> internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) { return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23> internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) { return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24> internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) { return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25> internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) { return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26> internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26) { return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27> internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27) { return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28> internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28) { return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29> internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29) { return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30> internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) { return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31> internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) { return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32> internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) { return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33> internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33) { return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34> internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34) { return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35> internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) { return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36> internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) { return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37> internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37) { return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38> internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) { return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39> internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) { return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40> internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) { return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41> internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) { return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42> internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42) { return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43> internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43) { return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44> internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44) { return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45> internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) { return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46> internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) { return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47> internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) { return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47, typename T48> internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) { return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47, typename T48, typename T49> internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49) { return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47, typename T48, typename T49, typename T50> internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) { return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50);
+ show +
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
} // Bool() allows generating tests with parameters in a set of (false, true). // // Synopsis: // Bool() // - returns a generator producing sequences with elements {false, true}. // // It is useful when testing code that depends on Boolean flags. Combinations // of multiple flags can be tested when several Bool()'s are combined using
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
// // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three")); // // This instantiates tests from test case BazTest each with values 1, 2, 3.5. // The exact type of values will depend on the type of parameter in BazTest. // // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5)); // // Currently, Values() supports from 1 to 50 parameters. //
+ show +
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
template <typename T1> internal::ValueArray1<T1> Values(T1 v1) { return internal::ValueArray1<T1>(v1); } template <typename T1, typename T2> internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) { return internal::ValueArray2<T1, T2>(v1, v2); } template <typename T1, typename T2, typename T3> internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) { return internal::ValueArray3<T1, T2, T3>(v1, v2, v3); } template <typename T1, typename T2, typename T3, typename T4> internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) { return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4); } template <typename T1, typename T2, typename T3, typename T4, typename T5> internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) { return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) { return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) { return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5, v6, v7); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) { return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4, v5, v6, v7, v8); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9> internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3, v4, v5, v6, v7, v8, v9); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10> internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) { return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11> internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11) { return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12> internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12) { return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13> internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13) { return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14> internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) { return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15> internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) { return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16> internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) { return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17> internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17) { return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18> internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18) { return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19> internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) { return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20> internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) { return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21> internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) { return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22> internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) { return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23> internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) { return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24> internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) { return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25> internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) { return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26> internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26) { return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27> internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27) { return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28> internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28) { return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29> internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29) { return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30> internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) { return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31> internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) { return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32> internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) { return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33> internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33) { return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34> internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34) { return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35> internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) { return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36> internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) { return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37> internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37) { return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38> internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) { return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39> internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) { return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40> internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) { return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41> internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) { return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42> internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42) { return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43> internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43) { return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44> internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44) { return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45> internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) { return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46> internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) { return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47> internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) { return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47, typename T48> internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) { return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47, typename T48, typename T49> internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49) { return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47, typename T48, typename T49, typename T50> internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) { return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50);
+ show +
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
} // Bool() allows generating tests with parameters in a set of (false, true). // // Synopsis: // Bool() // - returns a generator producing sequences with elements {false, true}. // // It is useful when testing code that depends on Boolean flags. Combinations // of multiple flags can be tested when several Bool()'s are combined using
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
// // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three")); // // This instantiates tests from test case BazTest each with values 1, 2, 3.5. // The exact type of values will depend on the type of parameter in BazTest. // // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5)); // // Currently, Values() supports from 1 to 50 parameters. //
+ show +
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
template <typename T1> internal::ValueArray1<T1> Values(T1 v1) { return internal::ValueArray1<T1>(v1); } template <typename T1, typename T2> internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) { return internal::ValueArray2<T1, T2>(v1, v2); } template <typename T1, typename T2, typename T3> internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) { return internal::ValueArray3<T1, T2, T3>(v1, v2, v3); } template <typename T1, typename T2, typename T3, typename T4> internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) { return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4); } template <typename T1, typename T2, typename T3, typename T4, typename T5> internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) { return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) { return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) { return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5, v6, v7); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) { return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4, v5, v6, v7, v8); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9> internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3, v4, v5, v6, v7, v8, v9); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10> internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) { return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11> internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11) { return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12> internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12) { return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13> internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13) { return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14> internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) { return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15> internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) { return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16> internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) { return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17> internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17) { return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18> internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18) { return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19> internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) { return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20> internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) { return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21> internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) { return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22> internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) { return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23> internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) { return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24> internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) { return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25> internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) { return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26> internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26) { return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27> internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27) { return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28> internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28) { return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29> internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29) { return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30> internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) { return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31> internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) { return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32> internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) { return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33> internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33) { return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34> internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34) { return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35> internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) { return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36> internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) { return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37> internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37) { return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38> internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) { return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39> internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) { return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40> internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) { return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41> internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) { return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42> internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42) { return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43> internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43) { return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44> internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44) { return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45> internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) { return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46> internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) { return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47> internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) { return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47, typename T48> internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) { return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47, typename T48, typename T49> internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49) { return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49); } template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20, typename T21, typename T22, typename T23, typename T24, typename T25, typename T26, typename T27, typename T28, typename T29, typename T30, typename T31, typename T32, typename T33, typename T34, typename T35, typename T36, typename T37, typename T38, typename T39, typename T40, typename T41, typename T42, typename T43, typename T44, typename T45, typename T46, typename T47, typename T48, typename T49, typename T50> internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) { return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50);
+ show +
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
} // Bool() allows generating tests with parameters in a set of (false, true). // // Synopsis: // Bool() // - returns a generator producing sequences with elements {false, true}. // // It is useful when testing code that depends on Boolean flags. Combinations // of multiple flags can be tested when several Bool()'s are combined using

[CVE-2020-0478_1.diff] gtest.h #19
- TestProperty(const std::string& a_key, const std::string& a_value) : - key_(a_key), value_(a_value) { - } + TestProperty(const std::string &a_key, const std::string &a_value) + : key_(a_key), value_(a_value) {} - const char* key() const { - return key_.c_str(); - } + const char *key() const { return key_.c_str(); } - const char* value() const { - return value_.c_str(); - } + const char *value() const { return value_.c_str(); } - void SetValue(const std::string& new_value) { - value_ = new_value; - } + void SetValue(const std::string &new_value) { value_ = new_value; }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/gtest.h
458
459
460
461
462
463
464
465
466
467
// A copyable object representing a user specified test property which can be // output as a key/value string pair. // // Don't inherit from TestProperty as its destructor is not virtual. class TestProperty { public: // C'tor. TestProperty does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestProperty object.
+ show +
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
TestProperty(const std::string& a_key, const std::string& a_value) : key_(a_key), value_(a_value) { } // Gets the user supplied key. const char* key() const { return key_.c_str(); } // Gets the user supplied value. const char* value() const { return value_.c_str(); } // Sets a new value, overriding the one supplied in the constructor. void SetValue(const std::string& new_value) { value_ = new_value;
+ show +
485
486
487
488
489
490
491
492
493
494
} private: // The key supplied by the user. std::string key_; // The value supplied by the user. std::string value_; }; // The result of a single Test. This includes a list of
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
// A copyable object representing a user specified test property which can be // output as a key/value string pair. // // Don't inherit from TestProperty as its destructor is not virtual. class TestProperty { public: // C'tor. TestProperty does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestProperty object.
+ show +
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
TestProperty(const std::string& a_key, const std::string& a_value) : key_(a_key), value_(a_value) { } // Gets the user supplied key. const char* key() const { return key_.c_str(); } // Gets the user supplied value. const char* value() const { return value_.c_str(); } // Sets a new value, overriding the one supplied in the constructor. void SetValue(const std::string& new_value) { value_ = new_value;
+ show +
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
} private: // The key supplied by the user. std::string key_; // The value supplied by the user. std::string value_; }; // The result of a single Test. This includes a list of
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest.h
458
459
460
461
462
463
464
465
466
467
// A copyable object representing a user specified test property which can be // output as a key/value string pair. // // Don't inherit from TestProperty as its destructor is not virtual. class TestProperty { public: // C'tor. TestProperty does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestProperty object.
+ show +
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
TestProperty(const std::string& a_key, const std::string& a_value) : key_(a_key), value_(a_value) { } // Gets the user supplied key. const char* key() const { return key_.c_str(); } // Gets the user supplied value. const char* value() const { return value_.c_str(); } // Sets a new value, overriding the one supplied in the constructor. void SetValue(const std::string& new_value) { value_ = new_value;
+ show +
485
486
487
488
489
490
491
492
493
494
} private: // The key supplied by the user. std::string key_; // The value supplied by the user. std::string value_; }; // The result of a single Test. This includes a list of
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest.h
481
482
483
484
485
486
487
488
489
490
// A copyable object representing a user specified test property which can be // output as a key/value string pair. // // Don't inherit from TestProperty as its destructor is not virtual. class TestProperty { public: // C'tor. TestProperty does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestProperty object.
+ show +
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
TestProperty(const std::string& a_key, const std::string& a_value) : key_(a_key), value_(a_value) { } // Gets the user supplied key. const char* key() const { return key_.c_str(); } // Gets the user supplied value. const char* value() const { return value_.c_str(); } // Sets a new value, overriding the one supplied in the constructor. void SetValue(const std::string& new_value) { value_ = new_value;
+ show +
508
509
510
511
512
513
514
515
516
517
} private: // The key supplied by the user. std::string key_; // The value supplied by the user. std::string value_; }; // The result of a single Test. This includes a list of
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
// A copyable object representing a user specified test property which can be // output as a key/value string pair. // // Don't inherit from TestProperty as its destructor is not virtual. class TestProperty { public: // C'tor. TestProperty does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestProperty object.
+ show +
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
TestProperty(const std::string& a_key, const std::string& a_value) : key_(a_key), value_(a_value) { } // Gets the user supplied key. const char* key() const { return key_.c_str(); } // Gets the user supplied value. const char* value() const { return value_.c_str(); } // Sets a new value, overriding the one supplied in the constructor. void SetValue(const std::string& new_value) { value_ = new_value;
+ show +
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
} private: // The key supplied by the user. std::string key_; // The value supplied by the user. std::string value_; }; // The result of a single Test. This includes a list of
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest.h
458
459
460
461
462
463
464
465
466
467
// A copyable object representing a user specified test property which can be // output as a key/value string pair. // // Don't inherit from TestProperty as its destructor is not virtual. class TestProperty { public: // C'tor. TestProperty does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestProperty object.
+ show +
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
TestProperty(const std::string& a_key, const std::string& a_value) : key_(a_key), value_(a_value) { } // Gets the user supplied key. const char* key() const { return key_.c_str(); } // Gets the user supplied value. const char* value() const { return value_.c_str(); } // Sets a new value, overriding the one supplied in the constructor. void SetValue(const std::string& new_value) { value_ = new_value;
+ show +
485
486
487
488
489
490
491
492
493
494
} private: // The key supplied by the user. std::string key_; // The value supplied by the user. std::string value_; }; // The result of a single Test. This includes a list of
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/gtest.h
531
532
533
534
535
536
537
538
539
540
// A copyable object representing a user specified test property which can be // output as a key/value string pair. // // Don't inherit from TestProperty as its destructor is not virtual. class TestProperty { public: // C'tor. TestProperty does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestProperty object.
+ show +
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
TestProperty(const std::string& a_key, const std::string& a_value) : key_(a_key), value_(a_value) { } // Gets the user supplied key. const char* key() const { return key_.c_str(); } // Gets the user supplied value. const char* value() const { return value_.c_str(); } // Sets a new value, overriding the one supplied in the constructor. void SetValue(const std::string& new_value) { value_ = new_value;
+ show +
558
559
560
561
562
563
564
565
566
567
} private: // The key supplied by the user. std::string key_; // The value supplied by the user. std::string value_; }; // The result of a single Test. This includes a list of
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
// A copyable object representing a user specified test property which can be // output as a key/value string pair. // // Don't inherit from TestProperty as its destructor is not virtual. class TestProperty { public: // C'tor. TestProperty does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestProperty object.
+ show +
19101
19102
19103
19104
19105
19106
19107
19108
19109
19110
19111
19112
19113
19114
19115
19116
19117
TestProperty(const std::string& a_key, const std::string& a_value) : key_(a_key), value_(a_value) { } // Gets the user supplied key. const char* key() const { return key_.c_str(); } // Gets the user supplied value. const char* value() const { return value_.c_str(); } // Sets a new value, overriding the one supplied in the constructor. void SetValue(const std::string& new_value) { value_ = new_value;
+ show +
19118
19119
19120
19121
19122
19123
19124
19125
19126
19127
} private: // The key supplied by the user. std::string key_; // The value supplied by the user. std::string value_; }; // The result of a single Test. This includes a list of
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/gtest.h
519
520
521
522
523
524
525
526
527
528
// A copyable object representing a user specified test property which can be // output as a key/value string pair. // // Don't inherit from TestProperty as its destructor is not virtual. class TestProperty { public: // C'tor. TestProperty does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestProperty object.
+ show +
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
TestProperty(const std::string& a_key, const std::string& a_value) : key_(a_key), value_(a_value) { } // Gets the user supplied key. const char* key() const { return key_.c_str(); } // Gets the user supplied value. const char* value() const { return value_.c_str(); } // Sets a new value, overriding the one supplied in the constructor. void SetValue(const std::string& new_value) { value_ = new_value;
+ show +
546
547
548
549
550
551
552
553
554
555
} private: // The key supplied by the user. std::string key_; // The value supplied by the user. std::string value_; }; // The result of a single Test. This includes a list of
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest.h
481
482
483
484
485
486
487
488
489
490
// A copyable object representing a user specified test property which can be // output as a key/value string pair. // // Don't inherit from TestProperty as its destructor is not virtual. class TestProperty { public: // C'tor. TestProperty does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestProperty object.
+ show +
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
TestProperty(const std::string& a_key, const std::string& a_value) : key_(a_key), value_(a_value) { } // Gets the user supplied key. const char* key() const { return key_.c_str(); } // Gets the user supplied value. const char* value() const { return value_.c_str(); } // Sets a new value, overriding the one supplied in the constructor. void SetValue(const std::string& new_value) { value_ = new_value;
+ show +
508
509
510
511
512
513
514
515
516
517
} private: // The key supplied by the user. std::string key_; // The value supplied by the user. std::string value_; }; // The result of a single Test. This includes a list of
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest.h
481
482
483
484
485
486
487
488
489
490
// A copyable object representing a user specified test property which can be // output as a key/value string pair. // // Don't inherit from TestProperty as its destructor is not virtual. class TestProperty { public: // C'tor. TestProperty does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestProperty object.
+ show +
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
TestProperty(const std::string& a_key, const std::string& a_value) : key_(a_key), value_(a_value) { } // Gets the user supplied key. const char* key() const { return key_.c_str(); } // Gets the user supplied value. const char* value() const { return value_.c_str(); } // Sets a new value, overriding the one supplied in the constructor. void SetValue(const std::string& new_value) { value_ = new_value;
+ show +
508
509
510
511
512
513
514
515
516
517
} private: // The key supplied by the user. std::string key_; // The value supplied by the user. std::string value_; }; // The result of a single Test. This includes a list of

[CVE-2020-0478_1.diff] gtest.h #21
- void RecordProperty(const std::string& xml_element, - const TestProperty& test_property); + void RecordProperty(const std::string &xml_element, + const TestProperty &test_property); - // testcase tags. Returns true if the property is valid. - // TODO(russr): Validate attribute names are legal and human readable. - static bool ValidateTestProperty(const std::string& xml_element, - const TestProperty& test_property); + // testsuite tags. Returns true if the property is valid. + // FIXME: Validate attribute names are legal and human readable. + static bool ValidateTestProperty(const std::string &xml_element, + const TestProperty &test_property); - void AddTestPartResult(const TestPartResult& test_part_result); + void AddTestPartResult(const TestPartResult &test_part_result);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/gtest.h
559
560
561
562
563
564
565
566
567
568
// Sets the elapsed time. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } // Adds a test property to the list. The property is validated and may add // a non-fatal failure if invalid (e.g., if it conflicts with reserved // key names). If a property is already recorded for the same key, the // value will be updated, rather than storing multiple values for the same // key. xml_element specifies the element for which the property is being // recorded and is used for validation.
+ show +
569
570
571
572
573
574
575
576
577
578
579
void RecordProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a failure if the key is a reserved attribute of Google Test // testcase tags. Returns true if the property is valid. // TODO(russr): Validate attribute names are legal and human readable. static bool ValidateTestProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a test part result to the list. void AddTestPartResult(const TestPartResult& test_part_result);
+ show +
580
581
582
583
584
585
586
587
588
589
// Returns the death test count. int death_test_count() const { return death_test_count_; } // Increments the death test count, returning the new count. int increment_death_test_count() { return ++death_test_count_; } // Clears the test part results. void ClearTestPartResults();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
// Sets the elapsed time. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } // Adds a test property to the list. The property is validated and may add // a non-fatal failure if invalid (e.g., if it conflicts with reserved // key names). If a property is already recorded for the same key, the // value will be updated, rather than storing multiple values for the same // key. xml_element specifies the element for which the property is being // recorded and is used for validation.
+ show +
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
void RecordProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a failure if the key is a reserved attribute of Google Test // testcase tags. Returns true if the property is valid. // TODO(russr): Validate attribute names are legal and human readable. static bool ValidateTestProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a test part result to the list. void AddTestPartResult(const TestPartResult& test_part_result);
+ show +
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
// Returns the death test count. int death_test_count() const { return death_test_count_; } // Increments the death test count, returning the new count. int increment_death_test_count() { return ++death_test_count_; } // Clears the test part results. void ClearTestPartResults();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest.h
559
560
561
562
563
564
565
566
567
568
// Sets the elapsed time. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } // Adds a test property to the list. The property is validated and may add // a non-fatal failure if invalid (e.g., if it conflicts with reserved // key names). If a property is already recorded for the same key, the // value will be updated, rather than storing multiple values for the same // key. xml_element specifies the element for which the property is being // recorded and is used for validation.
+ show +
569
570
571
572
573
574
575
576
577
578
579
void RecordProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a failure if the key is a reserved attribute of Google Test // testcase tags. Returns true if the property is valid. // TODO(russr): Validate attribute names are legal and human readable. static bool ValidateTestProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a test part result to the list. void AddTestPartResult(const TestPartResult& test_part_result);
+ show +
580
581
582
583
584
585
586
587
588
589
// Returns the death test count. int death_test_count() const { return death_test_count_; } // Increments the death test count, returning the new count. int increment_death_test_count() { return ++death_test_count_; } // Clears the test part results. void ClearTestPartResults();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest.h
582
583
584
585
586
587
588
589
590
591
// Sets the elapsed time. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } // Adds a test property to the list. The property is validated and may add // a non-fatal failure if invalid (e.g., if it conflicts with reserved // key names). If a property is already recorded for the same key, the // value will be updated, rather than storing multiple values for the same // key. xml_element specifies the element for which the property is being // recorded and is used for validation.
+ show +
592
593
594
595
596
597
598
599
600
601
602
void RecordProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a failure if the key is a reserved attribute of Google Test // testcase tags. Returns true if the property is valid. // TODO(russr): Validate attribute names are legal and human readable. static bool ValidateTestProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a test part result to the list. void AddTestPartResult(const TestPartResult& test_part_result);
+ show +
603
604
605
606
607
608
609
610
611
612
// Returns the death test count. int death_test_count() const { return death_test_count_; } // Increments the death test count, returning the new count. int increment_death_test_count() { return ++death_test_count_; } // Clears the test part results. void ClearTestPartResults();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
// Sets the elapsed time. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } // Adds a test property to the list. The property is validated and may add // a non-fatal failure if invalid (e.g., if it conflicts with reserved // key names). If a property is already recorded for the same key, the // value will be updated, rather than storing multiple values for the same // key. xml_element specifies the element for which the property is being // recorded and is used for validation.
+ show +
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
void RecordProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a failure if the key is a reserved attribute of Google Test // testcase tags. Returns true if the property is valid. // TODO(russr): Validate attribute names are legal and human readable. static bool ValidateTestProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a test part result to the list. void AddTestPartResult(const TestPartResult& test_part_result);
+ show +
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
// Returns the death test count. int death_test_count() const { return death_test_count_; } // Increments the death test count, returning the new count. int increment_death_test_count() { return ++death_test_count_; } // Clears the test part results. void ClearTestPartResults();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest.h
559
560
561
562
563
564
565
566
567
568
// Sets the elapsed time. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } // Adds a test property to the list. The property is validated and may add // a non-fatal failure if invalid (e.g., if it conflicts with reserved // key names). If a property is already recorded for the same key, the // value will be updated, rather than storing multiple values for the same // key. xml_element specifies the element for which the property is being // recorded and is used for validation.
+ show +
569
570
571
572
573
574
575
576
577
578
579
void RecordProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a failure if the key is a reserved attribute of Google Test // testcase tags. Returns true if the property is valid. // TODO(russr): Validate attribute names are legal and human readable. static bool ValidateTestProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a test part result to the list. void AddTestPartResult(const TestPartResult& test_part_result);
+ show +
580
581
582
583
584
585
586
587
588
589
// Returns the death test count. int death_test_count() const { return death_test_count_; } // Increments the death test count, returning the new count. int increment_death_test_count() { return ++death_test_count_; } // Clears the test part results. void ClearTestPartResults();
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/gtest.h
635
636
637
638
639
640
641
642
643
644
// Sets the elapsed time. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } // Adds a test property to the list. The property is validated and may add // a non-fatal failure if invalid (e.g., if it conflicts with reserved // key names). If a property is already recorded for the same key, the // value will be updated, rather than storing multiple values for the same // key. xml_element specifies the element for which the property is being // recorded and is used for validation.
+ show +
645
646
647
648
649
650
651
652
653
654
655
void RecordProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a failure if the key is a reserved attribute of Google Test // testsuite tags. Returns true if the property is valid. // FIXME: Validate attribute names are legal and human readable. static bool ValidateTestProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a test part result to the list. void AddTestPartResult(const TestPartResult& test_part_result);
+ show +
656
657
658
659
660
661
662
663
664
665
// Returns the death test count. int death_test_count() const { return death_test_count_; } // Increments the death test count, returning the new count. int increment_death_test_count() { return ++death_test_count_; } // Clears the test part results. void ClearTestPartResults();
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
19192
19193
19194
19195
19196
19197
19198
19199
19200
19201
// Sets the elapsed time. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } // Adds a test property to the list. The property is validated and may add // a non-fatal failure if invalid (e.g., if it conflicts with reserved // key names). If a property is already recorded for the same key, the // value will be updated, rather than storing multiple values for the same // key. xml_element specifies the element for which the property is being // recorded and is used for validation.
+ show +
19202
19203
19204
19205
19206
19207
19208
19209
19210
19211
19212
void RecordProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a failure if the key is a reserved attribute of Google Test // testcase tags. Returns true if the property is valid. // TODO(russr): Validate attribute names are legal and human readable. static bool ValidateTestProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a test part result to the list. void AddTestPartResult(const TestPartResult& test_part_result);
+ show +
19213
19214
19215
19216
19217
19218
19219
19220
19221
19222
// Returns the death test count. int death_test_count() const { return death_test_count_; } // Increments the death test count, returning the new count. int increment_death_test_count() { return ++death_test_count_; } // Clears the test part results. void ClearTestPartResults();
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/gtest.h
620
621
622
623
624
625
626
627
628
629
// Sets the elapsed time. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } // Adds a test property to the list. The property is validated and may add // a non-fatal failure if invalid (e.g., if it conflicts with reserved // key names). If a property is already recorded for the same key, the // value will be updated, rather than storing multiple values for the same // key. xml_element specifies the element for which the property is being // recorded and is used for validation.
+ show +
630
631
632
633
634
635
636
637
638
639
640
void RecordProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a failure if the key is a reserved attribute of Google Test // testcase tags. Returns true if the property is valid. // FIXME: Validate attribute names are legal and human readable. static bool ValidateTestProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a test part result to the list. void AddTestPartResult(const TestPartResult& test_part_result);
+ show +
641
642
643
644
645
646
647
648
649
650
// Returns the death test count. int death_test_count() const { return death_test_count_; } // Increments the death test count, returning the new count. int increment_death_test_count() { return ++death_test_count_; } // Clears the test part results. void ClearTestPartResults();
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest.h
582
583
584
585
586
587
588
589
590
591
// Sets the elapsed time. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } // Adds a test property to the list. The property is validated and may add // a non-fatal failure if invalid (e.g., if it conflicts with reserved // key names). If a property is already recorded for the same key, the // value will be updated, rather than storing multiple values for the same // key. xml_element specifies the element for which the property is being // recorded and is used for validation.
+ show +
592
593
594
595
596
597
598
599
600
601
602
void RecordProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a failure if the key is a reserved attribute of Google Test // testcase tags. Returns true if the property is valid. // TODO(russr): Validate attribute names are legal and human readable. static bool ValidateTestProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a test part result to the list. void AddTestPartResult(const TestPartResult& test_part_result);
+ show +
603
604
605
606
607
608
609
610
611
612
// Returns the death test count. int death_test_count() const { return death_test_count_; } // Increments the death test count, returning the new count. int increment_death_test_count() { return ++death_test_count_; } // Clears the test part results. void ClearTestPartResults();
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest.h
582
583
584
585
586
587
588
589
590
591
// Sets the elapsed time. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } // Adds a test property to the list. The property is validated and may add // a non-fatal failure if invalid (e.g., if it conflicts with reserved // key names). If a property is already recorded for the same key, the // value will be updated, rather than storing multiple values for the same // key. xml_element specifies the element for which the property is being // recorded and is used for validation.
+ show +
592
593
594
595
596
597
598
599
600
601
602
void RecordProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a failure if the key is a reserved attribute of Google Test // testcase tags. Returns true if the property is valid. // TODO(russr): Validate attribute names are legal and human readable. static bool ValidateTestProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a test part result to the list. void AddTestPartResult(const TestPartResult& test_part_result);
+ show +
603
604
605
606
607
608
609
610
611
612
// Returns the death test count. int death_test_count() const { return death_test_count_; } // Increments the death test count, returning the new count. int increment_death_test_count() { return ++death_test_count_; } // Clears the test part results. void ClearTestPartResults();

[CVE-2020-0478_1.diff] gtest.h #30
- virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} - virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, - int /*iteration*/) {} - virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} - virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} - virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} - virtual void OnTestStart(const TestInfo& /*test_info*/) {} - virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} - virtual void OnTestEnd(const TestInfo& /*test_info*/) {} - virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} - virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} - virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} - virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, - int /*iteration*/) {} - virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {} + void OnTestProgramStart(const UnitTest & /*unit_test*/) override {} + void OnTestIterationStart(const UnitTest & /*unit_test*/, + int /*iteration*/) override {} + void OnEnvironmentsSetUpStart(const UnitTest & /*unit_test*/) override {} + void OnEnvironmentsSetUpEnd(const UnitTest & /*unit_test*/) override {} + void OnTestSuiteStart(const TestSuite & /*test_suite*/) override {} +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + void OnTestCaseStart(const TestCase & /*test_case*/) override {} +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + + void OnTestStart(const TestInfo & /*test_info*/) override {} + void OnTestPartResult(const TestPartResult & /*test_part_result*/) override {} + void OnTestEnd(const TestInfo & /*test_info*/) override {} + void OnTestSuiteEnd(const TestSuite & /*test_suite*/) override {} +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + void OnTestCaseEnd(const TestCase & /*test_case*/) override {} +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + + void OnEnvironmentsTearDownStart(const UnitTest & /*unit_test*/) override {} + void OnEnvironmentsTearDownEnd(const UnitTest & /*unit_test*/) override {} + void OnTestIterationEnd(const UnitTest & /*unit_test*/, + int /*iteration*/) override {} + void OnTestProgramEnd(const UnitTest & /*unit_test*/) override {}
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/gtest.h
979
980
981
982
983
984
985
986
987
988
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest.h
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest.h
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest.h
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
19646
19647
19648
19649
19650
19651
19652
19653
19654
19655
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
19656
19657
19658
19659
19660
19661
19662
19663
19664
19665
19666
19667
19668
19669
19670
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
19671
19672
19673
19674
19675
19676
19677
19678
19679
19680
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/include/gtest/gtest.h
974
975
976
977
978
979
980
981
982
983
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/gtest.h
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest.h
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/include/gtest/gtest.h
974
975
976
977
978
979
980
981
982
983
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest.h
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when

[CVE-2020-0478_1.diff] gtest.h #69
-# define EXPECT_HRESULT_SUCCEEDED(expr) \ - EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) +#define EXPECT_HRESULT_SUCCEEDED(expr) \ + EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) -# define ASSERT_HRESULT_SUCCEEDED(expr) \ - ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) +#define ASSERT_HRESULT_SUCCEEDED(expr) \ + ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) -# define EXPECT_HRESULT_FAILED(expr) \ - EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) +#define EXPECT_HRESULT_FAILED(expr) \ + EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) -# define ASSERT_HRESULT_FAILED(expr) \ - ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) +#define ASSERT_HRESULT_FAILED(expr) \ + ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/gtest.h
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
19891
19892
19893
19894
19895
19896
19897
19898
19899
19900
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
19901
19902
19903
19904
19905
19906
19907
19908
19909
19910
19911
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
19912
19913
19914
19915
19916
19917
19918
19919
19920
19921
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest.h
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest.h
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
19891
19892
19893
19894
19895
19896
19897
19898
19899
19900
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
19901
19902
19903
19904
19905
19906
19907
19908
19909
19910
19911
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
19912
19913
19914
19915
19916
19917
19918
19919
19920
19921
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest.h
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/gtest.h
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
21032
21033
21034
21035
21036
21037
21038
21039
21040
21041
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
21042
21043
21044
21045
21046
21047
21048
21049
21050
21051
21052
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
21053
21054
21055
21056
21057
21058
21059
21060
21061
21062
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/include/gtest/gtest.h
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/gtest.h
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/include/gtest/gtest.h
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest.h
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/include/gtest/gtest.h
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest.h
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //

[CVE-2020-0470_1.diff] gtest.h #19
- TestProperty(const std::string& a_key, const std::string& a_value) : - key_(a_key), value_(a_value) { - } + TestProperty(const std::string &a_key, const std::string &a_value) + : key_(a_key), value_(a_value) {} - const char* key() const { - return key_.c_str(); - } + const char *key() const { return key_.c_str(); } - const char* value() const { - return value_.c_str(); - } + const char *value() const { return value_.c_str(); } - void SetValue(const std::string& new_value) { - value_ = new_value; - } + void SetValue(const std::string &new_value) { value_ = new_value; }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/gtest.h
458
459
460
461
462
463
464
465
466
467
// A copyable object representing a user specified test property which can be // output as a key/value string pair. // // Don't inherit from TestProperty as its destructor is not virtual. class TestProperty { public: // C'tor. TestProperty does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestProperty object.
+ show +
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
TestProperty(const std::string& a_key, const std::string& a_value) : key_(a_key), value_(a_value) { } // Gets the user supplied key. const char* key() const { return key_.c_str(); } // Gets the user supplied value. const char* value() const { return value_.c_str(); } // Sets a new value, overriding the one supplied in the constructor. void SetValue(const std::string& new_value) { value_ = new_value;
+ show +
485
486
487
488
489
490
491
492
493
494
} private: // The key supplied by the user. std::string key_; // The value supplied by the user. std::string value_; }; // The result of a single Test. This includes a list of
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
// A copyable object representing a user specified test property which can be // output as a key/value string pair. // // Don't inherit from TestProperty as its destructor is not virtual. class TestProperty { public: // C'tor. TestProperty does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestProperty object.
+ show +
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
TestProperty(const std::string& a_key, const std::string& a_value) : key_(a_key), value_(a_value) { } // Gets the user supplied key. const char* key() const { return key_.c_str(); } // Gets the user supplied value. const char* value() const { return value_.c_str(); } // Sets a new value, overriding the one supplied in the constructor. void SetValue(const std::string& new_value) { value_ = new_value;
+ show +
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
} private: // The key supplied by the user. std::string key_; // The value supplied by the user. std::string value_; }; // The result of a single Test. This includes a list of
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest.h
458
459
460
461
462
463
464
465
466
467
// A copyable object representing a user specified test property which can be // output as a key/value string pair. // // Don't inherit from TestProperty as its destructor is not virtual. class TestProperty { public: // C'tor. TestProperty does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestProperty object.
+ show +
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
TestProperty(const std::string& a_key, const std::string& a_value) : key_(a_key), value_(a_value) { } // Gets the user supplied key. const char* key() const { return key_.c_str(); } // Gets the user supplied value. const char* value() const { return value_.c_str(); } // Sets a new value, overriding the one supplied in the constructor. void SetValue(const std::string& new_value) { value_ = new_value;
+ show +
485
486
487
488
489
490
491
492
493
494
} private: // The key supplied by the user. std::string key_; // The value supplied by the user. std::string value_; }; // The result of a single Test. This includes a list of
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest.h
481
482
483
484
485
486
487
488
489
490
// A copyable object representing a user specified test property which can be // output as a key/value string pair. // // Don't inherit from TestProperty as its destructor is not virtual. class TestProperty { public: // C'tor. TestProperty does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestProperty object.
+ show +
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
TestProperty(const std::string& a_key, const std::string& a_value) : key_(a_key), value_(a_value) { } // Gets the user supplied key. const char* key() const { return key_.c_str(); } // Gets the user supplied value. const char* value() const { return value_.c_str(); } // Sets a new value, overriding the one supplied in the constructor. void SetValue(const std::string& new_value) { value_ = new_value;
+ show +
508
509
510
511
512
513
514
515
516
517
} private: // The key supplied by the user. std::string key_; // The value supplied by the user. std::string value_; }; // The result of a single Test. This includes a list of
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
// A copyable object representing a user specified test property which can be // output as a key/value string pair. // // Don't inherit from TestProperty as its destructor is not virtual. class TestProperty { public: // C'tor. TestProperty does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestProperty object.
+ show +
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
TestProperty(const std::string& a_key, const std::string& a_value) : key_(a_key), value_(a_value) { } // Gets the user supplied key. const char* key() const { return key_.c_str(); } // Gets the user supplied value. const char* value() const { return value_.c_str(); } // Sets a new value, overriding the one supplied in the constructor. void SetValue(const std::string& new_value) { value_ = new_value;
+ show +
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
} private: // The key supplied by the user. std::string key_; // The value supplied by the user. std::string value_; }; // The result of a single Test. This includes a list of
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest.h
458
459
460
461
462
463
464
465
466
467
// A copyable object representing a user specified test property which can be // output as a key/value string pair. // // Don't inherit from TestProperty as its destructor is not virtual. class TestProperty { public: // C'tor. TestProperty does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestProperty object.
+ show +
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
TestProperty(const std::string& a_key, const std::string& a_value) : key_(a_key), value_(a_value) { } // Gets the user supplied key. const char* key() const { return key_.c_str(); } // Gets the user supplied value. const char* value() const { return value_.c_str(); } // Sets a new value, overriding the one supplied in the constructor. void SetValue(const std::string& new_value) { value_ = new_value;
+ show +
485
486
487
488
489
490
491
492
493
494
} private: // The key supplied by the user. std::string key_; // The value supplied by the user. std::string value_; }; // The result of a single Test. This includes a list of
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/gtest.h
531
532
533
534
535
536
537
538
539
540
// A copyable object representing a user specified test property which can be // output as a key/value string pair. // // Don't inherit from TestProperty as its destructor is not virtual. class TestProperty { public: // C'tor. TestProperty does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestProperty object.
+ show +
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
TestProperty(const std::string& a_key, const std::string& a_value) : key_(a_key), value_(a_value) { } // Gets the user supplied key. const char* key() const { return key_.c_str(); } // Gets the user supplied value. const char* value() const { return value_.c_str(); } // Sets a new value, overriding the one supplied in the constructor. void SetValue(const std::string& new_value) { value_ = new_value;
+ show +
558
559
560
561
562
563
564
565
566
567
} private: // The key supplied by the user. std::string key_; // The value supplied by the user. std::string value_; }; // The result of a single Test. This includes a list of
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
// A copyable object representing a user specified test property which can be // output as a key/value string pair. // // Don't inherit from TestProperty as its destructor is not virtual. class TestProperty { public: // C'tor. TestProperty does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestProperty object.
+ show +
19101
19102
19103
19104
19105
19106
19107
19108
19109
19110
19111
19112
19113
19114
19115
19116
19117
TestProperty(const std::string& a_key, const std::string& a_value) : key_(a_key), value_(a_value) { } // Gets the user supplied key. const char* key() const { return key_.c_str(); } // Gets the user supplied value. const char* value() const { return value_.c_str(); } // Sets a new value, overriding the one supplied in the constructor. void SetValue(const std::string& new_value) { value_ = new_value;
+ show +
19118
19119
19120
19121
19122
19123
19124
19125
19126
19127
} private: // The key supplied by the user. std::string key_; // The value supplied by the user. std::string value_; }; // The result of a single Test. This includes a list of
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/gtest.h
519
520
521
522
523
524
525
526
527
528
// A copyable object representing a user specified test property which can be // output as a key/value string pair. // // Don't inherit from TestProperty as its destructor is not virtual. class TestProperty { public: // C'tor. TestProperty does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestProperty object.
+ show +
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
TestProperty(const std::string& a_key, const std::string& a_value) : key_(a_key), value_(a_value) { } // Gets the user supplied key. const char* key() const { return key_.c_str(); } // Gets the user supplied value. const char* value() const { return value_.c_str(); } // Sets a new value, overriding the one supplied in the constructor. void SetValue(const std::string& new_value) { value_ = new_value;
+ show +
546
547
548
549
550
551
552
553
554
555
} private: // The key supplied by the user. std::string key_; // The value supplied by the user. std::string value_; }; // The result of a single Test. This includes a list of
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest.h
481
482
483
484
485
486
487
488
489
490
// A copyable object representing a user specified test property which can be // output as a key/value string pair. // // Don't inherit from TestProperty as its destructor is not virtual. class TestProperty { public: // C'tor. TestProperty does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestProperty object.
+ show +
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
TestProperty(const std::string& a_key, const std::string& a_value) : key_(a_key), value_(a_value) { } // Gets the user supplied key. const char* key() const { return key_.c_str(); } // Gets the user supplied value. const char* value() const { return value_.c_str(); } // Sets a new value, overriding the one supplied in the constructor. void SetValue(const std::string& new_value) { value_ = new_value;
+ show +
508
509
510
511
512
513
514
515
516
517
} private: // The key supplied by the user. std::string key_; // The value supplied by the user. std::string value_; }; // The result of a single Test. This includes a list of
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest.h
481
482
483
484
485
486
487
488
489
490
// A copyable object representing a user specified test property which can be // output as a key/value string pair. // // Don't inherit from TestProperty as its destructor is not virtual. class TestProperty { public: // C'tor. TestProperty does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestProperty object.
+ show +
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
TestProperty(const std::string& a_key, const std::string& a_value) : key_(a_key), value_(a_value) { } // Gets the user supplied key. const char* key() const { return key_.c_str(); } // Gets the user supplied value. const char* value() const { return value_.c_str(); } // Sets a new value, overriding the one supplied in the constructor. void SetValue(const std::string& new_value) { value_ = new_value;
+ show +
508
509
510
511
512
513
514
515
516
517
} private: // The key supplied by the user. std::string key_; // The value supplied by the user. std::string value_; }; // The result of a single Test. This includes a list of

[CVE-2020-0470_1.diff] gtest.h #21
- void RecordProperty(const std::string& xml_element, - const TestProperty& test_property); + void RecordProperty(const std::string &xml_element, + const TestProperty &test_property); - // testcase tags. Returns true if the property is valid. - // TODO(russr): Validate attribute names are legal and human readable. - static bool ValidateTestProperty(const std::string& xml_element, - const TestProperty& test_property); + // testsuite tags. Returns true if the property is valid. + // FIXME: Validate attribute names are legal and human readable. + static bool ValidateTestProperty(const std::string &xml_element, + const TestProperty &test_property); - void AddTestPartResult(const TestPartResult& test_part_result); + void AddTestPartResult(const TestPartResult &test_part_result);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/gtest.h
559
560
561
562
563
564
565
566
567
568
// Sets the elapsed time. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } // Adds a test property to the list. The property is validated and may add // a non-fatal failure if invalid (e.g., if it conflicts with reserved // key names). If a property is already recorded for the same key, the // value will be updated, rather than storing multiple values for the same // key. xml_element specifies the element for which the property is being // recorded and is used for validation.
+ show +
569
570
571
572
573
574
575
576
577
578
579
void RecordProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a failure if the key is a reserved attribute of Google Test // testcase tags. Returns true if the property is valid. // TODO(russr): Validate attribute names are legal and human readable. static bool ValidateTestProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a test part result to the list. void AddTestPartResult(const TestPartResult& test_part_result);
+ show +
580
581
582
583
584
585
586
587
588
589
// Returns the death test count. int death_test_count() const { return death_test_count_; } // Increments the death test count, returning the new count. int increment_death_test_count() { return ++death_test_count_; } // Clears the test part results. void ClearTestPartResults();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
// Sets the elapsed time. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } // Adds a test property to the list. The property is validated and may add // a non-fatal failure if invalid (e.g., if it conflicts with reserved // key names). If a property is already recorded for the same key, the // value will be updated, rather than storing multiple values for the same // key. xml_element specifies the element for which the property is being // recorded and is used for validation.
+ show +
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
void RecordProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a failure if the key is a reserved attribute of Google Test // testcase tags. Returns true if the property is valid. // TODO(russr): Validate attribute names are legal and human readable. static bool ValidateTestProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a test part result to the list. void AddTestPartResult(const TestPartResult& test_part_result);
+ show +
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
// Returns the death test count. int death_test_count() const { return death_test_count_; } // Increments the death test count, returning the new count. int increment_death_test_count() { return ++death_test_count_; } // Clears the test part results. void ClearTestPartResults();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest.h
559
560
561
562
563
564
565
566
567
568
// Sets the elapsed time. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } // Adds a test property to the list. The property is validated and may add // a non-fatal failure if invalid (e.g., if it conflicts with reserved // key names). If a property is already recorded for the same key, the // value will be updated, rather than storing multiple values for the same // key. xml_element specifies the element for which the property is being // recorded and is used for validation.
+ show +
569
570
571
572
573
574
575
576
577
578
579
void RecordProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a failure if the key is a reserved attribute of Google Test // testcase tags. Returns true if the property is valid. // TODO(russr): Validate attribute names are legal and human readable. static bool ValidateTestProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a test part result to the list. void AddTestPartResult(const TestPartResult& test_part_result);
+ show +
580
581
582
583
584
585
586
587
588
589
// Returns the death test count. int death_test_count() const { return death_test_count_; } // Increments the death test count, returning the new count. int increment_death_test_count() { return ++death_test_count_; } // Clears the test part results. void ClearTestPartResults();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest.h
582
583
584
585
586
587
588
589
590
591
// Sets the elapsed time. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } // Adds a test property to the list. The property is validated and may add // a non-fatal failure if invalid (e.g., if it conflicts with reserved // key names). If a property is already recorded for the same key, the // value will be updated, rather than storing multiple values for the same // key. xml_element specifies the element for which the property is being // recorded and is used for validation.
+ show +
592
593
594
595
596
597
598
599
600
601
602
void RecordProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a failure if the key is a reserved attribute of Google Test // testcase tags. Returns true if the property is valid. // TODO(russr): Validate attribute names are legal and human readable. static bool ValidateTestProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a test part result to the list. void AddTestPartResult(const TestPartResult& test_part_result);
+ show +
603
604
605
606
607
608
609
610
611
612
// Returns the death test count. int death_test_count() const { return death_test_count_; } // Increments the death test count, returning the new count. int increment_death_test_count() { return ++death_test_count_; } // Clears the test part results. void ClearTestPartResults();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
// Sets the elapsed time. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } // Adds a test property to the list. The property is validated and may add // a non-fatal failure if invalid (e.g., if it conflicts with reserved // key names). If a property is already recorded for the same key, the // value will be updated, rather than storing multiple values for the same // key. xml_element specifies the element for which the property is being // recorded and is used for validation.
+ show +
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
void RecordProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a failure if the key is a reserved attribute of Google Test // testcase tags. Returns true if the property is valid. // TODO(russr): Validate attribute names are legal and human readable. static bool ValidateTestProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a test part result to the list. void AddTestPartResult(const TestPartResult& test_part_result);
+ show +
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
// Returns the death test count. int death_test_count() const { return death_test_count_; } // Increments the death test count, returning the new count. int increment_death_test_count() { return ++death_test_count_; } // Clears the test part results. void ClearTestPartResults();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest.h
559
560
561
562
563
564
565
566
567
568
// Sets the elapsed time. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } // Adds a test property to the list. The property is validated and may add // a non-fatal failure if invalid (e.g., if it conflicts with reserved // key names). If a property is already recorded for the same key, the // value will be updated, rather than storing multiple values for the same // key. xml_element specifies the element for which the property is being // recorded and is used for validation.
+ show +
569
570
571
572
573
574
575
576
577
578
579
void RecordProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a failure if the key is a reserved attribute of Google Test // testcase tags. Returns true if the property is valid. // TODO(russr): Validate attribute names are legal and human readable. static bool ValidateTestProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a test part result to the list. void AddTestPartResult(const TestPartResult& test_part_result);
+ show +
580
581
582
583
584
585
586
587
588
589
// Returns the death test count. int death_test_count() const { return death_test_count_; } // Increments the death test count, returning the new count. int increment_death_test_count() { return ++death_test_count_; } // Clears the test part results. void ClearTestPartResults();
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/gtest.h
635
636
637
638
639
640
641
642
643
644
// Sets the elapsed time. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } // Adds a test property to the list. The property is validated and may add // a non-fatal failure if invalid (e.g., if it conflicts with reserved // key names). If a property is already recorded for the same key, the // value will be updated, rather than storing multiple values for the same // key. xml_element specifies the element for which the property is being // recorded and is used for validation.
+ show +
645
646
647
648
649
650
651
652
653
654
655
void RecordProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a failure if the key is a reserved attribute of Google Test // testsuite tags. Returns true if the property is valid. // FIXME: Validate attribute names are legal and human readable. static bool ValidateTestProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a test part result to the list. void AddTestPartResult(const TestPartResult& test_part_result);
+ show +
656
657
658
659
660
661
662
663
664
665
// Returns the death test count. int death_test_count() const { return death_test_count_; } // Increments the death test count, returning the new count. int increment_death_test_count() { return ++death_test_count_; } // Clears the test part results. void ClearTestPartResults();
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
19192
19193
19194
19195
19196
19197
19198
19199
19200
19201
// Sets the elapsed time. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } // Adds a test property to the list. The property is validated and may add // a non-fatal failure if invalid (e.g., if it conflicts with reserved // key names). If a property is already recorded for the same key, the // value will be updated, rather than storing multiple values for the same // key. xml_element specifies the element for which the property is being // recorded and is used for validation.
+ show +
19202
19203
19204
19205
19206
19207
19208
19209
19210
19211
19212
void RecordProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a failure if the key is a reserved attribute of Google Test // testcase tags. Returns true if the property is valid. // TODO(russr): Validate attribute names are legal and human readable. static bool ValidateTestProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a test part result to the list. void AddTestPartResult(const TestPartResult& test_part_result);
+ show +
19213
19214
19215
19216
19217
19218
19219
19220
19221
19222
// Returns the death test count. int death_test_count() const { return death_test_count_; } // Increments the death test count, returning the new count. int increment_death_test_count() { return ++death_test_count_; } // Clears the test part results. void ClearTestPartResults();
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/gtest.h
620
621
622
623
624
625
626
627
628
629
// Sets the elapsed time. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } // Adds a test property to the list. The property is validated and may add // a non-fatal failure if invalid (e.g., if it conflicts with reserved // key names). If a property is already recorded for the same key, the // value will be updated, rather than storing multiple values for the same // key. xml_element specifies the element for which the property is being // recorded and is used for validation.
+ show +
630
631
632
633
634
635
636
637
638
639
640
void RecordProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a failure if the key is a reserved attribute of Google Test // testcase tags. Returns true if the property is valid. // FIXME: Validate attribute names are legal and human readable. static bool ValidateTestProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a test part result to the list. void AddTestPartResult(const TestPartResult& test_part_result);
+ show +
641
642
643
644
645
646
647
648
649
650
// Returns the death test count. int death_test_count() const { return death_test_count_; } // Increments the death test count, returning the new count. int increment_death_test_count() { return ++death_test_count_; } // Clears the test part results. void ClearTestPartResults();
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest.h
582
583
584
585
586
587
588
589
590
591
// Sets the elapsed time. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } // Adds a test property to the list. The property is validated and may add // a non-fatal failure if invalid (e.g., if it conflicts with reserved // key names). If a property is already recorded for the same key, the // value will be updated, rather than storing multiple values for the same // key. xml_element specifies the element for which the property is being // recorded and is used for validation.
+ show +
592
593
594
595
596
597
598
599
600
601
602
void RecordProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a failure if the key is a reserved attribute of Google Test // testcase tags. Returns true if the property is valid. // TODO(russr): Validate attribute names are legal and human readable. static bool ValidateTestProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a test part result to the list. void AddTestPartResult(const TestPartResult& test_part_result);
+ show +
603
604
605
606
607
608
609
610
611
612
// Returns the death test count. int death_test_count() const { return death_test_count_; } // Increments the death test count, returning the new count. int increment_death_test_count() { return ++death_test_count_; } // Clears the test part results. void ClearTestPartResults();
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest.h
582
583
584
585
586
587
588
589
590
591
// Sets the elapsed time. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } // Adds a test property to the list. The property is validated and may add // a non-fatal failure if invalid (e.g., if it conflicts with reserved // key names). If a property is already recorded for the same key, the // value will be updated, rather than storing multiple values for the same // key. xml_element specifies the element for which the property is being // recorded and is used for validation.
+ show +
592
593
594
595
596
597
598
599
600
601
602
void RecordProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a failure if the key is a reserved attribute of Google Test // testcase tags. Returns true if the property is valid. // TODO(russr): Validate attribute names are legal and human readable. static bool ValidateTestProperty(const std::string& xml_element, const TestProperty& test_property); // Adds a test part result to the list. void AddTestPartResult(const TestPartResult& test_part_result);
+ show +
603
604
605
606
607
608
609
610
611
612
// Returns the death test count. int death_test_count() const { return death_test_count_; } // Increments the death test count, returning the new count. int increment_death_test_count() { return ++death_test_count_; } // Clears the test part results. void ClearTestPartResults();

[CVE-2020-0470_1.diff] gtest.h #30
- virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} - virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, - int /*iteration*/) {} - virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} - virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} - virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} - virtual void OnTestStart(const TestInfo& /*test_info*/) {} - virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} - virtual void OnTestEnd(const TestInfo& /*test_info*/) {} - virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} - virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} - virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} - virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, - int /*iteration*/) {} - virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {} + void OnTestProgramStart(const UnitTest & /*unit_test*/) override {} + void OnTestIterationStart(const UnitTest & /*unit_test*/, + int /*iteration*/) override {} + void OnEnvironmentsSetUpStart(const UnitTest & /*unit_test*/) override {} + void OnEnvironmentsSetUpEnd(const UnitTest & /*unit_test*/) override {} + void OnTestSuiteStart(const TestSuite & /*test_suite*/) override {} +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + void OnTestCaseStart(const TestCase & /*test_case*/) override {} +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + + void OnTestStart(const TestInfo & /*test_info*/) override {} + void OnTestPartResult(const TestPartResult & /*test_part_result*/) override {} + void OnTestEnd(const TestInfo & /*test_info*/) override {} + void OnTestSuiteEnd(const TestSuite & /*test_suite*/) override {} +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + void OnTestCaseEnd(const TestCase & /*test_case*/) override {} +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + + void OnEnvironmentsTearDownStart(const UnitTest & /*unit_test*/) override {} + void OnEnvironmentsTearDownEnd(const UnitTest & /*unit_test*/) override {} + void OnTestIterationEnd(const UnitTest & /*unit_test*/, + int /*iteration*/) override {} + void OnTestProgramEnd(const UnitTest & /*unit_test*/) override {}
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/gtest.h
979
980
981
982
983
984
985
986
987
988
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest.h
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest.h
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest.h
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
19646
19647
19648
19649
19650
19651
19652
19653
19654
19655
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
19656
19657
19658
19659
19660
19661
19662
19663
19664
19665
19666
19667
19668
19669
19670
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
19671
19672
19673
19674
19675
19676
19677
19678
19679
19680
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/include/gtest/gtest.h
974
975
976
977
978
979
980
981
982
983
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/gtest.h
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest.h
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/include/gtest/gtest.h
974
975
976
977
978
979
980
981
982
983
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest.h
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; }; // The convenience class for users who need to override just one or two // methods and are not concerned that a possible change to a signature of // the methods they override will not be caught during the build. For // comments about each method please see the definition of TestEventListener // above. class EmptyTestEventListener : public TestEventListener { public:
+ show +
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} virtual void OnTestStart(const TestInfo& /*test_info*/) {} virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} virtual void OnTestEnd(const TestInfo& /*test_info*/) {} virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, int /*iteration*/) {} virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+ show +
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
}; // TestEventListeners lets users add listeners to track events in Google Test. class GTEST_API_ TestEventListeners { public: TestEventListeners(); ~TestEventListeners(); // Appends an event listener to the end of the list. Google Test assumes // the ownership of the listener (i.e. it will delete the listener when

[CVE-2020-0470_1.diff] gtest.h #69
-# define EXPECT_HRESULT_SUCCEEDED(expr) \ - EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) +#define EXPECT_HRESULT_SUCCEEDED(expr) \ + EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) -# define ASSERT_HRESULT_SUCCEEDED(expr) \ - ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) +#define ASSERT_HRESULT_SUCCEEDED(expr) \ + ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) -# define EXPECT_HRESULT_FAILED(expr) \ - EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) +#define EXPECT_HRESULT_FAILED(expr) \ + EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) -# define ASSERT_HRESULT_FAILED(expr) \ - ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) +#define ASSERT_HRESULT_FAILED(expr) \ + ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/gtest.h
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
19891
19892
19893
19894
19895
19896
19897
19898
19899
19900
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
19901
19902
19903
19904
19905
19906
19907
19908
19909
19910
19911
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
19912
19913
19914
19915
19916
19917
19918
19919
19920
19921
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest.h
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest.h
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
19891
19892
19893
19894
19895
19896
19897
19898
19899
19900
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
19901
19902
19903
19904
19905
19906
19907
19908
19909
19910
19911
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
19912
19913
19914
19915
19916
19917
19918
19919
19920
19921
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest.h
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/gtest.h
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
21032
21033
21034
21035
21036
21037
21038
21039
21040
21041
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
21042
21043
21044
21045
21046
21047
21048
21049
21050
21051
21052
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
21053
21054
21055
21056
21057
21058
21059
21060
21061
21062
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/include/gtest/gtest.h
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/gtest.h
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/include/gtest/gtest.h
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest.h
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/include/gtest/gtest.h
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest.h
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
// Macros that test for HRESULT failure and success, these are only useful // on Windows, and rely on Windows SDK macros and APIs to compile. // // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) // // When expr unexpectedly fails or succeeds, Google Test prints the // expected result and the actual result with both a human-readable // string representation of the error, if available, as well as the // hex result code.
+ show +
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
# define EXPECT_HRESULT_SUCCEEDED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define ASSERT_HRESULT_SUCCEEDED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) # define EXPECT_HRESULT_FAILED(expr) \ EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) # define ASSERT_HRESULT_FAILED(expr) \ ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+ show +
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
#endif // GTEST_OS_WINDOWS // Macros that execute statement and check that it doesn't generate new fatal // failures in the current thread. // // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); // // Examples: //

[CVE-2020-0478_1.diff] gtest-printers.h #7
- static void PrintValue(const T& value, ::std::ostream* os) { - const ::testing::internal::string short_str = value.ShortDebugString(); - const ::testing::internal::string pretty_str = - short_str.length() <= kProtobufOneLinerMaxLength ? - short_str : ("\n" + value.DebugString()); + static void PrintValue(const T &value, ::std::ostream *os) { + std::string pretty_str = value.ShortDebugString(); + if (pretty_str.length() > kProtobufOneLinerMaxLength) { + pretty_str = "\n" + value.DebugString(); + }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/gtest-printers.h
139
140
141
142
143
144
145
146
147
148
}; // We print a protobuf using its ShortDebugString() when the string // doesn't exceed this many characters; otherwise we print it using // DebugString() for better readability. const size_t kProtobufOneLinerMaxLength = 50; template <typename T> class TypeWithoutFormatter<T, kProtobuf> { public:
+ show +
149
150
151
152
153
static void PrintValue(const T& value, ::std::ostream* os) { const ::testing::internal::string short_str = value.ShortDebugString(); const ::testing::internal::string pretty_str = short_str.length() <= kProtobufOneLinerMaxLength ? short_str : ("\n" + value.DebugString());
+ show +
154
155
156
157
158
159
160
161
162
163
*os << ("<" + pretty_str + ">"); } }; template <typename T> class TypeWithoutFormatter<T, kConvertibleToInteger> { public: // Since T has no << operator or PrintTo() but can be implicitly // converted to BiggestInt, we print it as a BiggestInt. //
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
}; // We print a protobuf using its ShortDebugString() when the string // doesn't exceed this many characters; otherwise we print it using // DebugString() for better readability. const size_t kProtobufOneLinerMaxLength = 50; template <typename T> class TypeWithoutFormatter<T, kProtobuf> { public:
+ show +
9341
9342
9343
9344
9345
static void PrintValue(const T& value, ::std::ostream* os) { const ::testing::internal::string short_str = value.ShortDebugString(); const ::testing::internal::string pretty_str = short_str.length() <= kProtobufOneLinerMaxLength ? short_str : ("\n" + value.DebugString());
+ show +
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
*os << ("<" + pretty_str + ">"); } }; template <typename T> class TypeWithoutFormatter<T, kConvertibleToInteger> { public: // Since T has no << operator or PrintTo() but can be implicitly // converted to BiggestInt, we print it as a BiggestInt. //
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest-printers.h
139
140
141
142
143
144
145
146
147
148
}; // We print a protobuf using its ShortDebugString() when the string // doesn't exceed this many characters; otherwise we print it using // DebugString() for better readability. const size_t kProtobufOneLinerMaxLength = 50; template <typename T> class TypeWithoutFormatter<T, kProtobuf> { public:
+ show +
149
150
151
152
153
static void PrintValue(const T& value, ::std::ostream* os) { const ::testing::internal::string short_str = value.ShortDebugString(); const ::testing::internal::string pretty_str = short_str.length() <= kProtobufOneLinerMaxLength ? short_str : ("\n" + value.DebugString());
+ show +
154
155
156
157
158
159
160
161
162
163
*os << ("<" + pretty_str + ">"); } }; template <typename T> class TypeWithoutFormatter<T, kConvertibleToInteger> { public: // Since T has no << operator or PrintTo() but can be implicitly // converted to BiggestInt, we print it as a BiggestInt. //
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
}; // We print a protobuf using its ShortDebugString() when the string // doesn't exceed this many characters; otherwise we print it using // DebugString() for better readability. const size_t kProtobufOneLinerMaxLength = 50; template <typename T> class TypeWithoutFormatter<T, kProtobuf> { public:
+ show +
9341
9342
9343
9344
9345
static void PrintValue(const T& value, ::std::ostream* os) { const ::testing::internal::string short_str = value.ShortDebugString(); const ::testing::internal::string pretty_str = short_str.length() <= kProtobufOneLinerMaxLength ? short_str : ("\n" + value.DebugString());
+ show +
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
*os << ("<" + pretty_str + ">"); } }; template <typename T> class TypeWithoutFormatter<T, kConvertibleToInteger> { public: // Since T has no << operator or PrintTo() but can be implicitly // converted to BiggestInt, we print it as a BiggestInt. //
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest-printers.h
139
140
141
142
143
144
145
146
147
148
}; // We print a protobuf using its ShortDebugString() when the string // doesn't exceed this many characters; otherwise we print it using // DebugString() for better readability. const size_t kProtobufOneLinerMaxLength = 50; template <typename T> class TypeWithoutFormatter<T, kProtobuf> { public:
+ show +
149
150
151
152
153
static void PrintValue(const T& value, ::std::ostream* os) { const ::testing::internal::string short_str = value.ShortDebugString(); const ::testing::internal::string pretty_str = short_str.length() <= kProtobufOneLinerMaxLength ? short_str : ("\n" + value.DebugString());
+ show +
154
155
156
157
158
159
160
161
162
163
*os << ("<" + pretty_str + ">"); } }; template <typename T> class TypeWithoutFormatter<T, kConvertibleToInteger> { public: // Since T has no << operator or PrintTo() but can be implicitly // converted to BiggestInt, we print it as a BiggestInt. //
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
}; // We print a protobuf using its ShortDebugString() when the string // doesn't exceed this many characters; otherwise we print it using // DebugString() for better readability. const size_t kProtobufOneLinerMaxLength = 50; template <typename T> class TypeWithoutFormatter<T, kProtobuf> { public:
+ show +
10223
10224
10225
10226
10227
static void PrintValue(const T& value, ::std::ostream* os) { const ::testing::internal::string short_str = value.ShortDebugString(); const ::testing::internal::string pretty_str = short_str.length() <= kProtobufOneLinerMaxLength ? short_str : ("\n" + value.DebugString());
+ show +
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
*os << ("<" + pretty_str + ">"); } }; template <typename T> class TypeWithoutFormatter<T, kConvertibleToInteger> { public: // Since T has no << operator or PrintTo() but can be implicitly // converted to BiggestInt, we print it as a BiggestInt. //
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/include/gtest/gtest-printers.h
139
140
141
142
143
144
145
146
147
148
}; // We print a protobuf using its ShortDebugString() when the string // doesn't exceed this many characters; otherwise we print it using // DebugString() for better readability. const size_t kProtobufOneLinerMaxLength = 50; template <typename T> class TypeWithoutFormatter<T, kProtobuf> { public:
+ show +
149
150
151
152
153
static void PrintValue(const T& value, ::std::ostream* os) { const ::testing::internal::string short_str = value.ShortDebugString(); const ::testing::internal::string pretty_str = short_str.length() <= kProtobufOneLinerMaxLength ? short_str : ("\n" + value.DebugString());
+ show +
154
155
156
157
158
159
160
161
162
163
*os << ("<" + pretty_str + ">"); } }; template <typename T> class TypeWithoutFormatter<T, kConvertibleToInteger> { public: // Since T has no << operator or PrintTo() but can be implicitly // converted to BiggestInt, we print it as a BiggestInt. //
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/include/gtest/gtest-printers.h
139
140
141
142
143
144
145
146
147
148
}; // We print a protobuf using its ShortDebugString() when the string // doesn't exceed this many characters; otherwise we print it using // DebugString() for better readability. const size_t kProtobufOneLinerMaxLength = 50; template <typename T> class TypeWithoutFormatter<T, kProtobuf> { public:
+ show +
149
150
151
152
153
static void PrintValue(const T& value, ::std::ostream* os) { const ::testing::internal::string short_str = value.ShortDebugString(); const ::testing::internal::string pretty_str = short_str.length() <= kProtobufOneLinerMaxLength ? short_str : ("\n" + value.DebugString());
+ show +
154
155
156
157
158
159
160
161
162
163
*os << ("<" + pretty_str + ">"); } }; template <typename T> class TypeWithoutFormatter<T, kConvertibleToInteger> { public: // Since T has no << operator or PrintTo() but can be implicitly // converted to BiggestInt, we print it as a BiggestInt. //
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest-printers.h
143
144
145
146
147
148
149
150
151
152
}; // We print a protobuf using its ShortDebugString() when the string // doesn't exceed this many characters; otherwise we print it using // DebugString() for better readability. const size_t kProtobufOneLinerMaxLength = 50; template <typename T> class TypeWithoutFormatter<T, kProtobuf> { public:
+ show +
153
154
155
156
157
static void PrintValue(const T& value, ::std::ostream* os) { const ::testing::internal::string short_str = value.ShortDebugString(); const ::testing::internal::string pretty_str = short_str.length() <= kProtobufOneLinerMaxLength ? short_str : ("\n" + value.DebugString());
+ show +
158
159
160
161
162
163
164
165
166
167
*os << ("<" + pretty_str + ">"); } }; template <typename T> class TypeWithoutFormatter<T, kConvertibleToInteger> { public: // Since T has no << operator or PrintTo() but can be implicitly // converted to BiggestInt, we print it as a BiggestInt. //
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/include/gtest/gtest-printers.h
139
140
141
142
143
144
145
146
147
148
}; // We print a protobuf using its ShortDebugString() when the string // doesn't exceed this many characters; otherwise we print it using // DebugString() for better readability. const size_t kProtobufOneLinerMaxLength = 50; template <typename T> class TypeWithoutFormatter<T, kProtobuf> { public:
+ show +
149
150
151
152
153
static void PrintValue(const T& value, ::std::ostream* os) { const ::testing::internal::string short_str = value.ShortDebugString(); const ::testing::internal::string pretty_str = short_str.length() <= kProtobufOneLinerMaxLength ? short_str : ("\n" + value.DebugString());
+ show +
154
155
156
157
158
159
160
161
162
163
*os << ("<" + pretty_str + ">"); } }; template <typename T> class TypeWithoutFormatter<T, kConvertibleToInteger> { public: // Since T has no << operator or PrintTo() but can be implicitly // converted to BiggestInt, we print it as a BiggestInt. //
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest-printers.h
143
144
145
146
147
148
149
150
151
152
}; // We print a protobuf using its ShortDebugString() when the string // doesn't exceed this many characters; otherwise we print it using // DebugString() for better readability. const size_t kProtobufOneLinerMaxLength = 50; template <typename T> class TypeWithoutFormatter<T, kProtobuf> { public:
+ show +
153
154
155
156
157
static void PrintValue(const T& value, ::std::ostream* os) { const ::testing::internal::string short_str = value.ShortDebugString(); const ::testing::internal::string pretty_str = short_str.length() <= kProtobufOneLinerMaxLength ? short_str : ("\n" + value.DebugString());
+ show +
158
159
160
161
162
163
164
165
166
167
*os << ("<" + pretty_str + ">"); } }; template <typename T> class TypeWithoutFormatter<T, kConvertibleToInteger> { public: // Since T has no << operator or PrintTo() but can be implicitly // converted to BiggestInt, we print it as a BiggestInt. //

[CVE-2020-0478_1.diff] gtest-printers.h #9
-::std::basic_ostream<Char, CharTraits>& operator<<( - ::std::basic_ostream<Char, CharTraits>& os, const T& x) { - TypeWithoutFormatter<T, - (internal::IsAProtocolMessage<T>::value ? kProtobuf : - internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? - kConvertibleToInteger : kOtherType)>::PrintValue(x, &os); +::std::basic_ostream<Char, CharTraits> &operator<<( + ::std::basic_ostream<Char, CharTraits> &os, const T &x) { + TypeWithoutFormatter< + T, (internal::IsAProtocolMessage<T>::value + ? kProtobuf + : std::is_convertible<const T &, internal::BiggestInt>::value + ? kConvertibleToInteger + : +#if GTEST_INTERNAL_HAS_STRING_VIEW + std::is_convertible<const T &, internal::StringView>::value + ? kConvertibleToStringView + : +#endif + kOtherType)>::PrintValue(x, &os);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/gtest-printers.h
189
190
191
192
193
194
195
196
197
198
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
199
200
201
202
203
204
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
205
206
207
208
209
210
211
212
213
214
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
9391
9392
9393
9394
9395
9396
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest-printers.h
189
190
191
192
193
194
195
196
197
198
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
199
200
201
202
203
204
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
205
206
207
208
209
210
211
212
213
214
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest-printers.h
194
195
196
197
198
199
200
201
202
203
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
204
205
206
207
208
209
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
210
211
212
213
214
215
216
217
218
219
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
9391
9392
9393
9394
9395
9396
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest-printers.h
189
190
191
192
193
194
195
196
197
198
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
199
200
201
202
203
204
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
205
206
207
208
209
210
211
212
213
214
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
10273
10274
10275
10276
10277
10278
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/include/gtest/gtest-printers.h
189
190
191
192
193
194
195
196
197
198
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
199
200
201
202
203
204
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
205
206
207
208
209
210
211
212
213
214
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/include/gtest/gtest-printers.h
189
190
191
192
193
194
195
196
197
198
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
199
200
201
202
203
204
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
205
206
207
208
209
210
211
212
213
214
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest-printers.h
193
194
195
196
197
198
199
200
201
202
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
203
204
205
206
207
208
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
209
210
211
212
213
214
215
216
217
218
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/include/gtest/gtest-printers.h
189
190
191
192
193
194
195
196
197
198
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
199
200
201
202
203
204
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
205
206
207
208
209
210
211
212
213
214
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest-printers.h
193
194
195
196
197
198
199
200
201
202
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
203
204
205
206
207
208
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
209
210
211
212
213
214
215
216
217
218
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {

[CVE-2020-0478_1.diff] gtest-printers.h #22
-GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); +GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream *os); -GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); -inline void PrintTo(char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_<const char*>(s), os); +GTEST_API_ void PrintTo(const char *s, ::std::ostream *os); +inline void PrintTo(char *s, ::std::ostream *os) { + PrintTo(ImplicitCast_<const char *>(s), os); -inline void PrintTo(const signed char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_<const void*>(s), os); +inline void PrintTo(const signed char *s, ::std::ostream *os) { + PrintTo(ImplicitCast_<const void *>(s), os); -inline void PrintTo(signed char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_<const void*>(s), os); +inline void PrintTo(signed char *s, ::std::ostream *os) { + PrintTo(ImplicitCast_<const void *>(s), os); -inline void PrintTo(const unsigned char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_<const void*>(s), os); +inline void PrintTo(const unsigned char *s, ::std::ostream *os) { + PrintTo(ImplicitCast_<const void *>(s), os); -inline void PrintTo(unsigned char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_<const void*>(s), os); +inline void PrintTo(unsigned char *s, ::std::ostream *os) { + PrintTo(ImplicitCast_<const void *>(s), os);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/gtest-printers.h
395
396
397
398
399
400
401
402
403
404
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
426
427
428
429
430
431
432
433
434
435
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest-printers.h
395
396
397
398
399
400
401
402
403
404
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
426
427
428
429
430
431
432
433
434
435
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest-printers.h
513
514
515
516
517
518
519
520
521
522
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
544
545
546
547
548
549
550
551
552
553
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest-printers.h
395
396
397
398
399
400
401
402
403
404
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
426
427
428
429
430
431
432
433
434
435
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/gtest-printers.h
541
542
543
544
545
546
547
548
549
550
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
572
573
574
575
576
577
578
579
580
581
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/include/gtest/gtest-printers.h
395
396
397
398
399
400
401
402
403
404
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
426
427
428
429
430
431
432
433
434
435
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/gtest-printers.h
546
547
548
549
550
551
552
553
554
555
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
577
578
579
580
581
582
583
584
585
586
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/include/gtest/gtest-printers.h
395
396
397
398
399
400
401
402
403
404
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
426
427
428
429
430
431
432
433
434
435
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest-printers.h
496
497
498
499
500
501
502
503
504
505
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
527
528
529
530
531
532
533
534
535
536
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/include/gtest/gtest-printers.h
395
396
397
398
399
400
401
402
403
404
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
426
427
428
429
430
431
432
433
434
435
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest-printers.h
496
497
498
499
500
501
502
503
504
505
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
527
528
529
530
531
532
533
534
535
536
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);

[CVE-2020-0478_1.diff] gtest-printers.h #29
-GTEST_API_ void UniversalPrintArray( - const char* begin, size_t len, ::std::ostream* os); +GTEST_API_ void UniversalPrintArray(const char *begin, size_t len, + ::std::ostream *os); -GTEST_API_ void UniversalPrintArray( - const wchar_t* begin, size_t len, ::std::ostream* os); +GTEST_API_ void UniversalPrintArray(const wchar_t *begin, size_t len, + ::std::ostream *os);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/gtest-printers.h
623
624
625
626
627
628
629
630
631
632
PrintRawArrayTo(begin, len, os); } else { PrintRawArrayTo(begin, kChunkSize, os); *os << ", ..., "; PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); } *os << " }"; } } // This overload prints a (const) char array compactly.
+ show +
633
634
635
636
637
638
GTEST_API_ void UniversalPrintArray( const char* begin, size_t len, ::std::ostream* os); // This overload prints a (const) wchar_t array compactly. GTEST_API_ void UniversalPrintArray( const wchar_t* begin, size_t len, ::std::ostream* os);
+ show +
639
640
641
642
643
644
645
646
647
648
// Implements printing an array type T[N]. template <typename T, size_t N> class UniversalPrinter<T[N]> { public: // Prints the given array, omitting some elements when there are too // many. static void Print(const T (&a)[N], ::std::ostream* os) { UniversalPrintArray(a, N, os); }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
PrintRawArrayTo(begin, len, os); } else { PrintRawArrayTo(begin, kChunkSize, os); *os << ", ..., "; PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); } *os << " }"; } } // This overload prints a (const) char array compactly.
+ show +
9825
9826
9827
9828
9829
9830
GTEST_API_ void UniversalPrintArray( const char* begin, size_t len, ::std::ostream* os); // This overload prints a (const) wchar_t array compactly. GTEST_API_ void UniversalPrintArray( const wchar_t* begin, size_t len, ::std::ostream* os);
+ show +
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
// Implements printing an array type T[N]. template <typename T, size_t N> class UniversalPrinter<T[N]> { public: // Prints the given array, omitting some elements when there are too // many. static void Print(const T (&a)[N], ::std::ostream* os) { UniversalPrintArray(a, N, os); }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest-printers.h
623
624
625
626
627
628
629
630
631
632
PrintRawArrayTo(begin, len, os); } else { PrintRawArrayTo(begin, kChunkSize, os); *os << ", ..., "; PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); } *os << " }"; } } // This overload prints a (const) char array compactly.
+ show +
633
634
635
636
637
638
GTEST_API_ void UniversalPrintArray( const char* begin, size_t len, ::std::ostream* os); // This overload prints a (const) wchar_t array compactly. GTEST_API_ void UniversalPrintArray( const wchar_t* begin, size_t len, ::std::ostream* os);
+ show +
639
640
641
642
643
644
645
646
647
648
// Implements printing an array type T[N]. template <typename T, size_t N> class UniversalPrinter<T[N]> { public: // Prints the given array, omitting some elements when there are too // many. static void Print(const T (&a)[N], ::std::ostream* os) { UniversalPrintArray(a, N, os); }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest-printers.h
745
746
747
748
749
750
751
752
753
754
PrintRawArrayTo(begin, len, os); } else { PrintRawArrayTo(begin, kChunkSize, os); *os << ", ..., "; PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); } *os << " }"; } } // This overload prints a (const) char array compactly.
+ show +
755
756
757
758
759
760
GTEST_API_ void UniversalPrintArray( const char* begin, size_t len, ::std::ostream* os); // This overload prints a (const) wchar_t array compactly. GTEST_API_ void UniversalPrintArray( const wchar_t* begin, size_t len, ::std::ostream* os);
+ show +
761
762
763
764
765
766
767
768
769
770
// Implements printing an array type T[N]. template <typename T, size_t N> class UniversalPrinter<T[N]> { public: // Prints the given array, omitting some elements when there are too // many. static void Print(const T (&a)[N], ::std::ostream* os) { UniversalPrintArray(a, N, os); }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
PrintRawArrayTo(begin, len, os); } else { PrintRawArrayTo(begin, kChunkSize, os); *os << ", ..., "; PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); } *os << " }"; } } // This overload prints a (const) char array compactly.
+ show +
9825
9826
9827
9828
9829
9830
GTEST_API_ void UniversalPrintArray( const char* begin, size_t len, ::std::ostream* os); // This overload prints a (const) wchar_t array compactly. GTEST_API_ void UniversalPrintArray( const wchar_t* begin, size_t len, ::std::ostream* os);
+ show +
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
// Implements printing an array type T[N]. template <typename T, size_t N> class UniversalPrinter<T[N]> { public: // Prints the given array, omitting some elements when there are too // many. static void Print(const T (&a)[N], ::std::ostream* os) { UniversalPrintArray(a, N, os); }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest-printers.h
623
624
625
626
627
628
629
630
631
632
PrintRawArrayTo(begin, len, os); } else { PrintRawArrayTo(begin, kChunkSize, os); *os << ", ..., "; PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); } *os << " }"; } } // This overload prints a (const) char array compactly.
+ show +
633
634
635
636
637
638
GTEST_API_ void UniversalPrintArray( const char* begin, size_t len, ::std::ostream* os); // This overload prints a (const) wchar_t array compactly. GTEST_API_ void UniversalPrintArray( const wchar_t* begin, size_t len, ::std::ostream* os);
+ show +
639
640
641
642
643
644
645
646
647
648
// Implements printing an array type T[N]. template <typename T, size_t N> class UniversalPrinter<T[N]> { public: // Prints the given array, omitting some elements when there are too // many. static void Print(const T (&a)[N], ::std::ostream* os) { UniversalPrintArray(a, N, os); }
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/gtest-printers.h
764
765
766
767
768
769
770
771
772
773
PrintRawArrayTo(begin, len, os); } else { PrintRawArrayTo(begin, kChunkSize, os); *os << ", ..., "; PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); } *os << " }"; } } // This overload prints a (const) char array compactly.
+ show +
774
775
776
777
778
779
GTEST_API_ void UniversalPrintArray( const char* begin, size_t len, ::std::ostream* os); // This overload prints a (const) wchar_t array compactly. GTEST_API_ void UniversalPrintArray( const wchar_t* begin, size_t len, ::std::ostream* os);
+ show +
780
781
782
783
784
785
786
787
788
789
// Implements printing an array type T[N]. template <typename T, size_t N> class UniversalPrinter<T[N]> { public: // Prints the given array, omitting some elements when there are too // many. static void Print(const T (&a)[N], ::std::ostream* os) { UniversalPrintArray(a, N, os); }
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
PrintRawArrayTo(begin, len, os); } else { PrintRawArrayTo(begin, kChunkSize, os); *os << ", ..., "; PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); } *os << " }"; } } // This overload prints a (const) char array compactly.
+ show +
10808
10809
10810
10811
10812
10813
GTEST_API_ void UniversalPrintArray( const char* begin, size_t len, ::std::ostream* os); // This overload prints a (const) wchar_t array compactly. GTEST_API_ void UniversalPrintArray( const wchar_t* begin, size_t len, ::std::ostream* os);
+ show +
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
// Implements printing an array type T[N]. template <typename T, size_t N> class UniversalPrinter<T[N]> { public: // Prints the given array, omitting some elements when there are too // many. static void Print(const T (&a)[N], ::std::ostream* os) { UniversalPrintArray(a, N, os); }
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/gtest-printers.h
831
832
833
834
835
836
837
838
839
840
PrintRawArrayTo(begin, len, os); } else { PrintRawArrayTo(begin, kChunkSize, os); *os << ", ..., "; PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); } *os << " }"; } } // This overload prints a (const) char array compactly.
+ show +
841
842
843
844
845
846
GTEST_API_ void UniversalPrintArray( const char* begin, size_t len, ::std::ostream* os); // This overload prints a (const) wchar_t array compactly. GTEST_API_ void UniversalPrintArray( const wchar_t* begin, size_t len, ::std::ostream* os);
+ show +
847
848
849
850
851
852
853
854
855
856
// Implements printing an array type T[N]. template <typename T, size_t N> class UniversalPrinter<T[N]> { public: // Prints the given array, omitting some elements when there are too // many. static void Print(const T (&a)[N], ::std::ostream* os) { UniversalPrintArray(a, N, os); }
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest-printers.h
728
729
730
731
732
733
734
735
736
737
PrintRawArrayTo(begin, len, os); } else { PrintRawArrayTo(begin, kChunkSize, os); *os << ", ..., "; PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); } *os << " }"; } } // This overload prints a (const) char array compactly.
+ show +
738
739
740
741
742
743
GTEST_API_ void UniversalPrintArray( const char* begin, size_t len, ::std::ostream* os); // This overload prints a (const) wchar_t array compactly. GTEST_API_ void UniversalPrintArray( const wchar_t* begin, size_t len, ::std::ostream* os);
+ show +
744
745
746
747
748
749
750
751
752
753
// Implements printing an array type T[N]. template <typename T, size_t N> class UniversalPrinter<T[N]> { public: // Prints the given array, omitting some elements when there are too // many. static void Print(const T (&a)[N], ::std::ostream* os) { UniversalPrintArray(a, N, os); }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest-printers.h
728
729
730
731
732
733
734
735
736
737
PrintRawArrayTo(begin, len, os); } else { PrintRawArrayTo(begin, kChunkSize, os); *os << ", ..., "; PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); } *os << " }"; } } // This overload prints a (const) char array compactly.
+ show +
738
739
740
741
742
743
GTEST_API_ void UniversalPrintArray( const char* begin, size_t len, ::std::ostream* os); // This overload prints a (const) wchar_t array compactly. GTEST_API_ void UniversalPrintArray( const wchar_t* begin, size_t len, ::std::ostream* os);
+ show +
744
745
746
747
748
749
750
751
752
753
// Implements printing an array type T[N]. template <typename T, size_t N> class UniversalPrinter<T[N]> { public: // Prints the given array, omitting some elements when there are too // many. static void Print(const T (&a)[N], ::std::ostream* os) { UniversalPrintArray(a, N, os); }

[CVE-2020-0470_1.diff] gtest-printers.h #7
- static void PrintValue(const T& value, ::std::ostream* os) { - const ::testing::internal::string short_str = value.ShortDebugString(); - const ::testing::internal::string pretty_str = - short_str.length() <= kProtobufOneLinerMaxLength ? - short_str : ("\n" + value.DebugString()); + static void PrintValue(const T &value, ::std::ostream *os) { + std::string pretty_str = value.ShortDebugString(); + if (pretty_str.length() > kProtobufOneLinerMaxLength) { + pretty_str = "\n" + value.DebugString(); + }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/gtest-printers.h
139
140
141
142
143
144
145
146
147
148
}; // We print a protobuf using its ShortDebugString() when the string // doesn't exceed this many characters; otherwise we print it using // DebugString() for better readability. const size_t kProtobufOneLinerMaxLength = 50; template <typename T> class TypeWithoutFormatter<T, kProtobuf> { public:
+ show +
149
150
151
152
153
static void PrintValue(const T& value, ::std::ostream* os) { const ::testing::internal::string short_str = value.ShortDebugString(); const ::testing::internal::string pretty_str = short_str.length() <= kProtobufOneLinerMaxLength ? short_str : ("\n" + value.DebugString());
+ show +
154
155
156
157
158
159
160
161
162
163
*os << ("<" + pretty_str + ">"); } }; template <typename T> class TypeWithoutFormatter<T, kConvertibleToInteger> { public: // Since T has no << operator or PrintTo() but can be implicitly // converted to BiggestInt, we print it as a BiggestInt. //
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
}; // We print a protobuf using its ShortDebugString() when the string // doesn't exceed this many characters; otherwise we print it using // DebugString() for better readability. const size_t kProtobufOneLinerMaxLength = 50; template <typename T> class TypeWithoutFormatter<T, kProtobuf> { public:
+ show +
9341
9342
9343
9344
9345
static void PrintValue(const T& value, ::std::ostream* os) { const ::testing::internal::string short_str = value.ShortDebugString(); const ::testing::internal::string pretty_str = short_str.length() <= kProtobufOneLinerMaxLength ? short_str : ("\n" + value.DebugString());
+ show +
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
*os << ("<" + pretty_str + ">"); } }; template <typename T> class TypeWithoutFormatter<T, kConvertibleToInteger> { public: // Since T has no << operator or PrintTo() but can be implicitly // converted to BiggestInt, we print it as a BiggestInt. //
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest-printers.h
139
140
141
142
143
144
145
146
147
148
}; // We print a protobuf using its ShortDebugString() when the string // doesn't exceed this many characters; otherwise we print it using // DebugString() for better readability. const size_t kProtobufOneLinerMaxLength = 50; template <typename T> class TypeWithoutFormatter<T, kProtobuf> { public:
+ show +
149
150
151
152
153
static void PrintValue(const T& value, ::std::ostream* os) { const ::testing::internal::string short_str = value.ShortDebugString(); const ::testing::internal::string pretty_str = short_str.length() <= kProtobufOneLinerMaxLength ? short_str : ("\n" + value.DebugString());
+ show +
154
155
156
157
158
159
160
161
162
163
*os << ("<" + pretty_str + ">"); } }; template <typename T> class TypeWithoutFormatter<T, kConvertibleToInteger> { public: // Since T has no << operator or PrintTo() but can be implicitly // converted to BiggestInt, we print it as a BiggestInt. //
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
}; // We print a protobuf using its ShortDebugString() when the string // doesn't exceed this many characters; otherwise we print it using // DebugString() for better readability. const size_t kProtobufOneLinerMaxLength = 50; template <typename T> class TypeWithoutFormatter<T, kProtobuf> { public:
+ show +
9341
9342
9343
9344
9345
static void PrintValue(const T& value, ::std::ostream* os) { const ::testing::internal::string short_str = value.ShortDebugString(); const ::testing::internal::string pretty_str = short_str.length() <= kProtobufOneLinerMaxLength ? short_str : ("\n" + value.DebugString());
+ show +
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
*os << ("<" + pretty_str + ">"); } }; template <typename T> class TypeWithoutFormatter<T, kConvertibleToInteger> { public: // Since T has no << operator or PrintTo() but can be implicitly // converted to BiggestInt, we print it as a BiggestInt. //
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest-printers.h
139
140
141
142
143
144
145
146
147
148
}; // We print a protobuf using its ShortDebugString() when the string // doesn't exceed this many characters; otherwise we print it using // DebugString() for better readability. const size_t kProtobufOneLinerMaxLength = 50; template <typename T> class TypeWithoutFormatter<T, kProtobuf> { public:
+ show +
149
150
151
152
153
static void PrintValue(const T& value, ::std::ostream* os) { const ::testing::internal::string short_str = value.ShortDebugString(); const ::testing::internal::string pretty_str = short_str.length() <= kProtobufOneLinerMaxLength ? short_str : ("\n" + value.DebugString());
+ show +
154
155
156
157
158
159
160
161
162
163
*os << ("<" + pretty_str + ">"); } }; template <typename T> class TypeWithoutFormatter<T, kConvertibleToInteger> { public: // Since T has no << operator or PrintTo() but can be implicitly // converted to BiggestInt, we print it as a BiggestInt. //
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
}; // We print a protobuf using its ShortDebugString() when the string // doesn't exceed this many characters; otherwise we print it using // DebugString() for better readability. const size_t kProtobufOneLinerMaxLength = 50; template <typename T> class TypeWithoutFormatter<T, kProtobuf> { public:
+ show +
10223
10224
10225
10226
10227
static void PrintValue(const T& value, ::std::ostream* os) { const ::testing::internal::string short_str = value.ShortDebugString(); const ::testing::internal::string pretty_str = short_str.length() <= kProtobufOneLinerMaxLength ? short_str : ("\n" + value.DebugString());
+ show +
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
*os << ("<" + pretty_str + ">"); } }; template <typename T> class TypeWithoutFormatter<T, kConvertibleToInteger> { public: // Since T has no << operator or PrintTo() but can be implicitly // converted to BiggestInt, we print it as a BiggestInt. //
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/include/gtest/gtest-printers.h
139
140
141
142
143
144
145
146
147
148
}; // We print a protobuf using its ShortDebugString() when the string // doesn't exceed this many characters; otherwise we print it using // DebugString() for better readability. const size_t kProtobufOneLinerMaxLength = 50; template <typename T> class TypeWithoutFormatter<T, kProtobuf> { public:
+ show +
149
150
151
152
153
static void PrintValue(const T& value, ::std::ostream* os) { const ::testing::internal::string short_str = value.ShortDebugString(); const ::testing::internal::string pretty_str = short_str.length() <= kProtobufOneLinerMaxLength ? short_str : ("\n" + value.DebugString());
+ show +
154
155
156
157
158
159
160
161
162
163
*os << ("<" + pretty_str + ">"); } }; template <typename T> class TypeWithoutFormatter<T, kConvertibleToInteger> { public: // Since T has no << operator or PrintTo() but can be implicitly // converted to BiggestInt, we print it as a BiggestInt. //
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/include/gtest/gtest-printers.h
139
140
141
142
143
144
145
146
147
148
}; // We print a protobuf using its ShortDebugString() when the string // doesn't exceed this many characters; otherwise we print it using // DebugString() for better readability. const size_t kProtobufOneLinerMaxLength = 50; template <typename T> class TypeWithoutFormatter<T, kProtobuf> { public:
+ show +
149
150
151
152
153
static void PrintValue(const T& value, ::std::ostream* os) { const ::testing::internal::string short_str = value.ShortDebugString(); const ::testing::internal::string pretty_str = short_str.length() <= kProtobufOneLinerMaxLength ? short_str : ("\n" + value.DebugString());
+ show +
154
155
156
157
158
159
160
161
162
163
*os << ("<" + pretty_str + ">"); } }; template <typename T> class TypeWithoutFormatter<T, kConvertibleToInteger> { public: // Since T has no << operator or PrintTo() but can be implicitly // converted to BiggestInt, we print it as a BiggestInt. //
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest-printers.h
143
144
145
146
147
148
149
150
151
152
}; // We print a protobuf using its ShortDebugString() when the string // doesn't exceed this many characters; otherwise we print it using // DebugString() for better readability. const size_t kProtobufOneLinerMaxLength = 50; template <typename T> class TypeWithoutFormatter<T, kProtobuf> { public:
+ show +
153
154
155
156
157
static void PrintValue(const T& value, ::std::ostream* os) { const ::testing::internal::string short_str = value.ShortDebugString(); const ::testing::internal::string pretty_str = short_str.length() <= kProtobufOneLinerMaxLength ? short_str : ("\n" + value.DebugString());
+ show +
158
159
160
161
162
163
164
165
166
167
*os << ("<" + pretty_str + ">"); } }; template <typename T> class TypeWithoutFormatter<T, kConvertibleToInteger> { public: // Since T has no << operator or PrintTo() but can be implicitly // converted to BiggestInt, we print it as a BiggestInt. //
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/include/gtest/gtest-printers.h
139
140
141
142
143
144
145
146
147
148
}; // We print a protobuf using its ShortDebugString() when the string // doesn't exceed this many characters; otherwise we print it using // DebugString() for better readability. const size_t kProtobufOneLinerMaxLength = 50; template <typename T> class TypeWithoutFormatter<T, kProtobuf> { public:
+ show +
149
150
151
152
153
static void PrintValue(const T& value, ::std::ostream* os) { const ::testing::internal::string short_str = value.ShortDebugString(); const ::testing::internal::string pretty_str = short_str.length() <= kProtobufOneLinerMaxLength ? short_str : ("\n" + value.DebugString());
+ show +
154
155
156
157
158
159
160
161
162
163
*os << ("<" + pretty_str + ">"); } }; template <typename T> class TypeWithoutFormatter<T, kConvertibleToInteger> { public: // Since T has no << operator or PrintTo() but can be implicitly // converted to BiggestInt, we print it as a BiggestInt. //
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest-printers.h
143
144
145
146
147
148
149
150
151
152
}; // We print a protobuf using its ShortDebugString() when the string // doesn't exceed this many characters; otherwise we print it using // DebugString() for better readability. const size_t kProtobufOneLinerMaxLength = 50; template <typename T> class TypeWithoutFormatter<T, kProtobuf> { public:
+ show +
153
154
155
156
157
static void PrintValue(const T& value, ::std::ostream* os) { const ::testing::internal::string short_str = value.ShortDebugString(); const ::testing::internal::string pretty_str = short_str.length() <= kProtobufOneLinerMaxLength ? short_str : ("\n" + value.DebugString());
+ show +
158
159
160
161
162
163
164
165
166
167
*os << ("<" + pretty_str + ">"); } }; template <typename T> class TypeWithoutFormatter<T, kConvertibleToInteger> { public: // Since T has no << operator or PrintTo() but can be implicitly // converted to BiggestInt, we print it as a BiggestInt. //

[CVE-2020-0470_1.diff] gtest-printers.h #9
-::std::basic_ostream<Char, CharTraits>& operator<<( - ::std::basic_ostream<Char, CharTraits>& os, const T& x) { - TypeWithoutFormatter<T, - (internal::IsAProtocolMessage<T>::value ? kProtobuf : - internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? - kConvertibleToInteger : kOtherType)>::PrintValue(x, &os); +::std::basic_ostream<Char, CharTraits> &operator<<( + ::std::basic_ostream<Char, CharTraits> &os, const T &x) { + TypeWithoutFormatter< + T, (internal::IsAProtocolMessage<T>::value + ? kProtobuf + : std::is_convertible<const T &, internal::BiggestInt>::value + ? kConvertibleToInteger + : +#if GTEST_INTERNAL_HAS_STRING_VIEW + std::is_convertible<const T &, internal::StringView>::value + ? kConvertibleToStringView + : +#endif + kOtherType)>::PrintValue(x, &os);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/gtest-printers.h
189
190
191
192
193
194
195
196
197
198
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
199
200
201
202
203
204
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
205
206
207
208
209
210
211
212
213
214
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
9391
9392
9393
9394
9395
9396
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest-printers.h
189
190
191
192
193
194
195
196
197
198
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
199
200
201
202
203
204
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
205
206
207
208
209
210
211
212
213
214
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest-printers.h
194
195
196
197
198
199
200
201
202
203
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
204
205
206
207
208
209
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
210
211
212
213
214
215
216
217
218
219
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
9391
9392
9393
9394
9395
9396
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest-printers.h
189
190
191
192
193
194
195
196
197
198
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
199
200
201
202
203
204
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
205
206
207
208
209
210
211
212
213
214
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
10273
10274
10275
10276
10277
10278
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/include/gtest/gtest-printers.h
189
190
191
192
193
194
195
196
197
198
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
199
200
201
202
203
204
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
205
206
207
208
209
210
211
212
213
214
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/include/gtest/gtest-printers.h
189
190
191
192
193
194
195
196
197
198
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
199
200
201
202
203
204
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
205
206
207
208
209
210
211
212
213
214
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest-printers.h
193
194
195
196
197
198
199
200
201
202
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
203
204
205
206
207
208
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
209
210
211
212
213
214
215
216
217
218
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/include/gtest/gtest-printers.h
189
190
191
192
193
194
195
196
197
198
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
199
200
201
202
203
204
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
205
206
207
208
209
210
211
212
213
214
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest-printers.h
193
194
195
196
197
198
199
200
201
202
// Note that this operator<< takes a generic std::basic_ostream<Char, // CharTraits> type instead of the more restricted std::ostream. If // we define it to take an std::ostream instead, we'll get an // "ambiguous overloads" compiler error when trying to print a type // Foo that supports streaming to std::basic_ostream<Char, // CharTraits>, as the compiler cannot tell whether // operator<<(std::ostream&, const T&) or // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more // specific. template <typename Char, typename CharTraits, typename T>
+ show +
203
204
205
206
207
208
::std::basic_ostream<Char, CharTraits>& operator<<( ::std::basic_ostream<Char, CharTraits>& os, const T& x) { TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value ? kProtobuf : internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+ show +
209
210
211
212
213
214
215
216
217
218
return os; } } // namespace internal2 } // namespace testing // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up // magic needed for implementing UniversalPrinter won't work. namespace testing_internal {

[CVE-2020-0470_1.diff] gtest-printers.h #22
-GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); +GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream *os); -GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); -inline void PrintTo(char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_<const char*>(s), os); +GTEST_API_ void PrintTo(const char *s, ::std::ostream *os); +inline void PrintTo(char *s, ::std::ostream *os) { + PrintTo(ImplicitCast_<const char *>(s), os); -inline void PrintTo(const signed char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_<const void*>(s), os); +inline void PrintTo(const signed char *s, ::std::ostream *os) { + PrintTo(ImplicitCast_<const void *>(s), os); -inline void PrintTo(signed char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_<const void*>(s), os); +inline void PrintTo(signed char *s, ::std::ostream *os) { + PrintTo(ImplicitCast_<const void *>(s), os); -inline void PrintTo(const unsigned char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_<const void*>(s), os); +inline void PrintTo(const unsigned char *s, ::std::ostream *os) { + PrintTo(ImplicitCast_<const void *>(s), os); -inline void PrintTo(unsigned char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_<const void*>(s), os); +inline void PrintTo(unsigned char *s, ::std::ostream *os) { + PrintTo(ImplicitCast_<const void *>(s), os);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/gtest-printers.h
395
396
397
398
399
400
401
402
403
404
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
426
427
428
429
430
431
432
433
434
435
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest-printers.h
395
396
397
398
399
400
401
402
403
404
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
426
427
428
429
430
431
432
433
434
435
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest-printers.h
513
514
515
516
517
518
519
520
521
522
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
544
545
546
547
548
549
550
551
552
553
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest-printers.h
395
396
397
398
399
400
401
402
403
404
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
426
427
428
429
430
431
432
433
434
435
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/gtest-printers.h
541
542
543
544
545
546
547
548
549
550
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
572
573
574
575
576
577
578
579
580
581
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/include/gtest/gtest-printers.h
395
396
397
398
399
400
401
402
403
404
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
426
427
428
429
430
431
432
433
434
435
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/gtest-printers.h
546
547
548
549
550
551
552
553
554
555
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
577
578
579
580
581
582
583
584
585
586
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/include/gtest/gtest-printers.h
395
396
397
398
399
400
401
402
403
404
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
426
427
428
429
430
431
432
433
434
435
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest-printers.h
496
497
498
499
500
501
502
503
504
505
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
527
528
529
530
531
532
533
534
535
536
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/include/gtest/gtest-printers.h
395
396
397
398
399
400
401
402
403
404
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
426
427
428
429
430
431
432
433
434
435
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest-printers.h
496
497
498
499
500
501
502
503
504
505
*os << (x ? "true" : "false"); } // Overload for wchar_t type. // Prints a wchar_t as a symbol if it is printable or as its internal // code otherwise and also as its decimal code (except for L'\0'). // The L'\0' char is printed as "L'\\0'". The decimal code is printed // as signed integer when wchar_t is implemented by the compiler // as a signed type and is printed as an unsigned integer when wchar_t // is implemented as an unsigned type.
+ show +
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); // Overloads for C strings. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); inline void PrintTo(char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char*>(s), os); } // signed/unsigned char is often used for representing binary data, so // we print pointers to it as void* to be safe. inline void PrintTo(const signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(signed char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(const unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os); } inline void PrintTo(unsigned char* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const void*>(s), os);
+ show +
527
528
529
530
531
532
533
534
535
536
} // MSVC can be configured to define wchar_t as a typedef of unsigned // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native // type. When wchar_t is a typedef, defining an overload for const // wchar_t* would cause unsigned short* be printed as a wide string, // possibly causing invalid memory accesses. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // Overloads for wide C strings GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);

[CVE-2020-0470_1.diff] gtest-printers.h #29
-GTEST_API_ void UniversalPrintArray( - const char* begin, size_t len, ::std::ostream* os); +GTEST_API_ void UniversalPrintArray(const char *begin, size_t len, + ::std::ostream *os); -GTEST_API_ void UniversalPrintArray( - const wchar_t* begin, size_t len, ::std::ostream* os); +GTEST_API_ void UniversalPrintArray(const wchar_t *begin, size_t len, + ::std::ostream *os);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/gtest-printers.h
623
624
625
626
627
628
629
630
631
632
PrintRawArrayTo(begin, len, os); } else { PrintRawArrayTo(begin, kChunkSize, os); *os << ", ..., "; PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); } *os << " }"; } } // This overload prints a (const) char array compactly.
+ show +
633
634
635
636
637
638
GTEST_API_ void UniversalPrintArray( const char* begin, size_t len, ::std::ostream* os); // This overload prints a (const) wchar_t array compactly. GTEST_API_ void UniversalPrintArray( const wchar_t* begin, size_t len, ::std::ostream* os);
+ show +
639
640
641
642
643
644
645
646
647
648
// Implements printing an array type T[N]. template <typename T, size_t N> class UniversalPrinter<T[N]> { public: // Prints the given array, omitting some elements when there are too // many. static void Print(const T (&a)[N], ::std::ostream* os) { UniversalPrintArray(a, N, os); }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
PrintRawArrayTo(begin, len, os); } else { PrintRawArrayTo(begin, kChunkSize, os); *os << ", ..., "; PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); } *os << " }"; } } // This overload prints a (const) char array compactly.
+ show +
9825
9826
9827
9828
9829
9830
GTEST_API_ void UniversalPrintArray( const char* begin, size_t len, ::std::ostream* os); // This overload prints a (const) wchar_t array compactly. GTEST_API_ void UniversalPrintArray( const wchar_t* begin, size_t len, ::std::ostream* os);
+ show +
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
// Implements printing an array type T[N]. template <typename T, size_t N> class UniversalPrinter<T[N]> { public: // Prints the given array, omitting some elements when there are too // many. static void Print(const T (&a)[N], ::std::ostream* os) { UniversalPrintArray(a, N, os); }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest-printers.h
623
624
625
626
627
628
629
630
631
632
PrintRawArrayTo(begin, len, os); } else { PrintRawArrayTo(begin, kChunkSize, os); *os << ", ..., "; PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); } *os << " }"; } } // This overload prints a (const) char array compactly.
+ show +
633
634
635
636
637
638
GTEST_API_ void UniversalPrintArray( const char* begin, size_t len, ::std::ostream* os); // This overload prints a (const) wchar_t array compactly. GTEST_API_ void UniversalPrintArray( const wchar_t* begin, size_t len, ::std::ostream* os);
+ show +
639
640
641
642
643
644
645
646
647
648
// Implements printing an array type T[N]. template <typename T, size_t N> class UniversalPrinter<T[N]> { public: // Prints the given array, omitting some elements when there are too // many. static void Print(const T (&a)[N], ::std::ostream* os) { UniversalPrintArray(a, N, os); }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest-printers.h
745
746
747
748
749
750
751
752
753
754
PrintRawArrayTo(begin, len, os); } else { PrintRawArrayTo(begin, kChunkSize, os); *os << ", ..., "; PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); } *os << " }"; } } // This overload prints a (const) char array compactly.
+ show +
755
756
757
758
759
760
GTEST_API_ void UniversalPrintArray( const char* begin, size_t len, ::std::ostream* os); // This overload prints a (const) wchar_t array compactly. GTEST_API_ void UniversalPrintArray( const wchar_t* begin, size_t len, ::std::ostream* os);
+ show +
761
762
763
764
765
766
767
768
769
770
// Implements printing an array type T[N]. template <typename T, size_t N> class UniversalPrinter<T[N]> { public: // Prints the given array, omitting some elements when there are too // many. static void Print(const T (&a)[N], ::std::ostream* os) { UniversalPrintArray(a, N, os); }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
PrintRawArrayTo(begin, len, os); } else { PrintRawArrayTo(begin, kChunkSize, os); *os << ", ..., "; PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); } *os << " }"; } } // This overload prints a (const) char array compactly.
+ show +
9825
9826
9827
9828
9829
9830
GTEST_API_ void UniversalPrintArray( const char* begin, size_t len, ::std::ostream* os); // This overload prints a (const) wchar_t array compactly. GTEST_API_ void UniversalPrintArray( const wchar_t* begin, size_t len, ::std::ostream* os);
+ show +
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
// Implements printing an array type T[N]. template <typename T, size_t N> class UniversalPrinter<T[N]> { public: // Prints the given array, omitting some elements when there are too // many. static void Print(const T (&a)[N], ::std::ostream* os) { UniversalPrintArray(a, N, os); }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/gtest-printers.h
623
624
625
626
627
628
629
630
631
632
PrintRawArrayTo(begin, len, os); } else { PrintRawArrayTo(begin, kChunkSize, os); *os << ", ..., "; PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); } *os << " }"; } } // This overload prints a (const) char array compactly.
+ show +
633
634
635
636
637
638
GTEST_API_ void UniversalPrintArray( const char* begin, size_t len, ::std::ostream* os); // This overload prints a (const) wchar_t array compactly. GTEST_API_ void UniversalPrintArray( const wchar_t* begin, size_t len, ::std::ostream* os);
+ show +
639
640
641
642
643
644
645
646
647
648
// Implements printing an array type T[N]. template <typename T, size_t N> class UniversalPrinter<T[N]> { public: // Prints the given array, omitting some elements when there are too // many. static void Print(const T (&a)[N], ::std::ostream* os) { UniversalPrintArray(a, N, os); }
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/gtest-printers.h
764
765
766
767
768
769
770
771
772
773
PrintRawArrayTo(begin, len, os); } else { PrintRawArrayTo(begin, kChunkSize, os); *os << ", ..., "; PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); } *os << " }"; } } // This overload prints a (const) char array compactly.
+ show +
774
775
776
777
778
779
GTEST_API_ void UniversalPrintArray( const char* begin, size_t len, ::std::ostream* os); // This overload prints a (const) wchar_t array compactly. GTEST_API_ void UniversalPrintArray( const wchar_t* begin, size_t len, ::std::ostream* os);
+ show +
780
781
782
783
784
785
786
787
788
789
// Implements printing an array type T[N]. template <typename T, size_t N> class UniversalPrinter<T[N]> { public: // Prints the given array, omitting some elements when there are too // many. static void Print(const T (&a)[N], ::std::ostream* os) { UniversalPrintArray(a, N, os); }
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
PrintRawArrayTo(begin, len, os); } else { PrintRawArrayTo(begin, kChunkSize, os); *os << ", ..., "; PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); } *os << " }"; } } // This overload prints a (const) char array compactly.
+ show +
10808
10809
10810
10811
10812
10813
GTEST_API_ void UniversalPrintArray( const char* begin, size_t len, ::std::ostream* os); // This overload prints a (const) wchar_t array compactly. GTEST_API_ void UniversalPrintArray( const wchar_t* begin, size_t len, ::std::ostream* os);
+ show +
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
// Implements printing an array type T[N]. template <typename T, size_t N> class UniversalPrinter<T[N]> { public: // Prints the given array, omitting some elements when there are too // many. static void Print(const T (&a)[N], ::std::ostream* os) { UniversalPrintArray(a, N, os); }
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/gtest-printers.h
831
832
833
834
835
836
837
838
839
840
PrintRawArrayTo(begin, len, os); } else { PrintRawArrayTo(begin, kChunkSize, os); *os << ", ..., "; PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); } *os << " }"; } } // This overload prints a (const) char array compactly.
+ show +
841
842
843
844
845
846
GTEST_API_ void UniversalPrintArray( const char* begin, size_t len, ::std::ostream* os); // This overload prints a (const) wchar_t array compactly. GTEST_API_ void UniversalPrintArray( const wchar_t* begin, size_t len, ::std::ostream* os);
+ show +
847
848
849
850
851
852
853
854
855
856
// Implements printing an array type T[N]. template <typename T, size_t N> class UniversalPrinter<T[N]> { public: // Prints the given array, omitting some elements when there are too // many. static void Print(const T (&a)[N], ::std::ostream* os) { UniversalPrintArray(a, N, os); }
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest-printers.h
728
729
730
731
732
733
734
735
736
737
PrintRawArrayTo(begin, len, os); } else { PrintRawArrayTo(begin, kChunkSize, os); *os << ", ..., "; PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); } *os << " }"; } } // This overload prints a (const) char array compactly.
+ show +
738
739
740
741
742
743
GTEST_API_ void UniversalPrintArray( const char* begin, size_t len, ::std::ostream* os); // This overload prints a (const) wchar_t array compactly. GTEST_API_ void UniversalPrintArray( const wchar_t* begin, size_t len, ::std::ostream* os);
+ show +
744
745
746
747
748
749
750
751
752
753
// Implements printing an array type T[N]. template <typename T, size_t N> class UniversalPrinter<T[N]> { public: // Prints the given array, omitting some elements when there are too // many. static void Print(const T (&a)[N], ::std::ostream* os) { UniversalPrintArray(a, N, os); }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest-printers.h
728
729
730
731
732
733
734
735
736
737
PrintRawArrayTo(begin, len, os); } else { PrintRawArrayTo(begin, kChunkSize, os); *os << ", ..., "; PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); } *os << " }"; } } // This overload prints a (const) char array compactly.
+ show +
738
739
740
741
742
743
GTEST_API_ void UniversalPrintArray( const char* begin, size_t len, ::std::ostream* os); // This overload prints a (const) wchar_t array compactly. GTEST_API_ void UniversalPrintArray( const wchar_t* begin, size_t len, ::std::ostream* os);
+ show +
744
745
746
747
748
749
750
751
752
753
// Implements printing an array type T[N]. template <typename T, size_t N> class UniversalPrinter<T[N]> { public: // Prints the given array, omitting some elements when there are too // many. static void Print(const T (&a)[N], ::std::ostream* os) { UniversalPrintArray(a, N, os); }

[CVE-2020-0478_1.diff] gtest-string.h #5
- static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, - const wchar_t* rhs); + static bool CaseInsensitiveWideCStringEquals(const wchar_t *lhs, + const wchar_t *rhs); - // Returns true iff the given string ends with the given suffix, ignoring - // case. Any string is considered to end with an empty suffix. - static bool EndsWithCaseInsensitive( - const std::string& str, const std::string& suffix); + // Returns true if and only if the given string ends with the given suffix, + // ignoring case. Any string is considered to end with an empty suffix. + static bool EndsWithCaseInsensitive(const std::string &str, + const std::string &suffix);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/internal/gtest-string.h
129
130
131
132
133
134
135
136
137
138
// // Unlike wcscasecmp(), this function can handle NULL argument(s). // A NULL C string is considered different to any non-NULL wide C string, // including the empty string. // NB: The implementations on different platforms slightly differ. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE // environment variable. On GNU platform this method uses wcscasecmp // which compares according to LC_CTYPE category of the current locale. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the // current locale.
+ show +
139
140
141
142
143
144
145
static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); // Returns true iff the given string ends with the given suffix, ignoring // case. Any string is considered to end with an empty suffix. static bool EndsWithCaseInsensitive( const std::string& str, const std::string& suffix);
+ show +
146
147
148
149
150
151
152
153
154
155
// Formats an int value as "%02d". static std::string FormatIntWidth2(int value); // "%02d" for width == 2 // Formats an int value as "%X". static std::string FormatHexInt(int value); // Formats a byte as "%02X". static std::string FormatByte(unsigned char value);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
// // Unlike wcscasecmp(), this function can handle NULL argument(s). // A NULL C string is considered different to any non-NULL wide C string, // including the empty string. // NB: The implementations on different platforms slightly differ. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE // environment variable. On GNU platform this method uses wcscasecmp // which compares according to LC_CTYPE category of the current locale. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the // current locale.
+ show +
3460
3461
3462
3463
3464
3465
3466
static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); // Returns true iff the given string ends with the given suffix, ignoring // case. Any string is considered to end with an empty suffix. static bool EndsWithCaseInsensitive( const std::string& str, const std::string& suffix);
+ show +
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
// Formats an int value as "%02d". static std::string FormatIntWidth2(int value); // "%02d" for width == 2 // Formats an int value as "%X". static std::string FormatHexInt(int value); // Formats a byte as "%02X". static std::string FormatByte(unsigned char value);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-string.h
129
130
131
132
133
134
135
136
137
138
// // Unlike wcscasecmp(), this function can handle NULL argument(s). // A NULL C string is considered different to any non-NULL wide C string, // including the empty string. // NB: The implementations on different platforms slightly differ. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE // environment variable. On GNU platform this method uses wcscasecmp // which compares according to LC_CTYPE category of the current locale. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the // current locale.
+ show +
139
140
141
142
143
144
145
static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); // Returns true iff the given string ends with the given suffix, ignoring // case. Any string is considered to end with an empty suffix. static bool EndsWithCaseInsensitive( const std::string& str, const std::string& suffix);
+ show +
146
147
148
149
150
151
152
153
154
155
// Formats an int value as "%02d". static std::string FormatIntWidth2(int value); // "%02d" for width == 2 // Formats an int value as "%X". static std::string FormatHexInt(int value); // Formats a byte as "%02X". static std::string FormatByte(unsigned char value);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/internal/gtest-string.h
129
130
131
132
133
134
135
136
137
138
// // Unlike wcscasecmp(), this function can handle NULL argument(s). // A NULL C string is considered different to any non-NULL wide C string, // including the empty string. // NB: The implementations on different platforms slightly differ. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE // environment variable. On GNU platform this method uses wcscasecmp // which compares according to LC_CTYPE category of the current locale. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the // current locale.
+ show +
139
140
141
142
143
144
145
static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); // Returns true iff the given string ends with the given suffix, ignoring // case. Any string is considered to end with an empty suffix. static bool EndsWithCaseInsensitive( const std::string& str, const std::string& suffix);
+ show +
146
147
148
149
150
151
152
153
154
155
// Formats an int value as "%02d". static std::string FormatIntWidth2(int value); // "%02d" for width == 2 // Formats an int value as "%X". static std::string FormatHexInt(int value); // Formats a byte as "%02X". static std::string FormatByte(unsigned char value);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
// // Unlike wcscasecmp(), this function can handle NULL argument(s). // A NULL C string is considered different to any non-NULL wide C string, // including the empty string. // NB: The implementations on different platforms slightly differ. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE // environment variable. On GNU platform this method uses wcscasecmp // which compares according to LC_CTYPE category of the current locale. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the // current locale.
+ show +
3460
3461
3462
3463
3464
3465
3466
static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); // Returns true iff the given string ends with the given suffix, ignoring // case. Any string is considered to end with an empty suffix. static bool EndsWithCaseInsensitive( const std::string& str, const std::string& suffix);
+ show +
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
// Formats an int value as "%02d". static std::string FormatIntWidth2(int value); // "%02d" for width == 2 // Formats an int value as "%X". static std::string FormatHexInt(int value); // Formats a byte as "%02X". static std::string FormatByte(unsigned char value);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-string.h
129
130
131
132
133
134
135
136
137
138
// // Unlike wcscasecmp(), this function can handle NULL argument(s). // A NULL C string is considered different to any non-NULL wide C string, // including the empty string. // NB: The implementations on different platforms slightly differ. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE // environment variable. On GNU platform this method uses wcscasecmp // which compares according to LC_CTYPE category of the current locale. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the // current locale.
+ show +
139
140
141
142
143
144
145
static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); // Returns true iff the given string ends with the given suffix, ignoring // case. Any string is considered to end with an empty suffix. static bool EndsWithCaseInsensitive( const std::string& str, const std::string& suffix);
+ show +
146
147
148
149
150
151
152
153
154
155
// Formats an int value as "%02d". static std::string FormatIntWidth2(int value); // "%02d" for width == 2 // Formats an int value as "%X". static std::string FormatHexInt(int value); // Formats a byte as "%02X". static std::string FormatByte(unsigned char value);
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/internal/gtest-string.h
129
130
131
132
133
134
135
136
137
138
// // Unlike wcscasecmp(), this function can handle NULL argument(s). // A NULL C string is considered different to any non-NULL wide C string, // including the empty string. // NB: The implementations on different platforms slightly differ. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE // environment variable. On GNU platform this method uses wcscasecmp // which compares according to LC_CTYPE category of the current locale. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the // current locale.
+ show +
139
140
141
142
143
144
145
static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); // Returns true iff the given string ends with the given suffix, ignoring // case. Any string is considered to end with an empty suffix. static bool EndsWithCaseInsensitive( const std::string& str, const std::string& suffix);
+ show +
146
147
148
149
150
151
152
153
154
155
// Formats an int value as "%02d". static std::string FormatIntWidth2(int value); // "%02d" for width == 2 // Formats an int value as "%X". static std::string FormatHexInt(int value); // Formats a byte as "%02X". static std::string FormatByte(unsigned char value);
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
// // Unlike wcscasecmp(), this function can handle NULL argument(s). // A NULL C string is considered different to any non-NULL wide C string, // including the empty string. // NB: The implementations on different platforms slightly differ. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE // environment variable. On GNU platform this method uses wcscasecmp // which compares according to LC_CTYPE category of the current locale. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the // current locale.
+ show +
4249
4250
4251
4252
4253
4254
4255
static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); // Returns true iff the given string ends with the given suffix, ignoring // case. Any string is considered to end with an empty suffix. static bool EndsWithCaseInsensitive( const std::string& str, const std::string& suffix);
+ show +
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
// Formats an int value as "%02d". static std::string FormatIntWidth2(int value); // "%02d" for width == 2 // Formats an int value as "%X". static std::string FormatHexInt(int value); // Formats a byte as "%02X". static std::string FormatByte(unsigned char value);
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/internal/gtest-string.h
129
130
131
132
133
134
135
136
137
138
// // Unlike wcscasecmp(), this function can handle NULL argument(s). // A NULL C string is considered different to any non-NULL wide C string, // including the empty string. // NB: The implementations on different platforms slightly differ. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE // environment variable. On GNU platform this method uses wcscasecmp // which compares according to LC_CTYPE category of the current locale. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the // current locale.
+ show +
139
140
141
142
143
144
145
static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); // Returns true iff the given string ends with the given suffix, ignoring // case. Any string is considered to end with an empty suffix. static bool EndsWithCaseInsensitive( const std::string& str, const std::string& suffix);
+ show +
146
147
148
149
150
151
152
153
154
155
// Formats an int value as "%02d". static std::string FormatIntWidth2(int value); // "%02d" for width == 2 // Formats an int value as "%X". static std::string FormatHexInt(int value); // Formats a byte as "%02X". static std::string FormatByte(unsigned char value);
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/internal/gtest-string.h
129
130
131
132
133
134
135
136
137
138
// // Unlike wcscasecmp(), this function can handle NULL argument(s). // A NULL C string is considered different to any non-NULL wide C string, // including the empty string. // NB: The implementations on different platforms slightly differ. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE // environment variable. On GNU platform this method uses wcscasecmp // which compares according to LC_CTYPE category of the current locale. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the // current locale.
+ show +
139
140
141
142
143
144
145
static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); // Returns true iff the given string ends with the given suffix, ignoring // case. Any string is considered to end with an empty suffix. static bool EndsWithCaseInsensitive( const std::string& str, const std::string& suffix);
+ show +
146
147
148
149
150
151
152
153
154
155
// Formats an int value as "%02d". static std::string FormatIntWidth2(int value); // "%02d" for width == 2 // Formats an int value as "%X". static std::string FormatHexInt(int value); // Formats a byte as "%02X". static std::string FormatByte(unsigned char value);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/internal/gtest-string.h
129
130
131
132
133
134
135
136
137
138
// // Unlike wcscasecmp(), this function can handle NULL argument(s). // A NULL C string is considered different to any non-NULL wide C string, // including the empty string. // NB: The implementations on different platforms slightly differ. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE // environment variable. On GNU platform this method uses wcscasecmp // which compares according to LC_CTYPE category of the current locale. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the // current locale.
+ show +
139
140
141
142
143
144
145
static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); // Returns true iff the given string ends with the given suffix, ignoring // case. Any string is considered to end with an empty suffix. static bool EndsWithCaseInsensitive( const std::string& str, const std::string& suffix);
+ show +
146
147
148
149
150
151
152
153
154
155
// Formats an int value as "%02d". static std::string FormatIntWidth2(int value); // "%02d" for width == 2 // Formats an int value as "%X". static std::string FormatHexInt(int value); // Formats a byte as "%02X". static std::string FormatByte(unsigned char value);

[CVE-2020-0470_1.diff] gtest-string.h #5
- static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, - const wchar_t* rhs); + static bool CaseInsensitiveWideCStringEquals(const wchar_t *lhs, + const wchar_t *rhs); - // Returns true iff the given string ends with the given suffix, ignoring - // case. Any string is considered to end with an empty suffix. - static bool EndsWithCaseInsensitive( - const std::string& str, const std::string& suffix); + // Returns true if and only if the given string ends with the given suffix, + // ignoring case. Any string is considered to end with an empty suffix. + static bool EndsWithCaseInsensitive(const std::string &str, + const std::string &suffix);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/internal/gtest-string.h
129
130
131
132
133
134
135
136
137
138
// // Unlike wcscasecmp(), this function can handle NULL argument(s). // A NULL C string is considered different to any non-NULL wide C string, // including the empty string. // NB: The implementations on different platforms slightly differ. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE // environment variable. On GNU platform this method uses wcscasecmp // which compares according to LC_CTYPE category of the current locale. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the // current locale.
+ show +
139
140
141
142
143
144
145
static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); // Returns true iff the given string ends with the given suffix, ignoring // case. Any string is considered to end with an empty suffix. static bool EndsWithCaseInsensitive( const std::string& str, const std::string& suffix);
+ show +
146
147
148
149
150
151
152
153
154
155
// Formats an int value as "%02d". static std::string FormatIntWidth2(int value); // "%02d" for width == 2 // Formats an int value as "%X". static std::string FormatHexInt(int value); // Formats a byte as "%02X". static std::string FormatByte(unsigned char value);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
// // Unlike wcscasecmp(), this function can handle NULL argument(s). // A NULL C string is considered different to any non-NULL wide C string, // including the empty string. // NB: The implementations on different platforms slightly differ. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE // environment variable. On GNU platform this method uses wcscasecmp // which compares according to LC_CTYPE category of the current locale. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the // current locale.
+ show +
3460
3461
3462
3463
3464
3465
3466
static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); // Returns true iff the given string ends with the given suffix, ignoring // case. Any string is considered to end with an empty suffix. static bool EndsWithCaseInsensitive( const std::string& str, const std::string& suffix);
+ show +
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
// Formats an int value as "%02d". static std::string FormatIntWidth2(int value); // "%02d" for width == 2 // Formats an int value as "%X". static std::string FormatHexInt(int value); // Formats a byte as "%02X". static std::string FormatByte(unsigned char value);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-string.h
129
130
131
132
133
134
135
136
137
138
// // Unlike wcscasecmp(), this function can handle NULL argument(s). // A NULL C string is considered different to any non-NULL wide C string, // including the empty string. // NB: The implementations on different platforms slightly differ. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE // environment variable. On GNU platform this method uses wcscasecmp // which compares according to LC_CTYPE category of the current locale. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the // current locale.
+ show +
139
140
141
142
143
144
145
static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); // Returns true iff the given string ends with the given suffix, ignoring // case. Any string is considered to end with an empty suffix. static bool EndsWithCaseInsensitive( const std::string& str, const std::string& suffix);
+ show +
146
147
148
149
150
151
152
153
154
155
// Formats an int value as "%02d". static std::string FormatIntWidth2(int value); // "%02d" for width == 2 // Formats an int value as "%X". static std::string FormatHexInt(int value); // Formats a byte as "%02X". static std::string FormatByte(unsigned char value);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/internal/gtest-string.h
129
130
131
132
133
134
135
136
137
138
// // Unlike wcscasecmp(), this function can handle NULL argument(s). // A NULL C string is considered different to any non-NULL wide C string, // including the empty string. // NB: The implementations on different platforms slightly differ. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE // environment variable. On GNU platform this method uses wcscasecmp // which compares according to LC_CTYPE category of the current locale. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the // current locale.
+ show +
139
140
141
142
143
144
145
static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); // Returns true iff the given string ends with the given suffix, ignoring // case. Any string is considered to end with an empty suffix. static bool EndsWithCaseInsensitive( const std::string& str, const std::string& suffix);
+ show +
146
147
148
149
150
151
152
153
154
155
// Formats an int value as "%02d". static std::string FormatIntWidth2(int value); // "%02d" for width == 2 // Formats an int value as "%X". static std::string FormatHexInt(int value); // Formats a byte as "%02X". static std::string FormatByte(unsigned char value);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
// // Unlike wcscasecmp(), this function can handle NULL argument(s). // A NULL C string is considered different to any non-NULL wide C string, // including the empty string. // NB: The implementations on different platforms slightly differ. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE // environment variable. On GNU platform this method uses wcscasecmp // which compares according to LC_CTYPE category of the current locale. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the // current locale.
+ show +
3460
3461
3462
3463
3464
3465
3466
static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); // Returns true iff the given string ends with the given suffix, ignoring // case. Any string is considered to end with an empty suffix. static bool EndsWithCaseInsensitive( const std::string& str, const std::string& suffix);
+ show +
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
// Formats an int value as "%02d". static std::string FormatIntWidth2(int value); // "%02d" for width == 2 // Formats an int value as "%X". static std::string FormatHexInt(int value); // Formats a byte as "%02X". static std::string FormatByte(unsigned char value);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-string.h
129
130
131
132
133
134
135
136
137
138
// // Unlike wcscasecmp(), this function can handle NULL argument(s). // A NULL C string is considered different to any non-NULL wide C string, // including the empty string. // NB: The implementations on different platforms slightly differ. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE // environment variable. On GNU platform this method uses wcscasecmp // which compares according to LC_CTYPE category of the current locale. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the // current locale.
+ show +
139
140
141
142
143
144
145
static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); // Returns true iff the given string ends with the given suffix, ignoring // case. Any string is considered to end with an empty suffix. static bool EndsWithCaseInsensitive( const std::string& str, const std::string& suffix);
+ show +
146
147
148
149
150
151
152
153
154
155
// Formats an int value as "%02d". static std::string FormatIntWidth2(int value); // "%02d" for width == 2 // Formats an int value as "%X". static std::string FormatHexInt(int value); // Formats a byte as "%02X". static std::string FormatByte(unsigned char value);
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/internal/gtest-string.h
129
130
131
132
133
134
135
136
137
138
// // Unlike wcscasecmp(), this function can handle NULL argument(s). // A NULL C string is considered different to any non-NULL wide C string, // including the empty string. // NB: The implementations on different platforms slightly differ. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE // environment variable. On GNU platform this method uses wcscasecmp // which compares according to LC_CTYPE category of the current locale. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the // current locale.
+ show +
139
140
141
142
143
144
145
static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); // Returns true iff the given string ends with the given suffix, ignoring // case. Any string is considered to end with an empty suffix. static bool EndsWithCaseInsensitive( const std::string& str, const std::string& suffix);
+ show +
146
147
148
149
150
151
152
153
154
155
// Formats an int value as "%02d". static std::string FormatIntWidth2(int value); // "%02d" for width == 2 // Formats an int value as "%X". static std::string FormatHexInt(int value); // Formats a byte as "%02X". static std::string FormatByte(unsigned char value);
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
// // Unlike wcscasecmp(), this function can handle NULL argument(s). // A NULL C string is considered different to any non-NULL wide C string, // including the empty string. // NB: The implementations on different platforms slightly differ. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE // environment variable. On GNU platform this method uses wcscasecmp // which compares according to LC_CTYPE category of the current locale. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the // current locale.
+ show +
4249
4250
4251
4252
4253
4254
4255
static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); // Returns true iff the given string ends with the given suffix, ignoring // case. Any string is considered to end with an empty suffix. static bool EndsWithCaseInsensitive( const std::string& str, const std::string& suffix);
+ show +
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
// Formats an int value as "%02d". static std::string FormatIntWidth2(int value); // "%02d" for width == 2 // Formats an int value as "%X". static std::string FormatHexInt(int value); // Formats a byte as "%02X". static std::string FormatByte(unsigned char value);
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/internal/gtest-string.h
129
130
131
132
133
134
135
136
137
138
// // Unlike wcscasecmp(), this function can handle NULL argument(s). // A NULL C string is considered different to any non-NULL wide C string, // including the empty string. // NB: The implementations on different platforms slightly differ. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE // environment variable. On GNU platform this method uses wcscasecmp // which compares according to LC_CTYPE category of the current locale. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the // current locale.
+ show +
139
140
141
142
143
144
145
static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); // Returns true iff the given string ends with the given suffix, ignoring // case. Any string is considered to end with an empty suffix. static bool EndsWithCaseInsensitive( const std::string& str, const std::string& suffix);
+ show +
146
147
148
149
150
151
152
153
154
155
// Formats an int value as "%02d". static std::string FormatIntWidth2(int value); // "%02d" for width == 2 // Formats an int value as "%X". static std::string FormatHexInt(int value); // Formats a byte as "%02X". static std::string FormatByte(unsigned char value);
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/internal/gtest-string.h
129
130
131
132
133
134
135
136
137
138
// // Unlike wcscasecmp(), this function can handle NULL argument(s). // A NULL C string is considered different to any non-NULL wide C string, // including the empty string. // NB: The implementations on different platforms slightly differ. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE // environment variable. On GNU platform this method uses wcscasecmp // which compares according to LC_CTYPE category of the current locale. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the // current locale.
+ show +
139
140
141
142
143
144
145
static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); // Returns true iff the given string ends with the given suffix, ignoring // case. Any string is considered to end with an empty suffix. static bool EndsWithCaseInsensitive( const std::string& str, const std::string& suffix);
+ show +
146
147
148
149
150
151
152
153
154
155
// Formats an int value as "%02d". static std::string FormatIntWidth2(int value); // "%02d" for width == 2 // Formats an int value as "%X". static std::string FormatHexInt(int value); // Formats a byte as "%02X". static std::string FormatByte(unsigned char value);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/internal/gtest-string.h
129
130
131
132
133
134
135
136
137
138
// // Unlike wcscasecmp(), this function can handle NULL argument(s). // A NULL C string is considered different to any non-NULL wide C string, // including the empty string. // NB: The implementations on different platforms slightly differ. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE // environment variable. On GNU platform this method uses wcscasecmp // which compares according to LC_CTYPE category of the current locale. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the // current locale.
+ show +
139
140
141
142
143
144
145
static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); // Returns true iff the given string ends with the given suffix, ignoring // case. Any string is considered to end with an empty suffix. static bool EndsWithCaseInsensitive( const std::string& str, const std::string& suffix);
+ show +
146
147
148
149
150
151
152
153
154
155
// Formats an int value as "%02d". static std::string FormatIntWidth2(int value); // "%02d" for width == 2 // Formats an int value as "%X". static std::string FormatHexInt(int value); // Formats a byte as "%02X". static std::string FormatByte(unsigned char value);

[CVE-2020-0478_1.diff] gtest-filepath.h #3
- static FilePath MakeFileName(const FilePath& directory, - const FilePath& base_name, - int number, - const char* extension); + static FilePath MakeFileName(const FilePath &directory, + const FilePath &base_name, int number, + const char *extension); - static FilePath ConcatPaths(const FilePath& directory, - const FilePath& relative_path); + static FilePath ConcatPaths(const FilePath &directory, + const FilePath &relative_path);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/internal/gtest-filepath.h
77
78
79
80
81
82
83
84
85
86
const std::string& string() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
87
88
89
90
91
92
93
94
95
96
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
97
98
99
100
101
102
103
104
105
106
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
const std::string& string() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-filepath.h
77
78
79
80
81
82
83
84
85
86
const std::string& string() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
87
88
89
90
91
92
93
94
95
96
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
97
98
99
100
101
102
103
104
105
106
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/internal/gtest-filepath.h
77
78
79
80
81
82
83
84
85
86
const std::string& string() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
87
88
89
90
91
92
93
94
95
96
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
97
98
99
100
101
102
103
104
105
106
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
const std::string& string() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-filepath.h
77
78
79
80
81
82
83
84
85
86
const std::string& string() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
87
88
89
90
91
92
93
94
95
96
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
97
98
99
100
101
102
103
104
105
106
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/internal/gtest-filepath.h
80
81
82
83
84
85
86
87
88
89
const std::string& string() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
90
91
92
93
94
95
96
97
98
99
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
100
101
102
103
104
105
106
107
108
109
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
const std::string& string() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/include/gtest/internal/gtest-filepath.h
81
82
83
84
85
86
87
88
89
90
String ToString() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
91
92
93
94
95
96
97
98
99
100
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
101
102
103
104
105
106
107
108
109
110
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/internal/gtest-filepath.h
80
81
82
83
84
85
86
87
88
89
const std::string& string() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
90
91
92
93
94
95
96
97
98
99
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
100
101
102
103
104
105
106
107
108
109
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/include/gtest/internal/gtest-filepath.h
81
82
83
84
85
86
87
88
89
90
String ToString() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
91
92
93
94
95
96
97
98
99
100
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
101
102
103
104
105
106
107
108
109
110
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/internal/gtest-filepath.h
77
78
79
80
81
82
83
84
85
86
const std::string& string() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
87
88
89
90
91
92
93
94
95
96
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
97
98
99
100
101
102
103
104
105
106
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/include/gtest/internal/gtest-filepath.h
81
82
83
84
85
86
87
88
89
90
String ToString() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
91
92
93
94
95
96
97
98
99
100
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
101
102
103
104
105
106
107
108
109
110
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/internal/gtest-filepath.h
77
78
79
80
81
82
83
84
85
86
const std::string& string() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
87
88
89
90
91
92
93
94
95
96
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
97
98
99
100
101
102
103
104
105
106
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,

[CVE-2020-0470_1.diff] gtest-filepath.h #3
- static FilePath MakeFileName(const FilePath& directory, - const FilePath& base_name, - int number, - const char* extension); + static FilePath MakeFileName(const FilePath &directory, + const FilePath &base_name, int number, + const char *extension); - static FilePath ConcatPaths(const FilePath& directory, - const FilePath& relative_path); + static FilePath ConcatPaths(const FilePath &directory, + const FilePath &relative_path);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/internal/gtest-filepath.h
77
78
79
80
81
82
83
84
85
86
const std::string& string() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
87
88
89
90
91
92
93
94
95
96
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
97
98
99
100
101
102
103
104
105
106
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
const std::string& string() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-filepath.h
77
78
79
80
81
82
83
84
85
86
const std::string& string() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
87
88
89
90
91
92
93
94
95
96
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
97
98
99
100
101
102
103
104
105
106
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/internal/gtest-filepath.h
77
78
79
80
81
82
83
84
85
86
const std::string& string() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
87
88
89
90
91
92
93
94
95
96
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
97
98
99
100
101
102
103
104
105
106
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
const std::string& string() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-filepath.h
77
78
79
80
81
82
83
84
85
86
const std::string& string() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
87
88
89
90
91
92
93
94
95
96
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
97
98
99
100
101
102
103
104
105
106
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/internal/gtest-filepath.h
80
81
82
83
84
85
86
87
88
89
const std::string& string() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
90
91
92
93
94
95
96
97
98
99
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
100
101
102
103
104
105
106
107
108
109
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
const std::string& string() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/include/gtest/internal/gtest-filepath.h
81
82
83
84
85
86
87
88
89
90
String ToString() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
91
92
93
94
95
96
97
98
99
100
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
101
102
103
104
105
106
107
108
109
110
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/internal/gtest-filepath.h
80
81
82
83
84
85
86
87
88
89
const std::string& string() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
90
91
92
93
94
95
96
97
98
99
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
100
101
102
103
104
105
106
107
108
109
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/include/gtest/internal/gtest-filepath.h
81
82
83
84
85
86
87
88
89
90
String ToString() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
91
92
93
94
95
96
97
98
99
100
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
101
102
103
104
105
106
107
108
109
110
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/internal/gtest-filepath.h
77
78
79
80
81
82
83
84
85
86
const std::string& string() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
87
88
89
90
91
92
93
94
95
96
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
97
98
99
100
101
102
103
104
105
106
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/include/gtest/internal/gtest-filepath.h
81
82
83
84
85
86
87
88
89
90
String ToString() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
91
92
93
94
95
96
97
98
99
100
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
101
102
103
104
105
106
107
108
109
110
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/internal/gtest-filepath.h
77
78
79
80
81
82
83
84
85
86
const std::string& string() const { return pathname_; } const char* c_str() const { return pathname_.c_str(); } // Returns the current working directory, or "" if unsuccessful. static FilePath GetCurrentDir(); // Given directory = "dir", base_name = "test", number = 0, // extension = "xml", returns "dir/test.xml". If number is greater // than zero (e.g., 12), returns "dir/test_12.xml". // On Windows platform, uses \ as the separator rather than /.
+ show +
87
88
89
90
91
92
93
94
95
96
static FilePath MakeFileName(const FilePath& directory, const FilePath& base_name, int number, const char* extension); // Given directory = "dir", relative_path = "test.xml", // returns "dir/test.xml". // On Windows, uses \ as the separator rather than /. static FilePath ConcatPaths(const FilePath& directory, const FilePath& relative_path);
+ show +
97
98
99
100
101
102
103
104
105
106
// Returns a pathname for a file that does not currently exist. The pathname // will be directory/base_name.extension or // directory/base_name_<number>.extension if directory/base_name.extension // already exists. The number will be incremented until a pathname is found // that does not already exist. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. // There could be a race condition if two or more processes are calling this // function at the same time -- they could both pick the same filename. static FilePath GenerateUniqueFileName(const FilePath& directory,

[CVE-2020-0478_1.diff] gtest-death-test-internal.h #7
-InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag(); - -#else // GTEST_HAS_DEATH_TEST - -// This macro is used for implementing macros such as -// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where -// death tests are not supported. Those macros must compile on such systems -// iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on -// systems that support death tests. This allows one to write such a macro -// on a system that does not support death tests and be sure that it will -// compile on a death-test supporting system. -// -// Parameters: -// statement - A statement that a macro such as EXPECT_DEATH would test -// for program termination. This macro has to make sure this -// statement is compiled but not executed, to ensure that -// EXPECT_DEATH_IF_SUPPORTED compiles with a certain -// parameter iff EXPECT_DEATH compiles with it. -// regex - A regex that a macro such as EXPECT_DEATH would use to test -// the output of statement. This parameter has to be -// compiled but not evaluated by this macro, to ensure that -// this macro only accepts expressions that a macro such as -// EXPECT_DEATH would accept. -// terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED -// and a return statement for ASSERT_DEATH_IF_SUPPORTED. -// This ensures that ASSERT_DEATH_IF_SUPPORTED will not -// compile inside functions where ASSERT_DEATH doesn't -// compile. -// -// The branch that has an always false condition is used to ensure that -// statement and regex are compiled (and thus syntactically correct) but -// never executed. The unreachable code macro protects the terminator -// statement from generating an 'unreachable code' warning in case -// statement unconditionally returns or throws. The Message constructor at -// the end allows the syntax of streaming additional messages into the -// macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH. -# define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - GTEST_LOG_(WARNING) \ - << "Death tests are not supported on this platform.\n" \ - << "Statement '" #statement "' cannot be verified."; \ - } else if (::testing::internal::AlwaysFalse()) { \ - ::testing::internal::RE::PartialMatch(".*", (regex)); \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - terminator; \ - } else \ - ::testing::Message() +InternalRunDeathTestFlag *ParseInternalRunDeathTestFlag();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
int line_; int index_; int write_fd_; GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag); }; // Returns a newly created InternalRunDeathTestFlag object with fields // initialized from the GTEST_FLAG(internal_run_death_test) flag if // the flag is specified; otherwise returns NULL.
+ show +
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag(); #else // GTEST_HAS_DEATH_TEST // This macro is used for implementing macros such as // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where // death tests are not supported. Those macros must compile on such systems // iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on // systems that support death tests. This allows one to write such a macro // on a system that does not support death tests and be sure that it will // compile on a death-test supporting system. // // Parameters: // statement - A statement that a macro such as EXPECT_DEATH would test // for program termination. This macro has to make sure this // statement is compiled but not executed, to ensure that // EXPECT_DEATH_IF_SUPPORTED compiles with a certain // parameter iff EXPECT_DEATH compiles with it. // regex - A regex that a macro such as EXPECT_DEATH would use to test // the output of statement. This parameter has to be // compiled but not evaluated by this macro, to ensure that // this macro only accepts expressions that a macro such as // EXPECT_DEATH would accept. // terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED // and a return statement for ASSERT_DEATH_IF_SUPPORTED. // This ensures that ASSERT_DEATH_IF_SUPPORTED will not // compile inside functions where ASSERT_DEATH doesn't // compile. // // The branch that has an always false condition is used to ensure that // statement and regex are compiled (and thus syntactically correct) but // never executed. The unreachable code macro protects the terminator // statement from generating an 'unreachable code' warning in case // statement unconditionally returns or throws. The Message constructor at // the end allows the syntax of streaming additional messages into the // macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH. # define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::AlwaysTrue()) { \ GTEST_LOG_(WARNING) \ << "Death tests are not supported on this platform.\n" \ << "Statement '" #statement "' cannot be verified."; \ } else if (::testing::internal::AlwaysFalse()) { \ ::testing::internal::RE::PartialMatch(".*", (regex)); \ GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ terminator; \ } else \ ::testing::Message()
+ show +
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
#endif // GTEST_HAS_DEATH_TEST } // namespace internal } // namespace testing #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ namespace testing {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
int line_; int index_; int write_fd_; GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag); }; // Returns a newly created InternalRunDeathTestFlag object with fields // initialized from the GTEST_FLAG(internal_run_death_test) flag if // the flag is specified; otherwise returns NULL.
+ show +
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag(); #else // GTEST_HAS_DEATH_TEST // This macro is used for implementing macros such as // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where // death tests are not supported. Those macros must compile on such systems // iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on // systems that support death tests. This allows one to write such a macro // on a system that does not support death tests and be sure that it will // compile on a death-test supporting system. // // Parameters: // statement - A statement that a macro such as EXPECT_DEATH would test // for program termination. This macro has to make sure this // statement is compiled but not executed, to ensure that // EXPECT_DEATH_IF_SUPPORTED compiles with a certain // parameter iff EXPECT_DEATH compiles with it. // regex - A regex that a macro such as EXPECT_DEATH would use to test // the output of statement. This parameter has to be // compiled but not evaluated by this macro, to ensure that // this macro only accepts expressions that a macro such as // EXPECT_DEATH would accept. // terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED // and a return statement for ASSERT_DEATH_IF_SUPPORTED. // This ensures that ASSERT_DEATH_IF_SUPPORTED will not // compile inside functions where ASSERT_DEATH doesn't // compile. // // The branch that has an always false condition is used to ensure that // statement and regex are compiled (and thus syntactically correct) but // never executed. The unreachable code macro protects the terminator // statement from generating an 'unreachable code' warning in case // statement unconditionally returns or throws. The Message constructor at // the end allows the syntax of streaming additional messages into the // macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH. # define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::AlwaysTrue()) { \ GTEST_LOG_(WARNING) \ << "Death tests are not supported on this platform.\n" \ << "Statement '" #statement "' cannot be verified."; \ } else if (::testing::internal::AlwaysFalse()) { \ ::testing::internal::RE::PartialMatch(".*", (regex)); \ GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ terminator; \ } else \ ::testing::Message()
+ show +
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
#endif // GTEST_HAS_DEATH_TEST } // namespace internal } // namespace testing #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ namespace testing {
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
int line_; int index_; int write_fd_; GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag); }; // Returns a newly created InternalRunDeathTestFlag object with fields // initialized from the GTEST_FLAG(internal_run_death_test) flag if // the flag is specified; otherwise returns NULL.
+ show +
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag(); #else // GTEST_HAS_DEATH_TEST // This macro is used for implementing macros such as // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where // death tests are not supported. Those macros must compile on such systems // iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on // systems that support death tests. This allows one to write such a macro // on a system that does not support death tests and be sure that it will // compile on a death-test supporting system. // // Parameters: // statement - A statement that a macro such as EXPECT_DEATH would test // for program termination. This macro has to make sure this // statement is compiled but not executed, to ensure that // EXPECT_DEATH_IF_SUPPORTED compiles with a certain // parameter iff EXPECT_DEATH compiles with it. // regex - A regex that a macro such as EXPECT_DEATH would use to test // the output of statement. This parameter has to be // compiled but not evaluated by this macro, to ensure that // this macro only accepts expressions that a macro such as // EXPECT_DEATH would accept. // terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED // and a return statement for ASSERT_DEATH_IF_SUPPORTED. // This ensures that ASSERT_DEATH_IF_SUPPORTED will not // compile inside functions where ASSERT_DEATH doesn't // compile. // // The branch that has an always false condition is used to ensure that // statement and regex are compiled (and thus syntactically correct) but // never executed. The unreachable code macro protects the terminator // statement from generating an 'unreachable code' warning in case // statement unconditionally returns or throws. The Message constructor at // the end allows the syntax of streaming additional messages into the // macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH. # define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::AlwaysTrue()) { \ GTEST_LOG_(WARNING) \ << "Death tests are not supported on this platform.\n" \ << "Statement '" #statement "' cannot be verified."; \ } else if (::testing::internal::AlwaysFalse()) { \ ::testing::internal::RE::PartialMatch(".*", (regex)); \ GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ terminator; \ } else \ ::testing::Message()
+ show +
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
#endif // GTEST_HAS_DEATH_TEST } // namespace internal } // namespace testing #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ namespace testing {

[CVE-2020-0470_1.diff] gtest-death-test-internal.h #7
-InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag(); - -#else // GTEST_HAS_DEATH_TEST - -// This macro is used for implementing macros such as -// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where -// death tests are not supported. Those macros must compile on such systems -// iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on -// systems that support death tests. This allows one to write such a macro -// on a system that does not support death tests and be sure that it will -// compile on a death-test supporting system. -// -// Parameters: -// statement - A statement that a macro such as EXPECT_DEATH would test -// for program termination. This macro has to make sure this -// statement is compiled but not executed, to ensure that -// EXPECT_DEATH_IF_SUPPORTED compiles with a certain -// parameter iff EXPECT_DEATH compiles with it. -// regex - A regex that a macro such as EXPECT_DEATH would use to test -// the output of statement. This parameter has to be -// compiled but not evaluated by this macro, to ensure that -// this macro only accepts expressions that a macro such as -// EXPECT_DEATH would accept. -// terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED -// and a return statement for ASSERT_DEATH_IF_SUPPORTED. -// This ensures that ASSERT_DEATH_IF_SUPPORTED will not -// compile inside functions where ASSERT_DEATH doesn't -// compile. -// -// The branch that has an always false condition is used to ensure that -// statement and regex are compiled (and thus syntactically correct) but -// never executed. The unreachable code macro protects the terminator -// statement from generating an 'unreachable code' warning in case -// statement unconditionally returns or throws. The Message constructor at -// the end allows the syntax of streaming additional messages into the -// macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH. -# define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - GTEST_LOG_(WARNING) \ - << "Death tests are not supported on this platform.\n" \ - << "Statement '" #statement "' cannot be verified."; \ - } else if (::testing::internal::AlwaysFalse()) { \ - ::testing::internal::RE::PartialMatch(".*", (regex)); \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - terminator; \ - } else \ - ::testing::Message() +InternalRunDeathTestFlag *ParseInternalRunDeathTestFlag();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
int line_; int index_; int write_fd_; GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag); }; // Returns a newly created InternalRunDeathTestFlag object with fields // initialized from the GTEST_FLAG(internal_run_death_test) flag if // the flag is specified; otherwise returns NULL.
+ show +
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag(); #else // GTEST_HAS_DEATH_TEST // This macro is used for implementing macros such as // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where // death tests are not supported. Those macros must compile on such systems // iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on // systems that support death tests. This allows one to write such a macro // on a system that does not support death tests and be sure that it will // compile on a death-test supporting system. // // Parameters: // statement - A statement that a macro such as EXPECT_DEATH would test // for program termination. This macro has to make sure this // statement is compiled but not executed, to ensure that // EXPECT_DEATH_IF_SUPPORTED compiles with a certain // parameter iff EXPECT_DEATH compiles with it. // regex - A regex that a macro such as EXPECT_DEATH would use to test // the output of statement. This parameter has to be // compiled but not evaluated by this macro, to ensure that // this macro only accepts expressions that a macro such as // EXPECT_DEATH would accept. // terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED // and a return statement for ASSERT_DEATH_IF_SUPPORTED. // This ensures that ASSERT_DEATH_IF_SUPPORTED will not // compile inside functions where ASSERT_DEATH doesn't // compile. // // The branch that has an always false condition is used to ensure that // statement and regex are compiled (and thus syntactically correct) but // never executed. The unreachable code macro protects the terminator // statement from generating an 'unreachable code' warning in case // statement unconditionally returns or throws. The Message constructor at // the end allows the syntax of streaming additional messages into the // macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH. # define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::AlwaysTrue()) { \ GTEST_LOG_(WARNING) \ << "Death tests are not supported on this platform.\n" \ << "Statement '" #statement "' cannot be verified."; \ } else if (::testing::internal::AlwaysFalse()) { \ ::testing::internal::RE::PartialMatch(".*", (regex)); \ GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ terminator; \ } else \ ::testing::Message()
+ show +
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
#endif // GTEST_HAS_DEATH_TEST } // namespace internal } // namespace testing #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ namespace testing {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
int line_; int index_; int write_fd_; GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag); }; // Returns a newly created InternalRunDeathTestFlag object with fields // initialized from the GTEST_FLAG(internal_run_death_test) flag if // the flag is specified; otherwise returns NULL.
+ show +
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag(); #else // GTEST_HAS_DEATH_TEST // This macro is used for implementing macros such as // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where // death tests are not supported. Those macros must compile on such systems // iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on // systems that support death tests. This allows one to write such a macro // on a system that does not support death tests and be sure that it will // compile on a death-test supporting system. // // Parameters: // statement - A statement that a macro such as EXPECT_DEATH would test // for program termination. This macro has to make sure this // statement is compiled but not executed, to ensure that // EXPECT_DEATH_IF_SUPPORTED compiles with a certain // parameter iff EXPECT_DEATH compiles with it. // regex - A regex that a macro such as EXPECT_DEATH would use to test // the output of statement. This parameter has to be // compiled but not evaluated by this macro, to ensure that // this macro only accepts expressions that a macro such as // EXPECT_DEATH would accept. // terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED // and a return statement for ASSERT_DEATH_IF_SUPPORTED. // This ensures that ASSERT_DEATH_IF_SUPPORTED will not // compile inside functions where ASSERT_DEATH doesn't // compile. // // The branch that has an always false condition is used to ensure that // statement and regex are compiled (and thus syntactically correct) but // never executed. The unreachable code macro protects the terminator // statement from generating an 'unreachable code' warning in case // statement unconditionally returns or throws. The Message constructor at // the end allows the syntax of streaming additional messages into the // macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH. # define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::AlwaysTrue()) { \ GTEST_LOG_(WARNING) \ << "Death tests are not supported on this platform.\n" \ << "Statement '" #statement "' cannot be verified."; \ } else if (::testing::internal::AlwaysFalse()) { \ ::testing::internal::RE::PartialMatch(".*", (regex)); \ GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ terminator; \ } else \ ::testing::Message()
+ show +
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
#endif // GTEST_HAS_DEATH_TEST } // namespace internal } // namespace testing #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ namespace testing {
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
int line_; int index_; int write_fd_; GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag); }; // Returns a newly created InternalRunDeathTestFlag object with fields // initialized from the GTEST_FLAG(internal_run_death_test) flag if // the flag is specified; otherwise returns NULL.
+ show +
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag(); #else // GTEST_HAS_DEATH_TEST // This macro is used for implementing macros such as // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where // death tests are not supported. Those macros must compile on such systems // iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on // systems that support death tests. This allows one to write such a macro // on a system that does not support death tests and be sure that it will // compile on a death-test supporting system. // // Parameters: // statement - A statement that a macro such as EXPECT_DEATH would test // for program termination. This macro has to make sure this // statement is compiled but not executed, to ensure that // EXPECT_DEATH_IF_SUPPORTED compiles with a certain // parameter iff EXPECT_DEATH compiles with it. // regex - A regex that a macro such as EXPECT_DEATH would use to test // the output of statement. This parameter has to be // compiled but not evaluated by this macro, to ensure that // this macro only accepts expressions that a macro such as // EXPECT_DEATH would accept. // terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED // and a return statement for ASSERT_DEATH_IF_SUPPORTED. // This ensures that ASSERT_DEATH_IF_SUPPORTED will not // compile inside functions where ASSERT_DEATH doesn't // compile. // // The branch that has an always false condition is used to ensure that // statement and regex are compiled (and thus syntactically correct) but // never executed. The unreachable code macro protects the terminator // statement from generating an 'unreachable code' warning in case // statement unconditionally returns or throws. The Message constructor at // the end allows the syntax of streaming additional messages into the // macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH. # define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::AlwaysTrue()) { \ GTEST_LOG_(WARNING) \ << "Death tests are not supported on this platform.\n" \ << "Statement '" #statement "' cannot be verified."; \ } else if (::testing::internal::AlwaysFalse()) { \ ::testing::internal::RE::PartialMatch(".*", (regex)); \ GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ terminator; \ } else \ ::testing::Message()
+ show +
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
#endif // GTEST_HAS_DEATH_TEST } // namespace internal } // namespace testing #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ namespace testing {

[CVE-2020-0478_1.diff] gtest-port.h #26
-# define GTEST_CHECK_(condition) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::IsTrue(condition)) \ - ; \ - else \ - GTEST_LOG_(FATAL) << "Condition " #condition " failed. " +#define GTEST_CHECK_(condition) \ + GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ + if (::testing::internal::IsTrue(condition)) \ + ; \ + else \ + GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/internal/gtest-port.h
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
1064
1065
1066
1067
1068
1069
#define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
// An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ << gtest_error
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
2167
2168
2169
2170
2171
2172
#define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
// An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ << gtest_error
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-port.h
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
1074
1075
1076
1077
1078
1079
#define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
// An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ << gtest_error
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-port.h.orig
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
1064
1065
1066
1067
1068
1069
#define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
// An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ << gtest_error
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/internal/gtest-port.h
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
1340
1341
1342
1343
1344
1345
# define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
#endif // !defined(GTEST_CHECK_) // An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
2167
2168
2169
2170
2171
2172
#define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
// An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ << gtest_error
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-port.h
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
1074
1075
1076
1077
1078
1079
#define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
// An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ << gtest_error
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-port.h.orig
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
1064
1065
1066
1067
1068
1069
#define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
// An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ << gtest_error
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/internal/gtest-port.h
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
1046
1047
1048
1049
1050
1051
# define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
#endif // !defined(GTEST_CHECK_) // An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
2577
2578
2579
2580
2581
2582
# define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
#endif // !defined(GTEST_CHECK_) // An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/include/gtest/internal/gtest-port.h
958
959
960
961
962
963
964
965
966
967
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
968
969
970
971
972
973
#define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
974
975
976
977
978
979
980
981
982
983
// An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ << gtest_error
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/internal/gtest-port.h
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
1382
1383
1384
1385
1386
1387
# define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
#endif // !defined(GTEST_CHECK_) // An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h
947
948
949
950
951
952
953
954
955
956
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
957
958
959
960
961
962
#define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
963
964
965
966
967
968
969
970
971
972
// An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ << gtest_error
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/internal/gtest-port.h
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
1295
1296
1297
1298
1299
1300
# define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
#endif // !defined(GTEST_CHECK_) // An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/include/gtest/internal/gtest-port.h
939
940
941
942
943
944
945
946
947
948
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
949
950
951
952
953
954
#define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
955
956
957
958
959
960
961
962
963
964
// An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ << gtest_error
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/internal/gtest-port.h
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
1308
1309
1310
1311
1312
1313
# define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
#endif // !defined(GTEST_CHECK_) // An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \

[CVE-2020-0470_1.diff] gtest-port.h #26
-# define GTEST_CHECK_(condition) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::IsTrue(condition)) \ - ; \ - else \ - GTEST_LOG_(FATAL) << "Condition " #condition " failed. " +#define GTEST_CHECK_(condition) \ + GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ + if (::testing::internal::IsTrue(condition)) \ + ; \ + else \ + GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/include/gtest/internal/gtest-port.h
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
1064
1065
1066
1067
1068
1069
#define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
// An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ << gtest_error
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
2167
2168
2169
2170
2171
2172
#define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
// An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ << gtest_error
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-port.h
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
1074
1075
1076
1077
1078
1079
#define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
// An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ << gtest_error
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-port.h.orig
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
1064
1065
1066
1067
1068
1069
#define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
// An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ << gtest_error
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/internal/gtest-port.h
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
1340
1341
1342
1343
1344
1345
# define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
#endif // !defined(GTEST_CHECK_) // An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
2167
2168
2169
2170
2171
2172
#define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
// An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ << gtest_error
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-port.h
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
1074
1075
1076
1077
1078
1079
#define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
// An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ << gtest_error
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-port.h.orig
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
1064
1065
1066
1067
1068
1069
#define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
// An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ << gtest_error
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/internal/gtest-port.h
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
1046
1047
1048
1049
1050
1051
# define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
#endif // !defined(GTEST_CHECK_) // An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
2577
2578
2579
2580
2581
2582
# define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
#endif // !defined(GTEST_CHECK_) // An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/include/gtest/internal/gtest-port.h
958
959
960
961
962
963
964
965
966
967
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
968
969
970
971
972
973
#define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
974
975
976
977
978
979
980
981
982
983
// An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ << gtest_error
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/internal/gtest-port.h
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
1382
1383
1384
1385
1386
1387
# define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
#endif // !defined(GTEST_CHECK_) // An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h
947
948
949
950
951
952
953
954
955
956
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
957
958
959
960
961
962
#define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
963
964
965
966
967
968
969
970
971
972
// An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ << gtest_error
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/internal/gtest-port.h
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
1295
1296
1297
1298
1299
1300
# define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
#endif // !defined(GTEST_CHECK_) // An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/include/gtest/internal/gtest-port.h
939
940
941
942
943
944
945
946
947
948
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
949
950
951
952
953
954
#define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
955
956
957
958
959
960
961
962
963
964
// An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ << gtest_error
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/internal/gtest-port.h
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
// Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not.
+ show +
1308
1309
1310
1311
1312
1313
# define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::IsTrue(condition)) \ ; \ else \ GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+ show +
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
#endif // !defined(GTEST_CHECK_) // An all-mode assert to verify that the given POSIX-style function // call returns 0 (indicating success). Known limitation: this // doesn't expand to a balanced 'if' statement, so enclose the macro // in {} if you need to use it as the only statement in an 'if' // branch. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ if (const int gtest_error = (posix_call)) \ GTEST_LOG_(FATAL) << #posix_call << "failed with error " \

[CVE-2020-0478_1.diff] gtest-port.cc #48
+static const std::vector<std::string> *g_injected_test_argvs = + nullptr; // Owned. -static const ::std::vector<testing::internal::string>* g_injected_test_argvs = - NULL; // Owned. - -void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { - if (g_injected_test_argvs != argvs) - delete g_injected_test_argvs; - g_injected_test_argvs = argvs; -} - -const ::std::vector<testing::internal::string>& GetInjectableArgvs() { - if (g_injected_test_argvs != NULL) { +std::vector<std::string> GetInjectableArgvs() { + if (g_injected_test_argvs != nullptr) { + +void SetInjectableArgvs(const std::vector<std::string> *new_argvs) { + if (g_injected_test_argvs != new_argvs) delete g_injected_test_argvs; + g_injected_test_argvs = new_argvs; +} + +void SetInjectableArgvs(const std::vector<std::string> &new_argvs) { + SetInjectableArgvs( + new std::vector<std::string>(new_argvs.begin(), new_argvs.end())); +} + +void ClearInjectableArgvs() { + delete g_injected_test_argvs; + g_injected_test_argvs = nullptr; +}
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest-port.cc
670
671
672
673
674
675
676
677
678
679
return GetCapturedStream(&g_captured_stderr); } #endif // GTEST_HAS_STREAM_REDIRECTION #if GTEST_HAS_DEATH_TEST // A copy of all command line arguments. Set by InitGoogleTest(). ::std::vector<testing::internal::string> g_argvs;
+ show +
680
681
682
683
684
685
686
687
688
689
690
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
691
692
693
694
695
696
697
698
699
700
return *g_injected_test_argvs; } return g_argvs; } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
return GetCapturedStream(&g_captured_stderr); } #endif // GTEST_HAS_STREAM_REDIRECTION #if GTEST_HAS_DEATH_TEST // A copy of all command line arguments. Set by InitGoogleTest(). ::std::vector<testing::internal::string> g_argvs;
+ show +
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
return *g_injected_test_argvs; } return g_argvs; } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-port.cc.orig
670
671
672
673
674
675
676
677
678
679
return GetCapturedStream(&g_captured_stderr); } #endif // GTEST_HAS_STREAM_REDIRECTION #if GTEST_HAS_DEATH_TEST // A copy of all command line arguments. Set by InitGoogleTest(). ::std::vector<testing::internal::string> g_argvs;
+ show +
680
681
682
683
684
685
686
687
688
689
690
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
691
692
693
694
695
696
697
698
699
700
return *g_injected_test_argvs; } return g_argvs; } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-port.cc
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
return GetCapturedStream(&g_captured_stderr); } #endif // GTEST_HAS_STREAM_REDIRECTION #if GTEST_HAS_DEATH_TEST // A copy of all command line arguments. Set by InitGoogleTest(). ::std::vector<testing::internal::string> g_argvs;
+ show +
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
return *g_injected_test_argvs; } return g_argvs; } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-port.cc
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
} while (bytes_last_read > 0 && bytes_read < file_size); const std::string content(buffer, bytes_read); delete[] buffer; return content; } #if GTEST_HAS_DEATH_TEST
+ show +
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
return *g_injected_test_argvs; } return GetArgvs(); } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
return GetCapturedStream(&g_captured_stderr); } #endif // GTEST_HAS_STREAM_REDIRECTION #if GTEST_HAS_DEATH_TEST // A copy of all command line arguments. Set by InitGoogleTest(). ::std::vector<testing::internal::string> g_argvs;
+ show +
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
return *g_injected_test_argvs; } return g_argvs; } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-port.cc.orig
670
671
672
673
674
675
676
677
678
679
return GetCapturedStream(&g_captured_stderr); } #endif // GTEST_HAS_STREAM_REDIRECTION #if GTEST_HAS_DEATH_TEST // A copy of all command line arguments. Set by InitGoogleTest(). ::std::vector<testing::internal::string> g_argvs;
+ show +
680
681
682
683
684
685
686
687
688
689
690
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
691
692
693
694
695
696
697
698
699
700
return *g_injected_test_argvs; } return g_argvs; } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-port.cc
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
return GetCapturedStream(&g_captured_stderr); } #endif // GTEST_HAS_STREAM_REDIRECTION #if GTEST_HAS_DEATH_TEST // A copy of all command line arguments. Set by InitGoogleTest(). ::std::vector<testing::internal::string> g_argvs;
+ show +
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
return *g_injected_test_argvs; } return g_argvs; } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
} while (bytes_last_read > 0 && bytes_read < file_size); const std::string content(buffer, bytes_read); delete[] buffer; return content; } #if GTEST_HAS_DEATH_TEST
+ show +
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
return *g_injected_test_argvs; } return GetArgvs(); } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/src/gtest-port.cc
652
653
654
655
656
657
658
659
660
661
// Stops capturing stderr and returns the captured string. String GetCapturedStderr() { return GetCapturedStream(&g_captured_stderr); } #endif // GTEST_HAS_STREAM_REDIRECTION #if GTEST_HAS_DEATH_TEST // A copy of all command line arguments. Set by InitGoogleTest(). ::std::vector<testing::internal::string> g_argvs;
+ show +
662
663
664
665
666
667
668
669
670
671
672
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
673
674
675
676
677
678
679
680
681
682
return *g_injected_test_argvs; } return g_argvs; } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-port.cc
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
} while (bytes_last_read > 0 && bytes_read < file_size); const std::string content(buffer, bytes_read); delete[] buffer; return content; } #if GTEST_HAS_DEATH_TEST
+ show +
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
return *g_injected_test_argvs; } return GetArgvs(); } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-port.cc
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
} while (bytes_last_read > 0 && bytes_read < file_size); const std::string content(buffer, bytes_read); delete[] buffer; return content; } #if GTEST_HAS_DEATH_TEST
+ show +
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
return *g_injected_test_argvs; } return GetArgvs(); } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();

[CVE-2020-0470_1.diff] gtest-port.cc #48
+static const std::vector<std::string> *g_injected_test_argvs = + nullptr; // Owned. -static const ::std::vector<testing::internal::string>* g_injected_test_argvs = - NULL; // Owned. - -void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { - if (g_injected_test_argvs != argvs) - delete g_injected_test_argvs; - g_injected_test_argvs = argvs; -} - -const ::std::vector<testing::internal::string>& GetInjectableArgvs() { - if (g_injected_test_argvs != NULL) { +std::vector<std::string> GetInjectableArgvs() { + if (g_injected_test_argvs != nullptr) { + +void SetInjectableArgvs(const std::vector<std::string> *new_argvs) { + if (g_injected_test_argvs != new_argvs) delete g_injected_test_argvs; + g_injected_test_argvs = new_argvs; +} + +void SetInjectableArgvs(const std::vector<std::string> &new_argvs) { + SetInjectableArgvs( + new std::vector<std::string>(new_argvs.begin(), new_argvs.end())); +} + +void ClearInjectableArgvs() { + delete g_injected_test_argvs; + g_injected_test_argvs = nullptr; +}
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest-port.cc
670
671
672
673
674
675
676
677
678
679
return GetCapturedStream(&g_captured_stderr); } #endif // GTEST_HAS_STREAM_REDIRECTION #if GTEST_HAS_DEATH_TEST // A copy of all command line arguments. Set by InitGoogleTest(). ::std::vector<testing::internal::string> g_argvs;
+ show +
680
681
682
683
684
685
686
687
688
689
690
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
691
692
693
694
695
696
697
698
699
700
return *g_injected_test_argvs; } return g_argvs; } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
return GetCapturedStream(&g_captured_stderr); } #endif // GTEST_HAS_STREAM_REDIRECTION #if GTEST_HAS_DEATH_TEST // A copy of all command line arguments. Set by InitGoogleTest(). ::std::vector<testing::internal::string> g_argvs;
+ show +
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
return *g_injected_test_argvs; } return g_argvs; } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-port.cc.orig
670
671
672
673
674
675
676
677
678
679
return GetCapturedStream(&g_captured_stderr); } #endif // GTEST_HAS_STREAM_REDIRECTION #if GTEST_HAS_DEATH_TEST // A copy of all command line arguments. Set by InitGoogleTest(). ::std::vector<testing::internal::string> g_argvs;
+ show +
680
681
682
683
684
685
686
687
688
689
690
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
691
692
693
694
695
696
697
698
699
700
return *g_injected_test_argvs; } return g_argvs; } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-port.cc
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
return GetCapturedStream(&g_captured_stderr); } #endif // GTEST_HAS_STREAM_REDIRECTION #if GTEST_HAS_DEATH_TEST // A copy of all command line arguments. Set by InitGoogleTest(). ::std::vector<testing::internal::string> g_argvs;
+ show +
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
return *g_injected_test_argvs; } return g_argvs; } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-port.cc
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
} while (bytes_last_read > 0 && bytes_read < file_size); const std::string content(buffer, bytes_read); delete[] buffer; return content; } #if GTEST_HAS_DEATH_TEST
+ show +
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
return *g_injected_test_argvs; } return GetArgvs(); } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
return GetCapturedStream(&g_captured_stderr); } #endif // GTEST_HAS_STREAM_REDIRECTION #if GTEST_HAS_DEATH_TEST // A copy of all command line arguments. Set by InitGoogleTest(). ::std::vector<testing::internal::string> g_argvs;
+ show +
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
return *g_injected_test_argvs; } return g_argvs; } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-port.cc.orig
670
671
672
673
674
675
676
677
678
679
return GetCapturedStream(&g_captured_stderr); } #endif // GTEST_HAS_STREAM_REDIRECTION #if GTEST_HAS_DEATH_TEST // A copy of all command line arguments. Set by InitGoogleTest(). ::std::vector<testing::internal::string> g_argvs;
+ show +
680
681
682
683
684
685
686
687
688
689
690
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
691
692
693
694
695
696
697
698
699
700
return *g_injected_test_argvs; } return g_argvs; } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-port.cc
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
return GetCapturedStream(&g_captured_stderr); } #endif // GTEST_HAS_STREAM_REDIRECTION #if GTEST_HAS_DEATH_TEST // A copy of all command line arguments. Set by InitGoogleTest(). ::std::vector<testing::internal::string> g_argvs;
+ show +
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
return *g_injected_test_argvs; } return g_argvs; } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
} while (bytes_last_read > 0 && bytes_read < file_size); const std::string content(buffer, bytes_read); delete[] buffer; return content; } #if GTEST_HAS_DEATH_TEST
+ show +
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
return *g_injected_test_argvs; } return GetArgvs(); } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/src/gtest-port.cc
652
653
654
655
656
657
658
659
660
661
// Stops capturing stderr and returns the captured string. String GetCapturedStderr() { return GetCapturedStream(&g_captured_stderr); } #endif // GTEST_HAS_STREAM_REDIRECTION #if GTEST_HAS_DEATH_TEST // A copy of all command line arguments. Set by InitGoogleTest(). ::std::vector<testing::internal::string> g_argvs;
+ show +
662
663
664
665
666
667
668
669
670
671
672
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
673
674
675
676
677
678
679
680
681
682
return *g_injected_test_argvs; } return g_argvs; } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-port.cc
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
} while (bytes_last_read > 0 && bytes_read < file_size); const std::string content(buffer, bytes_read); delete[] buffer; return content; } #if GTEST_HAS_DEATH_TEST
+ show +
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
return *g_injected_test_argvs; } return GetArgvs(); } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-port.cc
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
} while (bytes_last_read > 0 && bytes_read < file_size); const std::string content(buffer, bytes_read); delete[] buffer; return content; } #if GTEST_HAS_DEATH_TEST
+ show +
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
static const ::std::vector<testing::internal::string>* g_injected_test_argvs = NULL; // Owned. void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) { if (g_injected_test_argvs != argvs) delete g_injected_test_argvs; g_injected_test_argvs = argvs; } const ::std::vector<testing::internal::string>& GetInjectableArgvs() { if (g_injected_test_argvs != NULL) {
+ show +
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
return *g_injected_test_argvs; } return GetArgvs(); } #endif // GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS_MOBILE namespace posix { void Abort() { DebugBreak();

[CVE-2020-0478_1.diff] gtest-internal-inl.h #23
- // Returns true iff the unit test passed (i.e. all test cases passed). + // Returns true if and only if the unit test passed (i.e. all test suites + // passed). - // Returns true iff the unit test failed (i.e. some test case failed - // or something outside of all tests failed). + // Returns true if and only if the unit test failed (i.e. some test suite + // failed or something outside of all tests failed). - return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); + return failed_test_suite_count() > 0 || ad_hoc_test_result()->Failed(); - // Gets the i-th test case among all the test cases. i can range from 0 to - // total_test_case_count() - 1. If i is not in that range, returns NULL. - const TestCase* GetTestCase(int i) const { - const int index = GetElementOr(test_case_indices_, i, -1); - return index < 0 ? NULL : test_cases_[i]; + // Gets the i-th test suite among all the test suites. i can range from 0 to + // total_test_suite_count() - 1. If i is not in that range, returns NULL. + const TestSuite *GetTestSuite(int i) const { + const int index = GetElementOr(test_suite_indices_, i, -1); + return index < 0 ? nullptr : test_suites_[static_cast<size_t>(i)]; - // Gets the i-th test case among all the test cases. i can range from 0 to - // total_test_case_count() - 1. If i is not in that range, returns NULL. - TestCase* GetMutableTestCase(int i) { - const int index = GetElementOr(test_case_indices_, i, -1); - return index < 0 ? NULL : test_cases_[index]; + // Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + const TestCase *GetTestCase(int i) const { return GetTestSuite(i); } +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + + // Gets the i-th test suite among all the test suites. i can range from 0 to + // total_test_suite_count() - 1. If i is not in that range, returns NULL. + TestSuite *GetMutableSuiteCase(int i) { + const int index = GetElementOr(test_suite_indices_, i, -1); + return index < 0 ? nullptr : test_suites_[static_cast<size_t>(index)]; - TestEventListeners* listeners() { return &listeners_; } + TestEventListeners *listeners() { return &listeners_; } - TestResult* current_test_result(); + TestResult *current_test_result(); - const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } + const TestResult *ad_hoc_test_result() const { return &ad_hoc_test_result_; } - void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); + void set_os_stack_trace_getter(OsStackTraceGetterInterface *getter); - OsStackTraceGetterInterface* os_stack_trace_getter(); + OsStackTraceGetterInterface *os_stack_trace_getter();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest-internal-inl.h
565
566
567
568
569
570
571
572
573
574
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
613
614
615
616
617
618
619
620
621
622
// Returns the current OS stack trace as an std::string. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
972
973
974
975
976
977
978
979
980
981
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
// Returns the current OS stack trace as an std::string. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-internal-inl.h
571
572
573
574
575
576
577
578
579
580
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
619
620
621
622
623
624
625
626
627
628
// Returns the current OS stack trace as an std::string. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-internal-inl.h
562
563
564
565
566
567
568
569
570
571
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
610
611
612
613
614
615
616
617
618
619
// Returns the current OS stack trace as an std::string. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
972
973
974
975
976
977
978
979
980
981
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
// Returns the current OS stack trace as an std::string. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-internal-inl.h
571
572
573
574
575
576
577
578
579
580
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
619
620
621
622
623
624
625
626
627
628
// Returns the current OS stack trace as an std::string. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
969
970
971
972
973
974
975
976
977
978
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
// Returns the current OS stack trace as an std::string. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/src/gtest-internal-inl.h
564
565
566
567
568
569
570
571
572
573
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
612
613
614
615
616
617
618
619
620
621
// Returns the current OS stack trace as a String. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-internal-inl.h
568
569
570
571
572
573
574
575
576
577
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
616
617
618
619
620
621
622
623
624
625
// Returns the current OS stack trace as an std::string. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/src/gtest-internal-inl.h
553
554
555
556
557
558
559
560
561
562
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
601
602
603
604
605
606
607
608
609
610
// Returns the current OS stack trace as a String. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-internal-inl.h
562
563
564
565
566
567
568
569
570
571
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
610
611
612
613
614
615
616
617
618
619
// Returns the current OS stack trace as an std::string. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/include/gtest/internal/gtest-internal-inl.h
550
551
552
553
554
555
556
557
558
559
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
598
599
600
601
602
603
604
605
606
607
// Returns the current OS stack trace as a String. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-internal-inl.h
562
563
564
565
566
567
568
569
570
571
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
610
611
612
613
614
615
616
617
618
619
// Returns the current OS stack trace as an std::string. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the

[CVE-2020-0478_1.diff] gtest-internal-inl.h #24
- // Finds and returns a TestCase with the given name. If one doesn't + // Finds and returns a TestSuite with the given name. If one doesn't - // test_case_name: name of the test case + // test_suite_name: name of the test suite - // set_up_tc: pointer to the function that sets up the test case - // tear_down_tc: pointer to the function that tears down the test case - TestCase* GetTestCase(const char* test_case_name, - const char* type_param, - Test::SetUpTestCaseFunc set_up_tc, - Test::TearDownTestCaseFunc tear_down_tc); + // set_up_tc: pointer to the function that sets up the test suite + // tear_down_tc: pointer to the function that tears down the test suite + TestSuite *GetTestSuite(const char *test_suite_name, const char *type_param, + internal::SetUpTestSuiteFunc set_up_tc, + internal::TearDownTestSuiteFunc tear_down_tc); + +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + TestCase *GetTestCase(const char *test_case_name, const char *type_param, + internal::SetUpTestSuiteFunc set_up_tc, + internal::TearDownTestSuiteFunc tear_down_tc) { + return GetTestSuite(test_case_name, type_param, set_up_tc, tear_down_tc); + } +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ - // set_up_tc: pointer to the function that sets up the test case - // tear_down_tc: pointer to the function that tears down the test case + // set_up_tc: pointer to the function that sets up the test suite + // tear_down_tc: pointer to the function that tears down the test suite - void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, - Test::TearDownTestCaseFunc tear_down_tc, - TestInfo* test_info) { + void AddTestInfo(internal::SetUpTestSuiteFunc set_up_tc, + internal::TearDownTestSuiteFunc tear_down_tc, + TestInfo *test_info) {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest-internal-inl.h
626
627
628
629
630
631
632
633
634
635
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
651
652
653
654
655
656
657
658
659
660
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-internal-inl.h
632
633
634
635
636
637
638
639
640
641
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
657
658
659
660
661
662
663
664
665
666
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-internal-inl.h
623
624
625
626
627
628
629
630
631
632
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
648
649
650
651
652
653
654
655
656
657
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-internal-inl.h
632
633
634
635
636
637
638
639
640
641
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
657
658
659
660
661
662
663
664
665
666
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/src/gtest-internal-inl.h
625
626
627
628
629
630
631
632
633
634
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
650
651
652
653
654
655
656
657
658
659
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-internal-inl.h
629
630
631
632
633
634
635
636
637
638
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
654
655
656
657
658
659
660
661
662
663
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/src/gtest-internal-inl.h
614
615
616
617
618
619
620
621
622
623
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
639
640
641
642
643
644
645
646
647
648
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-internal-inl.h
623
624
625
626
627
628
629
630
631
632
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
648
649
650
651
652
653
654
655
656
657
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/include/gtest/internal/gtest-internal-inl.h
611
612
613
614
615
616
617
618
619
620
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
636
637
638
639
640
641
642
643
644
645
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-internal-inl.h
623
624
625
626
627
628
629
630
631
632
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
648
649
650
651
652
653
654
655
656
657
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())

[CVE-2020-0478_1.diff] gtest-internal-inl.h #26
- ForEach(test_cases_, TestCase::ClearTestCaseResult); + ForEach(test_suites_, TestSuite::ClearTestSuiteResult); - void ClearAdHocTestResult() { - ad_hoc_test_result_.Clear(); - } + void ClearAdHocTestResult() { ad_hoc_test_result_.Clear(); } - // context of a test or a test case, or to the global property set. If the + // context of a test or a test suite, or to the global property set. If the - void RecordProperty(const TestProperty& test_property); + void RecordProperty(const TestProperty &test_property); - enum ReactionToSharding { - HONOR_SHARDING_PROTOCOL, - IGNORE_SHARDING_PROTOCOL - }; + enum ReactionToSharding { HONOR_SHARDING_PROTOCOL, IGNORE_SHARDING_PROTOCOL }; - // result in each TestCase and TestInfo object. + // result in each TestSuite and TestInfo object.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest-internal-inl.h
696
697
698
699
700
701
702
703
704
705
void RegisterParameterizedTests(); // Runs all tests in this UnitTest object, prints the result, and // returns true if all tests are successful. If any exception is // thrown during a test, this test is considered to be failed, but // the rest of the tests will still be run. bool RunAllTests(); // Clears the results of all tests, except the ad hoc tests. void ClearNonAdHocTestResult() {
+ show +
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
ForEach(test_cases_, TestCase::ClearTestCaseResult); } // Clears the results of ad-hoc test assertions. void ClearAdHocTestResult() { ad_hoc_test_result_.Clear(); } // Adds a TestProperty to the current TestResult object when invoked in a // context of a test or a test case, or to the global property set. If the // result already contains a property with the same key, the value will be // updated. void RecordProperty(const TestProperty& test_property); enum ReactionToSharding { HONOR_SHARDING_PROTOCOL, IGNORE_SHARDING_PROTOCOL };
+ show +
724
725
726
727
728
729
730
731
732
733
// Matches the full name of each test against the user-specified // filter to decide whether the test should run, then records the // result in each TestCase and TestInfo object. // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests // based on sharding variables in the environment. // Returns the number of tests that should run. int FilterTests(ReactionToSharding shard_tests); // Prints the names of the tests matching the user-specified filter flag.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
void RegisterParameterizedTests(); // Runs all tests in this UnitTest object, prints the result, and // returns true if all tests are successful. If any exception is // thrown during a test, this test is considered to be failed, but // the rest of the tests will still be run. bool RunAllTests(); // Clears the results of all tests, except the ad hoc tests. void ClearNonAdHocTestResult() {
+ show +
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
ForEach(test_cases_, TestCase::ClearTestCaseResult); } // Clears the results of ad-hoc test assertions. void ClearAdHocTestResult() { ad_hoc_test_result_.Clear(); } // Adds a TestProperty to the current TestResult object when invoked in a // context of a test or a test case, or to the global property set. If the // result already contains a property with the same key, the value will be // updated. void RecordProperty(const TestProperty& test_property); enum ReactionToSharding { HONOR_SHARDING_PROTOCOL, IGNORE_SHARDING_PROTOCOL };
+ show +
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
// Matches the full name of each test against the user-specified // filter to decide whether the test should run, then records the // result in each TestCase and TestInfo object. // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests // based on sharding variables in the environment. // Returns the number of tests that should run. int FilterTests(ReactionToSharding shard_tests); // Prints the names of the tests matching the user-specified filter flag.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-internal-inl.h
702
703
704
705
706
707
708
709
710
711
void RegisterParameterizedTests(); // Runs all tests in this UnitTest object, prints the result, and // returns true if all tests are successful. If any exception is // thrown during a test, this test is considered to be failed, but // the rest of the tests will still be run. bool RunAllTests(); // Clears the results of all tests, except the ad hoc tests. void ClearNonAdHocTestResult() {
+ show +
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
ForEach(test_cases_, TestCase::ClearTestCaseResult); } // Clears the results of ad-hoc test assertions. void ClearAdHocTestResult() { ad_hoc_test_result_.Clear(); } // Adds a TestProperty to the current TestResult object when invoked in a // context of a test or a test case, or to the global property set. If the // result already contains a property with the same key, the value will be // updated. void RecordProperty(const TestProperty& test_property); enum ReactionToSharding { HONOR_SHARDING_PROTOCOL, IGNORE_SHARDING_PROTOCOL };
+ show +
730
731
732
733
734
735
736
737
738
739
// Matches the full name of each test against the user-specified // filter to decide whether the test should run, then records the // result in each TestCase and TestInfo object. // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests // based on sharding variables in the environment. // Returns the number of tests that should run. int FilterTests(ReactionToSharding shard_tests); // Prints the names of the tests matching the user-specified filter flag.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-internal-inl.h
693
694
695
696
697
698
699
700
701
702
void RegisterParameterizedTests(); // Runs all tests in this UnitTest object, prints the result, and // returns true if all tests are successful. If any exception is // thrown during a test, this test is considered to be failed, but // the rest of the tests will still be run. bool RunAllTests(); // Clears the results of all tests, except the ad hoc tests. void ClearNonAdHocTestResult() {
+ show +
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
ForEach(test_cases_, TestCase::ClearTestCaseResult); } // Clears the results of ad-hoc test assertions. void ClearAdHocTestResult() { ad_hoc_test_result_.Clear(); } // Adds a TestProperty to the current TestResult object when invoked in a // context of a test or a test case, or to the global property set. If the // result already contains a property with the same key, the value will be // updated. void RecordProperty(const TestProperty& test_property); enum ReactionToSharding { HONOR_SHARDING_PROTOCOL, IGNORE_SHARDING_PROTOCOL };
+ show +
721
722
723
724
725
726
727
728
729
730
// Matches the full name of each test against the user-specified // filter to decide whether the test should run, then records the // result in each TestCase and TestInfo object. // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests // based on sharding variables in the environment. // Returns the number of tests that should run. int FilterTests(ReactionToSharding shard_tests); // Prints the names of the tests matching the user-specified filter flag.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
void RegisterParameterizedTests(); // Runs all tests in this UnitTest object, prints the result, and // returns true if all tests are successful. If any exception is // thrown during a test, this test is considered to be failed, but // the rest of the tests will still be run. bool RunAllTests(); // Clears the results of all tests, except the ad hoc tests. void ClearNonAdHocTestResult() {
+ show +
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
ForEach(test_cases_, TestCase::ClearTestCaseResult); } // Clears the results of ad-hoc test assertions. void ClearAdHocTestResult() { ad_hoc_test_result_.Clear(); } // Adds a TestProperty to the current TestResult object when invoked in a // context of a test or a test case, or to the global property set. If the // result already contains a property with the same key, the value will be // updated. void RecordProperty(const TestProperty& test_property); enum ReactionToSharding { HONOR_SHARDING_PROTOCOL, IGNORE_SHARDING_PROTOCOL };
+ show +
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
// Matches the full name of each test against the user-specified // filter to decide whether the test should run, then records the // result in each TestCase and TestInfo object. // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests // based on sharding variables in the environment. // Returns the number of tests that should run. int FilterTests(ReactionToSharding shard_tests); // Prints the names of the tests matching the user-specified filter flag.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-internal-inl.h
702
703
704
705
706
707
708
709
710
711
void RegisterParameterizedTests(); // Runs all tests in this UnitTest object, prints the result, and // returns true if all tests are successful. If any exception is // thrown during a test, this test is considered to be failed, but // the rest of the tests will still be run. bool RunAllTests(); // Clears the results of all tests, except the ad hoc tests. void ClearNonAdHocTestResult() {
+ show +
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
ForEach(test_cases_, TestCase::ClearTestCaseResult); } // Clears the results of ad-hoc test assertions. void ClearAdHocTestResult() { ad_hoc_test_result_.Clear(); } // Adds a TestProperty to the current TestResult object when invoked in a // context of a test or a test case, or to the global property set. If the // result already contains a property with the same key, the value will be // updated. void RecordProperty(const TestProperty& test_property); enum ReactionToSharding { HONOR_SHARDING_PROTOCOL, IGNORE_SHARDING_PROTOCOL };
+ show +
730
731
732
733
734
735
736
737
738
739
// Matches the full name of each test against the user-specified // filter to decide whether the test should run, then records the // result in each TestCase and TestInfo object. // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests // based on sharding variables in the environment. // Returns the number of tests that should run. int FilterTests(ReactionToSharding shard_tests); // Prints the names of the tests matching the user-specified filter flag.
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
void RegisterParameterizedTests(); // Runs all tests in this UnitTest object, prints the result, and // returns true if all tests are successful. If any exception is // thrown during a test, this test is considered to be failed, but // the rest of the tests will still be run. bool RunAllTests(); // Clears the results of all tests, except the ad hoc tests. void ClearNonAdHocTestResult() {
+ show +
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
ForEach(test_cases_, TestCase::ClearTestCaseResult); } // Clears the results of ad-hoc test assertions. void ClearAdHocTestResult() { ad_hoc_test_result_.Clear(); } // Adds a TestProperty to the current TestResult object when invoked in a // context of a test or a test case, or to the global property set. If the // result already contains a property with the same key, the value will be // updated. void RecordProperty(const TestProperty& test_property); enum ReactionToSharding { HONOR_SHARDING_PROTOCOL, IGNORE_SHARDING_PROTOCOL };
+ show +
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
// Matches the full name of each test against the user-specified // filter to decide whether the test should run, then records the // result in each TestCase and TestInfo object. // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests // based on sharding variables in the environment. // Returns the number of tests that should run. int FilterTests(ReactionToSharding shard_tests); // Prints the names of the tests matching the user-specified filter flag.
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-internal-inl.h
697
698
699
700
701
702
703
704
705
706
void RegisterParameterizedTests(); // Runs all tests in this UnitTest object, prints the result, and // returns true if all tests are successful. If any exception is // thrown during a test, this test is considered to be failed, but // the rest of the tests will still be run. bool RunAllTests(); // Clears the results of all tests, except the ad hoc tests. void ClearNonAdHocTestResult() {
+ show +
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
ForEach(test_cases_, TestCase::ClearTestCaseResult); } // Clears the results of ad-hoc test assertions. void ClearAdHocTestResult() { ad_hoc_test_result_.Clear(); } // Adds a TestProperty to the current TestResult object when invoked in a // context of a test or a test case, or to the global property set. If the // result already contains a property with the same key, the value will be // updated. void RecordProperty(const TestProperty& test_property); enum ReactionToSharding { HONOR_SHARDING_PROTOCOL, IGNORE_SHARDING_PROTOCOL };
+ show +
725
726
727
728
729
730
731
732
733
734
// Matches the full name of each test against the user-specified // filter to decide whether the test should run, then records the // result in each TestCase and TestInfo object. // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests // based on sharding variables in the environment. // Returns the number of tests that should run. int FilterTests(ReactionToSharding shard_tests); // Prints the names of the tests matching the user-specified filter flag.
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-internal-inl.h
693
694
695
696
697
698
699
700
701
702
void RegisterParameterizedTests(); // Runs all tests in this UnitTest object, prints the result, and // returns true if all tests are successful. If any exception is // thrown during a test, this test is considered to be failed, but // the rest of the tests will still be run. bool RunAllTests(); // Clears the results of all tests, except the ad hoc tests. void ClearNonAdHocTestResult() {
+ show +
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
ForEach(test_cases_, TestCase::ClearTestCaseResult); } // Clears the results of ad-hoc test assertions. void ClearAdHocTestResult() { ad_hoc_test_result_.Clear(); } // Adds a TestProperty to the current TestResult object when invoked in a // context of a test or a test case, or to the global property set. If the // result already contains a property with the same key, the value will be // updated. void RecordProperty(const TestProperty& test_property); enum ReactionToSharding { HONOR_SHARDING_PROTOCOL, IGNORE_SHARDING_PROTOCOL };
+ show +
721
722
723
724
725
726
727
728
729
730
// Matches the full name of each test against the user-specified // filter to decide whether the test should run, then records the // result in each TestCase and TestInfo object. // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests // based on sharding variables in the environment. // Returns the number of tests that should run. int FilterTests(ReactionToSharding shard_tests); // Prints the names of the tests matching the user-specified filter flag.
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-internal-inl.h
693
694
695
696
697
698
699
700
701
702
void RegisterParameterizedTests(); // Runs all tests in this UnitTest object, prints the result, and // returns true if all tests are successful. If any exception is // thrown during a test, this test is considered to be failed, but // the rest of the tests will still be run. bool RunAllTests(); // Clears the results of all tests, except the ad hoc tests. void ClearNonAdHocTestResult() {
+ show +
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
ForEach(test_cases_, TestCase::ClearTestCaseResult); } // Clears the results of ad-hoc test assertions. void ClearAdHocTestResult() { ad_hoc_test_result_.Clear(); } // Adds a TestProperty to the current TestResult object when invoked in a // context of a test or a test case, or to the global property set. If the // result already contains a property with the same key, the value will be // updated. void RecordProperty(const TestProperty& test_property); enum ReactionToSharding { HONOR_SHARDING_PROTOCOL, IGNORE_SHARDING_PROTOCOL };
+ show +
721
722
723
724
725
726
727
728
729
730
// Matches the full name of each test against the user-specified // filter to decide whether the test should run, then records the // result in each TestCase and TestInfo object. // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests // based on sharding variables in the environment. // Returns the number of tests that should run. int FilterTests(ReactionToSharding shard_tests); // Prints the names of the tests matching the user-specified filter flag.

[CVE-2020-0478_1.diff] gtest-internal-inl.h #38
- char* end; + char *end; + using BiggestConvertible = unsigned long long; // NOLINT -# if GTEST_OS_WINDOWS && !defined(__GNUC__) - - // MSVC and C++ Builder define __int64 instead of the standard long long. - typedef unsigned __int64 BiggestConvertible; - const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); - -# else - - typedef unsigned long long BiggestConvertible; // NOLINT - const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); - -# endif // GTEST_OS_WINDOWS && !defined(__GNUC__) - + const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); // NOLINT - // TODO(vladl@google.com): Convert this to compile time assertion when it is - // available.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest-internal-inl.h
995
996
997
998
999
1000
1001
1002
1003
1004
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-internal-inl.h
975
976
977
978
979
980
981
982
983
984
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-internal-inl.h
966
967
968
969
970
971
972
973
974
975
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
992
993
994
995
996
997
998
999
1000
1001
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-internal-inl.h
975
976
977
978
979
980
981
982
983
984
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest-internal-inl.h
984
985
986
987
988
989
990
991
992
993
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
const bool parse_success = *end == '\0' && errno == 0; GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result; return true; }
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/src/gtest-internal-inl.h
988
989
990
991
992
993
994
995
996
997
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-internal-inl.h
968
969
970
971
972
973
974
975
976
977
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
994
995
996
997
998
999
1000
1001
1002
1003
const bool parse_success = *end == '\0' && errno == 0; // FIXME: Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/src/gtest-internal-inl.h
973
974
975
976
977
978
979
980
981
982
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-internal-inl.h
966
967
968
969
970
971
972
973
974
975
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
992
993
994
995
996
997
998
999
1000
1001
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/include/gtest/internal/gtest-internal-inl.h
970
971
972
973
974
975
976
977
978
979
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
996
997
998
999
1000
1001
1002
1003
1004
1005
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-internal-inl.h
966
967
968
969
970
971
972
973
974
975
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
992
993
994
995
996
997
998
999
1000
1001
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;

[CVE-2020-0470_1.diff] gtest-internal-inl.h #23
- // Returns true iff the unit test passed (i.e. all test cases passed). + // Returns true if and only if the unit test passed (i.e. all test suites + // passed). - // Returns true iff the unit test failed (i.e. some test case failed - // or something outside of all tests failed). + // Returns true if and only if the unit test failed (i.e. some test suite + // failed or something outside of all tests failed). - return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); + return failed_test_suite_count() > 0 || ad_hoc_test_result()->Failed(); - // Gets the i-th test case among all the test cases. i can range from 0 to - // total_test_case_count() - 1. If i is not in that range, returns NULL. - const TestCase* GetTestCase(int i) const { - const int index = GetElementOr(test_case_indices_, i, -1); - return index < 0 ? NULL : test_cases_[i]; + // Gets the i-th test suite among all the test suites. i can range from 0 to + // total_test_suite_count() - 1. If i is not in that range, returns NULL. + const TestSuite *GetTestSuite(int i) const { + const int index = GetElementOr(test_suite_indices_, i, -1); + return index < 0 ? nullptr : test_suites_[static_cast<size_t>(i)]; - // Gets the i-th test case among all the test cases. i can range from 0 to - // total_test_case_count() - 1. If i is not in that range, returns NULL. - TestCase* GetMutableTestCase(int i) { - const int index = GetElementOr(test_case_indices_, i, -1); - return index < 0 ? NULL : test_cases_[index]; + // Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + const TestCase *GetTestCase(int i) const { return GetTestSuite(i); } +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + + // Gets the i-th test suite among all the test suites. i can range from 0 to + // total_test_suite_count() - 1. If i is not in that range, returns NULL. + TestSuite *GetMutableSuiteCase(int i) { + const int index = GetElementOr(test_suite_indices_, i, -1); + return index < 0 ? nullptr : test_suites_[static_cast<size_t>(index)]; - TestEventListeners* listeners() { return &listeners_; } + TestEventListeners *listeners() { return &listeners_; } - TestResult* current_test_result(); + TestResult *current_test_result(); - const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } + const TestResult *ad_hoc_test_result() const { return &ad_hoc_test_result_; } - void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); + void set_os_stack_trace_getter(OsStackTraceGetterInterface *getter); - OsStackTraceGetterInterface* os_stack_trace_getter(); + OsStackTraceGetterInterface *os_stack_trace_getter();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest-internal-inl.h
565
566
567
568
569
570
571
572
573
574
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
613
614
615
616
617
618
619
620
621
622
// Returns the current OS stack trace as an std::string. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
972
973
974
975
976
977
978
979
980
981
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
// Returns the current OS stack trace as an std::string. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-internal-inl.h
571
572
573
574
575
576
577
578
579
580
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
619
620
621
622
623
624
625
626
627
628
// Returns the current OS stack trace as an std::string. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-internal-inl.h
562
563
564
565
566
567
568
569
570
571
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
610
611
612
613
614
615
616
617
618
619
// Returns the current OS stack trace as an std::string. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
972
973
974
975
976
977
978
979
980
981
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
// Returns the current OS stack trace as an std::string. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-internal-inl.h
571
572
573
574
575
576
577
578
579
580
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
619
620
621
622
623
624
625
626
627
628
// Returns the current OS stack trace as an std::string. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
969
970
971
972
973
974
975
976
977
978
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
// Returns the current OS stack trace as an std::string. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/src/gtest-internal-inl.h
564
565
566
567
568
569
570
571
572
573
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
612
613
614
615
616
617
618
619
620
621
// Returns the current OS stack trace as a String. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-internal-inl.h
568
569
570
571
572
573
574
575
576
577
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
616
617
618
619
620
621
622
623
624
625
// Returns the current OS stack trace as an std::string. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/src/gtest-internal-inl.h
553
554
555
556
557
558
559
560
561
562
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
601
602
603
604
605
606
607
608
609
610
// Returns the current OS stack trace as a String. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-internal-inl.h
562
563
564
565
566
567
568
569
570
571
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
610
611
612
613
614
615
616
617
618
619
// Returns the current OS stack trace as an std::string. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/include/gtest/internal/gtest-internal-inl.h
550
551
552
553
554
555
556
557
558
559
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
598
599
600
601
602
603
604
605
606
607
// Returns the current OS stack trace as a String. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-internal-inl.h
562
563
564
565
566
567
568
569
570
571
// Gets the elapsed time, in milliseconds. TimeInMillis elapsed_time() const { return elapsed_time_; } // Returns true iff the unit test passed (i.e. all test cases passed). bool Passed() const { return !Failed(); } // Returns true iff the unit test failed (i.e. some test case failed // or something outside of all tests failed). bool Failed() const {
+ show +
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); return index < 0 ? NULL : test_cases_[index]; } // Provides access to the event listener list. TestEventListeners* listeners() { return &listeners_; } // Returns the TestResult for the test that's currently running, or // the TestResult for the ad hoc test if no test is running. TestResult* current_test_result(); // Returns the TestResult for the ad hoc test. const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } // Sets the OS stack trace getter. // // Does nothing if the input and the current OS stack trace getter // are the same; otherwise, deletes the old getter and makes the // input the current getter. void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); // Returns the current OS stack trace getter if it is not NULL; // otherwise, creates an OsStackTraceGetter, makes it the current // getter, and returns it. OsStackTraceGetterInterface* os_stack_trace_getter();
+ show +
610
611
612
613
614
615
616
617
618
619
// Returns the current OS stack trace as an std::string. // // The maximum number of stack frames to be included is specified by // the gtest_stack_trace_depth flag. The skip_count parameter // specifies the number of top frames to be skipped, which doesn't // count against the number of frames to be included. // // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the

[CVE-2020-0470_1.diff] gtest-internal-inl.h #24
- // Finds and returns a TestCase with the given name. If one doesn't + // Finds and returns a TestSuite with the given name. If one doesn't - // test_case_name: name of the test case + // test_suite_name: name of the test suite - // set_up_tc: pointer to the function that sets up the test case - // tear_down_tc: pointer to the function that tears down the test case - TestCase* GetTestCase(const char* test_case_name, - const char* type_param, - Test::SetUpTestCaseFunc set_up_tc, - Test::TearDownTestCaseFunc tear_down_tc); + // set_up_tc: pointer to the function that sets up the test suite + // tear_down_tc: pointer to the function that tears down the test suite + TestSuite *GetTestSuite(const char *test_suite_name, const char *type_param, + internal::SetUpTestSuiteFunc set_up_tc, + internal::TearDownTestSuiteFunc tear_down_tc); + +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + TestCase *GetTestCase(const char *test_case_name, const char *type_param, + internal::SetUpTestSuiteFunc set_up_tc, + internal::TearDownTestSuiteFunc tear_down_tc) { + return GetTestSuite(test_case_name, type_param, set_up_tc, tear_down_tc); + } +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ - // set_up_tc: pointer to the function that sets up the test case - // tear_down_tc: pointer to the function that tears down the test case + // set_up_tc: pointer to the function that sets up the test suite + // tear_down_tc: pointer to the function that tears down the test suite - void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, - Test::TearDownTestCaseFunc tear_down_tc, - TestInfo* test_info) { + void AddTestInfo(internal::SetUpTestSuiteFunc set_up_tc, + internal::TearDownTestSuiteFunc tear_down_tc, + TestInfo *test_info) {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest-internal-inl.h
626
627
628
629
630
631
632
633
634
635
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
651
652
653
654
655
656
657
658
659
660
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-internal-inl.h
632
633
634
635
636
637
638
639
640
641
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
657
658
659
660
661
662
663
664
665
666
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-internal-inl.h
623
624
625
626
627
628
629
630
631
632
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
648
649
650
651
652
653
654
655
656
657
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-internal-inl.h
632
633
634
635
636
637
638
639
640
641
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
657
658
659
660
661
662
663
664
665
666
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/src/gtest-internal-inl.h
625
626
627
628
629
630
631
632
633
634
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
650
651
652
653
654
655
656
657
658
659
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-internal-inl.h
629
630
631
632
633
634
635
636
637
638
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
654
655
656
657
658
659
660
661
662
663
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/src/gtest-internal-inl.h
614
615
616
617
618
619
620
621
622
623
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
639
640
641
642
643
644
645
646
647
648
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-internal-inl.h
623
624
625
626
627
628
629
630
631
632
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
648
649
650
651
652
653
654
655
656
657
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/include/gtest/internal/gtest-internal-inl.h
611
612
613
614
615
616
617
618
619
620
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
636
637
638
639
640
641
642
643
644
645
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-internal-inl.h
623
624
625
626
627
628
629
630
631
632
// Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. // // Arguments: // // test_case_name: name of the test case // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case
+ show +
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
TestCase* GetTestCase(const char* test_case_name, const char* type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); // Adds a TestInfo to the unit test. // // Arguments: // // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case // test_info: the TestInfo object void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo* test_info) {
+ show +
648
649
650
651
652
653
654
655
656
657
// In order to support thread-safe death tests, we need to // remember the original working directory when the test program // was first invoked. We cannot do this in RUN_ALL_TESTS(), as // the user may have changed the current directory before calling // RUN_ALL_TESTS(). Therefore we capture the current directory in // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { original_working_dir_.Set(FilePath::GetCurrentDir()); GTEST_CHECK_(!original_working_dir_.IsEmpty())

[CVE-2020-0470_1.diff] gtest-internal-inl.h #26
- ForEach(test_cases_, TestCase::ClearTestCaseResult); + ForEach(test_suites_, TestSuite::ClearTestSuiteResult); - void ClearAdHocTestResult() { - ad_hoc_test_result_.Clear(); - } + void ClearAdHocTestResult() { ad_hoc_test_result_.Clear(); } - // context of a test or a test case, or to the global property set. If the + // context of a test or a test suite, or to the global property set. If the - void RecordProperty(const TestProperty& test_property); + void RecordProperty(const TestProperty &test_property); - enum ReactionToSharding { - HONOR_SHARDING_PROTOCOL, - IGNORE_SHARDING_PROTOCOL - }; + enum ReactionToSharding { HONOR_SHARDING_PROTOCOL, IGNORE_SHARDING_PROTOCOL }; - // result in each TestCase and TestInfo object. + // result in each TestSuite and TestInfo object.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest-internal-inl.h
696
697
698
699
700
701
702
703
704
705
void RegisterParameterizedTests(); // Runs all tests in this UnitTest object, prints the result, and // returns true if all tests are successful. If any exception is // thrown during a test, this test is considered to be failed, but // the rest of the tests will still be run. bool RunAllTests(); // Clears the results of all tests, except the ad hoc tests. void ClearNonAdHocTestResult() {
+ show +
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
ForEach(test_cases_, TestCase::ClearTestCaseResult); } // Clears the results of ad-hoc test assertions. void ClearAdHocTestResult() { ad_hoc_test_result_.Clear(); } // Adds a TestProperty to the current TestResult object when invoked in a // context of a test or a test case, or to the global property set. If the // result already contains a property with the same key, the value will be // updated. void RecordProperty(const TestProperty& test_property); enum ReactionToSharding { HONOR_SHARDING_PROTOCOL, IGNORE_SHARDING_PROTOCOL };
+ show +
724
725
726
727
728
729
730
731
732
733
// Matches the full name of each test against the user-specified // filter to decide whether the test should run, then records the // result in each TestCase and TestInfo object. // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests // based on sharding variables in the environment. // Returns the number of tests that should run. int FilterTests(ReactionToSharding shard_tests); // Prints the names of the tests matching the user-specified filter flag.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
void RegisterParameterizedTests(); // Runs all tests in this UnitTest object, prints the result, and // returns true if all tests are successful. If any exception is // thrown during a test, this test is considered to be failed, but // the rest of the tests will still be run. bool RunAllTests(); // Clears the results of all tests, except the ad hoc tests. void ClearNonAdHocTestResult() {
+ show +
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
ForEach(test_cases_, TestCase::ClearTestCaseResult); } // Clears the results of ad-hoc test assertions. void ClearAdHocTestResult() { ad_hoc_test_result_.Clear(); } // Adds a TestProperty to the current TestResult object when invoked in a // context of a test or a test case, or to the global property set. If the // result already contains a property with the same key, the value will be // updated. void RecordProperty(const TestProperty& test_property); enum ReactionToSharding { HONOR_SHARDING_PROTOCOL, IGNORE_SHARDING_PROTOCOL };
+ show +
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
// Matches the full name of each test against the user-specified // filter to decide whether the test should run, then records the // result in each TestCase and TestInfo object. // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests // based on sharding variables in the environment. // Returns the number of tests that should run. int FilterTests(ReactionToSharding shard_tests); // Prints the names of the tests matching the user-specified filter flag.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-internal-inl.h
702
703
704
705
706
707
708
709
710
711
void RegisterParameterizedTests(); // Runs all tests in this UnitTest object, prints the result, and // returns true if all tests are successful. If any exception is // thrown during a test, this test is considered to be failed, but // the rest of the tests will still be run. bool RunAllTests(); // Clears the results of all tests, except the ad hoc tests. void ClearNonAdHocTestResult() {
+ show +
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
ForEach(test_cases_, TestCase::ClearTestCaseResult); } // Clears the results of ad-hoc test assertions. void ClearAdHocTestResult() { ad_hoc_test_result_.Clear(); } // Adds a TestProperty to the current TestResult object when invoked in a // context of a test or a test case, or to the global property set. If the // result already contains a property with the same key, the value will be // updated. void RecordProperty(const TestProperty& test_property); enum ReactionToSharding { HONOR_SHARDING_PROTOCOL, IGNORE_SHARDING_PROTOCOL };
+ show +
730
731
732
733
734
735
736
737
738
739
// Matches the full name of each test against the user-specified // filter to decide whether the test should run, then records the // result in each TestCase and TestInfo object. // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests // based on sharding variables in the environment. // Returns the number of tests that should run. int FilterTests(ReactionToSharding shard_tests); // Prints the names of the tests matching the user-specified filter flag.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-internal-inl.h
693
694
695
696
697
698
699
700
701
702
void RegisterParameterizedTests(); // Runs all tests in this UnitTest object, prints the result, and // returns true if all tests are successful. If any exception is // thrown during a test, this test is considered to be failed, but // the rest of the tests will still be run. bool RunAllTests(); // Clears the results of all tests, except the ad hoc tests. void ClearNonAdHocTestResult() {
+ show +
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
ForEach(test_cases_, TestCase::ClearTestCaseResult); } // Clears the results of ad-hoc test assertions. void ClearAdHocTestResult() { ad_hoc_test_result_.Clear(); } // Adds a TestProperty to the current TestResult object when invoked in a // context of a test or a test case, or to the global property set. If the // result already contains a property with the same key, the value will be // updated. void RecordProperty(const TestProperty& test_property); enum ReactionToSharding { HONOR_SHARDING_PROTOCOL, IGNORE_SHARDING_PROTOCOL };
+ show +
721
722
723
724
725
726
727
728
729
730
// Matches the full name of each test against the user-specified // filter to decide whether the test should run, then records the // result in each TestCase and TestInfo object. // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests // based on sharding variables in the environment. // Returns the number of tests that should run. int FilterTests(ReactionToSharding shard_tests); // Prints the names of the tests matching the user-specified filter flag.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
void RegisterParameterizedTests(); // Runs all tests in this UnitTest object, prints the result, and // returns true if all tests are successful. If any exception is // thrown during a test, this test is considered to be failed, but // the rest of the tests will still be run. bool RunAllTests(); // Clears the results of all tests, except the ad hoc tests. void ClearNonAdHocTestResult() {
+ show +
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
ForEach(test_cases_, TestCase::ClearTestCaseResult); } // Clears the results of ad-hoc test assertions. void ClearAdHocTestResult() { ad_hoc_test_result_.Clear(); } // Adds a TestProperty to the current TestResult object when invoked in a // context of a test or a test case, or to the global property set. If the // result already contains a property with the same key, the value will be // updated. void RecordProperty(const TestProperty& test_property); enum ReactionToSharding { HONOR_SHARDING_PROTOCOL, IGNORE_SHARDING_PROTOCOL };
+ show +
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
// Matches the full name of each test against the user-specified // filter to decide whether the test should run, then records the // result in each TestCase and TestInfo object. // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests // based on sharding variables in the environment. // Returns the number of tests that should run. int FilterTests(ReactionToSharding shard_tests); // Prints the names of the tests matching the user-specified filter flag.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-internal-inl.h
702
703
704
705
706
707
708
709
710
711
void RegisterParameterizedTests(); // Runs all tests in this UnitTest object, prints the result, and // returns true if all tests are successful. If any exception is // thrown during a test, this test is considered to be failed, but // the rest of the tests will still be run. bool RunAllTests(); // Clears the results of all tests, except the ad hoc tests. void ClearNonAdHocTestResult() {
+ show +
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
ForEach(test_cases_, TestCase::ClearTestCaseResult); } // Clears the results of ad-hoc test assertions. void ClearAdHocTestResult() { ad_hoc_test_result_.Clear(); } // Adds a TestProperty to the current TestResult object when invoked in a // context of a test or a test case, or to the global property set. If the // result already contains a property with the same key, the value will be // updated. void RecordProperty(const TestProperty& test_property); enum ReactionToSharding { HONOR_SHARDING_PROTOCOL, IGNORE_SHARDING_PROTOCOL };
+ show +
730
731
732
733
734
735
736
737
738
739
// Matches the full name of each test against the user-specified // filter to decide whether the test should run, then records the // result in each TestCase and TestInfo object. // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests // based on sharding variables in the environment. // Returns the number of tests that should run. int FilterTests(ReactionToSharding shard_tests); // Prints the names of the tests matching the user-specified filter flag.
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
void RegisterParameterizedTests(); // Runs all tests in this UnitTest object, prints the result, and // returns true if all tests are successful. If any exception is // thrown during a test, this test is considered to be failed, but // the rest of the tests will still be run. bool RunAllTests(); // Clears the results of all tests, except the ad hoc tests. void ClearNonAdHocTestResult() {
+ show +
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
ForEach(test_cases_, TestCase::ClearTestCaseResult); } // Clears the results of ad-hoc test assertions. void ClearAdHocTestResult() { ad_hoc_test_result_.Clear(); } // Adds a TestProperty to the current TestResult object when invoked in a // context of a test or a test case, or to the global property set. If the // result already contains a property with the same key, the value will be // updated. void RecordProperty(const TestProperty& test_property); enum ReactionToSharding { HONOR_SHARDING_PROTOCOL, IGNORE_SHARDING_PROTOCOL };
+ show +
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
// Matches the full name of each test against the user-specified // filter to decide whether the test should run, then records the // result in each TestCase and TestInfo object. // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests // based on sharding variables in the environment. // Returns the number of tests that should run. int FilterTests(ReactionToSharding shard_tests); // Prints the names of the tests matching the user-specified filter flag.
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-internal-inl.h
697
698
699
700
701
702
703
704
705
706
void RegisterParameterizedTests(); // Runs all tests in this UnitTest object, prints the result, and // returns true if all tests are successful. If any exception is // thrown during a test, this test is considered to be failed, but // the rest of the tests will still be run. bool RunAllTests(); // Clears the results of all tests, except the ad hoc tests. void ClearNonAdHocTestResult() {
+ show +
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
ForEach(test_cases_, TestCase::ClearTestCaseResult); } // Clears the results of ad-hoc test assertions. void ClearAdHocTestResult() { ad_hoc_test_result_.Clear(); } // Adds a TestProperty to the current TestResult object when invoked in a // context of a test or a test case, or to the global property set. If the // result already contains a property with the same key, the value will be // updated. void RecordProperty(const TestProperty& test_property); enum ReactionToSharding { HONOR_SHARDING_PROTOCOL, IGNORE_SHARDING_PROTOCOL };
+ show +
725
726
727
728
729
730
731
732
733
734
// Matches the full name of each test against the user-specified // filter to decide whether the test should run, then records the // result in each TestCase and TestInfo object. // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests // based on sharding variables in the environment. // Returns the number of tests that should run. int FilterTests(ReactionToSharding shard_tests); // Prints the names of the tests matching the user-specified filter flag.
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-internal-inl.h
693
694
695
696
697
698
699
700
701
702
void RegisterParameterizedTests(); // Runs all tests in this UnitTest object, prints the result, and // returns true if all tests are successful. If any exception is // thrown during a test, this test is considered to be failed, but // the rest of the tests will still be run. bool RunAllTests(); // Clears the results of all tests, except the ad hoc tests. void ClearNonAdHocTestResult() {
+ show +
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
ForEach(test_cases_, TestCase::ClearTestCaseResult); } // Clears the results of ad-hoc test assertions. void ClearAdHocTestResult() { ad_hoc_test_result_.Clear(); } // Adds a TestProperty to the current TestResult object when invoked in a // context of a test or a test case, or to the global property set. If the // result already contains a property with the same key, the value will be // updated. void RecordProperty(const TestProperty& test_property); enum ReactionToSharding { HONOR_SHARDING_PROTOCOL, IGNORE_SHARDING_PROTOCOL };
+ show +
721
722
723
724
725
726
727
728
729
730
// Matches the full name of each test against the user-specified // filter to decide whether the test should run, then records the // result in each TestCase and TestInfo object. // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests // based on sharding variables in the environment. // Returns the number of tests that should run. int FilterTests(ReactionToSharding shard_tests); // Prints the names of the tests matching the user-specified filter flag.
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-internal-inl.h
693
694
695
696
697
698
699
700
701
702
void RegisterParameterizedTests(); // Runs all tests in this UnitTest object, prints the result, and // returns true if all tests are successful. If any exception is // thrown during a test, this test is considered to be failed, but // the rest of the tests will still be run. bool RunAllTests(); // Clears the results of all tests, except the ad hoc tests. void ClearNonAdHocTestResult() {
+ show +
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
ForEach(test_cases_, TestCase::ClearTestCaseResult); } // Clears the results of ad-hoc test assertions. void ClearAdHocTestResult() { ad_hoc_test_result_.Clear(); } // Adds a TestProperty to the current TestResult object when invoked in a // context of a test or a test case, or to the global property set. If the // result already contains a property with the same key, the value will be // updated. void RecordProperty(const TestProperty& test_property); enum ReactionToSharding { HONOR_SHARDING_PROTOCOL, IGNORE_SHARDING_PROTOCOL };
+ show +
721
722
723
724
725
726
727
728
729
730
// Matches the full name of each test against the user-specified // filter to decide whether the test should run, then records the // result in each TestCase and TestInfo object. // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests // based on sharding variables in the environment. // Returns the number of tests that should run. int FilterTests(ReactionToSharding shard_tests); // Prints the names of the tests matching the user-specified filter flag.

[CVE-2020-0470_1.diff] gtest-internal-inl.h #38
- char* end; + char *end; + using BiggestConvertible = unsigned long long; // NOLINT -# if GTEST_OS_WINDOWS && !defined(__GNUC__) - - // MSVC and C++ Builder define __int64 instead of the standard long long. - typedef unsigned __int64 BiggestConvertible; - const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); - -# else - - typedef unsigned long long BiggestConvertible; // NOLINT - const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); - -# endif // GTEST_OS_WINDOWS && !defined(__GNUC__) - + const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); // NOLINT - // TODO(vladl@google.com): Convert this to compile time assertion when it is - // available.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest-internal-inl.h
995
996
997
998
999
1000
1001
1002
1003
1004
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-internal-inl.h
975
976
977
978
979
980
981
982
983
984
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-internal-inl.h
966
967
968
969
970
971
972
973
974
975
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
992
993
994
995
996
997
998
999
1000
1001
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-internal-inl.h
975
976
977
978
979
980
981
982
983
984
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest-internal-inl.h
984
985
986
987
988
989
990
991
992
993
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
const bool parse_success = *end == '\0' && errno == 0; GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result; return true; }
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/src/gtest-internal-inl.h
988
989
990
991
992
993
994
995
996
997
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-internal-inl.h
968
969
970
971
972
973
974
975
976
977
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
994
995
996
997
998
999
1000
1001
1002
1003
const bool parse_success = *end == '\0' && errno == 0; // FIXME: Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/src/gtest-internal-inl.h
973
974
975
976
977
978
979
980
981
982
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-internal-inl.h
966
967
968
969
970
971
972
973
974
975
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
992
993
994
995
996
997
998
999
1000
1001
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/include/gtest/internal/gtest-internal-inl.h
970
971
972
973
974
975
976
977
978
979
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
996
997
998
999
1000
1001
1002
1003
1004
1005
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-internal-inl.h
966
967
968
969
970
971
972
973
974
975
template <typename Integer> bool ParseNaturalNumber(const ::std::string& str, Integer* number) { // Fail fast if the given string does not begin with a digit; // this bypasses strtoXXX's "optional leading whitespace and plus // or minus sign" semantics, which are undesirable here. if (str.empty() || !IsDigit(str[0])) { return false; } errno = 0;
+ show +
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
char* end; // BiggestConvertible is the largest integer type that system-provided // string-to-number conversion routines can return. # if GTEST_OS_WINDOWS && !defined(__GNUC__) // MSVC and C++ Builder define __int64 instead of the standard long long. typedef unsigned __int64 BiggestConvertible; const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); # else typedef unsigned long long BiggestConvertible; // NOLINT const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
+ show +
992
993
994
995
996
997
998
999
1000
1001
const bool parse_success = *end == '\0' && errno == 0; // TODO(vladl@google.com): Convert this to compile time assertion when it is // available. GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); const Integer result = static_cast<Integer>(parsed); if (parse_success && static_cast<BiggestConvertible>(result) == parsed) { *number = result;

[CVE-2020-0478_1.diff] gtest-death-test.cc #12
-# define GTEST_DEATH_TEST_CHECK_(expression) \ - do { \ - if (!::testing::internal::IsTrue(expression)) { \ - DeathTestAbort( \ - ::std::string("CHECK failed: File ") + __FILE__ + ", line " \ - + ::testing::internal::StreamableToString(__LINE__) + ": " \ - + #expression); \ - } \ +#define GTEST_DEATH_TEST_CHECK_(expression) \ + do { \ + if (!::testing::internal::IsTrue(expression)) { \ + DeathTestAbort(::std::string("CHECK failed: File ") + __FILE__ + \ + ", line " + \ + ::testing::internal::StreamableToString(__LINE__) + \ + ": " + #expression); \ + } \
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest-death-test.cc
262
263
264
265
266
267
268
269
270
271
_exit(1); } else { fprintf(stderr, "%s", message.c_str()); fflush(stderr); posix::Abort(); } } // A replacement for CHECK that calls DeathTestAbort if the assertion // fails.
+ show +
272
273
274
275
276
277
278
279
# define GTEST_DEATH_TEST_CHECK_(expression) \ do { \ if (!::testing::internal::IsTrue(expression)) { \ DeathTestAbort( \ ::std::string("CHECK failed: File ") + __FILE__ + ", line " \ + ::testing::internal::StreamableToString(__LINE__) + ": " \ + #expression); \ } \
+ show +
280
281
282
283
284
285
286
287
288
289
} while (::testing::internal::AlwaysFalse()) // This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for // evaluating any system call that fulfills two conditions: it must return // -1 on failure, and set errno to EINTR when it is interrupted and // should be tried again. The macro expands to a loop that repeatedly // evaluates the expression as long as it evaluates to -1 and sets // errno to EINTR. If the expression evaluates to -1 but errno is // something other than EINTR, DeathTestAbort is called. # define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
_exit(1); } else { fprintf(stderr, "%s", message.c_str()); fflush(stderr); posix::Abort(); } } // A replacement for CHECK that calls DeathTestAbort if the assertion // fails.
+ show +
6766
6767
6768
6769
6770
6771
6772
6773
# define GTEST_DEATH_TEST_CHECK_(expression) \ do { \ if (!::testing::internal::IsTrue(expression)) { \ DeathTestAbort( \ ::std::string("CHECK failed: File ") + __FILE__ + ", line " \ + ::testing::internal::StreamableToString(__LINE__) + ": " \ + #expression); \ } \
+ show +
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
} while (::testing::internal::AlwaysFalse()) // This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for // evaluating any system call that fulfills two conditions: it must return // -1 on failure, and set errno to EINTR when it is interrupted and // should be tried again. The macro expands to a loop that repeatedly // evaluates the expression as long as it evaluates to -1 and sets // errno to EINTR. If the expression evaluates to -1 but errno is // something other than EINTR, DeathTestAbort is called. # define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-death-test.cc
273
274
275
276
277
278
279
280
281
282
_exit(1); } else { fprintf(stderr, "%s", message.c_str()); fflush(stderr); posix::Abort(); } } // A replacement for CHECK that calls DeathTestAbort if the assertion // fails.
+ show +
283
284
285
286
287
288
289
290
# define GTEST_DEATH_TEST_CHECK_(expression) \ do { \ if (!::testing::internal::IsTrue(expression)) { \ DeathTestAbort( \ ::std::string("CHECK failed: File ") + __FILE__ + ", line " \ + ::testing::internal::StreamableToString(__LINE__) + ": " \ + #expression); \ } \
+ show +
291
292
293
294
295
296
297
298
299
300
} while (::testing::internal::AlwaysFalse()) // This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for // evaluating any system call that fulfills two conditions: it must return // -1 on failure, and set errno to EINTR when it is interrupted and // should be tried again. The macro expands to a loop that repeatedly // evaluates the expression as long as it evaluates to -1 and sets // errno to EINTR. If the expression evaluates to -1 but errno is // something other than EINTR, DeathTestAbort is called. # define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
_exit(1); } else { fprintf(stderr, "%s", message.c_str()); fflush(stderr); posix::Abort(); } } // A replacement for CHECK that calls DeathTestAbort if the assertion // fails.
+ show +
6766
6767
6768
6769
6770
6771
6772
6773
# define GTEST_DEATH_TEST_CHECK_(expression) \ do { \ if (!::testing::internal::IsTrue(expression)) { \ DeathTestAbort( \ ::std::string("CHECK failed: File ") + __FILE__ + ", line " \ + ::testing::internal::StreamableToString(__LINE__) + ": " \ + #expression); \ } \
+ show +
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
} while (::testing::internal::AlwaysFalse()) // This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for // evaluating any system call that fulfills two conditions: it must return // -1 on failure, and set errno to EINTR when it is interrupted and // should be tried again. The macro expands to a loop that repeatedly // evaluates the expression as long as it evaluates to -1 and sets // errno to EINTR. If the expression evaluates to -1 but errno is // something other than EINTR, DeathTestAbort is called. # define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest-death-test.cc
295
296
297
298
299
300
301
302
303
304
_exit(1); } else { fprintf(stderr, "%s", message.c_str()); fflush(stderr); posix::Abort(); } } // A replacement for CHECK that calls DeathTestAbort if the assertion // fails.
+ show +
305
306
307
308
309
310
311
312
# define GTEST_DEATH_TEST_CHECK_(expression) \ do { \ if (!::testing::internal::IsTrue(expression)) { \ DeathTestAbort( \ ::std::string("CHECK failed: File ") + __FILE__ + ", line " \ + ::testing::internal::StreamableToString(__LINE__) + ": " \ + #expression); \ } \
+ show +
313
314
315
316
317
318
319
320
321
322
} while (::testing::internal::AlwaysFalse()) // This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for // evaluating any system call that fulfills two conditions: it must return // -1 on failure, and set errno to EINTR when it is interrupted and // should be tried again. The macro expands to a loop that repeatedly // evaluates the expression as long as it evaluates to -1 and sets // errno to EINTR. If the expression evaluates to -1 but errno is // something other than EINTR, DeathTestAbort is called. # define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
_exit(1); } else { fprintf(stderr, "%s", message.c_str()); fflush(stderr); posix::Abort(); } } // A replacement for CHECK that calls DeathTestAbort if the assertion // fails.
+ show +
7117
7118
7119
7120
7121
7122
7123
7124
# define GTEST_DEATH_TEST_CHECK_(expression) \ do { \ if (!::testing::internal::IsTrue(expression)) { \ DeathTestAbort( \ ::std::string("CHECK failed: File ") + __FILE__ + ", line " \ + ::testing::internal::StreamableToString(__LINE__) + ": " \ + #expression); \ } \
+ show +
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
} while (::testing::internal::AlwaysFalse()) // This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for // evaluating any system call that fulfills two conditions: it must return // -1 on failure, and set errno to EINTR when it is interrupted and // should be tried again. The macro expands to a loop that repeatedly // evaluates the expression as long as it evaluates to -1 and sets // errno to EINTR. If the expression evaluates to -1 but errno is // something other than EINTR, DeathTestAbort is called. # define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-death-test.cc
289
290
291
292
293
294
295
296
297
298
_exit(1); } else { fprintf(stderr, "%s", message.c_str()); fflush(stderr); posix::Abort(); } } // A replacement for CHECK that calls DeathTestAbort if the assertion // fails.
+ show +
299
300
301
302
303
304
305
306
# define GTEST_DEATH_TEST_CHECK_(expression) \ do { \ if (!::testing::internal::IsTrue(expression)) { \ DeathTestAbort( \ ::std::string("CHECK failed: File ") + __FILE__ + ", line " \ + ::testing::internal::StreamableToString(__LINE__) + ": " \ + #expression); \ } \
+ show +
307
308
309
310
311
312
313
314
315
316
} while (::testing::internal::AlwaysFalse()) // This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for // evaluating any system call that fulfills two conditions: it must return // -1 on failure, and set errno to EINTR when it is interrupted and // should be tried again. The macro expands to a loop that repeatedly // evaluates the expression as long as it evaluates to -1 and sets // errno to EINTR. If the expression evaluates to -1 but errno is // something other than EINTR, DeathTestAbort is called. # define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-death-test.cc
273
274
275
276
277
278
279
280
281
282
_exit(1); } else { fprintf(stderr, "%s", message.c_str()); fflush(stderr); posix::Abort(); } } // A replacement for CHECK that calls DeathTestAbort if the assertion // fails.
+ show +
283
284
285
286
287
288
289
290
# define GTEST_DEATH_TEST_CHECK_(expression) \ do { \ if (!::testing::internal::IsTrue(expression)) { \ DeathTestAbort( \ ::std::string("CHECK failed: File ") + __FILE__ + ", line " \ + ::testing::internal::StreamableToString(__LINE__) + ": " \ + #expression); \ } \
+ show +
291
292
293
294
295
296
297
298
299
300
} while (::testing::internal::AlwaysFalse()) // This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for // evaluating any system call that fulfills two conditions: it must return // -1 on failure, and set errno to EINTR when it is interrupted and // should be tried again. The macro expands to a loop that repeatedly // evaluates the expression as long as it evaluates to -1 and sets // errno to EINTR. If the expression evaluates to -1 but errno is // something other than EINTR, DeathTestAbort is called. # define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-death-test.cc
273
274
275
276
277
278
279
280
281
282
_exit(1); } else { fprintf(stderr, "%s", message.c_str()); fflush(stderr); posix::Abort(); } } // A replacement for CHECK that calls DeathTestAbort if the assertion // fails.
+ show +
283
284
285
286
287
288
289
290
# define GTEST_DEATH_TEST_CHECK_(expression) \ do { \ if (!::testing::internal::IsTrue(expression)) { \ DeathTestAbort( \ ::std::string("CHECK failed: File ") + __FILE__ + ", line " \ + ::testing::internal::StreamableToString(__LINE__) + ": " \ + #expression); \ } \
+ show +
291
292
293
294
295
296
297
298
299
300
} while (::testing::internal::AlwaysFalse()) // This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for // evaluating any system call that fulfills two conditions: it must return // -1 on failure, and set errno to EINTR when it is interrupted and // should be tried again. The macro expands to a loop that repeatedly // evaluates the expression as long as it evaluates to -1 and sets // errno to EINTR. If the expression evaluates to -1 but errno is // something other than EINTR, DeathTestAbort is called. # define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \

[CVE-2020-0478_1.diff] gtest-death-test.cc #15
- DeathTestImpl(const char* a_statement, const RE* a_regex) - : statement_(a_statement), - regex_(a_regex), - spawned_(false), - status_(-1), - outcome_(IN_PROGRESS), - read_fd_(-1), - write_fd_(-1) {} + DeathTestImpl(const char *a_statement, Matcher<const std::string &> matcher) + : statement_(a_statement), matcher_(std::move(matcher)), spawned_(false), + status_(-1), outcome_(IN_PROGRESS), read_fd_(-1), write_fd_(-1) {} - ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } + ~DeathTestImpl() override { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } - void Abort(AbortReason reason); - virtual bool Passed(bool status_ok); + void Abort(AbortReason reason) override; + bool Passed(bool status_ok) override; - const char* statement() const { return statement_; } - const RE* regex() const { return regex_; } + const char *statement() const { return statement_; }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest-death-test.cc
354
355
356
357
358
359
360
361
362
363
void DeathTest::set_last_death_test_message(const std::string& message) { last_death_test_message_ = message; } std::string DeathTest::last_death_test_message_; // Provides cross platform implementation for some death functionality. class DeathTestImpl : public DeathTest { protected:
+ show +
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
DeathTestImpl(const char* a_statement, const RE* a_regex) : statement_(a_statement), regex_(a_regex), spawned_(false), status_(-1), outcome_(IN_PROGRESS), read_fd_(-1), write_fd_(-1) {} // read_fd_ is expected to be closed and cleared by a derived class. ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } void Abort(AbortReason reason); virtual bool Passed(bool status_ok); const char* statement() const { return statement_; } const RE* regex() const { return regex_; }
+ show +
381
382
383
384
385
386
387
388
389
390
bool spawned() const { return spawned_; } void set_spawned(bool is_spawned) { spawned_ = is_spawned; } int status() const { return status_; } void set_status(int a_status) { status_ = a_status; } DeathTestOutcome outcome() const { return outcome_; } void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; } int read_fd() const { return read_fd_; } void set_read_fd(int fd) { read_fd_ = fd; } int write_fd() const { return write_fd_; } void set_write_fd(int fd) { write_fd_ = fd; }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
void DeathTest::set_last_death_test_message(const std::string& message) { last_death_test_message_ = message; } std::string DeathTest::last_death_test_message_; // Provides cross platform implementation for some death functionality. class DeathTestImpl : public DeathTest { protected:
+ show +
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
DeathTestImpl(const char* a_statement, const RE* a_regex) : statement_(a_statement), regex_(a_regex), spawned_(false), status_(-1), outcome_(IN_PROGRESS), read_fd_(-1), write_fd_(-1) {} // read_fd_ is expected to be closed and cleared by a derived class. ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } void Abort(AbortReason reason); virtual bool Passed(bool status_ok); const char* statement() const { return statement_; } const RE* regex() const { return regex_; }
+ show +
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
bool spawned() const { return spawned_; } void set_spawned(bool is_spawned) { spawned_ = is_spawned; } int status() const { return status_; } void set_status(int a_status) { status_ = a_status; } DeathTestOutcome outcome() const { return outcome_; } void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; } int read_fd() const { return read_fd_; } void set_read_fd(int fd) { read_fd_ = fd; } int write_fd() const { return write_fd_; } void set_write_fd(int fd) { write_fd_ = fd; }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-death-test.cc
365
366
367
368
369
370
371
372
373
374
void DeathTest::set_last_death_test_message(const std::string& message) { last_death_test_message_ = message; } std::string DeathTest::last_death_test_message_; // Provides cross platform implementation for some death functionality. class DeathTestImpl : public DeathTest { protected:
+ show +
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
DeathTestImpl(const char* a_statement, const RE* a_regex) : statement_(a_statement), regex_(a_regex), spawned_(false), status_(-1), outcome_(IN_PROGRESS), read_fd_(-1), write_fd_(-1) {} // read_fd_ is expected to be closed and cleared by a derived class. ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } void Abort(AbortReason reason); virtual bool Passed(bool status_ok); const char* statement() const { return statement_; } const RE* regex() const { return regex_; }
+ show +
392
393
394
395
396
397
398
399
400
401
bool spawned() const { return spawned_; } void set_spawned(bool is_spawned) { spawned_ = is_spawned; } int status() const { return status_; } void set_status(int a_status) { status_ = a_status; } DeathTestOutcome outcome() const { return outcome_; } void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; } int read_fd() const { return read_fd_; } void set_read_fd(int fd) { read_fd_ = fd; } int write_fd() const { return write_fd_; } void set_write_fd(int fd) { write_fd_ = fd; }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
void DeathTest::set_last_death_test_message(const std::string& message) { last_death_test_message_ = message; } std::string DeathTest::last_death_test_message_; // Provides cross platform implementation for some death functionality. class DeathTestImpl : public DeathTest { protected:
+ show +
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
DeathTestImpl(const char* a_statement, const RE* a_regex) : statement_(a_statement), regex_(a_regex), spawned_(false), status_(-1), outcome_(IN_PROGRESS), read_fd_(-1), write_fd_(-1) {} // read_fd_ is expected to be closed and cleared by a derived class. ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } void Abort(AbortReason reason); virtual bool Passed(bool status_ok); const char* statement() const { return statement_; } const RE* regex() const { return regex_; }
+ show +
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
bool spawned() const { return spawned_; } void set_spawned(bool is_spawned) { spawned_ = is_spawned; } int status() const { return status_; } void set_status(int a_status) { status_ = a_status; } DeathTestOutcome outcome() const { return outcome_; } void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; } int read_fd() const { return read_fd_; } void set_read_fd(int fd) { read_fd_ = fd; } int write_fd() const { return write_fd_; } void set_write_fd(int fd) { write_fd_ = fd; }
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
void DeathTest::set_last_death_test_message(const std::string& message) { last_death_test_message_ = message; } std::string DeathTest::last_death_test_message_; // Provides cross platform implementation for some death functionality. class DeathTestImpl : public DeathTest { protected:
+ show +
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
DeathTestImpl(const char* a_statement, const RE* a_regex) : statement_(a_statement), regex_(a_regex), spawned_(false), status_(-1), outcome_(IN_PROGRESS), read_fd_(-1), write_fd_(-1) {} // read_fd_ is expected to be closed and cleared by a derived class. ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } void Abort(AbortReason reason); virtual bool Passed(bool status_ok); const char* statement() const { return statement_; } const RE* regex() const { return regex_; }
+ show +
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
bool spawned() const { return spawned_; } void set_spawned(bool is_spawned) { spawned_ = is_spawned; } int status() const { return status_; } void set_status(int a_status) { status_ = a_status; } DeathTestOutcome outcome() const { return outcome_; } void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; } int read_fd() const { return read_fd_; } void set_read_fd(int fd) { read_fd_ = fd; } int write_fd() const { return write_fd_; } void set_write_fd(int fd) { write_fd_ = fd; }
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/src/gtest-death-test.cc
352
353
354
355
356
357
358
359
360
361
void DeathTest::set_last_death_test_message(const String& message) { last_death_test_message_ = message; } String DeathTest::last_death_test_message_; // Provides cross platform implementation for some death functionality. class DeathTestImpl : public DeathTest { protected:
+ show +
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
DeathTestImpl(const char* a_statement, const RE* a_regex) : statement_(a_statement), regex_(a_regex), spawned_(false), status_(-1), outcome_(IN_PROGRESS), read_fd_(-1), write_fd_(-1) {} // read_fd_ is expected to be closed and cleared by a derived class. ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } void Abort(AbortReason reason); virtual bool Passed(bool status_ok); const char* statement() const { return statement_; } const RE* regex() const { return regex_; }
+ show +
379
380
381
382
383
384
385
386
387
388
bool spawned() const { return spawned_; } void set_spawned(bool is_spawned) { spawned_ = is_spawned; } int status() const { return status_; } void set_status(int a_status) { status_ = a_status; } DeathTestOutcome outcome() const { return outcome_; } void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; } int read_fd() const { return read_fd_; } void set_read_fd(int fd) { read_fd_ = fd; } int write_fd() const { return write_fd_; } void set_write_fd(int fd) { write_fd_ = fd; }
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-death-test.cc
381
382
383
384
385
386
387
388
389
390
void DeathTest::set_last_death_test_message(const std::string& message) { last_death_test_message_ = message; } std::string DeathTest::last_death_test_message_; // Provides cross platform implementation for some death functionality. class DeathTestImpl : public DeathTest { protected:
+ show +
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
DeathTestImpl(const char* a_statement, const RE* a_regex) : statement_(a_statement), regex_(a_regex), spawned_(false), status_(-1), outcome_(IN_PROGRESS), read_fd_(-1), write_fd_(-1) {} // read_fd_ is expected to be closed and cleared by a derived class. ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } void Abort(AbortReason reason); virtual bool Passed(bool status_ok); const char* statement() const { return statement_; } const RE* regex() const { return regex_; }
+ show +
408
409
410
411
412
413
414
415
416
417
bool spawned() const { return spawned_; } void set_spawned(bool is_spawned) { spawned_ = is_spawned; } int status() const { return status_; } void set_status(int a_status) { status_ = a_status; } DeathTestOutcome outcome() const { return outcome_; } void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; } int read_fd() const { return read_fd_; } void set_read_fd(int fd) { read_fd_ = fd; } int write_fd() const { return write_fd_; } void set_write_fd(int fd) { write_fd_ = fd; }
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-death-test.cc
365
366
367
368
369
370
371
372
373
374
void DeathTest::set_last_death_test_message(const std::string& message) { last_death_test_message_ = message; } std::string DeathTest::last_death_test_message_; // Provides cross platform implementation for some death functionality. class DeathTestImpl : public DeathTest { protected:
+ show +
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
DeathTestImpl(const char* a_statement, const RE* a_regex) : statement_(a_statement), regex_(a_regex), spawned_(false), status_(-1), outcome_(IN_PROGRESS), read_fd_(-1), write_fd_(-1) {} // read_fd_ is expected to be closed and cleared by a derived class. ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } void Abort(AbortReason reason); virtual bool Passed(bool status_ok); const char* statement() const { return statement_; } const RE* regex() const { return regex_; }
+ show +
392
393
394
395
396
397
398
399
400
401
bool spawned() const { return spawned_; } void set_spawned(bool is_spawned) { spawned_ = is_spawned; } int status() const { return status_; } void set_status(int a_status) { status_ = a_status; } DeathTestOutcome outcome() const { return outcome_; } void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; } int read_fd() const { return read_fd_; } void set_read_fd(int fd) { read_fd_ = fd; } int write_fd() const { return write_fd_; } void set_write_fd(int fd) { write_fd_ = fd; }
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/gtest-death-test.cc
314
315
316
317
318
319
320
321
322
323
void DeathTest::set_last_death_test_message(const String& message) { last_death_test_message_ = message; } String DeathTest::last_death_test_message_; // Provides cross platform implementation for some death functionality. class DeathTestImpl : public DeathTest { protected:
+ show +
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
DeathTestImpl(const char* a_statement, const RE* a_regex) : statement_(a_statement), regex_(a_regex), spawned_(false), status_(-1), outcome_(IN_PROGRESS), read_fd_(-1), write_fd_(-1) {} // read_fd_ is expected to be closed and cleared by a derived class. ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } void Abort(AbortReason reason); virtual bool Passed(bool status_ok); const char* statement() const { return statement_; } const RE* regex() const { return regex_; }
+ show +
341
342
343
344
345
346
347
348
349
350
bool spawned() const { return spawned_; } void set_spawned(bool is_spawned) { spawned_ = is_spawned; } int status() const { return status_; } void set_status(int a_status) { status_ = a_status; } DeathTestOutcome outcome() const { return outcome_; } void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; } int read_fd() const { return read_fd_; } void set_read_fd(int fd) { read_fd_ = fd; } int write_fd() const { return write_fd_; } void set_write_fd(int fd) { write_fd_ = fd; }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-death-test.cc
365
366
367
368
369
370
371
372
373
374
void DeathTest::set_last_death_test_message(const std::string& message) { last_death_test_message_ = message; } std::string DeathTest::last_death_test_message_; // Provides cross platform implementation for some death functionality. class DeathTestImpl : public DeathTest { protected:
+ show +
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
DeathTestImpl(const char* a_statement, const RE* a_regex) : statement_(a_statement), regex_(a_regex), spawned_(false), status_(-1), outcome_(IN_PROGRESS), read_fd_(-1), write_fd_(-1) {} // read_fd_ is expected to be closed and cleared by a derived class. ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } void Abort(AbortReason reason); virtual bool Passed(bool status_ok); const char* statement() const { return statement_; } const RE* regex() const { return regex_; }
+ show +
392
393
394
395
396
397
398
399
400
401
bool spawned() const { return spawned_; } void set_spawned(bool is_spawned) { spawned_ = is_spawned; } int status() const { return status_; } void set_status(int a_status) { status_ = a_status; } DeathTestOutcome outcome() const { return outcome_; } void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; } int read_fd() const { return read_fd_; } void set_read_fd(int fd) { read_fd_ = fd; } int write_fd() const { return write_fd_; } void set_write_fd(int fd) { write_fd_ = fd; }

[CVE-2020-0478_1.diff] gtest-death-test.cc #17
- case kDeathTestReturned: - set_outcome(RETURNED); - break; - case kDeathTestThrew: - set_outcome(THREW); - break; - case kDeathTestLived: - set_outcome(LIVED); - break; + case kDeathTestReturned: set_outcome(RETURNED); break; + case kDeathTestThrew: set_outcome(THREW); break; + case kDeathTestLived: set_outcome(LIVED); break;
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest-death-test.cc
431
432
433
434
435
436
437
438
439
440
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
441
442
443
444
445
446
447
448
449
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
450
451
452
453
454
455
456
457
458
459
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
6935
6936
6937
6938
6939
6940
6941
6942
6943
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-death-test.cc
442
443
444
445
446
447
448
449
450
451
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
452
453
454
455
456
457
458
459
460
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
461
462
463
464
465
466
467
468
469
470
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
6935
6936
6937
6938
6939
6940
6941
6942
6943
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest-death-test.cc
466
467
468
469
470
471
472
473
474
475
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
476
477
478
479
480
481
482
483
484
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
485
486
487
488
489
490
491
492
493
494
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
7286
7287
7288
7289
7290
7291
7292
7293
7294
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/src/gtest-death-test.cc
429
430
431
432
433
434
435
436
437
438
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
439
440
441
442
443
444
445
446
447
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
448
449
450
451
452
453
454
455
456
457
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-death-test.cc
458
459
460
461
462
463
464
465
466
467
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
468
469
470
471
472
473
474
475
476
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
477
478
479
480
481
482
483
484
485
486
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/src/gtest-death-test.cc
394
395
396
397
398
399
400
401
402
403
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
404
405
406
407
408
409
410
411
412
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
413
414
415
416
417
418
419
420
421
422
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-death-test.cc
442
443
444
445
446
447
448
449
450
451
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
452
453
454
455
456
457
458
459
460
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
461
462
463
464
465
466
467
468
469
470
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/gtest-death-test.cc
391
392
393
394
395
396
397
398
399
400
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
401
402
403
404
405
406
407
408
409
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
410
411
412
413
414
415
416
417
418
419
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-death-test.cc
442
443
444
445
446
447
448
449
450
451
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
452
453
454
455
456
457
458
459
460
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
461
462
463
464
465
466
467
468
469
470
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "

[CVE-2020-0478_1.diff] gtest-death-test.cc #42
- const std::string filter_flag = - std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" - + info->test_case_name() + "." + info->name(); - const std::string internal_flag = - std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "=" - + file_ + "|" + StreamableToString(line_) + "|" - + StreamableToString(death_test_index) + "|" - + StreamableToString(pipe_fd[1]); + const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ + + kFilterFlag + "=" + info->test_suite_name() + + "." + info->name(); + const std::string internal_flag = std::string("--") + GTEST_FLAG_PREFIX_ + + kInternalRunDeathTestFlag + "=" + file_ + + "|" + StreamableToString(line_) + "|" + + StreamableToString(death_test_index) + "|" + + StreamableToString(pipe_fd[1]);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest-death-test.cc
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
set_write_fd(flag->write_fd()); return EXECUTE_TEST; } int pipe_fd[2]; GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1); // Clear the close-on-exec flag on the write end of the pipe, lest // it be closed when the child process does an exec: GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);
+ show +
1118
1119
1120
1121
1122
1123
1124
1125
const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" + info->test_case_name() + "." + info->name(); const std::string internal_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "=" + file_ + "|" + StreamableToString(line_) + "|" + StreamableToString(death_test_index) + "|" + StreamableToString(pipe_fd[1]);
+ show +
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
Arguments args; args.AddArguments(GetArgvsForDeathTestChildProcess()); args.AddArgument(filter_flag.c_str()); args.AddArgument(internal_flag.c_str()); DeathTest::set_last_death_test_message(""); CaptureStderr(); // See the comment in NoExecDeathTest::AssumeRole for why the next line // is necessary.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
set_write_fd(flag->write_fd()); return EXECUTE_TEST; } int pipe_fd[2]; GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1); // Clear the close-on-exec flag on the write end of the pipe, lest // it be closed when the child process does an exec: GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);
+ show +
7612
7613
7614
7615
7616
7617
7618
7619
const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" + info->test_case_name() + "." + info->name(); const std::string internal_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "=" + file_ + "|" + StreamableToString(line_) + "|" + StreamableToString(death_test_index) + "|" + StreamableToString(pipe_fd[1]);
+ show +
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
Arguments args; args.AddArguments(GetArgvsForDeathTestChildProcess()); args.AddArgument(filter_flag.c_str()); args.AddArgument(internal_flag.c_str()); DeathTest::set_last_death_test_message(""); CaptureStderr(); // See the comment in NoExecDeathTest::AssumeRole for why the next line // is necessary.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-death-test.cc
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
set_write_fd(flag->write_fd()); return EXECUTE_TEST; } int pipe_fd[2]; GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1); // Clear the close-on-exec flag on the write end of the pipe, lest // it be closed when the child process does an exec: GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);
+ show +
1135
1136
1137
1138
1139
1140
1141
1142
const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" + info->test_case_name() + "." + info->name(); const std::string internal_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "=" + file_ + "|" + StreamableToString(line_) + "|" + StreamableToString(death_test_index) + "|" + StreamableToString(pipe_fd[1]);
+ show +
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
Arguments args; args.AddArguments(GetArgvsForDeathTestChildProcess()); args.AddArgument(filter_flag.c_str()); args.AddArgument(internal_flag.c_str()); DeathTest::set_last_death_test_message(""); CaptureStderr(); // See the comment in NoExecDeathTest::AssumeRole for why the next line // is necessary.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
set_write_fd(flag->write_fd()); return EXECUTE_TEST; } int pipe_fd[2]; GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1); // Clear the close-on-exec flag on the write end of the pipe, lest // it be closed when the child process does an exec: GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);
+ show +
7612
7613
7614
7615
7616
7617
7618
7619
const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" + info->test_case_name() + "." + info->name(); const std::string internal_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "=" + file_ + "|" + StreamableToString(line_) + "|" + StreamableToString(death_test_index) + "|" + StreamableToString(pipe_fd[1]);
+ show +
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
Arguments args; args.AddArguments(GetArgvsForDeathTestChildProcess()); args.AddArgument(filter_flag.c_str()); args.AddArgument(internal_flag.c_str()); DeathTest::set_last_death_test_message(""); CaptureStderr(); // See the comment in NoExecDeathTest::AssumeRole for why the next line // is necessary.
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
set_write_fd(flag->write_fd()); return EXECUTE_TEST; } int pipe_fd[2]; GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1); // Clear the close-on-exec flag on the write end of the pipe, lest // it be closed when the child process does an exec: GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);
+ show +
7970
7971
7972
7973
7974
7975
7976
7977
const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" + info->test_case_name() + "." + info->name(); const std::string internal_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "=" + file_ + "|" + StreamableToString(line_) + "|" + StreamableToString(death_test_index) + "|" + StreamableToString(pipe_fd[1]);
+ show +
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
Arguments args; args.AddArguments(GetArgvsForDeathTestChildProcess()); args.AddArgument(filter_flag.c_str()); args.AddArgument(internal_flag.c_str()); DeathTest::set_last_death_test_message(""); CaptureStderr(); // See the comment in NoExecDeathTest::AssumeRole for why the next line // is necessary.
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-death-test.cc
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
set_write_fd(flag->write_fd()); return EXECUTE_TEST; } int pipe_fd[2]; GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1); // Clear the close-on-exec flag on the write end of the pipe, lest // it be closed when the child process does an exec: GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);
+ show +
1352
1353
1354
1355
1356
1357
1358
1359
const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" + info->test_case_name() + "." + info->name(); const std::string internal_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "=" + file_ + "|" + StreamableToString(line_) + "|" + StreamableToString(death_test_index) + "|" + StreamableToString(pipe_fd[1]);
+ show +
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
Arguments args; args.AddArguments(GetArgvsForDeathTestChildProcess()); args.AddArgument(filter_flag.c_str()); args.AddArgument(internal_flag.c_str()); DeathTest::set_last_death_test_message(""); CaptureStderr(); // See the comment in NoExecDeathTest::AssumeRole for why the next line // is necessary.
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-death-test.cc
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
set_write_fd(flag->write_fd()); return EXECUTE_TEST; } int pipe_fd[2]; GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1); // Clear the close-on-exec flag on the write end of the pipe, lest // it be closed when the child process does an exec: GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);
+ show +
1136
1137
1138
1139
1140
1141
1142
1143
const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" + info->test_case_name() + "." + info->name(); const std::string internal_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "=" + file_ + "|" + StreamableToString(line_) + "|" + StreamableToString(death_test_index) + "|" + StreamableToString(pipe_fd[1]);
+ show +
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
Arguments args; args.AddArguments(GetArgvsForDeathTestChildProcess()); args.AddArgument(filter_flag.c_str()); args.AddArgument(internal_flag.c_str()); DeathTest::set_last_death_test_message(""); CaptureStderr(); // See the comment in NoExecDeathTest::AssumeRole for why the next line // is necessary.
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-death-test.cc
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
set_write_fd(flag->write_fd()); return EXECUTE_TEST; } int pipe_fd[2]; GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1); // Clear the close-on-exec flag on the write end of the pipe, lest // it be closed when the child process does an exec: GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);
+ show +
1136
1137
1138
1139
1140
1141
1142
1143
const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" + info->test_case_name() + "." + info->name(); const std::string internal_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "=" + file_ + "|" + StreamableToString(line_) + "|" + StreamableToString(death_test_index) + "|" + StreamableToString(pipe_fd[1]);
+ show +
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
Arguments args; args.AddArguments(GetArgvsForDeathTestChildProcess()); args.AddArgument(filter_flag.c_str()); args.AddArgument(internal_flag.c_str()); DeathTest::set_last_death_test_message(""); CaptureStderr(); // See the comment in NoExecDeathTest::AssumeRole for why the next line // is necessary.

[CVE-2020-0470_1.diff] gtest-death-test.cc #12
-# define GTEST_DEATH_TEST_CHECK_(expression) \ - do { \ - if (!::testing::internal::IsTrue(expression)) { \ - DeathTestAbort( \ - ::std::string("CHECK failed: File ") + __FILE__ + ", line " \ - + ::testing::internal::StreamableToString(__LINE__) + ": " \ - + #expression); \ - } \ +#define GTEST_DEATH_TEST_CHECK_(expression) \ + do { \ + if (!::testing::internal::IsTrue(expression)) { \ + DeathTestAbort(::std::string("CHECK failed: File ") + __FILE__ + \ + ", line " + \ + ::testing::internal::StreamableToString(__LINE__) + \ + ": " + #expression); \ + } \
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest-death-test.cc
262
263
264
265
266
267
268
269
270
271
_exit(1); } else { fprintf(stderr, "%s", message.c_str()); fflush(stderr); posix::Abort(); } } // A replacement for CHECK that calls DeathTestAbort if the assertion // fails.
+ show +
272
273
274
275
276
277
278
279
# define GTEST_DEATH_TEST_CHECK_(expression) \ do { \ if (!::testing::internal::IsTrue(expression)) { \ DeathTestAbort( \ ::std::string("CHECK failed: File ") + __FILE__ + ", line " \ + ::testing::internal::StreamableToString(__LINE__) + ": " \ + #expression); \ } \
+ show +
280
281
282
283
284
285
286
287
288
289
} while (::testing::internal::AlwaysFalse()) // This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for // evaluating any system call that fulfills two conditions: it must return // -1 on failure, and set errno to EINTR when it is interrupted and // should be tried again. The macro expands to a loop that repeatedly // evaluates the expression as long as it evaluates to -1 and sets // errno to EINTR. If the expression evaluates to -1 but errno is // something other than EINTR, DeathTestAbort is called. # define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
_exit(1); } else { fprintf(stderr, "%s", message.c_str()); fflush(stderr); posix::Abort(); } } // A replacement for CHECK that calls DeathTestAbort if the assertion // fails.
+ show +
6766
6767
6768
6769
6770
6771
6772
6773
# define GTEST_DEATH_TEST_CHECK_(expression) \ do { \ if (!::testing::internal::IsTrue(expression)) { \ DeathTestAbort( \ ::std::string("CHECK failed: File ") + __FILE__ + ", line " \ + ::testing::internal::StreamableToString(__LINE__) + ": " \ + #expression); \ } \
+ show +
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
} while (::testing::internal::AlwaysFalse()) // This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for // evaluating any system call that fulfills two conditions: it must return // -1 on failure, and set errno to EINTR when it is interrupted and // should be tried again. The macro expands to a loop that repeatedly // evaluates the expression as long as it evaluates to -1 and sets // errno to EINTR. If the expression evaluates to -1 but errno is // something other than EINTR, DeathTestAbort is called. # define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-death-test.cc
273
274
275
276
277
278
279
280
281
282
_exit(1); } else { fprintf(stderr, "%s", message.c_str()); fflush(stderr); posix::Abort(); } } // A replacement for CHECK that calls DeathTestAbort if the assertion // fails.
+ show +
283
284
285
286
287
288
289
290
# define GTEST_DEATH_TEST_CHECK_(expression) \ do { \ if (!::testing::internal::IsTrue(expression)) { \ DeathTestAbort( \ ::std::string("CHECK failed: File ") + __FILE__ + ", line " \ + ::testing::internal::StreamableToString(__LINE__) + ": " \ + #expression); \ } \
+ show +
291
292
293
294
295
296
297
298
299
300
} while (::testing::internal::AlwaysFalse()) // This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for // evaluating any system call that fulfills two conditions: it must return // -1 on failure, and set errno to EINTR when it is interrupted and // should be tried again. The macro expands to a loop that repeatedly // evaluates the expression as long as it evaluates to -1 and sets // errno to EINTR. If the expression evaluates to -1 but errno is // something other than EINTR, DeathTestAbort is called. # define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
_exit(1); } else { fprintf(stderr, "%s", message.c_str()); fflush(stderr); posix::Abort(); } } // A replacement for CHECK that calls DeathTestAbort if the assertion // fails.
+ show +
6766
6767
6768
6769
6770
6771
6772
6773
# define GTEST_DEATH_TEST_CHECK_(expression) \ do { \ if (!::testing::internal::IsTrue(expression)) { \ DeathTestAbort( \ ::std::string("CHECK failed: File ") + __FILE__ + ", line " \ + ::testing::internal::StreamableToString(__LINE__) + ": " \ + #expression); \ } \
+ show +
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
} while (::testing::internal::AlwaysFalse()) // This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for // evaluating any system call that fulfills two conditions: it must return // -1 on failure, and set errno to EINTR when it is interrupted and // should be tried again. The macro expands to a loop that repeatedly // evaluates the expression as long as it evaluates to -1 and sets // errno to EINTR. If the expression evaluates to -1 but errno is // something other than EINTR, DeathTestAbort is called. # define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest-death-test.cc
295
296
297
298
299
300
301
302
303
304
_exit(1); } else { fprintf(stderr, "%s", message.c_str()); fflush(stderr); posix::Abort(); } } // A replacement for CHECK that calls DeathTestAbort if the assertion // fails.
+ show +
305
306
307
308
309
310
311
312
# define GTEST_DEATH_TEST_CHECK_(expression) \ do { \ if (!::testing::internal::IsTrue(expression)) { \ DeathTestAbort( \ ::std::string("CHECK failed: File ") + __FILE__ + ", line " \ + ::testing::internal::StreamableToString(__LINE__) + ": " \ + #expression); \ } \
+ show +
313
314
315
316
317
318
319
320
321
322
} while (::testing::internal::AlwaysFalse()) // This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for // evaluating any system call that fulfills two conditions: it must return // -1 on failure, and set errno to EINTR when it is interrupted and // should be tried again. The macro expands to a loop that repeatedly // evaluates the expression as long as it evaluates to -1 and sets // errno to EINTR. If the expression evaluates to -1 but errno is // something other than EINTR, DeathTestAbort is called. # define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
_exit(1); } else { fprintf(stderr, "%s", message.c_str()); fflush(stderr); posix::Abort(); } } // A replacement for CHECK that calls DeathTestAbort if the assertion // fails.
+ show +
7117
7118
7119
7120
7121
7122
7123
7124
# define GTEST_DEATH_TEST_CHECK_(expression) \ do { \ if (!::testing::internal::IsTrue(expression)) { \ DeathTestAbort( \ ::std::string("CHECK failed: File ") + __FILE__ + ", line " \ + ::testing::internal::StreamableToString(__LINE__) + ": " \ + #expression); \ } \
+ show +
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
} while (::testing::internal::AlwaysFalse()) // This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for // evaluating any system call that fulfills two conditions: it must return // -1 on failure, and set errno to EINTR when it is interrupted and // should be tried again. The macro expands to a loop that repeatedly // evaluates the expression as long as it evaluates to -1 and sets // errno to EINTR. If the expression evaluates to -1 but errno is // something other than EINTR, DeathTestAbort is called. # define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-death-test.cc
289
290
291
292
293
294
295
296
297
298
_exit(1); } else { fprintf(stderr, "%s", message.c_str()); fflush(stderr); posix::Abort(); } } // A replacement for CHECK that calls DeathTestAbort if the assertion // fails.
+ show +
299
300
301
302
303
304
305
306
# define GTEST_DEATH_TEST_CHECK_(expression) \ do { \ if (!::testing::internal::IsTrue(expression)) { \ DeathTestAbort( \ ::std::string("CHECK failed: File ") + __FILE__ + ", line " \ + ::testing::internal::StreamableToString(__LINE__) + ": " \ + #expression); \ } \
+ show +
307
308
309
310
311
312
313
314
315
316
} while (::testing::internal::AlwaysFalse()) // This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for // evaluating any system call that fulfills two conditions: it must return // -1 on failure, and set errno to EINTR when it is interrupted and // should be tried again. The macro expands to a loop that repeatedly // evaluates the expression as long as it evaluates to -1 and sets // errno to EINTR. If the expression evaluates to -1 but errno is // something other than EINTR, DeathTestAbort is called. # define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-death-test.cc
273
274
275
276
277
278
279
280
281
282
_exit(1); } else { fprintf(stderr, "%s", message.c_str()); fflush(stderr); posix::Abort(); } } // A replacement for CHECK that calls DeathTestAbort if the assertion // fails.
+ show +
283
284
285
286
287
288
289
290
# define GTEST_DEATH_TEST_CHECK_(expression) \ do { \ if (!::testing::internal::IsTrue(expression)) { \ DeathTestAbort( \ ::std::string("CHECK failed: File ") + __FILE__ + ", line " \ + ::testing::internal::StreamableToString(__LINE__) + ": " \ + #expression); \ } \
+ show +
291
292
293
294
295
296
297
298
299
300
} while (::testing::internal::AlwaysFalse()) // This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for // evaluating any system call that fulfills two conditions: it must return // -1 on failure, and set errno to EINTR when it is interrupted and // should be tried again. The macro expands to a loop that repeatedly // evaluates the expression as long as it evaluates to -1 and sets // errno to EINTR. If the expression evaluates to -1 but errno is // something other than EINTR, DeathTestAbort is called. # define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-death-test.cc
273
274
275
276
277
278
279
280
281
282
_exit(1); } else { fprintf(stderr, "%s", message.c_str()); fflush(stderr); posix::Abort(); } } // A replacement for CHECK that calls DeathTestAbort if the assertion // fails.
+ show +
283
284
285
286
287
288
289
290
# define GTEST_DEATH_TEST_CHECK_(expression) \ do { \ if (!::testing::internal::IsTrue(expression)) { \ DeathTestAbort( \ ::std::string("CHECK failed: File ") + __FILE__ + ", line " \ + ::testing::internal::StreamableToString(__LINE__) + ": " \ + #expression); \ } \
+ show +
291
292
293
294
295
296
297
298
299
300
} while (::testing::internal::AlwaysFalse()) // This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for // evaluating any system call that fulfills two conditions: it must return // -1 on failure, and set errno to EINTR when it is interrupted and // should be tried again. The macro expands to a loop that repeatedly // evaluates the expression as long as it evaluates to -1 and sets // errno to EINTR. If the expression evaluates to -1 but errno is // something other than EINTR, DeathTestAbort is called. # define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \

[CVE-2020-0470_1.diff] gtest-death-test.cc #15
- DeathTestImpl(const char* a_statement, const RE* a_regex) - : statement_(a_statement), - regex_(a_regex), - spawned_(false), - status_(-1), - outcome_(IN_PROGRESS), - read_fd_(-1), - write_fd_(-1) {} + DeathTestImpl(const char *a_statement, Matcher<const std::string &> matcher) + : statement_(a_statement), matcher_(std::move(matcher)), spawned_(false), + status_(-1), outcome_(IN_PROGRESS), read_fd_(-1), write_fd_(-1) {} - ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } + ~DeathTestImpl() override { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } - void Abort(AbortReason reason); - virtual bool Passed(bool status_ok); + void Abort(AbortReason reason) override; + bool Passed(bool status_ok) override; - const char* statement() const { return statement_; } - const RE* regex() const { return regex_; } + const char *statement() const { return statement_; }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest-death-test.cc
354
355
356
357
358
359
360
361
362
363
void DeathTest::set_last_death_test_message(const std::string& message) { last_death_test_message_ = message; } std::string DeathTest::last_death_test_message_; // Provides cross platform implementation for some death functionality. class DeathTestImpl : public DeathTest { protected:
+ show +
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
DeathTestImpl(const char* a_statement, const RE* a_regex) : statement_(a_statement), regex_(a_regex), spawned_(false), status_(-1), outcome_(IN_PROGRESS), read_fd_(-1), write_fd_(-1) {} // read_fd_ is expected to be closed and cleared by a derived class. ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } void Abort(AbortReason reason); virtual bool Passed(bool status_ok); const char* statement() const { return statement_; } const RE* regex() const { return regex_; }
+ show +
381
382
383
384
385
386
387
388
389
390
bool spawned() const { return spawned_; } void set_spawned(bool is_spawned) { spawned_ = is_spawned; } int status() const { return status_; } void set_status(int a_status) { status_ = a_status; } DeathTestOutcome outcome() const { return outcome_; } void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; } int read_fd() const { return read_fd_; } void set_read_fd(int fd) { read_fd_ = fd; } int write_fd() const { return write_fd_; } void set_write_fd(int fd) { write_fd_ = fd; }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
void DeathTest::set_last_death_test_message(const std::string& message) { last_death_test_message_ = message; } std::string DeathTest::last_death_test_message_; // Provides cross platform implementation for some death functionality. class DeathTestImpl : public DeathTest { protected:
+ show +
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
DeathTestImpl(const char* a_statement, const RE* a_regex) : statement_(a_statement), regex_(a_regex), spawned_(false), status_(-1), outcome_(IN_PROGRESS), read_fd_(-1), write_fd_(-1) {} // read_fd_ is expected to be closed and cleared by a derived class. ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } void Abort(AbortReason reason); virtual bool Passed(bool status_ok); const char* statement() const { return statement_; } const RE* regex() const { return regex_; }
+ show +
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
bool spawned() const { return spawned_; } void set_spawned(bool is_spawned) { spawned_ = is_spawned; } int status() const { return status_; } void set_status(int a_status) { status_ = a_status; } DeathTestOutcome outcome() const { return outcome_; } void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; } int read_fd() const { return read_fd_; } void set_read_fd(int fd) { read_fd_ = fd; } int write_fd() const { return write_fd_; } void set_write_fd(int fd) { write_fd_ = fd; }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-death-test.cc
365
366
367
368
369
370
371
372
373
374
void DeathTest::set_last_death_test_message(const std::string& message) { last_death_test_message_ = message; } std::string DeathTest::last_death_test_message_; // Provides cross platform implementation for some death functionality. class DeathTestImpl : public DeathTest { protected:
+ show +
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
DeathTestImpl(const char* a_statement, const RE* a_regex) : statement_(a_statement), regex_(a_regex), spawned_(false), status_(-1), outcome_(IN_PROGRESS), read_fd_(-1), write_fd_(-1) {} // read_fd_ is expected to be closed and cleared by a derived class. ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } void Abort(AbortReason reason); virtual bool Passed(bool status_ok); const char* statement() const { return statement_; } const RE* regex() const { return regex_; }
+ show +
392
393
394
395
396
397
398
399
400
401
bool spawned() const { return spawned_; } void set_spawned(bool is_spawned) { spawned_ = is_spawned; } int status() const { return status_; } void set_status(int a_status) { status_ = a_status; } DeathTestOutcome outcome() const { return outcome_; } void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; } int read_fd() const { return read_fd_; } void set_read_fd(int fd) { read_fd_ = fd; } int write_fd() const { return write_fd_; } void set_write_fd(int fd) { write_fd_ = fd; }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
void DeathTest::set_last_death_test_message(const std::string& message) { last_death_test_message_ = message; } std::string DeathTest::last_death_test_message_; // Provides cross platform implementation for some death functionality. class DeathTestImpl : public DeathTest { protected:
+ show +
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
DeathTestImpl(const char* a_statement, const RE* a_regex) : statement_(a_statement), regex_(a_regex), spawned_(false), status_(-1), outcome_(IN_PROGRESS), read_fd_(-1), write_fd_(-1) {} // read_fd_ is expected to be closed and cleared by a derived class. ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } void Abort(AbortReason reason); virtual bool Passed(bool status_ok); const char* statement() const { return statement_; } const RE* regex() const { return regex_; }
+ show +
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
bool spawned() const { return spawned_; } void set_spawned(bool is_spawned) { spawned_ = is_spawned; } int status() const { return status_; } void set_status(int a_status) { status_ = a_status; } DeathTestOutcome outcome() const { return outcome_; } void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; } int read_fd() const { return read_fd_; } void set_read_fd(int fd) { read_fd_ = fd; } int write_fd() const { return write_fd_; } void set_write_fd(int fd) { write_fd_ = fd; }
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
void DeathTest::set_last_death_test_message(const std::string& message) { last_death_test_message_ = message; } std::string DeathTest::last_death_test_message_; // Provides cross platform implementation for some death functionality. class DeathTestImpl : public DeathTest { protected:
+ show +
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
DeathTestImpl(const char* a_statement, const RE* a_regex) : statement_(a_statement), regex_(a_regex), spawned_(false), status_(-1), outcome_(IN_PROGRESS), read_fd_(-1), write_fd_(-1) {} // read_fd_ is expected to be closed and cleared by a derived class. ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } void Abort(AbortReason reason); virtual bool Passed(bool status_ok); const char* statement() const { return statement_; } const RE* regex() const { return regex_; }
+ show +
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
bool spawned() const { return spawned_; } void set_spawned(bool is_spawned) { spawned_ = is_spawned; } int status() const { return status_; } void set_status(int a_status) { status_ = a_status; } DeathTestOutcome outcome() const { return outcome_; } void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; } int read_fd() const { return read_fd_; } void set_read_fd(int fd) { read_fd_ = fd; } int write_fd() const { return write_fd_; } void set_write_fd(int fd) { write_fd_ = fd; }
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/src/gtest-death-test.cc
352
353
354
355
356
357
358
359
360
361
void DeathTest::set_last_death_test_message(const String& message) { last_death_test_message_ = message; } String DeathTest::last_death_test_message_; // Provides cross platform implementation for some death functionality. class DeathTestImpl : public DeathTest { protected:
+ show +
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
DeathTestImpl(const char* a_statement, const RE* a_regex) : statement_(a_statement), regex_(a_regex), spawned_(false), status_(-1), outcome_(IN_PROGRESS), read_fd_(-1), write_fd_(-1) {} // read_fd_ is expected to be closed and cleared by a derived class. ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } void Abort(AbortReason reason); virtual bool Passed(bool status_ok); const char* statement() const { return statement_; } const RE* regex() const { return regex_; }
+ show +
379
380
381
382
383
384
385
386
387
388
bool spawned() const { return spawned_; } void set_spawned(bool is_spawned) { spawned_ = is_spawned; } int status() const { return status_; } void set_status(int a_status) { status_ = a_status; } DeathTestOutcome outcome() const { return outcome_; } void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; } int read_fd() const { return read_fd_; } void set_read_fd(int fd) { read_fd_ = fd; } int write_fd() const { return write_fd_; } void set_write_fd(int fd) { write_fd_ = fd; }
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-death-test.cc
381
382
383
384
385
386
387
388
389
390
void DeathTest::set_last_death_test_message(const std::string& message) { last_death_test_message_ = message; } std::string DeathTest::last_death_test_message_; // Provides cross platform implementation for some death functionality. class DeathTestImpl : public DeathTest { protected:
+ show +
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
DeathTestImpl(const char* a_statement, const RE* a_regex) : statement_(a_statement), regex_(a_regex), spawned_(false), status_(-1), outcome_(IN_PROGRESS), read_fd_(-1), write_fd_(-1) {} // read_fd_ is expected to be closed and cleared by a derived class. ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } void Abort(AbortReason reason); virtual bool Passed(bool status_ok); const char* statement() const { return statement_; } const RE* regex() const { return regex_; }
+ show +
408
409
410
411
412
413
414
415
416
417
bool spawned() const { return spawned_; } void set_spawned(bool is_spawned) { spawned_ = is_spawned; } int status() const { return status_; } void set_status(int a_status) { status_ = a_status; } DeathTestOutcome outcome() const { return outcome_; } void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; } int read_fd() const { return read_fd_; } void set_read_fd(int fd) { read_fd_ = fd; } int write_fd() const { return write_fd_; } void set_write_fd(int fd) { write_fd_ = fd; }
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-death-test.cc
365
366
367
368
369
370
371
372
373
374
void DeathTest::set_last_death_test_message(const std::string& message) { last_death_test_message_ = message; } std::string DeathTest::last_death_test_message_; // Provides cross platform implementation for some death functionality. class DeathTestImpl : public DeathTest { protected:
+ show +
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
DeathTestImpl(const char* a_statement, const RE* a_regex) : statement_(a_statement), regex_(a_regex), spawned_(false), status_(-1), outcome_(IN_PROGRESS), read_fd_(-1), write_fd_(-1) {} // read_fd_ is expected to be closed and cleared by a derived class. ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } void Abort(AbortReason reason); virtual bool Passed(bool status_ok); const char* statement() const { return statement_; } const RE* regex() const { return regex_; }
+ show +
392
393
394
395
396
397
398
399
400
401
bool spawned() const { return spawned_; } void set_spawned(bool is_spawned) { spawned_ = is_spawned; } int status() const { return status_; } void set_status(int a_status) { status_ = a_status; } DeathTestOutcome outcome() const { return outcome_; } void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; } int read_fd() const { return read_fd_; } void set_read_fd(int fd) { read_fd_ = fd; } int write_fd() const { return write_fd_; } void set_write_fd(int fd) { write_fd_ = fd; }
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/gtest-death-test.cc
314
315
316
317
318
319
320
321
322
323
void DeathTest::set_last_death_test_message(const String& message) { last_death_test_message_ = message; } String DeathTest::last_death_test_message_; // Provides cross platform implementation for some death functionality. class DeathTestImpl : public DeathTest { protected:
+ show +
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
DeathTestImpl(const char* a_statement, const RE* a_regex) : statement_(a_statement), regex_(a_regex), spawned_(false), status_(-1), outcome_(IN_PROGRESS), read_fd_(-1), write_fd_(-1) {} // read_fd_ is expected to be closed and cleared by a derived class. ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } void Abort(AbortReason reason); virtual bool Passed(bool status_ok); const char* statement() const { return statement_; } const RE* regex() const { return regex_; }
+ show +
341
342
343
344
345
346
347
348
349
350
bool spawned() const { return spawned_; } void set_spawned(bool is_spawned) { spawned_ = is_spawned; } int status() const { return status_; } void set_status(int a_status) { status_ = a_status; } DeathTestOutcome outcome() const { return outcome_; } void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; } int read_fd() const { return read_fd_; } void set_read_fd(int fd) { read_fd_ = fd; } int write_fd() const { return write_fd_; } void set_write_fd(int fd) { write_fd_ = fd; }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-death-test.cc
365
366
367
368
369
370
371
372
373
374
void DeathTest::set_last_death_test_message(const std::string& message) { last_death_test_message_ = message; } std::string DeathTest::last_death_test_message_; // Provides cross platform implementation for some death functionality. class DeathTestImpl : public DeathTest { protected:
+ show +
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
DeathTestImpl(const char* a_statement, const RE* a_regex) : statement_(a_statement), regex_(a_regex), spawned_(false), status_(-1), outcome_(IN_PROGRESS), read_fd_(-1), write_fd_(-1) {} // read_fd_ is expected to be closed and cleared by a derived class. ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } void Abort(AbortReason reason); virtual bool Passed(bool status_ok); const char* statement() const { return statement_; } const RE* regex() const { return regex_; }
+ show +
392
393
394
395
396
397
398
399
400
401
bool spawned() const { return spawned_; } void set_spawned(bool is_spawned) { spawned_ = is_spawned; } int status() const { return status_; } void set_status(int a_status) { status_ = a_status; } DeathTestOutcome outcome() const { return outcome_; } void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; } int read_fd() const { return read_fd_; } void set_read_fd(int fd) { read_fd_ = fd; } int write_fd() const { return write_fd_; } void set_write_fd(int fd) { write_fd_ = fd; }

[CVE-2020-0470_1.diff] gtest-death-test.cc #17
- case kDeathTestReturned: - set_outcome(RETURNED); - break; - case kDeathTestThrew: - set_outcome(THREW); - break; - case kDeathTestLived: - set_outcome(LIVED); - break; + case kDeathTestReturned: set_outcome(RETURNED); break; + case kDeathTestThrew: set_outcome(THREW); break; + case kDeathTestLived: set_outcome(LIVED); break;
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest-death-test.cc
431
432
433
434
435
436
437
438
439
440
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
441
442
443
444
445
446
447
448
449
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
450
451
452
453
454
455
456
457
458
459
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
6935
6936
6937
6938
6939
6940
6941
6942
6943
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-death-test.cc
442
443
444
445
446
447
448
449
450
451
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
452
453
454
455
456
457
458
459
460
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
461
462
463
464
465
466
467
468
469
470
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
6935
6936
6937
6938
6939
6940
6941
6942
6943
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest-death-test.cc
466
467
468
469
470
471
472
473
474
475
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
476
477
478
479
480
481
482
483
484
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
485
486
487
488
489
490
491
492
493
494
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
7286
7287
7288
7289
7290
7291
7292
7293
7294
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/src/gtest-death-test.cc
429
430
431
432
433
434
435
436
437
438
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
439
440
441
442
443
444
445
446
447
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
448
449
450
451
452
453
454
455
456
457
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-death-test.cc
458
459
460
461
462
463
464
465
466
467
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
468
469
470
471
472
473
474
475
476
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
477
478
479
480
481
482
483
484
485
486
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/src/gtest-death-test.cc
394
395
396
397
398
399
400
401
402
403
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
404
405
406
407
408
409
410
411
412
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
413
414
415
416
417
418
419
420
421
422
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-death-test.cc
442
443
444
445
446
447
448
449
450
451
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
452
453
454
455
456
457
458
459
460
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
461
462
463
464
465
466
467
468
469
470
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/gtest-death-test.cc
391
392
393
394
395
396
397
398
399
400
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
401
402
403
404
405
406
407
408
409
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
410
411
412
413
414
415
416
417
418
419
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-death-test.cc
442
443
444
445
446
447
448
449
450
451
// its success), so it's okay to call this in the parent before // the child process has exited. do { bytes_read = posix::Read(read_fd(), &flag, 1); } while (bytes_read == -1 && errno == EINTR); if (bytes_read == 0) { set_outcome(DIED); } else if (bytes_read == 1) { switch (flag) {
+ show +
452
453
454
455
456
457
458
459
460
case kDeathTestReturned: set_outcome(RETURNED); break; case kDeathTestThrew: set_outcome(THREW); break; case kDeathTestLived: set_outcome(LIVED); break;
+ show +
461
462
463
464
465
466
467
468
469
470
case kDeathTestInternalError: FailFromInternalError(read_fd()); // Does not return. break; default: GTEST_LOG_(FATAL) << "Death test child process reported " << "unexpected status byte (" << static_cast<unsigned int>(flag) << ")"; } } else { GTEST_LOG_(FATAL) << "Read from death test child process failed: "

[CVE-2020-0470_1.diff] gtest-death-test.cc #42
- const std::string filter_flag = - std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" - + info->test_case_name() + "." + info->name(); - const std::string internal_flag = - std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "=" - + file_ + "|" + StreamableToString(line_) + "|" - + StreamableToString(death_test_index) + "|" - + StreamableToString(pipe_fd[1]); + const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ + + kFilterFlag + "=" + info->test_suite_name() + + "." + info->name(); + const std::string internal_flag = std::string("--") + GTEST_FLAG_PREFIX_ + + kInternalRunDeathTestFlag + "=" + file_ + + "|" + StreamableToString(line_) + "|" + + StreamableToString(death_test_index) + "|" + + StreamableToString(pipe_fd[1]);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest-death-test.cc
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
set_write_fd(flag->write_fd()); return EXECUTE_TEST; } int pipe_fd[2]; GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1); // Clear the close-on-exec flag on the write end of the pipe, lest // it be closed when the child process does an exec: GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);
+ show +
1118
1119
1120
1121
1122
1123
1124
1125
const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" + info->test_case_name() + "." + info->name(); const std::string internal_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "=" + file_ + "|" + StreamableToString(line_) + "|" + StreamableToString(death_test_index) + "|" + StreamableToString(pipe_fd[1]);
+ show +
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
Arguments args; args.AddArguments(GetArgvsForDeathTestChildProcess()); args.AddArgument(filter_flag.c_str()); args.AddArgument(internal_flag.c_str()); DeathTest::set_last_death_test_message(""); CaptureStderr(); // See the comment in NoExecDeathTest::AssumeRole for why the next line // is necessary.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
set_write_fd(flag->write_fd()); return EXECUTE_TEST; } int pipe_fd[2]; GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1); // Clear the close-on-exec flag on the write end of the pipe, lest // it be closed when the child process does an exec: GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);
+ show +
7612
7613
7614
7615
7616
7617
7618
7619
const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" + info->test_case_name() + "." + info->name(); const std::string internal_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "=" + file_ + "|" + StreamableToString(line_) + "|" + StreamableToString(death_test_index) + "|" + StreamableToString(pipe_fd[1]);
+ show +
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
Arguments args; args.AddArguments(GetArgvsForDeathTestChildProcess()); args.AddArgument(filter_flag.c_str()); args.AddArgument(internal_flag.c_str()); DeathTest::set_last_death_test_message(""); CaptureStderr(); // See the comment in NoExecDeathTest::AssumeRole for why the next line // is necessary.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-death-test.cc
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
set_write_fd(flag->write_fd()); return EXECUTE_TEST; } int pipe_fd[2]; GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1); // Clear the close-on-exec flag on the write end of the pipe, lest // it be closed when the child process does an exec: GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);
+ show +
1135
1136
1137
1138
1139
1140
1141
1142
const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" + info->test_case_name() + "." + info->name(); const std::string internal_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "=" + file_ + "|" + StreamableToString(line_) + "|" + StreamableToString(death_test_index) + "|" + StreamableToString(pipe_fd[1]);
+ show +
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
Arguments args; args.AddArguments(GetArgvsForDeathTestChildProcess()); args.AddArgument(filter_flag.c_str()); args.AddArgument(internal_flag.c_str()); DeathTest::set_last_death_test_message(""); CaptureStderr(); // See the comment in NoExecDeathTest::AssumeRole for why the next line // is necessary.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
set_write_fd(flag->write_fd()); return EXECUTE_TEST; } int pipe_fd[2]; GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1); // Clear the close-on-exec flag on the write end of the pipe, lest // it be closed when the child process does an exec: GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);
+ show +
7612
7613
7614
7615
7616
7617
7618
7619
const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" + info->test_case_name() + "." + info->name(); const std::string internal_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "=" + file_ + "|" + StreamableToString(line_) + "|" + StreamableToString(death_test_index) + "|" + StreamableToString(pipe_fd[1]);
+ show +
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
Arguments args; args.AddArguments(GetArgvsForDeathTestChildProcess()); args.AddArgument(filter_flag.c_str()); args.AddArgument(internal_flag.c_str()); DeathTest::set_last_death_test_message(""); CaptureStderr(); // See the comment in NoExecDeathTest::AssumeRole for why the next line // is necessary.
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
set_write_fd(flag->write_fd()); return EXECUTE_TEST; } int pipe_fd[2]; GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1); // Clear the close-on-exec flag on the write end of the pipe, lest // it be closed when the child process does an exec: GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);
+ show +
7970
7971
7972
7973
7974
7975
7976
7977
const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" + info->test_case_name() + "." + info->name(); const std::string internal_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "=" + file_ + "|" + StreamableToString(line_) + "|" + StreamableToString(death_test_index) + "|" + StreamableToString(pipe_fd[1]);
+ show +
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
Arguments args; args.AddArguments(GetArgvsForDeathTestChildProcess()); args.AddArgument(filter_flag.c_str()); args.AddArgument(internal_flag.c_str()); DeathTest::set_last_death_test_message(""); CaptureStderr(); // See the comment in NoExecDeathTest::AssumeRole for why the next line // is necessary.
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-death-test.cc
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
set_write_fd(flag->write_fd()); return EXECUTE_TEST; } int pipe_fd[2]; GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1); // Clear the close-on-exec flag on the write end of the pipe, lest // it be closed when the child process does an exec: GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);
+ show +
1352
1353
1354
1355
1356
1357
1358
1359
const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" + info->test_case_name() + "." + info->name(); const std::string internal_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "=" + file_ + "|" + StreamableToString(line_) + "|" + StreamableToString(death_test_index) + "|" + StreamableToString(pipe_fd[1]);
+ show +
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
Arguments args; args.AddArguments(GetArgvsForDeathTestChildProcess()); args.AddArgument(filter_flag.c_str()); args.AddArgument(internal_flag.c_str()); DeathTest::set_last_death_test_message(""); CaptureStderr(); // See the comment in NoExecDeathTest::AssumeRole for why the next line // is necessary.
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-death-test.cc
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
set_write_fd(flag->write_fd()); return EXECUTE_TEST; } int pipe_fd[2]; GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1); // Clear the close-on-exec flag on the write end of the pipe, lest // it be closed when the child process does an exec: GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);
+ show +
1136
1137
1138
1139
1140
1141
1142
1143
const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" + info->test_case_name() + "." + info->name(); const std::string internal_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "=" + file_ + "|" + StreamableToString(line_) + "|" + StreamableToString(death_test_index) + "|" + StreamableToString(pipe_fd[1]);
+ show +
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
Arguments args; args.AddArguments(GetArgvsForDeathTestChildProcess()); args.AddArgument(filter_flag.c_str()); args.AddArgument(internal_flag.c_str()); DeathTest::set_last_death_test_message(""); CaptureStderr(); // See the comment in NoExecDeathTest::AssumeRole for why the next line // is necessary.
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-death-test.cc
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
set_write_fd(flag->write_fd()); return EXECUTE_TEST; } int pipe_fd[2]; GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1); // Clear the close-on-exec flag on the write end of the pipe, lest // it be closed when the child process does an exec: GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);
+ show +
1136
1137
1138
1139
1140
1141
1142
1143
const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" + info->test_case_name() + "." + info->name(); const std::string internal_flag = std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "=" + file_ + "|" + StreamableToString(line_) + "|" + StreamableToString(death_test_index) + "|" + StreamableToString(pipe_fd[1]);
+ show +
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
Arguments args; args.AddArguments(GetArgvsForDeathTestChildProcess()); args.AddArgument(filter_flag.c_str()); args.AddArgument(internal_flag.c_str()); DeathTest::set_last_death_test_message(""); CaptureStderr(); // See the comment in NoExecDeathTest::AssumeRole for why the next line // is necessary.

[CVE-2020-0478_1.diff] gtest.cc #22
-AssertionResult HasOneFailure(const char* /* results_expr */, - const char* /* type_expr */, - const char* /* substr_expr */, - const TestPartResultArray& results, - TestPartResult::Type type, - const string& substr) { - const std::string expected(type == TestPartResult::kFatalFailure ? - "1 fatal failure" : - "1 non-fatal failure"); +static AssertionResult HasOneFailure(const char * /* results_expr */, + const char * /* type_expr */, + const char * /* substr_expr */, + const TestPartResultArray &results, + TestPartResult::Type type, + const std::string &substr) { + const std::string expected(type == TestPartResult::kFatalFailure + ? "1 fatal failure" + : "1 non-fatal failure");
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest.cc
595
596
597
598
599
600
601
602
603
604
return GetTypeId<Test>(); } // The value of GetTestTypeId() as seen from within the Google Test // library. This is solely for testing GetTestTypeId(). extern const TypeId kTestTypeIdInGoogleTest = GetTestTypeId(); // This predicate-formatter checks that 'results' contains a test part // failure of the given type and that the failure message contains the // given substring.
+ show +
605
606
607
608
609
610
611
612
613
AssertionResult HasOneFailure(const char* /* results_expr */, const char* /* type_expr */, const char* /* substr_expr */, const TestPartResultArray& results, TestPartResult::Type type, const string& substr) { const std::string expected(type == TestPartResult::kFatalFailure ? "1 fatal failure" : "1 non-fatal failure");
+ show +
614
615
616
617
618
619
620
621
622
623
Message msg; if (results.size() != 1) { msg << "Expected: " << expected << "\n" << " Actual: " << results.size() << " failures"; for (int i = 0; i < results.size(); i++) { msg << "\n" << results.GetTestPartResult(i); } return AssertionFailure() << msg; }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
return GetTypeId<Test>(); } // The value of GetTestTypeId() as seen from within the Google Test // library. This is solely for testing GetTestTypeId(). extern const TypeId kTestTypeIdInGoogleTest = GetTestTypeId(); // This predicate-formatter checks that 'results' contains a test part // failure of the given type and that the failure message contains the // given substring.
+ show +
2093
2094
2095
2096
2097
2098
2099
2100
2101
AssertionResult HasOneFailure(const char* /* results_expr */, const char* /* type_expr */, const char* /* substr_expr */, const TestPartResultArray& results, TestPartResult::Type type, const string& substr) { const std::string expected(type == TestPartResult::kFatalFailure ? "1 fatal failure" : "1 non-fatal failure");
+ show +
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
Message msg; if (results.size() != 1) { msg << "Expected: " << expected << "\n" << " Actual: " << results.size() << " failures"; for (int i = 0; i < results.size(); i++) { msg << "\n" << results.GetTestPartResult(i); } return AssertionFailure() << msg; }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
return GetTypeId<Test>(); } // The value of GetTestTypeId() as seen from within the Google Test // library. This is solely for testing GetTestTypeId(). extern const TypeId kTestTypeIdInGoogleTest = GetTestTypeId(); // This predicate-formatter checks that 'results' contains a test part // failure of the given type and that the failure message contains the // given substring.
+ show +
2093
2094
2095
2096
2097
2098
2099
2100
2101
AssertionResult HasOneFailure(const char* /* results_expr */, const char* /* type_expr */, const char* /* substr_expr */, const TestPartResultArray& results, TestPartResult::Type type, const string& substr) { const std::string expected(type == TestPartResult::kFatalFailure ? "1 fatal failure" : "1 non-fatal failure");
+ show +
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
Message msg; if (results.size() != 1) { msg << "Expected: " << expected << "\n" << " Actual: " << results.size() << " failures"; for (int i = 0; i < results.size(); i++) { msg << "\n" << results.GetTestPartResult(i); } return AssertionFailure() << msg; }
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
return GetTypeId<Test>(); } // The value of GetTestTypeId() as seen from within the Google Test // library. This is solely for testing GetTestTypeId(). extern const TypeId kTestTypeIdInGoogleTest = GetTestTypeId(); // This predicate-formatter checks that 'results' contains a test part // failure of the given type and that the failure message contains the // given substring.
+ show +
2079
2080
2081
2082
2083
2084
2085
2086
2087
AssertionResult HasOneFailure(const char* /* results_expr */, const char* /* type_expr */, const char* /* substr_expr */, const TestPartResultArray& results, TestPartResult::Type type, const string& substr) { const std::string expected(type == TestPartResult::kFatalFailure ? "1 fatal failure" : "1 non-fatal failure");
+ show +
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
Message msg; if (results.size() != 1) { msg << "Expected: " << expected << "\n" << " Actual: " << results.size() << " failures"; for (int i = 0; i < results.size(); i++) { msg << "\n" << results.GetTestPartResult(i); } return AssertionFailure() << msg; }
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest.cc
621
622
623
624
625
626
627
628
629
630
return GetTypeId<Test>(); } // The value of GetTestTypeId() as seen from within the Google Test // library. This is solely for testing GetTestTypeId(). extern const TypeId kTestTypeIdInGoogleTest = GetTestTypeId(); // This predicate-formatter checks that 'results' contains a test part // failure of the given type and that the failure message contains the // given substring.
+ show +
631
632
633
634
635
636
637
638
639
AssertionResult HasOneFailure(const char* /* results_expr */, const char* /* type_expr */, const char* /* substr_expr */, const TestPartResultArray& results, TestPartResult::Type type, const string& substr) { const std::string expected(type == TestPartResult::kFatalFailure ? "1 fatal failure" : "1 non-fatal failure");
+ show +
640
641
642
643
644
645
646
647
648
649
Message msg; if (results.size() != 1) { msg << "Expected: " << expected << "\n" << " Actual: " << results.size() << " failures"; for (int i = 0; i < results.size(); i++) { msg << "\n" << results.GetTestPartResult(i); } return AssertionFailure() << msg; }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest.cc
622
623
624
625
626
627
628
629
630
631
return GetTypeId<Test>(); } // The value of GetTestTypeId() as seen from within the Google Test // library. This is solely for testing GetTestTypeId(). extern const TypeId kTestTypeIdInGoogleTest = GetTestTypeId(); // This predicate-formatter checks that 'results' contains a test part // failure of the given type and that the failure message contains the // given substring.
+ show +
632
633
634
635
636
637
638
639
640
AssertionResult HasOneFailure(const char* /* results_expr */, const char* /* type_expr */, const char* /* substr_expr */, const TestPartResultArray& results, TestPartResult::Type type, const string& substr) { const std::string expected(type == TestPartResult::kFatalFailure ? "1 fatal failure" : "1 non-fatal failure");
+ show +
641
642
643
644
645
646
647
648
649
650
Message msg; if (results.size() != 1) { msg << "Expected: " << expected << "\n" << " Actual: " << results.size() << " failures"; for (int i = 0; i < results.size(); i++) { msg << "\n" << results.GetTestPartResult(i); } return AssertionFailure() << msg; }

[CVE-2020-0478_1.diff] gtest.cc #24
-SingleFailureChecker:: SingleFailureChecker( - const TestPartResultArray* results, - TestPartResult::Type type, - const string& substr) - : results_(results), - type_(type), - substr_(substr) {} +SingleFailureChecker::SingleFailureChecker(const TestPartResultArray *results, + TestPartResult::Type type, + const std::string &substr) + : results_(results), type_(type), substr_(substr) {}
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest.cc
634
635
636
637
638
639
640
641
642
643
<< " Actual:\n" << r; } return AssertionSuccess(); } // The constructor of SingleFailureChecker remembers where to look up // test part results, what type of failure we expect, and what // substring the failure message should contain.
+ show +
644
645
646
647
648
649
650
SingleFailureChecker:: SingleFailureChecker( const TestPartResultArray* results, TestPartResult::Type type, const string& substr) : results_(results), type_(type), substr_(substr) {}
+ show +
651
652
653
654
655
656
657
658
659
660
// The destructor of SingleFailureChecker verifies that the given // TestPartResultArray contains exactly one failure that has the given // type and contains the given substring. If that's not the case, a // non-fatal failure will be generated. SingleFailureChecker::~SingleFailureChecker() { EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_); } DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
<< " Actual:\n" << r; } return AssertionSuccess(); } // The constructor of SingleFailureChecker remembers where to look up // test part results, what type of failure we expect, and what // substring the failure message should contain.
+ show +
2132
2133
2134
2135
2136
2137
2138
SingleFailureChecker:: SingleFailureChecker( const TestPartResultArray* results, TestPartResult::Type type, const string& substr) : results_(results), type_(type), substr_(substr) {}
+ show +
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
// The destructor of SingleFailureChecker verifies that the given // TestPartResultArray contains exactly one failure that has the given // type and contains the given substring. If that's not the case, a // non-fatal failure will be generated. SingleFailureChecker::~SingleFailureChecker() { EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_); } DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
<< " Actual:\n" << r; } return AssertionSuccess(); } // The constructor of SingleFailureChecker remembers where to look up // test part results, what type of failure we expect, and what // substring the failure message should contain.
+ show +
2132
2133
2134
2135
2136
2137
2138
SingleFailureChecker:: SingleFailureChecker( const TestPartResultArray* results, TestPartResult::Type type, const string& substr) : results_(results), type_(type), substr_(substr) {}
+ show +
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
// The destructor of SingleFailureChecker verifies that the given // TestPartResultArray contains exactly one failure that has the given // type and contains the given substring. If that's not the case, a // non-fatal failure will be generated. SingleFailureChecker::~SingleFailureChecker() { EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_); } DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
<< " Actual:\n" << r; } return AssertionSuccess(); } // The constructor of SingleFailureChecker remembers where to look up // test part results, what type of failure we expect, and what // substring the failure message should contain.
+ show +
2118
2119
2120
2121
2122
2123
2124
SingleFailureChecker:: SingleFailureChecker( const TestPartResultArray* results, TestPartResult::Type type, const string& substr) : results_(results), type_(type), substr_(substr) {}
+ show +
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
// The destructor of SingleFailureChecker verifies that the given // TestPartResultArray contains exactly one failure that has the given // type and contains the given substring. If that's not the case, a // non-fatal failure will be generated. SingleFailureChecker::~SingleFailureChecker() { EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_); } DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/src/gtest.cc
635
636
637
638
639
640
641
642
643
644
<< " Actual:\n" << r; } return AssertionSuccess(); } // The constructor of SingleFailureChecker remembers where to look up // test part results, what type of failure we expect, and what // substring the failure message should contain.
+ show +
645
646
647
648
649
650
651
SingleFailureChecker:: SingleFailureChecker( const TestPartResultArray* results, TestPartResult::Type type, const string& substr) : results_(results), type_(type), substr_(substr) {}
+ show +
652
653
654
655
656
657
658
659
660
661
// The destructor of SingleFailureChecker verifies that the given // TestPartResultArray contains exactly one failure that has the given // type and contains the given substring. If that's not the case, a // non-fatal failure will be generated. SingleFailureChecker::~SingleFailureChecker() { EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_); } DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/src/gtest.cc
634
635
636
637
638
639
640
641
642
643
<< " Actual:\n" << r; } return AssertionSuccess(); } // The constructor of SingleFailureChecker remembers where to look up // test part results, what type of failure we expect, and what // substring the failure message should contain.
+ show +
644
645
646
647
648
649
650
SingleFailureChecker:: SingleFailureChecker( const TestPartResultArray* results, TestPartResult::Type type, const string& substr) : results_(results), type_(type), substr_(substr) {}
+ show +
651
652
653
654
655
656
657
658
659
660
// The destructor of SingleFailureChecker verifies that the given // TestPartResultArray contains exactly one failure that has the given // type and contains the given substring. If that's not the case, a // non-fatal failure will be generated. SingleFailureChecker::~SingleFailureChecker() { EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_); } DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest.cc
660
661
662
663
664
665
666
667
668
669
<< " Actual:\n" << r; } return AssertionSuccess(); } // The constructor of SingleFailureChecker remembers where to look up // test part results, what type of failure we expect, and what // substring the failure message should contain.
+ show +
670
671
672
673
674
675
676
SingleFailureChecker:: SingleFailureChecker( const TestPartResultArray* results, TestPartResult::Type type, const string& substr) : results_(results), type_(type), substr_(substr) {}
+ show +
677
678
679
680
681
682
683
684
685
686
// The destructor of SingleFailureChecker verifies that the given // TestPartResultArray contains exactly one failure that has the given // type and contains the given substring. If that's not the case, a // non-fatal failure will be generated. SingleFailureChecker::~SingleFailureChecker() { EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_); } DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/gtest.cc
634
635
636
637
638
639
640
641
642
643
<< " Actual:\n" << r; } return AssertionSuccess(); } // The constructor of SingleFailureChecker remembers where to look up // test part results, what type of failure we expect, and what // substring the failure message should contain.
+ show +
644
645
646
647
648
649
650
SingleFailureChecker:: SingleFailureChecker( const TestPartResultArray* results, TestPartResult::Type type, const string& substr) : results_(results), type_(type), substr_(substr) {}
+ show +
651
652
653
654
655
656
657
658
659
660
// The destructor of SingleFailureChecker verifies that the given // TestPartResultArray contains exactly one failure that has the given // type and contains the given substring. If that's not the case, a // non-fatal failure will be generated. SingleFailureChecker::~SingleFailureChecker() { EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_); } DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest.cc
661
662
663
664
665
666
667
668
669
670
<< " Actual:\n" << r; } return AssertionSuccess(); } // The constructor of SingleFailureChecker remembers where to look up // test part results, what type of failure we expect, and what // substring the failure message should contain.
+ show +
671
672
673
674
675
676
677
SingleFailureChecker:: SingleFailureChecker( const TestPartResultArray* results, TestPartResult::Type type, const string& substr) : results_(results), type_(type), substr_(substr) {}
+ show +
678
679
680
681
682
683
684
685
686
687
// The destructor of SingleFailureChecker verifies that the given // TestPartResultArray contains exactly one failure that has the given // type and contains the given substring. If that's not the case, a // non-fatal failure will be generated. SingleFailureChecker::~SingleFailureChecker() { EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_); } DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(

[CVE-2020-0478_1.diff] gtest.cc #57
-// The following two functions only make sense if the the system +// The following two functions only make sense if the system -// with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. +// with 16 bit wchar_t (Windows, Cygwin) do use UTF-16. - return sizeof(wchar_t) == 2 && - (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; + return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && + (second & 0xFC00) == 0xDC00; -inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, - wchar_t second) { - const UInt32 mask = (1 << 10) - 1; - return (sizeof(wchar_t) == 2) ? - (((first & mask) << 10) | (second & mask)) + 0x10000 : - // This function should not be called when the condition is - // false, but we provide a sensible default in case it is. - static_cast<UInt32>(first); +inline uint32_t CreateCodePointFromUtf16SurrogatePair(wchar_t first, + wchar_t second) { + const auto first_u = static_cast<uint32_t>(first); + const auto second_u = static_cast<uint32_t>(second); + const uint32_t mask = (1 << 10) - 1; + return (sizeof(wchar_t) == 2) + ? (((first_u & mask) << 10) | (second_u & mask)) + 0x10000 + : + // This function should not be called when the condition is + // false, but we provide a sensible default in case it is. + first_u; -// UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) +// UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin)
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest.cc
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
} // The following two functions only make sense if the the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
} // The following two functions only make sense if the the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest.cc
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
} // The following two functions only make sense if the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
} // The following two functions only make sense if the the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest.cc
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
} // The following two functions only make sense if the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
} // The following two functions only make sense if the the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/src/gtest.cc
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
} // The following two functions only make sense if the the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest.cc
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
} // The following two functions only make sense if the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/src/gtest.cc
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
} // The following two functions only make sense if the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest.cc
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
} // The following two functions only make sense if the the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/gtest.cc
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
} // The following two functions only make sense if the the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest.cc
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
} // The following two functions only make sense if the the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.

[CVE-2020-0478_1.diff] gtest.cc #93
- const TestPartResult& test_part_result) { - return (Message() - << internal::FormatFileLocation(test_part_result.file_name(), - test_part_result.line_number()) - << " " << TestPartResultTypeToString(test_part_result.type()) - << test_part_result.message()).GetString(); + const TestPartResult &test_part_result) { + return (Message() << internal::FormatFileLocation( + test_part_result.file_name(), + test_part_result.line_number()) + << " " + << TestPartResultTypeToString(test_part_result.type()) + << test_part_result.message()) + .GetString(); -static void PrintTestPartResult(const TestPartResult& test_part_result) { - const std::string& result = - PrintTestPartResultToString(test_part_result); +static void PrintTestPartResult(const TestPartResult &test_part_result) { + const std::string &result = PrintTestPartResultToString(test_part_result);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest.cc
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
#endif default: return "Unknown result type"; } } namespace internal { // Prints a TestPartResult to an std::string. static std::string PrintTestPartResultToString(
+ show +
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
const TestPartResult& test_part_result) { return (Message() << internal::FormatFileLocation(test_part_result.file_name(), test_part_result.line_number()) << " " << TestPartResultTypeToString(test_part_result.type()) << test_part_result.message()).GetString(); } // Prints a TestPartResult. static void PrintTestPartResult(const TestPartResult& test_part_result) { const std::string& result = PrintTestPartResultToString(test_part_result);
+ show +
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
printf("%s\n", result.c_str()); fflush(stdout); // If the test program runs in Visual Studio or a debugger, the // following statements add the test part result message to the Output // window such that the user can double-click on it to jump to the // corresponding source code location; otherwise they do nothing. #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE // We don't call OutputDebugString*() on Windows Mobile, as printing // to stdout is done by OutputDebugString() there already - we don't // want the same message printed twice.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
#endif default: return "Unknown result type"; } } namespace internal { // Prints a TestPartResult to an std::string. static std::string PrintTestPartResultToString(
+ show +
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
const TestPartResult& test_part_result) { return (Message() << internal::FormatFileLocation(test_part_result.file_name(), test_part_result.line_number()) << " " << TestPartResultTypeToString(test_part_result.type()) << test_part_result.message()).GetString(); } // Prints a TestPartResult. static void PrintTestPartResult(const TestPartResult& test_part_result) { const std::string& result = PrintTestPartResultToString(test_part_result);
+ show +
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
printf("%s\n", result.c_str()); fflush(stdout); // If the test program runs in Visual Studio or a debugger, the // following statements add the test part result message to the Output // window such that the user can double-click on it to jump to the // corresponding source code location; otherwise they do nothing. #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE // We don't call OutputDebugString*() on Windows Mobile, as printing // to stdout is done by OutputDebugString() there already - we don't // want the same message printed twice.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest.cc
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
#endif default: return "Unknown result type"; } } namespace internal { // Prints a TestPartResult to an std::string. static std::string PrintTestPartResultToString(
+ show +
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
const TestPartResult& test_part_result) { return (Message() << internal::FormatFileLocation(test_part_result.file_name(), test_part_result.line_number()) << " " << TestPartResultTypeToString(test_part_result.type()) << test_part_result.message()).GetString(); } // Prints a TestPartResult. static void PrintTestPartResult(const TestPartResult& test_part_result) { const std::string& result = PrintTestPartResultToString(test_part_result);
+ show +
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
printf("%s\n", result.c_str()); fflush(stdout); // If the test program runs in Visual Studio or a debugger, the // following statements add the test part result message to the Output // window such that the user can double-click on it to jump to the // corresponding source code location; otherwise they do nothing. #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE // We don't call OutputDebugString*() on Windows Mobile, as printing // to stdout is done by OutputDebugString() there already - we don't // want the same message printed twice.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
#endif default: return "Unknown result type"; } } namespace internal { // Prints a TestPartResult to an std::string. static std::string PrintTestPartResultToString(
+ show +
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
const TestPartResult& test_part_result) { return (Message() << internal::FormatFileLocation(test_part_result.file_name(), test_part_result.line_number()) << " " << TestPartResultTypeToString(test_part_result.type()) << test_part_result.message()).GetString(); } // Prints a TestPartResult. static void PrintTestPartResult(const TestPartResult& test_part_result) { const std::string& result = PrintTestPartResultToString(test_part_result);
+ show +
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
printf("%s\n", result.c_str()); fflush(stdout); // If the test program runs in Visual Studio or a debugger, the // following statements add the test part result message to the Output // window such that the user can double-click on it to jump to the // corresponding source code location; otherwise they do nothing. #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE // We don't call OutputDebugString*() on Windows Mobile, as printing // to stdout is done by OutputDebugString() there already - we don't // want the same message printed twice.
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest.cc
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
#endif default: return "Unknown result type"; } } namespace internal { // Prints a TestPartResult to an std::string. static std::string PrintTestPartResultToString(
+ show +
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
const TestPartResult& test_part_result) { return (Message() << internal::FormatFileLocation(test_part_result.file_name(), test_part_result.line_number()) << " " << TestPartResultTypeToString(test_part_result.type()) << test_part_result.message()).GetString(); } // Prints a TestPartResult. static void PrintTestPartResult(const TestPartResult& test_part_result) { const std::string& result = PrintTestPartResultToString(test_part_result);
+ show +
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
printf("%s\n", result.c_str()); fflush(stdout); // If the test program runs in Visual Studio or a debugger, the // following statements add the test part result message to the Output // window such that the user can double-click on it to jump to the // corresponding source code location; otherwise they do nothing. #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE // We don't call OutputDebugString*() on Windows Mobile, as printing // to stdout is done by OutputDebugString() there already - we don't // want the same message printed twice.
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
#endif default: return "Unknown result type"; } } namespace internal { // Prints a TestPartResult to an std::string. static std::string PrintTestPartResultToString(
+ show +
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
const TestPartResult& test_part_result) { return (Message() << internal::FormatFileLocation(test_part_result.file_name(), test_part_result.line_number()) << " " << TestPartResultTypeToString(test_part_result.type()) << test_part_result.message()).GetString(); } // Prints a TestPartResult. static void PrintTestPartResult(const TestPartResult& test_part_result) { const std::string& result = PrintTestPartResultToString(test_part_result);
+ show +
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
printf("%s\n", result.c_str()); fflush(stdout); // If the test program runs in Visual Studio or a debugger, the // following statements add the test part result message to the Output // window such that the user can double-click on it to jump to the // corresponding source code location; otherwise they do nothing. #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE // We don't call OutputDebugString*() on Windows Mobile, as printing // to stdout is done by OutputDebugString() there already - we don't // want the same message printed twice.
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest.cc
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
#endif default: return "Unknown result type"; } } namespace internal { // Prints a TestPartResult to an std::string. static std::string PrintTestPartResultToString(
+ show +
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
const TestPartResult& test_part_result) { return (Message() << internal::FormatFileLocation(test_part_result.file_name(), test_part_result.line_number()) << " " << TestPartResultTypeToString(test_part_result.type()) << test_part_result.message()).GetString(); } // Prints a TestPartResult. static void PrintTestPartResult(const TestPartResult& test_part_result) { const std::string& result = PrintTestPartResultToString(test_part_result);
+ show +
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
printf("%s\n", result.c_str()); fflush(stdout); // If the test program runs in Visual Studio or a debugger, the // following statements add the test part result message to the Output // window such that the user can double-click on it to jump to the // corresponding source code location; otherwise they do nothing. #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE // We don't call OutputDebugString*() on Windows Mobile, as printing // to stdout is done by OutputDebugString() there already - we don't // want the same message printed twice.
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest.cc
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
#endif default: return "Unknown result type"; } } namespace internal { // Prints a TestPartResult to an std::string. static std::string PrintTestPartResultToString(
+ show +
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
const TestPartResult& test_part_result) { return (Message() << internal::FormatFileLocation(test_part_result.file_name(), test_part_result.line_number()) << " " << TestPartResultTypeToString(test_part_result.type()) << test_part_result.message()).GetString(); } // Prints a TestPartResult. static void PrintTestPartResult(const TestPartResult& test_part_result) { const std::string& result = PrintTestPartResultToString(test_part_result);
+ show +
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
printf("%s\n", result.c_str()); fflush(stdout); // If the test program runs in Visual Studio or a debugger, the // following statements add the test part result message to the Output // window such that the user can double-click on it to jump to the // corresponding source code location; otherwise they do nothing. #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE // We don't call OutputDebugString*() on Windows Mobile, as printing // to stdout is done by OutputDebugString() there already - we don't // want the same message printed twice.
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest.cc
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
#endif default: return "Unknown result type"; } } namespace internal { // Prints a TestPartResult to an std::string. static std::string PrintTestPartResultToString(
+ show +
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
const TestPartResult& test_part_result) { return (Message() << internal::FormatFileLocation(test_part_result.file_name(), test_part_result.line_number()) << " " << TestPartResultTypeToString(test_part_result.type()) << test_part_result.message()).GetString(); } // Prints a TestPartResult. static void PrintTestPartResult(const TestPartResult& test_part_result) { const std::string& result = PrintTestPartResultToString(test_part_result);
+ show +
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
printf("%s\n", result.c_str()); fflush(stdout); // If the test program runs in Visual Studio or a debugger, the // following statements add the test part result message to the Output // window such that the user can double-click on it to jump to the // corresponding source code location; otherwise they do nothing. #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE // We don't call OutputDebugString*() on Windows Mobile, as printing // to stdout is done by OutputDebugString() there already - we don't // want the same message printed twice.

[CVE-2020-0478_1.diff] gtest.cc #126
-void UnitTest::AddTestPartResult( - TestPartResult::Type result_type, - const char* file_name, - int line_number, - const std::string& message, - const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) { +void UnitTest::AddTestPartResult(TestPartResult::Type result_type, + const char *file_name, int line_number, + const std::string &message, + const std::string &os_stack_trace) + GTEST_LOCK_EXCLUDED_(mutex_) {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest.cc
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
} impl_->environments().push_back(env); return env; } // Adds a TestPartResult to the current TestResult object. All Google Test // assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call // this to report their results. The user code should use the // assertion macros instead of calling this directly.
+ show +
3708
3709
3710
3711
3712
3713
void UnitTest::AddTestPartResult( TestPartResult::Type result_type, const char* file_name, int line_number, const std::string& message, const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) {
+ show +
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
Message msg; msg << message; internal::MutexLock lock(&mutex_); if (impl_->gtest_trace_stack().size() > 0) { msg << "\n" << GTEST_NAME_ << " trace:"; for (int i = static_cast<int>(impl_->gtest_trace_stack().size()); i > 0; --i) { const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
} impl_->environments().push_back(env); return env; } // Adds a TestPartResult to the current TestResult object. All Google Test // assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call // this to report their results. The user code should use the // assertion macros instead of calling this directly.
+ show +
5261
5262
5263
5264
5265
5266
void UnitTest::AddTestPartResult( TestPartResult::Type result_type, const char* file_name, int line_number, const std::string& message, const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) {
+ show +
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
Message msg; msg << message; internal::MutexLock lock(&mutex_); if (impl_->gtest_trace_stack().size() > 0) { msg << "\n" << GTEST_NAME_ << " trace:"; for (int i = static_cast<int>(impl_->gtest_trace_stack().size()); i > 0; --i) { const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest.cc
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
} impl_->environments().push_back(env); return env; } // Adds a TestPartResult to the current TestResult object. All Google Test // assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call // this to report their results. The user code should use the // assertion macros instead of calling this directly.
+ show +
4132
4133
4134
4135
4136
4137
void UnitTest::AddTestPartResult( TestPartResult::Type result_type, const char* file_name, int line_number, const std::string& message, const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) {
+ show +
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
Message msg; msg << message; internal::MutexLock lock(&mutex_); if (impl_->gtest_trace_stack().size() > 0) { msg << "\n" << GTEST_NAME_ << " trace:"; for (int i = static_cast<int>(impl_->gtest_trace_stack().size()); i > 0; --i) { const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
} impl_->environments().push_back(env); return env; } // Adds a TestPartResult to the current TestResult object. All Google Test // assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call // this to report their results. The user code should use the // assertion macros instead of calling this directly.
+ show +
5261
5262
5263
5264
5265
5266
void UnitTest::AddTestPartResult( TestPartResult::Type result_type, const char* file_name, int line_number, const std::string& message, const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) {
+ show +
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
Message msg; msg << message; internal::MutexLock lock(&mutex_); if (impl_->gtest_trace_stack().size() > 0) { msg << "\n" << GTEST_NAME_ << " trace:"; for (int i = static_cast<int>(impl_->gtest_trace_stack().size()); i > 0; --i) { const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest.cc
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
} impl_->environments().push_back(env); return env; } // Adds a TestPartResult to the current TestResult object. All Google Test // assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call // this to report their results. The user code should use the // assertion macros instead of calling this directly.
+ show +
4697
4698
4699
4700
4701
4702
void UnitTest::AddTestPartResult( TestPartResult::Type result_type, const char* file_name, int line_number, const std::string& message, const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) {
+ show +
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
Message msg; msg << message; internal::MutexLock lock(&mutex_); if (impl_->gtest_trace_stack().size() > 0) { msg << "\n" << GTEST_NAME_ << " trace:"; for (int i = static_cast<int>(impl_->gtest_trace_stack().size()); i > 0; --i) { const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
} impl_->environments().push_back(env); return env; } // Adds a TestPartResult to the current TestResult object. All Google Test // assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call // this to report their results. The user code should use the // assertion macros instead of calling this directly.
+ show +
5560
5561
5562
5563
5564
5565
void UnitTest::AddTestPartResult( TestPartResult::Type result_type, const char* file_name, int line_number, const std::string& message, const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) {
+ show +
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
Message msg; msg << message; internal::MutexLock lock(&mutex_); if (impl_->gtest_trace_stack().size() > 0) { msg << "\n" << GTEST_NAME_ << " trace:"; for (int i = static_cast<int>(impl_->gtest_trace_stack().size()); i > 0; --i) { const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest.cc
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
} impl_->environments().push_back(env); return env; } // Adds a TestPartResult to the current TestResult object. All Google Test // assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call // this to report their results. The user code should use the // assertion macros instead of calling this directly.
+ show +
4632
4633
4634
4635
4636
4637
void UnitTest::AddTestPartResult( TestPartResult::Type result_type, const char* file_name, int line_number, const std::string& message, const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) {
+ show +
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
Message msg; msg << message; internal::MutexLock lock(&mutex_); if (impl_->gtest_trace_stack().size() > 0) { msg << "\n" << GTEST_NAME_ << " trace:"; for (int i = static_cast<int>(impl_->gtest_trace_stack().size()); i > 0; --i) { const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest.cc
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
} impl_->environments().push_back(env); return env; } // Adds a TestPartResult to the current TestResult object. All Google Test // assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call // this to report their results. The user code should use the // assertion macros instead of calling this directly.
+ show +
4108
4109
4110
4111
4112
4113
void UnitTest::AddTestPartResult( TestPartResult::Type result_type, const char* file_name, int line_number, const std::string& message, const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) {
+ show +
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
Message msg; msg << message; internal::MutexLock lock(&mutex_); if (impl_->gtest_trace_stack().size() > 0) { msg << "\n" << GTEST_NAME_ << " trace:"; for (int i = static_cast<int>(impl_->gtest_trace_stack().size()); i > 0; --i) { const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest.cc
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
} impl_->environments().push_back(env); return env; } // Adds a TestPartResult to the current TestResult object. All Google Test // assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call // this to report their results. The user code should use the // assertion macros instead of calling this directly.
+ show +
4109
4110
4111
4112
4113
4114
void UnitTest::AddTestPartResult( TestPartResult::Type result_type, const char* file_name, int line_number, const std::string& message, const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) {
+ show +
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
Message msg; msg << message; internal::MutexLock lock(&mutex_); if (impl_->gtest_trace_stack().size() > 0) { msg << "\n" << GTEST_NAME_ << " trace:"; for (int i = static_cast<int>(impl_->gtest_trace_stack().size()); i > 0; --i) { const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];

[CVE-2020-0478_1.diff] gtest.cc #138
- // Makes sure InitGoogleTest() was called. - if (!GTestIsInitialized()) { - printf("%s", - "\nThis test program did NOT call ::testing::InitGoogleTest " - "before calling RUN_ALL_TESTS(). Please fix it.\n"); - return false; - } + // True if and only if Google Test is initialized before RUN_ALL_TESTS() is + // called. + const bool gtest_is_initialized_before_run_all_tests = GTestIsInitialized(); - if (g_help_flag) - return true; + if (g_help_flag) return true;
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest.cc
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
// returns true if all tests are successful. If any exception is // thrown during a test, the test is considered to be failed, but the // rest of the tests will still be run. // // When parameterized tests are enabled, it expands and registers // parameterized tests first in RegisterParameterizedTests(). // All other functions called from RunAllTests() may safely assume that // parameterized tests are ready to be counted and run. bool UnitTestImpl::RunAllTests() { // Makes sure InitGoogleTest() was called.
+ show +
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
if (!GTestIsInitialized()) { printf("%s", "\nThis test program did NOT call ::testing::InitGoogleTest " "before calling RUN_ALL_TESTS(). Please fix it.\n"); return false; } // Do not run any test if the --help flag was specified. if (g_help_flag) return true;
+ show +
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
// Repeats the call to the post-flag parsing initialization in case the // user didn't call InitGoogleTest. PostFlagParsingInit(); // Even if sharding is not on, test runners may want to use the // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding // protocol. internal::WriteToShardStatusFileIfNeeded();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
// returns true if all tests are successful. If any exception is // thrown during a test, the test is considered to be failed, but the // rest of the tests will still be run. // // When parameterized tests are enabled, it expands and registers // parameterized tests first in RegisterParameterizedTests(). // All other functions called from RunAllTests() may safely assume that // parameterized tests are ready to be counted and run. bool UnitTestImpl::RunAllTests() { // Makes sure InitGoogleTest() was called.
+ show +
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
if (!GTestIsInitialized()) { printf("%s", "\nThis test program did NOT call ::testing::InitGoogleTest " "before calling RUN_ALL_TESTS(). Please fix it.\n"); return false; } // Do not run any test if the --help flag was specified. if (g_help_flag) return true;
+ show +
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
// Repeats the call to the post-flag parsing initialization in case the // user didn't call InitGoogleTest. PostFlagParsingInit(); // Even if sharding is not on, test runners may want to use the // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding // protocol. internal::WriteToShardStatusFileIfNeeded();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
// returns true if all tests are successful. If any exception is // thrown during a test, the test is considered to be failed, but the // rest of the tests will still be run. // // When parameterized tests are enabled, it expands and registers // parameterized tests first in RegisterParameterizedTests(). // All other functions called from RunAllTests() may safely assume that // parameterized tests are ready to be counted and run. bool UnitTestImpl::RunAllTests() { // Makes sure InitGoogleTest() was called.
+ show +
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
if (!GTestIsInitialized()) { printf("%s", "\nThis test program did NOT call ::testing::InitGoogleTest " "before calling RUN_ALL_TESTS(). Please fix it.\n"); return false; } // Do not run any test if the --help flag was specified. if (g_help_flag) return true;
+ show +
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
// Repeats the call to the post-flag parsing initialization in case the // user didn't call InitGoogleTest. PostFlagParsingInit(); // Even if sharding is not on, test runners may want to use the // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding // protocol. internal::WriteToShardStatusFileIfNeeded();
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
// returns true if all tests are successful. If any exception is // thrown during a test, the test is considered to be failed, but the // rest of the tests will still be run. // // When parameterized tests are enabled, it expands and registers // parameterized tests first in RegisterParameterizedTests(). // All other functions called from RunAllTests() may safely assume that // parameterized tests are ready to be counted and run. bool UnitTestImpl::RunAllTests() { // Makes sure InitGoogleTest() was called.
+ show +
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
if (!GTestIsInitialized()) { printf("%s", "\nThis test program did NOT call ::testing::InitGoogleTest " "before calling RUN_ALL_TESTS(). Please fix it.\n"); return false; } // Do not run any test if the --help flag was specified. if (g_help_flag) return true;
+ show +
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
// Repeats the call to the post-flag parsing initialization in case the // user didn't call InitGoogleTest. PostFlagParsingInit(); // Even if sharding is not on, test runners may want to use the // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding // protocol. internal::WriteToShardStatusFileIfNeeded();
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/src/gtest.cc
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
// returns true if all tests are successful. If any exception is // thrown during a test, the test is considered to be failed, but the // rest of the tests will still be run. // // When parameterized tests are enabled, it expands and registers // parameterized tests first in RegisterParameterizedTests(). // All other functions called from RunAllTests() may safely assume that // parameterized tests are ready to be counted and run. bool UnitTestImpl::RunAllTests() { // Makes sure InitGoogleTest() was called.
+ show +
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
if (!GTestIsInitialized()) { printf("%s", "\nThis test program did NOT call ::testing::InitGoogleTest " "before calling RUN_ALL_TESTS(). Please fix it.\n"); return false; } // Do not run any test if the --help flag was specified. if (g_help_flag) return true;
+ show +
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
// Repeats the call to the post-flag parsing initialization in case the // user didn't call InitGoogleTest. PostFlagParsingInit(); // Even if sharding is not on, test runners may want to use the // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding // protocol. internal::WriteToShardStatusFileIfNeeded();
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/src/gtest.cc
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
// returns true if all tests are successful. If any exception is // thrown during a test, the test is considered to be failed, but the // rest of the tests will still be run. // // When parameterized tests are enabled, it expands and registers // parameterized tests first in RegisterParameterizedTests(). // All other functions called from RunAllTests() may safely assume that // parameterized tests are ready to be counted and run. bool UnitTestImpl::RunAllTests() { // Makes sure InitGoogleTest() was called.
+ show +
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
if (!GTestIsInitialized()) { printf("%s", "\nThis test program did NOT call ::testing::InitGoogleTest " "before calling RUN_ALL_TESTS(). Please fix it.\n"); return false; } // Do not run any test if the --help flag was specified. if (g_help_flag) return true;
+ show +
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
// Repeats the call to the post-flag parsing initialization in case the // user didn't call InitGoogleTest. PostFlagParsingInit(); // Even if sharding is not on, test runners may want to use the // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding // protocol. internal::WriteToShardStatusFileIfNeeded();
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest.cc
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
// returns true if all tests are successful. If any exception is // thrown during a test, the test is considered to be failed, but the // rest of the tests will still be run. // // When parameterized tests are enabled, it expands and registers // parameterized tests first in RegisterParameterizedTests(). // All other functions called from RunAllTests() may safely assume that // parameterized tests are ready to be counted and run. bool UnitTestImpl::RunAllTests() { // Makes sure InitGoogleTest() was called.
+ show +
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
if (!GTestIsInitialized()) { printf("%s", "\nThis test program did NOT call ::testing::InitGoogleTest " "before calling RUN_ALL_TESTS(). Please fix it.\n"); return false; } // Do not run any test if the --help flag was specified. if (g_help_flag) return true;
+ show +
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
// Repeats the call to the post-flag parsing initialization in case the // user didn't call InitGoogleTest. PostFlagParsingInit(); // Even if sharding is not on, test runners may want to use the // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding // protocol. internal::WriteToShardStatusFileIfNeeded();
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/gtest.cc
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
// returns true if all tests are successful. If any exception is // thrown during a test, the test is considered to be failed, but the // rest of the tests will still be run. // // When parameterized tests are enabled, it expands and registers // parameterized tests first in RegisterParameterizedTests(). // All other functions called from RunAllTests() may safely assume that // parameterized tests are ready to be counted and run. bool UnitTestImpl::RunAllTests() { // Makes sure InitGoogleTest() was called.
+ show +
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
if (!GTestIsInitialized()) { printf("%s", "\nThis test program did NOT call ::testing::InitGoogleTest " "before calling RUN_ALL_TESTS(). Please fix it.\n"); return false; } // Do not run any test if the --help flag was specified. if (g_help_flag) return true;
+ show +
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
// Repeats the call to the post-flag parsing initialization in case the // user didn't call InitGoogleTest. PostFlagParsingInit(); // Even if sharding is not on, test runners may want to use the // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding // protocol. internal::WriteToShardStatusFileIfNeeded();
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest.cc
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
// returns true if all tests are successful. If any exception is // thrown during a test, the test is considered to be failed, but the // rest of the tests will still be run. // // When parameterized tests are enabled, it expands and registers // parameterized tests first in RegisterParameterizedTests(). // All other functions called from RunAllTests() may safely assume that // parameterized tests are ready to be counted and run. bool UnitTestImpl::RunAllTests() { // Makes sure InitGoogleTest() was called.
+ show +
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
if (!GTestIsInitialized()) { printf("%s", "\nThis test program did NOT call ::testing::InitGoogleTest " "before calling RUN_ALL_TESTS(). Please fix it.\n"); return false; } // Do not run any test if the --help flag was specified. if (g_help_flag) return true;
+ show +
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
// Repeats the call to the post-flag parsing initialization in case the // user didn't call InitGoogleTest. PostFlagParsingInit(); // Even if sharding is not on, test runners may want to use the // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding // protocol. internal::WriteToShardStatusFileIfNeeded();

[CVE-2020-0478_1.diff] gtest.cc #145
+ if (!gtest_is_initialized_before_run_all_tests) { + ColoredPrintf( + COLOR_RED, + "\nIMPORTANT NOTICE - DO NOT IGNORE:\n" + "This test program did NOT call " GTEST_INIT_GOOGLE_TEST_NAME_ + "() before calling RUN_ALL_TESTS(). This is INVALID. Soon " GTEST_NAME_ + " will start to enforce the valid usage. " + "Please fix it ASAP, or IT WILL START TO FAIL.\n"); // NOLINT +#if GTEST_FOR_GOOGLE_ + ColoredPrintf(COLOR_RED, + "For more details, see http://wiki/Main/ValidGUnitMain.\n"); +#endif // GTEST_FOR_GOOGLE_ + } + - const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); - if (test_shard_file != NULL) { - FILE* const file = posix::FOpen(test_shard_file, "w"); - if (file == NULL) { + const char *const test_shard_file = posix::GetEnv(kTestShardStatusFile); + if (test_shard_file != nullptr) { + FILE *const file = posix::FOpen(test_shard_file, "w"); + if (file == nullptr) {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest.cc
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
repeater->OnTestProgramEnd(*parent_); return !failed; } // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file // if the variable is present. If a file already exists at this location, this // function will write over it. If the variable is present, but the file cannot // be created, prints an error and exits. void WriteToShardStatusFileIfNeeded() {
+ show +
4267
4268
4269
4270
const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); if (test_shard_file != NULL) { FILE* const file = posix::FOpen(test_shard_file, "w"); if (file == NULL) {
+ show +
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
ColoredPrintf(COLOR_RED, "Could not write to the test shard status file \"%s\" " "specified by the %s environment variable.\n", test_shard_file, kTestShardStatusFile); fflush(stdout); exit(EXIT_FAILURE); } fclose(file); } }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
repeater->OnTestProgramEnd(*parent_); return !failed; } // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file // if the variable is present. If a file already exists at this location, this // function will write over it. If the variable is present, but the file cannot // be created, prints an error and exits. void WriteToShardStatusFileIfNeeded() {
+ show +
5844
5845
5846
5847
const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); if (test_shard_file != NULL) { FILE* const file = posix::FOpen(test_shard_file, "w"); if (file == NULL) {
+ show +
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
ColoredPrintf(COLOR_RED, "Could not write to the test shard status file \"%s\" " "specified by the %s environment variable.\n", test_shard_file, kTestShardStatusFile); fflush(stdout); exit(EXIT_FAILURE); } fclose(file); } }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest.cc
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
repeater->OnTestProgramEnd(*parent_); return !failed; } // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file // if the variable is present. If a file already exists at this location, this // function will write over it. If the variable is present, but the file cannot // be created, prints an error and exits. void WriteToShardStatusFileIfNeeded() {
+ show +
4718
4719
4720
4721
const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); if (test_shard_file != NULL) { FILE* const file = posix::FOpen(test_shard_file, "w"); if (file == NULL) {
+ show +
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
ColoredPrintf(COLOR_RED, "Could not write to the test shard status file \"%s\" " "specified by the %s environment variable.\n", test_shard_file, kTestShardStatusFile); fflush(stdout); exit(EXIT_FAILURE); } fclose(file); } }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
repeater->OnTestProgramEnd(*parent_); return !failed; } // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file // if the variable is present. If a file already exists at this location, this // function will write over it. If the variable is present, but the file cannot // be created, prints an error and exits. void WriteToShardStatusFileIfNeeded() {
+ show +
5844
5845
5846
5847
const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); if (test_shard_file != NULL) { FILE* const file = posix::FOpen(test_shard_file, "w"); if (file == NULL) {
+ show +
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
ColoredPrintf(COLOR_RED, "Could not write to the test shard status file \"%s\" " "specified by the %s environment variable.\n", test_shard_file, kTestShardStatusFile); fflush(stdout); exit(EXIT_FAILURE); } fclose(file); } }
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
repeater->OnTestProgramEnd(*parent_); return !failed; } // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file // if the variable is present. If a file already exists at this location, this // function will write over it. If the variable is present, but the file cannot // be created, prints an error and exits. void WriteToShardStatusFileIfNeeded() {
+ show +
6146
6147
6148
6149
const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); if (test_shard_file != NULL) { FILE* const file = posix::FOpen(test_shard_file, "w"); if (file == NULL) {
+ show +
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
ColoredPrintf(COLOR_RED, "Could not write to the test shard status file \"%s\" " "specified by the %s environment variable.\n", test_shard_file, kTestShardStatusFile); fflush(stdout); exit(EXIT_FAILURE); } fclose(file); } }
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/src/gtest.cc
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
repeater->OnTestProgramEnd(*parent_); return !failed; } // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file // if the variable is present. If a file already exists at this location, this // function will write over it. If the variable is present, but the file cannot // be created, prints an error and exits. void WriteToShardStatusFileIfNeeded() {
+ show +
4314
4315
4316
4317
const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); if (test_shard_file != NULL) { FILE* const file = posix::FOpen(test_shard_file, "w"); if (file == NULL) {
+ show +
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
ColoredPrintf(COLOR_RED, "Could not write to the test shard status file \"%s\" " "specified by the %s environment variable.\n", test_shard_file, kTestShardStatusFile); fflush(stdout); exit(EXIT_FAILURE); } fclose(file); } }
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest.cc
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
} return !failed; } // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file // if the variable is present. If a file already exists at this location, this // function will write over it. If the variable is present, but the file cannot // be created, prints an error and exits. void WriteToShardStatusFileIfNeeded() {
+ show +
5236
5237
5238
5239
const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); if (test_shard_file != NULL) { FILE* const file = posix::FOpen(test_shard_file, "w"); if (file == NULL) {
+ show +
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
ColoredPrintf(COLOR_RED, "Could not write to the test shard status file \"%s\" " "specified by the %s environment variable.\n", test_shard_file, kTestShardStatusFile); fflush(stdout); exit(EXIT_FAILURE); } fclose(file); } }
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/src/gtest.cc
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
repeater->OnTestProgramEnd(*parent_); return !failed; } // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file // if the variable is present. If a file already exists at this location, this // function will write over it. If the variable is present, but the file cannot // be created, prints an error and exits. void WriteToShardStatusFileIfNeeded() {
+ show +
4252
4253
4254
4255
const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); if (test_shard_file != NULL) { FILE* const file = posix::FOpen(test_shard_file, "w"); if (file == NULL) {
+ show +
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
ColoredPrintf(COLOR_RED, "Could not write to the test shard status file \"%s\" " "specified by the %s environment variable.\n", test_shard_file, kTestShardStatusFile); fflush(stdout); exit(EXIT_FAILURE); } fclose(file); } }
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest.cc
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
repeater->OnTestProgramEnd(*parent_); return !failed; } // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file // if the variable is present. If a file already exists at this location, this // function will write over it. If the variable is present, but the file cannot // be created, prints an error and exits. void WriteToShardStatusFileIfNeeded() {
+ show +
4694
4695
4696
4697
const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); if (test_shard_file != NULL) { FILE* const file = posix::FOpen(test_shard_file, "w"); if (file == NULL) {
+ show +
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
ColoredPrintf(COLOR_RED, "Could not write to the test shard status file \"%s\" " "specified by the %s environment variable.\n", test_shard_file, kTestShardStatusFile); fflush(stdout); exit(EXIT_FAILURE); } fclose(file); } }
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/gtest.cc
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
repeater->OnTestProgramEnd(*parent_); return !failed; } // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file // if the variable is present. If a file already exists at this location, this // function will write over it. If the variable is present, but the file cannot // be created, prints an error and exits. void WriteToShardStatusFileIfNeeded() {
+ show +
4249
4250
4251
4252
const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); if (test_shard_file != NULL) { FILE* const file = posix::FOpen(test_shard_file, "w"); if (file == NULL) {
+ show +
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
ColoredPrintf(COLOR_RED, "Could not write to the test shard status file \"%s\" " "specified by the %s environment variable.\n", test_shard_file, kTestShardStatusFile); fflush(stdout); exit(EXIT_FAILURE); } fclose(file); } }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest.cc
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
repeater->OnTestProgramEnd(*parent_); return !failed; } // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file // if the variable is present. If a file already exists at this location, this // function will write over it. If the variable is present, but the file cannot // be created, prints an error and exits. void WriteToShardStatusFileIfNeeded() {
+ show +
4695
4696
4697
4698
const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); if (test_shard_file != NULL) { FILE* const file = posix::FOpen(test_shard_file, "w"); if (file == NULL) {
+ show +
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
ColoredPrintf(COLOR_RED, "Could not write to the test shard status file \"%s\" " "specified by the %s environment variable.\n", test_shard_file, kTestShardStatusFile); fflush(stdout); exit(EXIT_FAILURE); } fclose(file); } }

[CVE-2020-0470_1.diff] gtest.cc #22
-AssertionResult HasOneFailure(const char* /* results_expr */, - const char* /* type_expr */, - const char* /* substr_expr */, - const TestPartResultArray& results, - TestPartResult::Type type, - const string& substr) { - const std::string expected(type == TestPartResult::kFatalFailure ? - "1 fatal failure" : - "1 non-fatal failure"); +static AssertionResult HasOneFailure(const char * /* results_expr */, + const char * /* type_expr */, + const char * /* substr_expr */, + const TestPartResultArray &results, + TestPartResult::Type type, + const std::string &substr) { + const std::string expected(type == TestPartResult::kFatalFailure + ? "1 fatal failure" + : "1 non-fatal failure");
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest.cc
595
596
597
598
599
600
601
602
603
604
return GetTypeId<Test>(); } // The value of GetTestTypeId() as seen from within the Google Test // library. This is solely for testing GetTestTypeId(). extern const TypeId kTestTypeIdInGoogleTest = GetTestTypeId(); // This predicate-formatter checks that 'results' contains a test part // failure of the given type and that the failure message contains the // given substring.
+ show +
605
606
607
608
609
610
611
612
613
AssertionResult HasOneFailure(const char* /* results_expr */, const char* /* type_expr */, const char* /* substr_expr */, const TestPartResultArray& results, TestPartResult::Type type, const string& substr) { const std::string expected(type == TestPartResult::kFatalFailure ? "1 fatal failure" : "1 non-fatal failure");
+ show +
614
615
616
617
618
619
620
621
622
623
Message msg; if (results.size() != 1) { msg << "Expected: " << expected << "\n" << " Actual: " << results.size() << " failures"; for (int i = 0; i < results.size(); i++) { msg << "\n" << results.GetTestPartResult(i); } return AssertionFailure() << msg; }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
return GetTypeId<Test>(); } // The value of GetTestTypeId() as seen from within the Google Test // library. This is solely for testing GetTestTypeId(). extern const TypeId kTestTypeIdInGoogleTest = GetTestTypeId(); // This predicate-formatter checks that 'results' contains a test part // failure of the given type and that the failure message contains the // given substring.
+ show +
2093
2094
2095
2096
2097
2098
2099
2100
2101
AssertionResult HasOneFailure(const char* /* results_expr */, const char* /* type_expr */, const char* /* substr_expr */, const TestPartResultArray& results, TestPartResult::Type type, const string& substr) { const std::string expected(type == TestPartResult::kFatalFailure ? "1 fatal failure" : "1 non-fatal failure");
+ show +
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
Message msg; if (results.size() != 1) { msg << "Expected: " << expected << "\n" << " Actual: " << results.size() << " failures"; for (int i = 0; i < results.size(); i++) { msg << "\n" << results.GetTestPartResult(i); } return AssertionFailure() << msg; }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
return GetTypeId<Test>(); } // The value of GetTestTypeId() as seen from within the Google Test // library. This is solely for testing GetTestTypeId(). extern const TypeId kTestTypeIdInGoogleTest = GetTestTypeId(); // This predicate-formatter checks that 'results' contains a test part // failure of the given type and that the failure message contains the // given substring.
+ show +
2093
2094
2095
2096
2097
2098
2099
2100
2101
AssertionResult HasOneFailure(const char* /* results_expr */, const char* /* type_expr */, const char* /* substr_expr */, const TestPartResultArray& results, TestPartResult::Type type, const string& substr) { const std::string expected(type == TestPartResult::kFatalFailure ? "1 fatal failure" : "1 non-fatal failure");
+ show +
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
Message msg; if (results.size() != 1) { msg << "Expected: " << expected << "\n" << " Actual: " << results.size() << " failures"; for (int i = 0; i < results.size(); i++) { msg << "\n" << results.GetTestPartResult(i); } return AssertionFailure() << msg; }
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
return GetTypeId<Test>(); } // The value of GetTestTypeId() as seen from within the Google Test // library. This is solely for testing GetTestTypeId(). extern const TypeId kTestTypeIdInGoogleTest = GetTestTypeId(); // This predicate-formatter checks that 'results' contains a test part // failure of the given type and that the failure message contains the // given substring.
+ show +
2079
2080
2081
2082
2083
2084
2085
2086
2087
AssertionResult HasOneFailure(const char* /* results_expr */, const char* /* type_expr */, const char* /* substr_expr */, const TestPartResultArray& results, TestPartResult::Type type, const string& substr) { const std::string expected(type == TestPartResult::kFatalFailure ? "1 fatal failure" : "1 non-fatal failure");
+ show +
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
Message msg; if (results.size() != 1) { msg << "Expected: " << expected << "\n" << " Actual: " << results.size() << " failures"; for (int i = 0; i < results.size(); i++) { msg << "\n" << results.GetTestPartResult(i); } return AssertionFailure() << msg; }
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest.cc
621
622
623
624
625
626
627
628
629
630
return GetTypeId<Test>(); } // The value of GetTestTypeId() as seen from within the Google Test // library. This is solely for testing GetTestTypeId(). extern const TypeId kTestTypeIdInGoogleTest = GetTestTypeId(); // This predicate-formatter checks that 'results' contains a test part // failure of the given type and that the failure message contains the // given substring.
+ show +
631
632
633
634
635
636
637
638
639
AssertionResult HasOneFailure(const char* /* results_expr */, const char* /* type_expr */, const char* /* substr_expr */, const TestPartResultArray& results, TestPartResult::Type type, const string& substr) { const std::string expected(type == TestPartResult::kFatalFailure ? "1 fatal failure" : "1 non-fatal failure");
+ show +
640
641
642
643
644
645
646
647
648
649
Message msg; if (results.size() != 1) { msg << "Expected: " << expected << "\n" << " Actual: " << results.size() << " failures"; for (int i = 0; i < results.size(); i++) { msg << "\n" << results.GetTestPartResult(i); } return AssertionFailure() << msg; }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest.cc
622
623
624
625
626
627
628
629
630
631
return GetTypeId<Test>(); } // The value of GetTestTypeId() as seen from within the Google Test // library. This is solely for testing GetTestTypeId(). extern const TypeId kTestTypeIdInGoogleTest = GetTestTypeId(); // This predicate-formatter checks that 'results' contains a test part // failure of the given type and that the failure message contains the // given substring.
+ show +
632
633
634
635
636
637
638
639
640
AssertionResult HasOneFailure(const char* /* results_expr */, const char* /* type_expr */, const char* /* substr_expr */, const TestPartResultArray& results, TestPartResult::Type type, const string& substr) { const std::string expected(type == TestPartResult::kFatalFailure ? "1 fatal failure" : "1 non-fatal failure");
+ show +
641
642
643
644
645
646
647
648
649
650
Message msg; if (results.size() != 1) { msg << "Expected: " << expected << "\n" << " Actual: " << results.size() << " failures"; for (int i = 0; i < results.size(); i++) { msg << "\n" << results.GetTestPartResult(i); } return AssertionFailure() << msg; }

[CVE-2020-0470_1.diff] gtest.cc #24
-SingleFailureChecker:: SingleFailureChecker( - const TestPartResultArray* results, - TestPartResult::Type type, - const string& substr) - : results_(results), - type_(type), - substr_(substr) {} +SingleFailureChecker::SingleFailureChecker(const TestPartResultArray *results, + TestPartResult::Type type, + const std::string &substr) + : results_(results), type_(type), substr_(substr) {}
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest.cc
634
635
636
637
638
639
640
641
642
643
<< " Actual:\n" << r; } return AssertionSuccess(); } // The constructor of SingleFailureChecker remembers where to look up // test part results, what type of failure we expect, and what // substring the failure message should contain.
+ show +
644
645
646
647
648
649
650
SingleFailureChecker:: SingleFailureChecker( const TestPartResultArray* results, TestPartResult::Type type, const string& substr) : results_(results), type_(type), substr_(substr) {}
+ show +
651
652
653
654
655
656
657
658
659
660
// The destructor of SingleFailureChecker verifies that the given // TestPartResultArray contains exactly one failure that has the given // type and contains the given substring. If that's not the case, a // non-fatal failure will be generated. SingleFailureChecker::~SingleFailureChecker() { EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_); } DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
<< " Actual:\n" << r; } return AssertionSuccess(); } // The constructor of SingleFailureChecker remembers where to look up // test part results, what type of failure we expect, and what // substring the failure message should contain.
+ show +
2132
2133
2134
2135
2136
2137
2138
SingleFailureChecker:: SingleFailureChecker( const TestPartResultArray* results, TestPartResult::Type type, const string& substr) : results_(results), type_(type), substr_(substr) {}
+ show +
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
// The destructor of SingleFailureChecker verifies that the given // TestPartResultArray contains exactly one failure that has the given // type and contains the given substring. If that's not the case, a // non-fatal failure will be generated. SingleFailureChecker::~SingleFailureChecker() { EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_); } DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
<< " Actual:\n" << r; } return AssertionSuccess(); } // The constructor of SingleFailureChecker remembers where to look up // test part results, what type of failure we expect, and what // substring the failure message should contain.
+ show +
2132
2133
2134
2135
2136
2137
2138
SingleFailureChecker:: SingleFailureChecker( const TestPartResultArray* results, TestPartResult::Type type, const string& substr) : results_(results), type_(type), substr_(substr) {}
+ show +
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
// The destructor of SingleFailureChecker verifies that the given // TestPartResultArray contains exactly one failure that has the given // type and contains the given substring. If that's not the case, a // non-fatal failure will be generated. SingleFailureChecker::~SingleFailureChecker() { EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_); } DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
<< " Actual:\n" << r; } return AssertionSuccess(); } // The constructor of SingleFailureChecker remembers where to look up // test part results, what type of failure we expect, and what // substring the failure message should contain.
+ show +
2118
2119
2120
2121
2122
2123
2124
SingleFailureChecker:: SingleFailureChecker( const TestPartResultArray* results, TestPartResult::Type type, const string& substr) : results_(results), type_(type), substr_(substr) {}
+ show +
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
// The destructor of SingleFailureChecker verifies that the given // TestPartResultArray contains exactly one failure that has the given // type and contains the given substring. If that's not the case, a // non-fatal failure will be generated. SingleFailureChecker::~SingleFailureChecker() { EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_); } DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/src/gtest.cc
635
636
637
638
639
640
641
642
643
644
<< " Actual:\n" << r; } return AssertionSuccess(); } // The constructor of SingleFailureChecker remembers where to look up // test part results, what type of failure we expect, and what // substring the failure message should contain.
+ show +
645
646
647
648
649
650
651
SingleFailureChecker:: SingleFailureChecker( const TestPartResultArray* results, TestPartResult::Type type, const string& substr) : results_(results), type_(type), substr_(substr) {}
+ show +
652
653
654
655
656
657
658
659
660
661
// The destructor of SingleFailureChecker verifies that the given // TestPartResultArray contains exactly one failure that has the given // type and contains the given substring. If that's not the case, a // non-fatal failure will be generated. SingleFailureChecker::~SingleFailureChecker() { EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_); } DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/src/gtest.cc
634
635
636
637
638
639
640
641
642
643
<< " Actual:\n" << r; } return AssertionSuccess(); } // The constructor of SingleFailureChecker remembers where to look up // test part results, what type of failure we expect, and what // substring the failure message should contain.
+ show +
644
645
646
647
648
649
650
SingleFailureChecker:: SingleFailureChecker( const TestPartResultArray* results, TestPartResult::Type type, const string& substr) : results_(results), type_(type), substr_(substr) {}
+ show +
651
652
653
654
655
656
657
658
659
660
// The destructor of SingleFailureChecker verifies that the given // TestPartResultArray contains exactly one failure that has the given // type and contains the given substring. If that's not the case, a // non-fatal failure will be generated. SingleFailureChecker::~SingleFailureChecker() { EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_); } DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest.cc
660
661
662
663
664
665
666
667
668
669
<< " Actual:\n" << r; } return AssertionSuccess(); } // The constructor of SingleFailureChecker remembers where to look up // test part results, what type of failure we expect, and what // substring the failure message should contain.
+ show +
670
671
672
673
674
675
676
SingleFailureChecker:: SingleFailureChecker( const TestPartResultArray* results, TestPartResult::Type type, const string& substr) : results_(results), type_(type), substr_(substr) {}
+ show +
677
678
679
680
681
682
683
684
685
686
// The destructor of SingleFailureChecker verifies that the given // TestPartResultArray contains exactly one failure that has the given // type and contains the given substring. If that's not the case, a // non-fatal failure will be generated. SingleFailureChecker::~SingleFailureChecker() { EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_); } DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/gtest.cc
634
635
636
637
638
639
640
641
642
643
<< " Actual:\n" << r; } return AssertionSuccess(); } // The constructor of SingleFailureChecker remembers where to look up // test part results, what type of failure we expect, and what // substring the failure message should contain.
+ show +
644
645
646
647
648
649
650
SingleFailureChecker:: SingleFailureChecker( const TestPartResultArray* results, TestPartResult::Type type, const string& substr) : results_(results), type_(type), substr_(substr) {}
+ show +
651
652
653
654
655
656
657
658
659
660
// The destructor of SingleFailureChecker verifies that the given // TestPartResultArray contains exactly one failure that has the given // type and contains the given substring. If that's not the case, a // non-fatal failure will be generated. SingleFailureChecker::~SingleFailureChecker() { EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_); } DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest.cc
661
662
663
664
665
666
667
668
669
670
<< " Actual:\n" << r; } return AssertionSuccess(); } // The constructor of SingleFailureChecker remembers where to look up // test part results, what type of failure we expect, and what // substring the failure message should contain.
+ show +
671
672
673
674
675
676
677
SingleFailureChecker:: SingleFailureChecker( const TestPartResultArray* results, TestPartResult::Type type, const string& substr) : results_(results), type_(type), substr_(substr) {}
+ show +
678
679
680
681
682
683
684
685
686
687
// The destructor of SingleFailureChecker verifies that the given // TestPartResultArray contains exactly one failure that has the given // type and contains the given substring. If that's not the case, a // non-fatal failure will be generated. SingleFailureChecker::~SingleFailureChecker() { EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_); } DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(

[CVE-2020-0470_1.diff] gtest.cc #57
-// The following two functions only make sense if the the system +// The following two functions only make sense if the system -// with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. +// with 16 bit wchar_t (Windows, Cygwin) do use UTF-16. - return sizeof(wchar_t) == 2 && - (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; + return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && + (second & 0xFC00) == 0xDC00; -inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, - wchar_t second) { - const UInt32 mask = (1 << 10) - 1; - return (sizeof(wchar_t) == 2) ? - (((first & mask) << 10) | (second & mask)) + 0x10000 : - // This function should not be called when the condition is - // false, but we provide a sensible default in case it is. - static_cast<UInt32>(first); +inline uint32_t CreateCodePointFromUtf16SurrogatePair(wchar_t first, + wchar_t second) { + const auto first_u = static_cast<uint32_t>(first); + const auto second_u = static_cast<uint32_t>(second); + const uint32_t mask = (1 << 10) - 1; + return (sizeof(wchar_t) == 2) + ? (((first_u & mask) << 10) | (second_u & mask)) + 0x10000 + : + // This function should not be called when the condition is + // false, but we provide a sensible default in case it is. + first_u; -// UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) +// UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin)
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest.cc
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
} // The following two functions only make sense if the the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
} // The following two functions only make sense if the the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest.cc
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
} // The following two functions only make sense if the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
} // The following two functions only make sense if the the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest.cc
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
} // The following two functions only make sense if the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
} // The following two functions only make sense if the the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/src/gtest.cc
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
} // The following two functions only make sense if the the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest.cc
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
} // The following two functions only make sense if the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/src/gtest.cc
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
} // The following two functions only make sense if the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest.cc
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
} // The following two functions only make sense if the the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/gtest.cc
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
} // The following two functions only make sense if the the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest.cc
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
} // The following two functions only make sense if the the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. // Determines if the arguments constitute UTF-16 surrogate pair // and thus should be combined into a single Unicode code point // using CreateCodePointFromUtf16SurrogatePair. inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+ show +
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
return sizeof(wchar_t) == 2 && (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; } // Creates a Unicode code point from UTF16 surrogate pair. inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second) { const UInt32 mask = (1 << 10) - 1; return (sizeof(wchar_t) == 2) ? (((first & mask) << 10) | (second & mask)) + 0x10000 : // This function should not be called when the condition is // false, but we provide a sensible default in case it is. static_cast<UInt32>(first);
+ show +
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
} // Converts a wide string to a narrow string in UTF-8 encoding. // The wide string is assumed to have the following encoding: // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) // UTF-32 if sizeof(wchar_t) == 4 (on Linux) // Parameter str points to a null-terminated wide string. // Parameter num_chars may additionally limit the number // of wchar_t characters processed. -1 is used when the entire string // should be processed.

[CVE-2020-0470_1.diff] gtest.cc #93
- const TestPartResult& test_part_result) { - return (Message() - << internal::FormatFileLocation(test_part_result.file_name(), - test_part_result.line_number()) - << " " << TestPartResultTypeToString(test_part_result.type()) - << test_part_result.message()).GetString(); + const TestPartResult &test_part_result) { + return (Message() << internal::FormatFileLocation( + test_part_result.file_name(), + test_part_result.line_number()) + << " " + << TestPartResultTypeToString(test_part_result.type()) + << test_part_result.message()) + .GetString(); -static void PrintTestPartResult(const TestPartResult& test_part_result) { - const std::string& result = - PrintTestPartResultToString(test_part_result); +static void PrintTestPartResult(const TestPartResult &test_part_result) { + const std::string &result = PrintTestPartResultToString(test_part_result);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest.cc
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
#endif default: return "Unknown result type"; } } namespace internal { // Prints a TestPartResult to an std::string. static std::string PrintTestPartResultToString(
+ show +
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
const TestPartResult& test_part_result) { return (Message() << internal::FormatFileLocation(test_part_result.file_name(), test_part_result.line_number()) << " " << TestPartResultTypeToString(test_part_result.type()) << test_part_result.message()).GetString(); } // Prints a TestPartResult. static void PrintTestPartResult(const TestPartResult& test_part_result) { const std::string& result = PrintTestPartResultToString(test_part_result);
+ show +
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
printf("%s\n", result.c_str()); fflush(stdout); // If the test program runs in Visual Studio or a debugger, the // following statements add the test part result message to the Output // window such that the user can double-click on it to jump to the // corresponding source code location; otherwise they do nothing. #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE // We don't call OutputDebugString*() on Windows Mobile, as printing // to stdout is done by OutputDebugString() there already - we don't // want the same message printed twice.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
#endif default: return "Unknown result type"; } } namespace internal { // Prints a TestPartResult to an std::string. static std::string PrintTestPartResultToString(
+ show +
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
const TestPartResult& test_part_result) { return (Message() << internal::FormatFileLocation(test_part_result.file_name(), test_part_result.line_number()) << " " << TestPartResultTypeToString(test_part_result.type()) << test_part_result.message()).GetString(); } // Prints a TestPartResult. static void PrintTestPartResult(const TestPartResult& test_part_result) { const std::string& result = PrintTestPartResultToString(test_part_result);
+ show +
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
printf("%s\n", result.c_str()); fflush(stdout); // If the test program runs in Visual Studio or a debugger, the // following statements add the test part result message to the Output // window such that the user can double-click on it to jump to the // corresponding source code location; otherwise they do nothing. #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE // We don't call OutputDebugString*() on Windows Mobile, as printing // to stdout is done by OutputDebugString() there already - we don't // want the same message printed twice.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest.cc
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
#endif default: return "Unknown result type"; } } namespace internal { // Prints a TestPartResult to an std::string. static std::string PrintTestPartResultToString(
+ show +
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
const TestPartResult& test_part_result) { return (Message() << internal::FormatFileLocation(test_part_result.file_name(), test_part_result.line_number()) << " " << TestPartResultTypeToString(test_part_result.type()) << test_part_result.message()).GetString(); } // Prints a TestPartResult. static void PrintTestPartResult(const TestPartResult& test_part_result) { const std::string& result = PrintTestPartResultToString(test_part_result);
+ show +
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
printf("%s\n", result.c_str()); fflush(stdout); // If the test program runs in Visual Studio or a debugger, the // following statements add the test part result message to the Output // window such that the user can double-click on it to jump to the // corresponding source code location; otherwise they do nothing. #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE // We don't call OutputDebugString*() on Windows Mobile, as printing // to stdout is done by OutputDebugString() there already - we don't // want the same message printed twice.
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
#endif default: return "Unknown result type"; } } namespace internal { // Prints a TestPartResult to an std::string. static std::string PrintTestPartResultToString(
+ show +
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
const TestPartResult& test_part_result) { return (Message() << internal::FormatFileLocation(test_part_result.file_name(), test_part_result.line_number()) << " " << TestPartResultTypeToString(test_part_result.type()) << test_part_result.message()).GetString(); } // Prints a TestPartResult. static void PrintTestPartResult(const TestPartResult& test_part_result) { const std::string& result = PrintTestPartResultToString(test_part_result);
+ show +
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
printf("%s\n", result.c_str()); fflush(stdout); // If the test program runs in Visual Studio or a debugger, the // following statements add the test part result message to the Output // window such that the user can double-click on it to jump to the // corresponding source code location; otherwise they do nothing. #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE // We don't call OutputDebugString*() on Windows Mobile, as printing // to stdout is done by OutputDebugString() there already - we don't // want the same message printed twice.
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest.cc
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
#endif default: return "Unknown result type"; } } namespace internal { // Prints a TestPartResult to an std::string. static std::string PrintTestPartResultToString(
+ show +
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
const TestPartResult& test_part_result) { return (Message() << internal::FormatFileLocation(test_part_result.file_name(), test_part_result.line_number()) << " " << TestPartResultTypeToString(test_part_result.type()) << test_part_result.message()).GetString(); } // Prints a TestPartResult. static void PrintTestPartResult(const TestPartResult& test_part_result) { const std::string& result = PrintTestPartResultToString(test_part_result);
+ show +
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
printf("%s\n", result.c_str()); fflush(stdout); // If the test program runs in Visual Studio or a debugger, the // following statements add the test part result message to the Output // window such that the user can double-click on it to jump to the // corresponding source code location; otherwise they do nothing. #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE // We don't call OutputDebugString*() on Windows Mobile, as printing // to stdout is done by OutputDebugString() there already - we don't // want the same message printed twice.
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
#endif default: return "Unknown result type"; } } namespace internal { // Prints a TestPartResult to an std::string. static std::string PrintTestPartResultToString(
+ show +
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
const TestPartResult& test_part_result) { return (Message() << internal::FormatFileLocation(test_part_result.file_name(), test_part_result.line_number()) << " " << TestPartResultTypeToString(test_part_result.type()) << test_part_result.message()).GetString(); } // Prints a TestPartResult. static void PrintTestPartResult(const TestPartResult& test_part_result) { const std::string& result = PrintTestPartResultToString(test_part_result);
+ show +
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
printf("%s\n", result.c_str()); fflush(stdout); // If the test program runs in Visual Studio or a debugger, the // following statements add the test part result message to the Output // window such that the user can double-click on it to jump to the // corresponding source code location; otherwise they do nothing. #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE // We don't call OutputDebugString*() on Windows Mobile, as printing // to stdout is done by OutputDebugString() there already - we don't // want the same message printed twice.
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest.cc
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
#endif default: return "Unknown result type"; } } namespace internal { // Prints a TestPartResult to an std::string. static std::string PrintTestPartResultToString(
+ show +
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
const TestPartResult& test_part_result) { return (Message() << internal::FormatFileLocation(test_part_result.file_name(), test_part_result.line_number()) << " " << TestPartResultTypeToString(test_part_result.type()) << test_part_result.message()).GetString(); } // Prints a TestPartResult. static void PrintTestPartResult(const TestPartResult& test_part_result) { const std::string& result = PrintTestPartResultToString(test_part_result);
+ show +
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
printf("%s\n", result.c_str()); fflush(stdout); // If the test program runs in Visual Studio or a debugger, the // following statements add the test part result message to the Output // window such that the user can double-click on it to jump to the // corresponding source code location; otherwise they do nothing. #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE // We don't call OutputDebugString*() on Windows Mobile, as printing // to stdout is done by OutputDebugString() there already - we don't // want the same message printed twice.
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest.cc
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
#endif default: return "Unknown result type"; } } namespace internal { // Prints a TestPartResult to an std::string. static std::string PrintTestPartResultToString(
+ show +
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
const TestPartResult& test_part_result) { return (Message() << internal::FormatFileLocation(test_part_result.file_name(), test_part_result.line_number()) << " " << TestPartResultTypeToString(test_part_result.type()) << test_part_result.message()).GetString(); } // Prints a TestPartResult. static void PrintTestPartResult(const TestPartResult& test_part_result) { const std::string& result = PrintTestPartResultToString(test_part_result);
+ show +
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
printf("%s\n", result.c_str()); fflush(stdout); // If the test program runs in Visual Studio or a debugger, the // following statements add the test part result message to the Output // window such that the user can double-click on it to jump to the // corresponding source code location; otherwise they do nothing. #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE // We don't call OutputDebugString*() on Windows Mobile, as printing // to stdout is done by OutputDebugString() there already - we don't // want the same message printed twice.
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest.cc
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
#endif default: return "Unknown result type"; } } namespace internal { // Prints a TestPartResult to an std::string. static std::string PrintTestPartResultToString(
+ show +
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
const TestPartResult& test_part_result) { return (Message() << internal::FormatFileLocation(test_part_result.file_name(), test_part_result.line_number()) << " " << TestPartResultTypeToString(test_part_result.type()) << test_part_result.message()).GetString(); } // Prints a TestPartResult. static void PrintTestPartResult(const TestPartResult& test_part_result) { const std::string& result = PrintTestPartResultToString(test_part_result);
+ show +
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
printf("%s\n", result.c_str()); fflush(stdout); // If the test program runs in Visual Studio or a debugger, the // following statements add the test part result message to the Output // window such that the user can double-click on it to jump to the // corresponding source code location; otherwise they do nothing. #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE // We don't call OutputDebugString*() on Windows Mobile, as printing // to stdout is done by OutputDebugString() there already - we don't // want the same message printed twice.

[CVE-2020-0470_1.diff] gtest.cc #126
-void UnitTest::AddTestPartResult( - TestPartResult::Type result_type, - const char* file_name, - int line_number, - const std::string& message, - const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) { +void UnitTest::AddTestPartResult(TestPartResult::Type result_type, + const char *file_name, int line_number, + const std::string &message, + const std::string &os_stack_trace) + GTEST_LOCK_EXCLUDED_(mutex_) {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest.cc
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
} impl_->environments().push_back(env); return env; } // Adds a TestPartResult to the current TestResult object. All Google Test // assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call // this to report their results. The user code should use the // assertion macros instead of calling this directly.
+ show +
3708
3709
3710
3711
3712
3713
void UnitTest::AddTestPartResult( TestPartResult::Type result_type, const char* file_name, int line_number, const std::string& message, const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) {
+ show +
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
Message msg; msg << message; internal::MutexLock lock(&mutex_); if (impl_->gtest_trace_stack().size() > 0) { msg << "\n" << GTEST_NAME_ << " trace:"; for (int i = static_cast<int>(impl_->gtest_trace_stack().size()); i > 0; --i) { const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
} impl_->environments().push_back(env); return env; } // Adds a TestPartResult to the current TestResult object. All Google Test // assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call // this to report their results. The user code should use the // assertion macros instead of calling this directly.
+ show +
5261
5262
5263
5264
5265
5266
void UnitTest::AddTestPartResult( TestPartResult::Type result_type, const char* file_name, int line_number, const std::string& message, const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) {
+ show +
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
Message msg; msg << message; internal::MutexLock lock(&mutex_); if (impl_->gtest_trace_stack().size() > 0) { msg << "\n" << GTEST_NAME_ << " trace:"; for (int i = static_cast<int>(impl_->gtest_trace_stack().size()); i > 0; --i) { const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest.cc
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
} impl_->environments().push_back(env); return env; } // Adds a TestPartResult to the current TestResult object. All Google Test // assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call // this to report their results. The user code should use the // assertion macros instead of calling this directly.
+ show +
4132
4133
4134
4135
4136
4137
void UnitTest::AddTestPartResult( TestPartResult::Type result_type, const char* file_name, int line_number, const std::string& message, const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) {
+ show +
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
Message msg; msg << message; internal::MutexLock lock(&mutex_); if (impl_->gtest_trace_stack().size() > 0) { msg << "\n" << GTEST_NAME_ << " trace:"; for (int i = static_cast<int>(impl_->gtest_trace_stack().size()); i > 0; --i) { const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
} impl_->environments().push_back(env); return env; } // Adds a TestPartResult to the current TestResult object. All Google Test // assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call // this to report their results. The user code should use the // assertion macros instead of calling this directly.
+ show +
5261
5262
5263
5264
5265
5266
void UnitTest::AddTestPartResult( TestPartResult::Type result_type, const char* file_name, int line_number, const std::string& message, const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) {
+ show +
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
Message msg; msg << message; internal::MutexLock lock(&mutex_); if (impl_->gtest_trace_stack().size() > 0) { msg << "\n" << GTEST_NAME_ << " trace:"; for (int i = static_cast<int>(impl_->gtest_trace_stack().size()); i > 0; --i) { const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest.cc
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
} impl_->environments().push_back(env); return env; } // Adds a TestPartResult to the current TestResult object. All Google Test // assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call // this to report their results. The user code should use the // assertion macros instead of calling this directly.
+ show +
4697
4698
4699
4700
4701
4702
void UnitTest::AddTestPartResult( TestPartResult::Type result_type, const char* file_name, int line_number, const std::string& message, const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) {
+ show +
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
Message msg; msg << message; internal::MutexLock lock(&mutex_); if (impl_->gtest_trace_stack().size() > 0) { msg << "\n" << GTEST_NAME_ << " trace:"; for (int i = static_cast<int>(impl_->gtest_trace_stack().size()); i > 0; --i) { const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
} impl_->environments().push_back(env); return env; } // Adds a TestPartResult to the current TestResult object. All Google Test // assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call // this to report their results. The user code should use the // assertion macros instead of calling this directly.
+ show +
5560
5561
5562
5563
5564
5565
void UnitTest::AddTestPartResult( TestPartResult::Type result_type, const char* file_name, int line_number, const std::string& message, const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) {
+ show +
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
Message msg; msg << message; internal::MutexLock lock(&mutex_); if (impl_->gtest_trace_stack().size() > 0) { msg << "\n" << GTEST_NAME_ << " trace:"; for (int i = static_cast<int>(impl_->gtest_trace_stack().size()); i > 0; --i) { const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest.cc
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
} impl_->environments().push_back(env); return env; } // Adds a TestPartResult to the current TestResult object. All Google Test // assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call // this to report their results. The user code should use the // assertion macros instead of calling this directly.
+ show +
4632
4633
4634
4635
4636
4637
void UnitTest::AddTestPartResult( TestPartResult::Type result_type, const char* file_name, int line_number, const std::string& message, const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) {
+ show +
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
Message msg; msg << message; internal::MutexLock lock(&mutex_); if (impl_->gtest_trace_stack().size() > 0) { msg << "\n" << GTEST_NAME_ << " trace:"; for (int i = static_cast<int>(impl_->gtest_trace_stack().size()); i > 0; --i) { const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest.cc
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
} impl_->environments().push_back(env); return env; } // Adds a TestPartResult to the current TestResult object. All Google Test // assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call // this to report their results. The user code should use the // assertion macros instead of calling this directly.
+ show +
4108
4109
4110
4111
4112
4113
void UnitTest::AddTestPartResult( TestPartResult::Type result_type, const char* file_name, int line_number, const std::string& message, const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) {
+ show +
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
Message msg; msg << message; internal::MutexLock lock(&mutex_); if (impl_->gtest_trace_stack().size() > 0) { msg << "\n" << GTEST_NAME_ << " trace:"; for (int i = static_cast<int>(impl_->gtest_trace_stack().size()); i > 0; --i) { const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest.cc
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
} impl_->environments().push_back(env); return env; } // Adds a TestPartResult to the current TestResult object. All Google Test // assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call // this to report their results. The user code should use the // assertion macros instead of calling this directly.
+ show +
4109
4110
4111
4112
4113
4114
void UnitTest::AddTestPartResult( TestPartResult::Type result_type, const char* file_name, int line_number, const std::string& message, const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) {
+ show +
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
Message msg; msg << message; internal::MutexLock lock(&mutex_); if (impl_->gtest_trace_stack().size() > 0) { msg << "\n" << GTEST_NAME_ << " trace:"; for (int i = static_cast<int>(impl_->gtest_trace_stack().size()); i > 0; --i) { const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];

[CVE-2020-0470_1.diff] gtest.cc #138
- // Makes sure InitGoogleTest() was called. - if (!GTestIsInitialized()) { - printf("%s", - "\nThis test program did NOT call ::testing::InitGoogleTest " - "before calling RUN_ALL_TESTS(). Please fix it.\n"); - return false; - } + // True if and only if Google Test is initialized before RUN_ALL_TESTS() is + // called. + const bool gtest_is_initialized_before_run_all_tests = GTestIsInitialized(); - if (g_help_flag) - return true; + if (g_help_flag) return true;
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest.cc
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
// returns true if all tests are successful. If any exception is // thrown during a test, the test is considered to be failed, but the // rest of the tests will still be run. // // When parameterized tests are enabled, it expands and registers // parameterized tests first in RegisterParameterizedTests(). // All other functions called from RunAllTests() may safely assume that // parameterized tests are ready to be counted and run. bool UnitTestImpl::RunAllTests() { // Makes sure InitGoogleTest() was called.
+ show +
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
if (!GTestIsInitialized()) { printf("%s", "\nThis test program did NOT call ::testing::InitGoogleTest " "before calling RUN_ALL_TESTS(). Please fix it.\n"); return false; } // Do not run any test if the --help flag was specified. if (g_help_flag) return true;
+ show +
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
// Repeats the call to the post-flag parsing initialization in case the // user didn't call InitGoogleTest. PostFlagParsingInit(); // Even if sharding is not on, test runners may want to use the // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding // protocol. internal::WriteToShardStatusFileIfNeeded();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
// returns true if all tests are successful. If any exception is // thrown during a test, the test is considered to be failed, but the // rest of the tests will still be run. // // When parameterized tests are enabled, it expands and registers // parameterized tests first in RegisterParameterizedTests(). // All other functions called from RunAllTests() may safely assume that // parameterized tests are ready to be counted and run. bool UnitTestImpl::RunAllTests() { // Makes sure InitGoogleTest() was called.
+ show +
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
if (!GTestIsInitialized()) { printf("%s", "\nThis test program did NOT call ::testing::InitGoogleTest " "before calling RUN_ALL_TESTS(). Please fix it.\n"); return false; } // Do not run any test if the --help flag was specified. if (g_help_flag) return true;
+ show +
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
// Repeats the call to the post-flag parsing initialization in case the // user didn't call InitGoogleTest. PostFlagParsingInit(); // Even if sharding is not on, test runners may want to use the // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding // protocol. internal::WriteToShardStatusFileIfNeeded();
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
// returns true if all tests are successful. If any exception is // thrown during a test, the test is considered to be failed, but the // rest of the tests will still be run. // // When parameterized tests are enabled, it expands and registers // parameterized tests first in RegisterParameterizedTests(). // All other functions called from RunAllTests() may safely assume that // parameterized tests are ready to be counted and run. bool UnitTestImpl::RunAllTests() { // Makes sure InitGoogleTest() was called.
+ show +
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
if (!GTestIsInitialized()) { printf("%s", "\nThis test program did NOT call ::testing::InitGoogleTest " "before calling RUN_ALL_TESTS(). Please fix it.\n"); return false; } // Do not run any test if the --help flag was specified. if (g_help_flag) return true;
+ show +
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
// Repeats the call to the post-flag parsing initialization in case the // user didn't call InitGoogleTest. PostFlagParsingInit(); // Even if sharding is not on, test runners may want to use the // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding // protocol. internal::WriteToShardStatusFileIfNeeded();
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
// returns true if all tests are successful. If any exception is // thrown during a test, the test is considered to be failed, but the // rest of the tests will still be run. // // When parameterized tests are enabled, it expands and registers // parameterized tests first in RegisterParameterizedTests(). // All other functions called from RunAllTests() may safely assume that // parameterized tests are ready to be counted and run. bool UnitTestImpl::RunAllTests() { // Makes sure InitGoogleTest() was called.
+ show +
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
if (!GTestIsInitialized()) { printf("%s", "\nThis test program did NOT call ::testing::InitGoogleTest " "before calling RUN_ALL_TESTS(). Please fix it.\n"); return false; } // Do not run any test if the --help flag was specified. if (g_help_flag) return true;
+ show +
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
// Repeats the call to the post-flag parsing initialization in case the // user didn't call InitGoogleTest. PostFlagParsingInit(); // Even if sharding is not on, test runners may want to use the // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding // protocol. internal::WriteToShardStatusFileIfNeeded();
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/src/gtest.cc
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
// returns true if all tests are successful. If any exception is // thrown during a test, the test is considered to be failed, but the // rest of the tests will still be run. // // When parameterized tests are enabled, it expands and registers // parameterized tests first in RegisterParameterizedTests(). // All other functions called from RunAllTests() may safely assume that // parameterized tests are ready to be counted and run. bool UnitTestImpl::RunAllTests() { // Makes sure InitGoogleTest() was called.
+ show +
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
if (!GTestIsInitialized()) { printf("%s", "\nThis test program did NOT call ::testing::InitGoogleTest " "before calling RUN_ALL_TESTS(). Please fix it.\n"); return false; } // Do not run any test if the --help flag was specified. if (g_help_flag) return true;
+ show +
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
// Repeats the call to the post-flag parsing initialization in case the // user didn't call InitGoogleTest. PostFlagParsingInit(); // Even if sharding is not on, test runners may want to use the // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding // protocol. internal::WriteToShardStatusFileIfNeeded();
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/src/gtest.cc
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
// returns true if all tests are successful. If any exception is // thrown during a test, the test is considered to be failed, but the // rest of the tests will still be run. // // When parameterized tests are enabled, it expands and registers // parameterized tests first in RegisterParameterizedTests(). // All other functions called from RunAllTests() may safely assume that // parameterized tests are ready to be counted and run. bool UnitTestImpl::RunAllTests() { // Makes sure InitGoogleTest() was called.
+ show +
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
if (!GTestIsInitialized()) { printf("%s", "\nThis test program did NOT call ::testing::InitGoogleTest " "before calling RUN_ALL_TESTS(). Please fix it.\n"); return false; } // Do not run any test if the --help flag was specified. if (g_help_flag) return true;
+ show +
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
// Repeats the call to the post-flag parsing initialization in case the // user didn't call InitGoogleTest. PostFlagParsingInit(); // Even if sharding is not on, test runners may want to use the // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding // protocol. internal::WriteToShardStatusFileIfNeeded();
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest.cc
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
// returns true if all tests are successful. If any exception is // thrown during a test, the test is considered to be failed, but the // rest of the tests will still be run. // // When parameterized tests are enabled, it expands and registers // parameterized tests first in RegisterParameterizedTests(). // All other functions called from RunAllTests() may safely assume that // parameterized tests are ready to be counted and run. bool UnitTestImpl::RunAllTests() { // Makes sure InitGoogleTest() was called.
+ show +
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
if (!GTestIsInitialized()) { printf("%s", "\nThis test program did NOT call ::testing::InitGoogleTest " "before calling RUN_ALL_TESTS(). Please fix it.\n"); return false; } // Do not run any test if the --help flag was specified. if (g_help_flag) return true;
+ show +
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
// Repeats the call to the post-flag parsing initialization in case the // user didn't call InitGoogleTest. PostFlagParsingInit(); // Even if sharding is not on, test runners may want to use the // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding // protocol. internal::WriteToShardStatusFileIfNeeded();
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/gtest.cc
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
// returns true if all tests are successful. If any exception is // thrown during a test, the test is considered to be failed, but the // rest of the tests will still be run. // // When parameterized tests are enabled, it expands and registers // parameterized tests first in RegisterParameterizedTests(). // All other functions called from RunAllTests() may safely assume that // parameterized tests are ready to be counted and run. bool UnitTestImpl::RunAllTests() { // Makes sure InitGoogleTest() was called.
+ show +
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
if (!GTestIsInitialized()) { printf("%s", "\nThis test program did NOT call ::testing::InitGoogleTest " "before calling RUN_ALL_TESTS(). Please fix it.\n"); return false; } // Do not run any test if the --help flag was specified. if (g_help_flag) return true;
+ show +
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
// Repeats the call to the post-flag parsing initialization in case the // user didn't call InitGoogleTest. PostFlagParsingInit(); // Even if sharding is not on, test runners may want to use the // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding // protocol. internal::WriteToShardStatusFileIfNeeded();
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest.cc
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
// returns true if all tests are successful. If any exception is // thrown during a test, the test is considered to be failed, but the // rest of the tests will still be run. // // When parameterized tests are enabled, it expands and registers // parameterized tests first in RegisterParameterizedTests(). // All other functions called from RunAllTests() may safely assume that // parameterized tests are ready to be counted and run. bool UnitTestImpl::RunAllTests() { // Makes sure InitGoogleTest() was called.
+ show +
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
if (!GTestIsInitialized()) { printf("%s", "\nThis test program did NOT call ::testing::InitGoogleTest " "before calling RUN_ALL_TESTS(). Please fix it.\n"); return false; } // Do not run any test if the --help flag was specified. if (g_help_flag) return true;
+ show +
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
// Repeats the call to the post-flag parsing initialization in case the // user didn't call InitGoogleTest. PostFlagParsingInit(); // Even if sharding is not on, test runners may want to use the // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding // protocol. internal::WriteToShardStatusFileIfNeeded();

[CVE-2020-0470_1.diff] gtest.cc #145
+ if (!gtest_is_initialized_before_run_all_tests) { + ColoredPrintf( + COLOR_RED, + "\nIMPORTANT NOTICE - DO NOT IGNORE:\n" + "This test program did NOT call " GTEST_INIT_GOOGLE_TEST_NAME_ + "() before calling RUN_ALL_TESTS(). This is INVALID. Soon " GTEST_NAME_ + " will start to enforce the valid usage. " + "Please fix it ASAP, or IT WILL START TO FAIL.\n"); // NOLINT +#if GTEST_FOR_GOOGLE_ + ColoredPrintf(COLOR_RED, + "For more details, see http://wiki/Main/ValidGUnitMain.\n"); +#endif // GTEST_FOR_GOOGLE_ + } + - const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); - if (test_shard_file != NULL) { - FILE* const file = posix::FOpen(test_shard_file, "w"); - if (file == NULL) { + const char *const test_shard_file = posix::GetEnv(kTestShardStatusFile); + if (test_shard_file != nullptr) { + FILE *const file = posix::FOpen(test_shard_file, "w"); + if (file == nullptr) {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/googletest/googletest/src/gtest.cc
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
repeater->OnTestProgramEnd(*parent_); return !failed; } // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file // if the variable is present. If a file already exists at this location, this // function will write over it. If the variable is present, but the file cannot // be created, prints an error and exits. void WriteToShardStatusFileIfNeeded() {
+ show +
4267
4268
4269
4270
const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); if (test_shard_file != NULL) { FILE* const file = posix::FOpen(test_shard_file, "w"); if (file == NULL) {
+ show +
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
ColoredPrintf(COLOR_RED, "Could not write to the test shard status file \"%s\" " "specified by the %s environment variable.\n", test_shard_file, kTestShardStatusFile); fflush(stdout); exit(EXIT_FAILURE); } fclose(file); } }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
repeater->OnTestProgramEnd(*parent_); return !failed; } // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file // if the variable is present. If a file already exists at this location, this // function will write over it. If the variable is present, but the file cannot // be created, prints an error and exits. void WriteToShardStatusFileIfNeeded() {
+ show +
5844
5845
5846
5847
const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); if (test_shard_file != NULL) { FILE* const file = posix::FOpen(test_shard_file, "w"); if (file == NULL) {
+ show +
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
ColoredPrintf(COLOR_RED, "Could not write to the test shard status file \"%s\" " "specified by the %s environment variable.\n", test_shard_file, kTestShardStatusFile); fflush(stdout); exit(EXIT_FAILURE); } fclose(file); } }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest.cc
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
repeater->OnTestProgramEnd(*parent_); return !failed; } // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file // if the variable is present. If a file already exists at this location, this // function will write over it. If the variable is present, but the file cannot // be created, prints an error and exits. void WriteToShardStatusFileIfNeeded() {
+ show +
4718
4719
4720
4721
const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); if (test_shard_file != NULL) { FILE* const file = posix::FOpen(test_shard_file, "w"); if (file == NULL) {
+ show +
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
ColoredPrintf(COLOR_RED, "Could not write to the test shard status file \"%s\" " "specified by the %s environment variable.\n", test_shard_file, kTestShardStatusFile); fflush(stdout); exit(EXIT_FAILURE); } fclose(file); } }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest-all.cc
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
repeater->OnTestProgramEnd(*parent_); return !failed; } // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file // if the variable is present. If a file already exists at this location, this // function will write over it. If the variable is present, but the file cannot // be created, prints an error and exits. void WriteToShardStatusFileIfNeeded() {
+ show +
5844
5845
5846
5847
const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); if (test_shard_file != NULL) { FILE* const file = posix::FOpen(test_shard_file, "w"); if (file == NULL) {
+ show +
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
ColoredPrintf(COLOR_RED, "Could not write to the test shard status file \"%s\" " "specified by the %s environment variable.\n", test_shard_file, kTestShardStatusFile); fflush(stdout); exit(EXIT_FAILURE); } fclose(file); } }
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
repeater->OnTestProgramEnd(*parent_); return !failed; } // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file // if the variable is present. If a file already exists at this location, this // function will write over it. If the variable is present, but the file cannot // be created, prints an error and exits. void WriteToShardStatusFileIfNeeded() {
+ show +
6146
6147
6148
6149
const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); if (test_shard_file != NULL) { FILE* const file = posix::FOpen(test_shard_file, "w"); if (file == NULL) {
+ show +
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
ColoredPrintf(COLOR_RED, "Could not write to the test shard status file \"%s\" " "specified by the %s environment variable.\n", test_shard_file, kTestShardStatusFile); fflush(stdout); exit(EXIT_FAILURE); } fclose(file); } }
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/src/gtest.cc
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
repeater->OnTestProgramEnd(*parent_); return !failed; } // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file // if the variable is present. If a file already exists at this location, this // function will write over it. If the variable is present, but the file cannot // be created, prints an error and exits. void WriteToShardStatusFileIfNeeded() {
+ show +
4314
4315
4316
4317
const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); if (test_shard_file != NULL) { FILE* const file = posix::FOpen(test_shard_file, "w"); if (file == NULL) {
+ show +
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
ColoredPrintf(COLOR_RED, "Could not write to the test shard status file \"%s\" " "specified by the %s environment variable.\n", test_shard_file, kTestShardStatusFile); fflush(stdout); exit(EXIT_FAILURE); } fclose(file); } }
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest.cc
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
} return !failed; } // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file // if the variable is present. If a file already exists at this location, this // function will write over it. If the variable is present, but the file cannot // be created, prints an error and exits. void WriteToShardStatusFileIfNeeded() {
+ show +
5236
5237
5238
5239
const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); if (test_shard_file != NULL) { FILE* const file = posix::FOpen(test_shard_file, "w"); if (file == NULL) {
+ show +
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
ColoredPrintf(COLOR_RED, "Could not write to the test shard status file \"%s\" " "specified by the %s environment variable.\n", test_shard_file, kTestShardStatusFile); fflush(stdout); exit(EXIT_FAILURE); } fclose(file); } }
/media/esteban/ACOS/ResurrectionX/external/llvm/utils/unittest/googletest/src/gtest.cc
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
repeater->OnTestProgramEnd(*parent_); return !failed; } // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file // if the variable is present. If a file already exists at this location, this // function will write over it. If the variable is present, but the file cannot // be created, prints an error and exits. void WriteToShardStatusFileIfNeeded() {
+ show +
4252
4253
4254
4255
const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); if (test_shard_file != NULL) { FILE* const file = posix::FOpen(test_shard_file, "w"); if (file == NULL) {
+ show +
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
ColoredPrintf(COLOR_RED, "Could not write to the test shard status file \"%s\" " "specified by the %s environment variable.\n", test_shard_file, kTestShardStatusFile); fflush(stdout); exit(EXIT_FAILURE); } fclose(file); } }
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest.cc
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
repeater->OnTestProgramEnd(*parent_); return !failed; } // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file // if the variable is present. If a file already exists at this location, this // function will write over it. If the variable is present, but the file cannot // be created, prints an error and exits. void WriteToShardStatusFileIfNeeded() {
+ show +
4694
4695
4696
4697
const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); if (test_shard_file != NULL) { FILE* const file = posix::FOpen(test_shard_file, "w"); if (file == NULL) {
+ show +
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
ColoredPrintf(COLOR_RED, "Could not write to the test shard status file \"%s\" " "specified by the %s environment variable.\n", test_shard_file, kTestShardStatusFile); fflush(stdout); exit(EXIT_FAILURE); } fclose(file); } }
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/LLVM/utils/unittest/googletest/gtest.cc
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
repeater->OnTestProgramEnd(*parent_); return !failed; } // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file // if the variable is present. If a file already exists at this location, this // function will write over it. If the variable is present, but the file cannot // be created, prints an error and exits. void WriteToShardStatusFileIfNeeded() {
+ show +
4249
4250
4251
4252
const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); if (test_shard_file != NULL) { FILE* const file = posix::FOpen(test_shard_file, "w"); if (file == NULL) {
+ show +
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
ColoredPrintf(COLOR_RED, "Could not write to the test shard status file \"%s\" " "specified by the %s environment variable.\n", test_shard_file, kTestShardStatusFile); fflush(stdout); exit(EXIT_FAILURE); } fclose(file); } }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest.cc
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
repeater->OnTestProgramEnd(*parent_); return !failed; } // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file // if the variable is present. If a file already exists at this location, this // function will write over it. If the variable is present, but the file cannot // be created, prints an error and exits. void WriteToShardStatusFileIfNeeded() {
+ show +
4695
4696
4697
4698
const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); if (test_shard_file != NULL) { FILE* const file = posix::FOpen(test_shard_file, "w"); if (file == NULL) {
+ show +
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
ColoredPrintf(COLOR_RED, "Could not write to the test shard status file \"%s\" " "specified by the %s environment variable.\n", test_shard_file, kTestShardStatusFile); fflush(stdout); exit(EXIT_FAILURE); } fclose(file); } }

[CVE-2020-0478_1.diff] gtest-port.h #16
-# if GTEST_OS_LINUX && !defined(__ia64__) -# if GTEST_OS_LINUX_ANDROID -// On Android, clone() is only available on ARM starting with Gingerbread. -# if defined(__arm__) && __ANDROID_API__ >= 9 -# define GTEST_HAS_CLONE 1 -# else -# define GTEST_HAS_CLONE 0 -# endif -# else -# define GTEST_HAS_CLONE 1 -# endif -# else -# define GTEST_HAS_CLONE 0 -# endif // GTEST_OS_LINUX && !defined(__ia64__) +#if GTEST_OS_LINUX && !defined(__ia64__) +#if GTEST_OS_LINUX_ANDROID +// On Android, clone() became available at different API levels for each 32-bit +// architecture. +#if defined(__LP64__) || (defined(__arm__) && __ANDROID_API__ >= 9) || \ + (defined(__mips__) && __ANDROID_API__ >= 12) || \ + (defined(__i386__) && __ANDROID_API__ >= 17) +#define GTEST_HAS_CLONE 1 +#else +#define GTEST_HAS_CLONE 0 +#endif +#else +#define GTEST_HAS_CLONE 1 +#endif +#else +#define GTEST_HAS_CLONE 0 +#endif // GTEST_OS_LINUX && !defined(__ia64__)
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
#endif // GTEST_HAS_TR1_TUPLE // Determines whether clone(2) is supported. // Usually it will only be available on Linux, excluding // Linux on the Itanium architecture. // Also see http://linux.die.net/man/2/clone. #ifndef GTEST_HAS_CLONE // The user didn't tell us, so we need to figure it out.
+ show +
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
# if GTEST_OS_LINUX && !defined(__ia64__) # if GTEST_OS_LINUX_ANDROID // On Android, clone() is only available on ARM starting with Gingerbread. # if defined(__arm__) && __ANDROID_API__ >= 9 # define GTEST_HAS_CLONE 1 # else # define GTEST_HAS_CLONE 0 # endif # else # define GTEST_HAS_CLONE 1 # endif # else # define GTEST_HAS_CLONE 0 # endif // GTEST_OS_LINUX && !defined(__ia64__)
+ show +
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
#endif // GTEST_HAS_CLONE // Determines whether to support stream redirection. This is used to test // output correctness and to implement death tests. #ifndef GTEST_HAS_STREAM_REDIRECTION // By default, we assume that stream redirection is supported on all // platforms except known mobile ones. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN # define GTEST_HAS_STREAM_REDIRECTION 0
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-port.h
609
610
611
612
613
614
615
616
617
618
#endif // GTEST_HAS_TR1_TUPLE // Determines whether clone(2) is supported. // Usually it will only be available on Linux, excluding // Linux on the Itanium architecture. // Also see http://linux.die.net/man/2/clone. #ifndef GTEST_HAS_CLONE // The user didn't tell us, so we need to figure it out.
+ show +
619
620
621
622
623
624
625
626
627
628
629
630
631
632
# if GTEST_OS_LINUX && !defined(__ia64__) # if GTEST_OS_LINUX_ANDROID // On Android, clone() is only available on ARM starting with Gingerbread. # if defined(__arm__) && __ANDROID_API__ >= 9 # define GTEST_HAS_CLONE 1 # else # define GTEST_HAS_CLONE 0 # endif # else # define GTEST_HAS_CLONE 1 # endif # else # define GTEST_HAS_CLONE 0 # endif // GTEST_OS_LINUX && !defined(__ia64__)
+ show +
633
634
635
636
637
638
639
640
641
642
#endif // GTEST_HAS_CLONE // Determines whether to support stream redirection. This is used to test // output correctness and to implement death tests. #ifndef GTEST_HAS_STREAM_REDIRECTION // By default, we assume that stream redirection is supported on all // platforms except known mobile ones. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN # define GTEST_HAS_STREAM_REDIRECTION 0
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-port.h.orig
602
603
604
605
606
607
608
609
610
611
#endif // GTEST_HAS_TR1_TUPLE // Determines whether clone(2) is supported. // Usually it will only be available on Linux, excluding // Linux on the Itanium architecture. // Also see http://linux.die.net/man/2/clone. #ifndef GTEST_HAS_CLONE // The user didn't tell us, so we need to figure it out.
+ show +
612
613
614
615
616
617
618
619
620
621
622
623
624
625
# if GTEST_OS_LINUX && !defined(__ia64__) # if GTEST_OS_LINUX_ANDROID // On Android, clone() is only available on ARM starting with Gingerbread. # if defined(__arm__) && __ANDROID_API__ >= 9 # define GTEST_HAS_CLONE 1 # else # define GTEST_HAS_CLONE 0 # endif # else # define GTEST_HAS_CLONE 1 # endif # else # define GTEST_HAS_CLONE 0 # endif // GTEST_OS_LINUX && !defined(__ia64__)
+ show +
626
627
628
629
630
631
632
633
634
635
#endif // GTEST_HAS_CLONE // Determines whether to support stream redirection. This is used to test // output correctness and to implement death tests. #ifndef GTEST_HAS_STREAM_REDIRECTION // By default, we assume that stream redirection is supported on all // platforms except known mobile ones. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN # define GTEST_HAS_STREAM_REDIRECTION 0
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
#endif // GTEST_HAS_TR1_TUPLE // Determines whether clone(2) is supported. // Usually it will only be available on Linux, excluding // Linux on the Itanium architecture. // Also see http://linux.die.net/man/2/clone. #ifndef GTEST_HAS_CLONE // The user didn't tell us, so we need to figure it out.
+ show +
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
# if GTEST_OS_LINUX && !defined(__ia64__) # if GTEST_OS_LINUX_ANDROID // On Android, clone() is only available on ARM starting with Gingerbread. # if defined(__arm__) && __ANDROID_API__ >= 9 # define GTEST_HAS_CLONE 1 # else # define GTEST_HAS_CLONE 0 # endif # else # define GTEST_HAS_CLONE 1 # endif # else # define GTEST_HAS_CLONE 0 # endif // GTEST_OS_LINUX && !defined(__ia64__)
+ show +
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
#endif // GTEST_HAS_CLONE // Determines whether to support stream redirection. This is used to test // output correctness and to implement death tests. #ifndef GTEST_HAS_STREAM_REDIRECTION // By default, we assume that stream redirection is supported on all // platforms except known mobile ones. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN # define GTEST_HAS_STREAM_REDIRECTION 0
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-port.h
609
610
611
612
613
614
615
616
617
618
#endif // GTEST_HAS_TR1_TUPLE // Determines whether clone(2) is supported. // Usually it will only be available on Linux, excluding // Linux on the Itanium architecture. // Also see http://linux.die.net/man/2/clone. #ifndef GTEST_HAS_CLONE // The user didn't tell us, so we need to figure it out.
+ show +
619
620
621
622
623
624
625
626
627
628
629
630
631
632
# if GTEST_OS_LINUX && !defined(__ia64__) # if GTEST_OS_LINUX_ANDROID // On Android, clone() is only available on ARM starting with Gingerbread. # if defined(__arm__) && __ANDROID_API__ >= 9 # define GTEST_HAS_CLONE 1 # else # define GTEST_HAS_CLONE 0 # endif # else # define GTEST_HAS_CLONE 1 # endif # else # define GTEST_HAS_CLONE 0 # endif // GTEST_OS_LINUX && !defined(__ia64__)
+ show +
633
634
635
636
637
638
639
640
641
642
#endif // GTEST_HAS_CLONE // Determines whether to support stream redirection. This is used to test // output correctness and to implement death tests. #ifndef GTEST_HAS_STREAM_REDIRECTION // By default, we assume that stream redirection is supported on all // platforms except known mobile ones. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN # define GTEST_HAS_STREAM_REDIRECTION 0
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-port.h.orig
602
603
604
605
606
607
608
609
610
611
#endif // GTEST_HAS_TR1_TUPLE // Determines whether clone(2) is supported. // Usually it will only be available on Linux, excluding // Linux on the Itanium architecture. // Also see http://linux.die.net/man/2/clone. #ifndef GTEST_HAS_CLONE // The user didn't tell us, so we need to figure it out.
+ show +
612
613
614
615
616
617
618
619
620
621
622
623
624
625
# if GTEST_OS_LINUX && !defined(__ia64__) # if GTEST_OS_LINUX_ANDROID // On Android, clone() is only available on ARM starting with Gingerbread. # if defined(__arm__) && __ANDROID_API__ >= 9 # define GTEST_HAS_CLONE 1 # else # define GTEST_HAS_CLONE 0 # endif # else # define GTEST_HAS_CLONE 1 # endif # else # define GTEST_HAS_CLONE 0 # endif // GTEST_OS_LINUX && !defined(__ia64__)
+ show +
626
627
628
629
630
631
632
633
634
635
#endif // GTEST_HAS_CLONE // Determines whether to support stream redirection. This is used to test // output correctness and to implement death tests. #ifndef GTEST_HAS_STREAM_REDIRECTION // By default, we assume that stream redirection is supported on all // platforms except known mobile ones. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN # define GTEST_HAS_STREAM_REDIRECTION 0
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
#endif // GTEST_HAS_TR1_TUPLE // Determines whether clone(2) is supported. // Usually it will only be available on Linux, excluding // Linux on the Itanium architecture. // Also see http://linux.die.net/man/2/clone. #ifndef GTEST_HAS_CLONE // The user didn't tell us, so we need to figure it out.
+ show +
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
# if GTEST_OS_LINUX && !defined(__ia64__) # if GTEST_OS_LINUX_ANDROID // On Android, clone() is only available on ARM starting with Gingerbread. # if defined(__arm__) && __ANDROID_API__ >= 9 # define GTEST_HAS_CLONE 1 # else # define GTEST_HAS_CLONE 0 # endif # else # define GTEST_HAS_CLONE 1 # endif # else # define GTEST_HAS_CLONE 0 # endif // GTEST_OS_LINUX && !defined(__ia64__)
+ show +
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
#endif // GTEST_HAS_CLONE // Determines whether to support stream redirection. This is used to test // output correctness and to implement death tests. #ifndef GTEST_HAS_STREAM_REDIRECTION // By default, we assume that stream redirection is supported on all // platforms except known mobile ones. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || \ GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/internal/gtest-port.h
745
746
747
748
749
750
751
752
753
754
#endif // GTEST_HAS_TR1_TUPLE // Determines whether clone(2) is supported. // Usually it will only be available on Linux, excluding // Linux on the Itanium architecture. // Also see http://linux.die.net/man/2/clone. #ifndef GTEST_HAS_CLONE // The user didn't tell us, so we need to figure it out.
+ show +
755
756
757
758
759
760
761
762
763
764
765
766
767
768
# if GTEST_OS_LINUX && !defined(__ia64__) # if GTEST_OS_LINUX_ANDROID // On Android, clone() is only available on ARM starting with Gingerbread. # if defined(__arm__) && __ANDROID_API__ >= 9 # define GTEST_HAS_CLONE 1 # else # define GTEST_HAS_CLONE 0 # endif # else # define GTEST_HAS_CLONE 1 # endif # else # define GTEST_HAS_CLONE 0 # endif // GTEST_OS_LINUX && !defined(__ia64__)
+ show +
769
770
771
772
773
774
775
776
777
778
#endif // GTEST_HAS_CLONE // Determines whether to support stream redirection. This is used to test // output correctness and to implement death tests. #ifndef GTEST_HAS_STREAM_REDIRECTION // By default, we assume that stream redirection is supported on all // platforms except known mobile ones. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || \ GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/internal/gtest-port.h
745
746
747
748
749
750
751
752
753
754
#endif // GTEST_HAS_TR1_TUPLE // Determines whether clone(2) is supported. // Usually it will only be available on Linux, excluding // Linux on the Itanium architecture. // Also see http://linux.die.net/man/2/clone. #ifndef GTEST_HAS_CLONE // The user didn't tell us, so we need to figure it out.
+ show +
755
756
757
758
759
760
761
762
763
764
765
766
767
768
# if GTEST_OS_LINUX && !defined(__ia64__) # if GTEST_OS_LINUX_ANDROID // On Android, clone() is only available on ARM starting with Gingerbread. # if defined(__arm__) && __ANDROID_API__ >= 9 # define GTEST_HAS_CLONE 1 # else # define GTEST_HAS_CLONE 0 # endif # else # define GTEST_HAS_CLONE 1 # endif # else # define GTEST_HAS_CLONE 0 # endif // GTEST_OS_LINUX && !defined(__ia64__)
+ show +
769
770
771
772
773
774
775
776
777
778
#endif // GTEST_HAS_CLONE // Determines whether to support stream redirection. This is used to test // output correctness and to implement death tests. #ifndef GTEST_HAS_STREAM_REDIRECTION // By default, we assume that stream redirection is supported on all // platforms except known mobile ones. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || \ GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT

[CVE-2020-0470_1.diff] gtest-port.h #16
-# if GTEST_OS_LINUX && !defined(__ia64__) -# if GTEST_OS_LINUX_ANDROID -// On Android, clone() is only available on ARM starting with Gingerbread. -# if defined(__arm__) && __ANDROID_API__ >= 9 -# define GTEST_HAS_CLONE 1 -# else -# define GTEST_HAS_CLONE 0 -# endif -# else -# define GTEST_HAS_CLONE 1 -# endif -# else -# define GTEST_HAS_CLONE 0 -# endif // GTEST_OS_LINUX && !defined(__ia64__) +#if GTEST_OS_LINUX && !defined(__ia64__) +#if GTEST_OS_LINUX_ANDROID +// On Android, clone() became available at different API levels for each 32-bit +// architecture. +#if defined(__LP64__) || (defined(__arm__) && __ANDROID_API__ >= 9) || \ + (defined(__mips__) && __ANDROID_API__ >= 12) || \ + (defined(__i386__) && __ANDROID_API__ >= 17) +#define GTEST_HAS_CLONE 1 +#else +#define GTEST_HAS_CLONE 0 +#endif +#else +#define GTEST_HAS_CLONE 1 +#endif +#else +#define GTEST_HAS_CLONE 0 +#endif // GTEST_OS_LINUX && !defined(__ia64__)
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
#endif // GTEST_HAS_TR1_TUPLE // Determines whether clone(2) is supported. // Usually it will only be available on Linux, excluding // Linux on the Itanium architecture. // Also see http://linux.die.net/man/2/clone. #ifndef GTEST_HAS_CLONE // The user didn't tell us, so we need to figure it out.
+ show +
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
# if GTEST_OS_LINUX && !defined(__ia64__) # if GTEST_OS_LINUX_ANDROID // On Android, clone() is only available on ARM starting with Gingerbread. # if defined(__arm__) && __ANDROID_API__ >= 9 # define GTEST_HAS_CLONE 1 # else # define GTEST_HAS_CLONE 0 # endif # else # define GTEST_HAS_CLONE 1 # endif # else # define GTEST_HAS_CLONE 0 # endif // GTEST_OS_LINUX && !defined(__ia64__)
+ show +
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
#endif // GTEST_HAS_CLONE // Determines whether to support stream redirection. This is used to test // output correctness and to implement death tests. #ifndef GTEST_HAS_STREAM_REDIRECTION // By default, we assume that stream redirection is supported on all // platforms except known mobile ones. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN # define GTEST_HAS_STREAM_REDIRECTION 0
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-port.h
609
610
611
612
613
614
615
616
617
618
#endif // GTEST_HAS_TR1_TUPLE // Determines whether clone(2) is supported. // Usually it will only be available on Linux, excluding // Linux on the Itanium architecture. // Also see http://linux.die.net/man/2/clone. #ifndef GTEST_HAS_CLONE // The user didn't tell us, so we need to figure it out.
+ show +
619
620
621
622
623
624
625
626
627
628
629
630
631
632
# if GTEST_OS_LINUX && !defined(__ia64__) # if GTEST_OS_LINUX_ANDROID // On Android, clone() is only available on ARM starting with Gingerbread. # if defined(__arm__) && __ANDROID_API__ >= 9 # define GTEST_HAS_CLONE 1 # else # define GTEST_HAS_CLONE 0 # endif # else # define GTEST_HAS_CLONE 1 # endif # else # define GTEST_HAS_CLONE 0 # endif // GTEST_OS_LINUX && !defined(__ia64__)
+ show +
633
634
635
636
637
638
639
640
641
642
#endif // GTEST_HAS_CLONE // Determines whether to support stream redirection. This is used to test // output correctness and to implement death tests. #ifndef GTEST_HAS_STREAM_REDIRECTION // By default, we assume that stream redirection is supported on all // platforms except known mobile ones. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN # define GTEST_HAS_STREAM_REDIRECTION 0
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-port.h.orig
602
603
604
605
606
607
608
609
610
611
#endif // GTEST_HAS_TR1_TUPLE // Determines whether clone(2) is supported. // Usually it will only be available on Linux, excluding // Linux on the Itanium architecture. // Also see http://linux.die.net/man/2/clone. #ifndef GTEST_HAS_CLONE // The user didn't tell us, so we need to figure it out.
+ show +
612
613
614
615
616
617
618
619
620
621
622
623
624
625
# if GTEST_OS_LINUX && !defined(__ia64__) # if GTEST_OS_LINUX_ANDROID // On Android, clone() is only available on ARM starting with Gingerbread. # if defined(__arm__) && __ANDROID_API__ >= 9 # define GTEST_HAS_CLONE 1 # else # define GTEST_HAS_CLONE 0 # endif # else # define GTEST_HAS_CLONE 1 # endif # else # define GTEST_HAS_CLONE 0 # endif // GTEST_OS_LINUX && !defined(__ia64__)
+ show +
626
627
628
629
630
631
632
633
634
635
#endif // GTEST_HAS_CLONE // Determines whether to support stream redirection. This is used to test // output correctness and to implement death tests. #ifndef GTEST_HAS_STREAM_REDIRECTION // By default, we assume that stream redirection is supported on all // platforms except known mobile ones. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN # define GTEST_HAS_STREAM_REDIRECTION 0
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/fused-src/gtest/gtest.h
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
#endif // GTEST_HAS_TR1_TUPLE // Determines whether clone(2) is supported. // Usually it will only be available on Linux, excluding // Linux on the Itanium architecture. // Also see http://linux.die.net/man/2/clone. #ifndef GTEST_HAS_CLONE // The user didn't tell us, so we need to figure it out.
+ show +
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
# if GTEST_OS_LINUX && !defined(__ia64__) # if GTEST_OS_LINUX_ANDROID // On Android, clone() is only available on ARM starting with Gingerbread. # if defined(__arm__) && __ANDROID_API__ >= 9 # define GTEST_HAS_CLONE 1 # else # define GTEST_HAS_CLONE 0 # endif # else # define GTEST_HAS_CLONE 1 # endif # else # define GTEST_HAS_CLONE 0 # endif // GTEST_OS_LINUX && !defined(__ia64__)
+ show +
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
#endif // GTEST_HAS_CLONE // Determines whether to support stream redirection. This is used to test // output correctness and to implement death tests. #ifndef GTEST_HAS_STREAM_REDIRECTION // By default, we assume that stream redirection is supported on all // platforms except known mobile ones. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN # define GTEST_HAS_STREAM_REDIRECTION 0
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-port.h
609
610
611
612
613
614
615
616
617
618
#endif // GTEST_HAS_TR1_TUPLE // Determines whether clone(2) is supported. // Usually it will only be available on Linux, excluding // Linux on the Itanium architecture. // Also see http://linux.die.net/man/2/clone. #ifndef GTEST_HAS_CLONE // The user didn't tell us, so we need to figure it out.
+ show +
619
620
621
622
623
624
625
626
627
628
629
630
631
632
# if GTEST_OS_LINUX && !defined(__ia64__) # if GTEST_OS_LINUX_ANDROID // On Android, clone() is only available on ARM starting with Gingerbread. # if defined(__arm__) && __ANDROID_API__ >= 9 # define GTEST_HAS_CLONE 1 # else # define GTEST_HAS_CLONE 0 # endif # else # define GTEST_HAS_CLONE 1 # endif # else # define GTEST_HAS_CLONE 0 # endif // GTEST_OS_LINUX && !defined(__ia64__)
+ show +
633
634
635
636
637
638
639
640
641
642
#endif // GTEST_HAS_CLONE // Determines whether to support stream redirection. This is used to test // output correctness and to implement death tests. #ifndef GTEST_HAS_STREAM_REDIRECTION // By default, we assume that stream redirection is supported on all // platforms except known mobile ones. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN # define GTEST_HAS_STREAM_REDIRECTION 0
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/include/gtest/internal/gtest-port.h.orig
602
603
604
605
606
607
608
609
610
611
#endif // GTEST_HAS_TR1_TUPLE // Determines whether clone(2) is supported. // Usually it will only be available on Linux, excluding // Linux on the Itanium architecture. // Also see http://linux.die.net/man/2/clone. #ifndef GTEST_HAS_CLONE // The user didn't tell us, so we need to figure it out.
+ show +
612
613
614
615
616
617
618
619
620
621
622
623
624
625
# if GTEST_OS_LINUX && !defined(__ia64__) # if GTEST_OS_LINUX_ANDROID // On Android, clone() is only available on ARM starting with Gingerbread. # if defined(__arm__) && __ANDROID_API__ >= 9 # define GTEST_HAS_CLONE 1 # else # define GTEST_HAS_CLONE 0 # endif # else # define GTEST_HAS_CLONE 1 # endif # else # define GTEST_HAS_CLONE 0 # endif // GTEST_OS_LINUX && !defined(__ia64__)
+ show +
626
627
628
629
630
631
632
633
634
635
#endif // GTEST_HAS_CLONE // Determines whether to support stream redirection. This is used to test // output correctness and to implement death tests. #ifndef GTEST_HAS_STREAM_REDIRECTION // By default, we assume that stream redirection is supported on all // platforms except known mobile ones. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN # define GTEST_HAS_STREAM_REDIRECTION 0
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
#endif // GTEST_HAS_TR1_TUPLE // Determines whether clone(2) is supported. // Usually it will only be available on Linux, excluding // Linux on the Itanium architecture. // Also see http://linux.die.net/man/2/clone. #ifndef GTEST_HAS_CLONE // The user didn't tell us, so we need to figure it out.
+ show +
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
# if GTEST_OS_LINUX && !defined(__ia64__) # if GTEST_OS_LINUX_ANDROID // On Android, clone() is only available on ARM starting with Gingerbread. # if defined(__arm__) && __ANDROID_API__ >= 9 # define GTEST_HAS_CLONE 1 # else # define GTEST_HAS_CLONE 0 # endif # else # define GTEST_HAS_CLONE 1 # endif # else # define GTEST_HAS_CLONE 0 # endif // GTEST_OS_LINUX && !defined(__ia64__)
+ show +
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
#endif // GTEST_HAS_CLONE // Determines whether to support stream redirection. This is used to test // output correctness and to implement death tests. #ifndef GTEST_HAS_STREAM_REDIRECTION // By default, we assume that stream redirection is supported on all // platforms except known mobile ones. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || \ GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/internal/gtest-port.h
745
746
747
748
749
750
751
752
753
754
#endif // GTEST_HAS_TR1_TUPLE // Determines whether clone(2) is supported. // Usually it will only be available on Linux, excluding // Linux on the Itanium architecture. // Also see http://linux.die.net/man/2/clone. #ifndef GTEST_HAS_CLONE // The user didn't tell us, so we need to figure it out.
+ show +
755
756
757
758
759
760
761
762
763
764
765
766
767
768
# if GTEST_OS_LINUX && !defined(__ia64__) # if GTEST_OS_LINUX_ANDROID // On Android, clone() is only available on ARM starting with Gingerbread. # if defined(__arm__) && __ANDROID_API__ >= 9 # define GTEST_HAS_CLONE 1 # else # define GTEST_HAS_CLONE 0 # endif # else # define GTEST_HAS_CLONE 1 # endif # else # define GTEST_HAS_CLONE 0 # endif // GTEST_OS_LINUX && !defined(__ia64__)
+ show +
769
770
771
772
773
774
775
776
777
778
#endif // GTEST_HAS_CLONE // Determines whether to support stream redirection. This is used to test // output correctness and to implement death tests. #ifndef GTEST_HAS_STREAM_REDIRECTION // By default, we assume that stream redirection is supported on all // platforms except known mobile ones. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || \ GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/internal/gtest-port.h
745
746
747
748
749
750
751
752
753
754
#endif // GTEST_HAS_TR1_TUPLE // Determines whether clone(2) is supported. // Usually it will only be available on Linux, excluding // Linux on the Itanium architecture. // Also see http://linux.die.net/man/2/clone. #ifndef GTEST_HAS_CLONE // The user didn't tell us, so we need to figure it out.
+ show +
755
756
757
758
759
760
761
762
763
764
765
766
767
768
# if GTEST_OS_LINUX && !defined(__ia64__) # if GTEST_OS_LINUX_ANDROID // On Android, clone() is only available on ARM starting with Gingerbread. # if defined(__arm__) && __ANDROID_API__ >= 9 # define GTEST_HAS_CLONE 1 # else # define GTEST_HAS_CLONE 0 # endif # else # define GTEST_HAS_CLONE 1 # endif # else # define GTEST_HAS_CLONE 0 # endif // GTEST_OS_LINUX && !defined(__ia64__)
+ show +
769
770
771
772
773
774
775
776
777
778
#endif // GTEST_HAS_CLONE // Determines whether to support stream redirection. This is used to test // output correctness and to implement death tests. #ifndef GTEST_HAS_STREAM_REDIRECTION // By default, we assume that stream redirection is supported on all // platforms except known mobile ones. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || \ GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT

[CVE-2020-0478_1.diff] gtest-port.cc #9
+#elif GTEST_OS_FUCHSIA + +size_t GetThreadCount() { + int dummy_buffer; + size_t avail; + zx_status_t status = + zx_object_get_info(zx_process_self(), ZX_INFO_PROCESS_THREADS, + &dummy_buffer, 0, nullptr, &avail); + if (status == ZX_OK) { + return avail; + } else { + return 0; + } +} + -void SleepMilliseconds(int n) { - ::Sleep(n); -} +void SleepMilliseconds(int n) { ::Sleep(static_cast<DWORD>(n)); } -AutoHandle::AutoHandle() - : handle_(INVALID_HANDLE_VALUE) {} +AutoHandle::AutoHandle() : handle_(INVALID_HANDLE_VALUE) {} -AutoHandle::AutoHandle(Handle handle) - : handle_(handle) {} +AutoHandle::AutoHandle(Handle handle) : handle_(handle) {} -AutoHandle::~AutoHandle() { - Reset(); -} +AutoHandle::~AutoHandle() { Reset(); } -AutoHandle::Handle AutoHandle::Get() const { - return handle_; -} +AutoHandle::Handle AutoHandle::Get() const { return handle_; } -void AutoHandle::Reset() { - Reset(INVALID_HANDLE_VALUE); -} +void AutoHandle::Reset() { Reset(INVALID_HANDLE_VALUE); }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-port.cc
128
129
130
131
132
133
134
135
136
137
size_t GetThreadCount() { // There's no portable way to detect the number of threads, so we just // return 0 to indicate that we cannot detect it. return 0; } #endif // GTEST_OS_MAC #if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
+ show +
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
void SleepMilliseconds(int n) { ::Sleep(n); } AutoHandle::AutoHandle() : handle_(INVALID_HANDLE_VALUE) {} AutoHandle::AutoHandle(Handle handle) : handle_(handle) {} AutoHandle::~AutoHandle() { Reset(); } AutoHandle::Handle AutoHandle::Get() const { return handle_; } void AutoHandle::Reset() { Reset(INVALID_HANDLE_VALUE);
+ show +
158
159
160
161
162
163
164
165
166
167
} void AutoHandle::Reset(HANDLE handle) { // Resetting with the same handle we already own is invalid. if (handle_ != handle) { if (IsCloseable()) { ::CloseHandle(handle_); } handle_ = handle; } else {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-port.cc
169
170
171
172
173
174
175
176
177
178
size_t GetThreadCount() { // There's no portable way to detect the number of threads, so we just // return 0 to indicate that we cannot detect it. return 0; } #endif // GTEST_OS_LINUX #if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
+ show +
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
void SleepMilliseconds(int n) { ::Sleep(n); } AutoHandle::AutoHandle() : handle_(INVALID_HANDLE_VALUE) {} AutoHandle::AutoHandle(Handle handle) : handle_(handle) {} AutoHandle::~AutoHandle() { Reset(); } AutoHandle::Handle AutoHandle::Get() const { return handle_; } void AutoHandle::Reset() { Reset(INVALID_HANDLE_VALUE);
+ show +
199
200
201
202
203
204
205
206
207
208
} void AutoHandle::Reset(HANDLE handle) { // Resetting with the same handle we already own is invalid. if (handle_ != handle) { if (IsCloseable()) { ::CloseHandle(handle_); } handle_ = handle; } else {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-port.cc
128
129
130
131
132
133
134
135
136
137
size_t GetThreadCount() { // There's no portable way to detect the number of threads, so we just // return 0 to indicate that we cannot detect it. return 0; } #endif // GTEST_OS_MAC #if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
+ show +
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
void SleepMilliseconds(int n) { ::Sleep(n); } AutoHandle::AutoHandle() : handle_(INVALID_HANDLE_VALUE) {} AutoHandle::AutoHandle(Handle handle) : handle_(handle) {} AutoHandle::~AutoHandle() { Reset(); } AutoHandle::Handle AutoHandle::Get() const { return handle_; } void AutoHandle::Reset() { Reset(INVALID_HANDLE_VALUE);
+ show +
158
159
160
161
162
163
164
165
166
167
} void AutoHandle::Reset(HANDLE handle) { // Resetting with the same handle we already own is invalid. if (handle_ != handle) { if (IsCloseable()) { ::CloseHandle(handle_); } handle_ = handle; } else {
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest-port.cc
271
272
273
274
275
276
277
278
279
280
size_t GetThreadCount() { // There's no portable way to detect the number of threads, so we just // return 0 to indicate that we cannot detect it. return 0; } #endif // GTEST_OS_LINUX #if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
+ show +
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
void SleepMilliseconds(int n) { ::Sleep(n); } AutoHandle::AutoHandle() : handle_(INVALID_HANDLE_VALUE) {} AutoHandle::AutoHandle(Handle handle) : handle_(handle) {} AutoHandle::~AutoHandle() { Reset(); } AutoHandle::Handle AutoHandle::Get() const { return handle_; } void AutoHandle::Reset() { Reset(INVALID_HANDLE_VALUE);
+ show +
301
302
303
304
305
306
307
308
309
310
} void AutoHandle::Reset(HANDLE handle) { // Resetting with the same handle we already own is invalid. if (handle_ != handle) { if (IsCloseable()) { ::CloseHandle(handle_); } handle_ = handle; } else {
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
size_t GetThreadCount() { // There's no portable way to detect the number of threads, so we just // return 0 to indicate that we cannot detect it. return 0; } #endif // GTEST_OS_LINUX #if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
+ show +
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
void SleepMilliseconds(int n) { ::Sleep(n); } AutoHandle::AutoHandle() : handle_(INVALID_HANDLE_VALUE) {} AutoHandle::AutoHandle(Handle handle) : handle_(handle) {} AutoHandle::~AutoHandle() { Reset(); } AutoHandle::Handle AutoHandle::Get() const { return handle_; } void AutoHandle::Reset() { Reset(INVALID_HANDLE_VALUE);
+ show +
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
} void AutoHandle::Reset(HANDLE handle) { // Resetting with the same handle we already own is invalid. if (handle_ != handle) { if (IsCloseable()) { ::CloseHandle(handle_); } handle_ = handle; } else {
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-port.cc
184
185
186
187
188
189
190
191
192
193
size_t GetThreadCount() { // There's no portable way to detect the number of threads, so we just // return 0 to indicate that we cannot detect it. return 0; } #endif // GTEST_OS_LINUX #if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
+ show +
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
void SleepMilliseconds(int n) { ::Sleep(n); } AutoHandle::AutoHandle() : handle_(INVALID_HANDLE_VALUE) {} AutoHandle::AutoHandle(Handle handle) : handle_(handle) {} AutoHandle::~AutoHandle() { Reset(); } AutoHandle::Handle AutoHandle::Get() const { return handle_; } void AutoHandle::Reset() { Reset(INVALID_HANDLE_VALUE);
+ show +
214
215
216
217
218
219
220
221
222
223
} void AutoHandle::Reset(HANDLE handle) { // Resetting with the same handle we already own is invalid. if (handle_ != handle) { if (IsCloseable()) { ::CloseHandle(handle_); } handle_ = handle; } else {
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-port.cc
169
170
171
172
173
174
175
176
177
178
size_t GetThreadCount() { // There's no portable way to detect the number of threads, so we just // return 0 to indicate that we cannot detect it. return 0; } #endif // GTEST_OS_LINUX #if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
+ show +
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
void SleepMilliseconds(int n) { ::Sleep(n); } AutoHandle::AutoHandle() : handle_(INVALID_HANDLE_VALUE) {} AutoHandle::AutoHandle(Handle handle) : handle_(handle) {} AutoHandle::~AutoHandle() { Reset(); } AutoHandle::Handle AutoHandle::Get() const { return handle_; } void AutoHandle::Reset() { Reset(INVALID_HANDLE_VALUE);
+ show +
199
200
201
202
203
204
205
206
207
208
} void AutoHandle::Reset(HANDLE handle) { // Resetting with the same handle we already own is invalid. if (handle_ != handle) { if (IsCloseable()) { ::CloseHandle(handle_); } handle_ = handle; } else {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-port.cc
169
170
171
172
173
174
175
176
177
178
size_t GetThreadCount() { // There's no portable way to detect the number of threads, so we just // return 0 to indicate that we cannot detect it. return 0; } #endif // GTEST_OS_LINUX #if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
+ show +
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
void SleepMilliseconds(int n) { ::Sleep(n); } AutoHandle::AutoHandle() : handle_(INVALID_HANDLE_VALUE) {} AutoHandle::AutoHandle(Handle handle) : handle_(handle) {} AutoHandle::~AutoHandle() { Reset(); } AutoHandle::Handle AutoHandle::Get() const { return handle_; } void AutoHandle::Reset() { Reset(INVALID_HANDLE_VALUE);
+ show +
199
200
201
202
203
204
205
206
207
208
} void AutoHandle::Reset(HANDLE handle) { // Resetting with the same handle we already own is invalid. if (handle_ != handle) { if (IsCloseable()) { ::CloseHandle(handle_); } handle_ = handle; } else {

[CVE-2020-0478_1.diff] gtest-port.cc #17
- Notification* thread_can_start) - : thread_(ThreadWithParamSupport::CreateThread(runnable, - thread_can_start)) { -} + Notification *thread_can_start) + : thread_( + ThreadWithParamSupport::CreateThread(runnable, thread_can_start)) {} -ThreadWithParamBase::~ThreadWithParamBase() { - Join(); -} +ThreadWithParamBase::~ThreadWithParamBase() { Join(); }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-port.cc
325
326
327
328
329
330
331
332
333
334
// Prohibit instantiation. ThreadWithParamSupport(); GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParamSupport); }; } // namespace ThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,
+ show +
335
336
337
338
339
340
341
Notification* thread_can_start) : thread_(ThreadWithParamSupport::CreateThread(runnable, thread_can_start)) { } ThreadWithParamBase::~ThreadWithParamBase() { Join();
+ show +
342
343
344
345
346
347
348
349
350
351
} void ThreadWithParamBase::Join() { GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0) << "Failed to join the thread with error " << ::GetLastError() << "."; } // Maps a thread to a set of ThreadIdToThreadLocals that have values // instantiated on that thread and notifies them when the thread exits. A // ThreadLocal instance is expected to persist until all threads it has
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-port.cc
366
367
368
369
370
371
372
373
374
375
// Prohibit instantiation. ThreadWithParamSupport(); GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParamSupport); }; } // namespace ThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,
+ show +
376
377
378
379
380
381
382
Notification* thread_can_start) : thread_(ThreadWithParamSupport::CreateThread(runnable, thread_can_start)) { } ThreadWithParamBase::~ThreadWithParamBase() { Join();
+ show +
383
384
385
386
387
388
389
390
391
392
} void ThreadWithParamBase::Join() { GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0) << "Failed to join the thread with error " << ::GetLastError() << "."; } // Maps a thread to a set of ThreadIdToThreadLocals that have values // instantiated on that thread and notifies them when the thread exits. A // ThreadLocal instance is expected to persist until all threads it has
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-port.cc
325
326
327
328
329
330
331
332
333
334
// Prohibit instantiation. ThreadWithParamSupport(); GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParamSupport); }; } // namespace ThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,
+ show +
335
336
337
338
339
340
341
Notification* thread_can_start) : thread_(ThreadWithParamSupport::CreateThread(runnable, thread_can_start)) { } ThreadWithParamBase::~ThreadWithParamBase() { Join();
+ show +
342
343
344
345
346
347
348
349
350
351
} void ThreadWithParamBase::Join() { GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0) << "Failed to join the thread with error " << ::GetLastError() << "."; } // Maps a thread to a set of ThreadIdToThreadLocals that have values // instantiated on that thread and notifies them when the thread exits. A // ThreadLocal instance is expected to persist until all threads it has
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest-port.cc
505
506
507
508
509
510
511
512
513
514
// Prohibit instantiation. ThreadWithParamSupport(); GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParamSupport); }; } // namespace ThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,
+ show +
515
516
517
518
519
520
521
Notification* thread_can_start) : thread_(ThreadWithParamSupport::CreateThread(runnable, thread_can_start)) { } ThreadWithParamBase::~ThreadWithParamBase() { Join();
+ show +
522
523
524
525
526
527
528
529
530
531
} void ThreadWithParamBase::Join() { GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0) << "Failed to join the thread with error " << ::GetLastError() << "."; } // Maps a thread to a set of ThreadIdToThreadLocals that have values // instantiated on that thread and notifies them when the thread exits. A // ThreadLocal instance is expected to persist until all threads it has
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
// Prohibit instantiation. ThreadWithParamSupport(); GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParamSupport); }; } // namespace ThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,
+ show +
8929
8930
8931
8932
8933
8934
8935
Notification* thread_can_start) : thread_(ThreadWithParamSupport::CreateThread(runnable, thread_can_start)) { } ThreadWithParamBase::~ThreadWithParamBase() { Join();
+ show +
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
} void ThreadWithParamBase::Join() { GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0) << "Failed to join the thread with error " << ::GetLastError() << "."; } // Maps a thread to a set of ThreadIdToThreadLocals that have values // instantiated on that thread and notifies them when the thread exits. A // ThreadLocal instance is expected to persist until all threads it has
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-port.cc
422
423
424
425
426
427
428
429
430
431
// Prohibit instantiation. ThreadWithParamSupport(); GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParamSupport); }; } // namespace ThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,
+ show +
432
433
434
435
436
437
438
Notification* thread_can_start) : thread_(ThreadWithParamSupport::CreateThread(runnable, thread_can_start)) { } ThreadWithParamBase::~ThreadWithParamBase() { Join();
+ show +
439
440
441
442
443
444
445
446
447
448
} void ThreadWithParamBase::Join() { GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0) << "Failed to join the thread with error " << ::GetLastError() << "."; } // Maps a thread to a set of ThreadIdToThreadLocals that have values // instantiated on that thread and notifies them when the thread exits. A // ThreadLocal instance is expected to persist until all threads it has
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-port.cc
366
367
368
369
370
371
372
373
374
375
// Prohibit instantiation. ThreadWithParamSupport(); GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParamSupport); }; } // namespace ThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,
+ show +
376
377
378
379
380
381
382
Notification* thread_can_start) : thread_(ThreadWithParamSupport::CreateThread(runnable, thread_can_start)) { } ThreadWithParamBase::~ThreadWithParamBase() { Join();
+ show +
383
384
385
386
387
388
389
390
391
392
} void ThreadWithParamBase::Join() { GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0) << "Failed to join the thread with error " << ::GetLastError() << "."; } // Maps a thread to a set of ThreadIdToThreadLocals that have values // instantiated on that thread and notifies them when the thread exits. A // ThreadLocal instance is expected to persist until all threads it has
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-port.cc
366
367
368
369
370
371
372
373
374
375
// Prohibit instantiation. ThreadWithParamSupport(); GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParamSupport); }; } // namespace ThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,
+ show +
376
377
378
379
380
381
382
Notification* thread_can_start) : thread_(ThreadWithParamSupport::CreateThread(runnable, thread_can_start)) { } ThreadWithParamBase::~ThreadWithParamBase() { Join();
+ show +
383
384
385
386
387
388
389
390
391
392
} void ThreadWithParamBase::Join() { GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0) << "Failed to join the thread with error " << ::GetLastError() << "."; } // Maps a thread to a set of ThreadIdToThreadLocals that have values // instantiated on that thread and notifies them when the thread exits. A // ThreadLocal instance is expected to persist until all threads it has

[CVE-2020-0478_1.diff] gtest-port.cc #24
- const ThreadIdAndHandle* tah = - reinterpret_cast<const ThreadIdAndHandle*>(param); - GTEST_CHECK_( - ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0); + const ThreadIdAndHandle *tah = + reinterpret_cast<const ThreadIdAndHandle *>(param); + GTEST_CHECK_(::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-port.cc
470
471
472
473
474
475
476
477
478
479
// blocked by it. ::SetThreadPriority(watcher_thread, ::GetThreadPriority(::GetCurrentThread())); ::ResumeThread(watcher_thread); ::CloseHandle(watcher_thread); } // Monitors exit from a given thread and notifies those // ThreadIdToThreadLocals about thread termination. static DWORD WINAPI WatcherThreadFunc(LPVOID param) {
+ show +
480
481
482
483
const ThreadIdAndHandle* tah = reinterpret_cast<const ThreadIdAndHandle*>(param); GTEST_CHECK_( ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
+ show +
484
485
486
487
488
489
490
491
492
493
OnThreadExit(tah->first); ::CloseHandle(tah->second); delete tah; return 0; } // Returns map of thread local instances. static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() { mutex_.AssertHeld(); static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals;
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-port.cc
511
512
513
514
515
516
517
518
519
520
// blocked by it. ::SetThreadPriority(watcher_thread, ::GetThreadPriority(::GetCurrentThread())); ::ResumeThread(watcher_thread); ::CloseHandle(watcher_thread); } // Monitors exit from a given thread and notifies those // ThreadIdToThreadLocals about thread termination. static DWORD WINAPI WatcherThreadFunc(LPVOID param) {
+ show +
521
522
523
524
const ThreadIdAndHandle* tah = reinterpret_cast<const ThreadIdAndHandle*>(param); GTEST_CHECK_( ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
+ show +
525
526
527
528
529
530
531
532
533
534
OnThreadExit(tah->first); ::CloseHandle(tah->second); delete tah; return 0; } // Returns map of thread local instances. static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() { mutex_.AssertHeld(); static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals;
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-port.cc
470
471
472
473
474
475
476
477
478
479
// blocked by it. ::SetThreadPriority(watcher_thread, ::GetThreadPriority(::GetCurrentThread())); ::ResumeThread(watcher_thread); ::CloseHandle(watcher_thread); } // Monitors exit from a given thread and notifies those // ThreadIdToThreadLocals about thread termination. static DWORD WINAPI WatcherThreadFunc(LPVOID param) {
+ show +
480
481
482
483
const ThreadIdAndHandle* tah = reinterpret_cast<const ThreadIdAndHandle*>(param); GTEST_CHECK_( ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
+ show +
484
485
486
487
488
489
490
491
492
493
OnThreadExit(tah->first); ::CloseHandle(tah->second); delete tah; return 0; } // Returns map of thread local instances. static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() { mutex_.AssertHeld(); static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals;
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest-port.cc
650
651
652
653
654
655
656
657
658
659
// blocked by it. ::SetThreadPriority(watcher_thread, ::GetThreadPriority(::GetCurrentThread())); ::ResumeThread(watcher_thread); ::CloseHandle(watcher_thread); } // Monitors exit from a given thread and notifies those // ThreadIdToThreadLocals about thread termination. static DWORD WINAPI WatcherThreadFunc(LPVOID param) {
+ show +
660
661
662
663
const ThreadIdAndHandle* tah = reinterpret_cast<const ThreadIdAndHandle*>(param); GTEST_CHECK_( ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
+ show +
664
665
666
667
668
669
670
671
672
673
OnThreadExit(tah->first); ::CloseHandle(tah->second); delete tah; return 0; } // Returns map of thread local instances. static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() { mutex_.AssertHeld(); MemoryIsNotDeallocated memory_is_not_deallocated;
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
// blocked by it. ::SetThreadPriority(watcher_thread, ::GetThreadPriority(::GetCurrentThread())); ::ResumeThread(watcher_thread); ::CloseHandle(watcher_thread); } // Monitors exit from a given thread and notifies those // ThreadIdToThreadLocals about thread termination. static DWORD WINAPI WatcherThreadFunc(LPVOID param) {
+ show +
9074
9075
9076
9077
const ThreadIdAndHandle* tah = reinterpret_cast<const ThreadIdAndHandle*>(param); GTEST_CHECK_( ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
+ show +
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
OnThreadExit(tah->first); ::CloseHandle(tah->second); delete tah; return 0; } // Returns map of thread local instances. static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() { mutex_.AssertHeld(); static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-port.cc
567
568
569
570
571
572
573
574
575
576
// blocked by it. ::SetThreadPriority(watcher_thread, ::GetThreadPriority(::GetCurrentThread())); ::ResumeThread(watcher_thread); ::CloseHandle(watcher_thread); } // Monitors exit from a given thread and notifies those // ThreadIdToThreadLocals about thread termination. static DWORD WINAPI WatcherThreadFunc(LPVOID param) {
+ show +
577
578
579
580
const ThreadIdAndHandle* tah = reinterpret_cast<const ThreadIdAndHandle*>(param); GTEST_CHECK_( ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
+ show +
581
582
583
584
585
586
587
588
589
590
OnThreadExit(tah->first); ::CloseHandle(tah->second); delete tah; return 0; } // Returns map of thread local instances. static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() { mutex_.AssertHeld(); MemoryIsNotDeallocated memory_is_not_deallocated;
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-port.cc
511
512
513
514
515
516
517
518
519
520
// blocked by it. ::SetThreadPriority(watcher_thread, ::GetThreadPriority(::GetCurrentThread())); ::ResumeThread(watcher_thread); ::CloseHandle(watcher_thread); } // Monitors exit from a given thread and notifies those // ThreadIdToThreadLocals about thread termination. static DWORD WINAPI WatcherThreadFunc(LPVOID param) {
+ show +
521
522
523
524
const ThreadIdAndHandle* tah = reinterpret_cast<const ThreadIdAndHandle*>(param); GTEST_CHECK_( ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
+ show +
525
526
527
528
529
530
531
532
533
534
OnThreadExit(tah->first); ::CloseHandle(tah->second); delete tah; return 0; } // Returns map of thread local instances. static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() { mutex_.AssertHeld(); static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-port.cc
511
512
513
514
515
516
517
518
519
520
// blocked by it. ::SetThreadPriority(watcher_thread, ::GetThreadPriority(::GetCurrentThread())); ::ResumeThread(watcher_thread); ::CloseHandle(watcher_thread); } // Monitors exit from a given thread and notifies those // ThreadIdToThreadLocals about thread termination. static DWORD WINAPI WatcherThreadFunc(LPVOID param) {
+ show +
521
522
523
524
const ThreadIdAndHandle* tah = reinterpret_cast<const ThreadIdAndHandle*>(param); GTEST_CHECK_( ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
+ show +
525
526
527
528
529
530
531
532
533
534
OnThreadExit(tah->first); ::CloseHandle(tah->second); delete tah; return 0; } // Returns map of thread local instances. static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() { mutex_.AssertHeld(); static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals;

[CVE-2020-0470_1.diff] gtest-port.cc #9
+#elif GTEST_OS_FUCHSIA + +size_t GetThreadCount() { + int dummy_buffer; + size_t avail; + zx_status_t status = + zx_object_get_info(zx_process_self(), ZX_INFO_PROCESS_THREADS, + &dummy_buffer, 0, nullptr, &avail); + if (status == ZX_OK) { + return avail; + } else { + return 0; + } +} + -void SleepMilliseconds(int n) { - ::Sleep(n); -} +void SleepMilliseconds(int n) { ::Sleep(static_cast<DWORD>(n)); } -AutoHandle::AutoHandle() - : handle_(INVALID_HANDLE_VALUE) {} +AutoHandle::AutoHandle() : handle_(INVALID_HANDLE_VALUE) {} -AutoHandle::AutoHandle(Handle handle) - : handle_(handle) {} +AutoHandle::AutoHandle(Handle handle) : handle_(handle) {} -AutoHandle::~AutoHandle() { - Reset(); -} +AutoHandle::~AutoHandle() { Reset(); } -AutoHandle::Handle AutoHandle::Get() const { - return handle_; -} +AutoHandle::Handle AutoHandle::Get() const { return handle_; } -void AutoHandle::Reset() { - Reset(INVALID_HANDLE_VALUE); -} +void AutoHandle::Reset() { Reset(INVALID_HANDLE_VALUE); }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-port.cc
128
129
130
131
132
133
134
135
136
137
size_t GetThreadCount() { // There's no portable way to detect the number of threads, so we just // return 0 to indicate that we cannot detect it. return 0; } #endif // GTEST_OS_MAC #if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
+ show +
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
void SleepMilliseconds(int n) { ::Sleep(n); } AutoHandle::AutoHandle() : handle_(INVALID_HANDLE_VALUE) {} AutoHandle::AutoHandle(Handle handle) : handle_(handle) {} AutoHandle::~AutoHandle() { Reset(); } AutoHandle::Handle AutoHandle::Get() const { return handle_; } void AutoHandle::Reset() { Reset(INVALID_HANDLE_VALUE);
+ show +
158
159
160
161
162
163
164
165
166
167
} void AutoHandle::Reset(HANDLE handle) { // Resetting with the same handle we already own is invalid. if (handle_ != handle) { if (IsCloseable()) { ::CloseHandle(handle_); } handle_ = handle; } else {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-port.cc
169
170
171
172
173
174
175
176
177
178
size_t GetThreadCount() { // There's no portable way to detect the number of threads, so we just // return 0 to indicate that we cannot detect it. return 0; } #endif // GTEST_OS_LINUX #if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
+ show +
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
void SleepMilliseconds(int n) { ::Sleep(n); } AutoHandle::AutoHandle() : handle_(INVALID_HANDLE_VALUE) {} AutoHandle::AutoHandle(Handle handle) : handle_(handle) {} AutoHandle::~AutoHandle() { Reset(); } AutoHandle::Handle AutoHandle::Get() const { return handle_; } void AutoHandle::Reset() { Reset(INVALID_HANDLE_VALUE);
+ show +
199
200
201
202
203
204
205
206
207
208
} void AutoHandle::Reset(HANDLE handle) { // Resetting with the same handle we already own is invalid. if (handle_ != handle) { if (IsCloseable()) { ::CloseHandle(handle_); } handle_ = handle; } else {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-port.cc
128
129
130
131
132
133
134
135
136
137
size_t GetThreadCount() { // There's no portable way to detect the number of threads, so we just // return 0 to indicate that we cannot detect it. return 0; } #endif // GTEST_OS_MAC #if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
+ show +
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
void SleepMilliseconds(int n) { ::Sleep(n); } AutoHandle::AutoHandle() : handle_(INVALID_HANDLE_VALUE) {} AutoHandle::AutoHandle(Handle handle) : handle_(handle) {} AutoHandle::~AutoHandle() { Reset(); } AutoHandle::Handle AutoHandle::Get() const { return handle_; } void AutoHandle::Reset() { Reset(INVALID_HANDLE_VALUE);
+ show +
158
159
160
161
162
163
164
165
166
167
} void AutoHandle::Reset(HANDLE handle) { // Resetting with the same handle we already own is invalid. if (handle_ != handle) { if (IsCloseable()) { ::CloseHandle(handle_); } handle_ = handle; } else {
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest-port.cc
271
272
273
274
275
276
277
278
279
280
size_t GetThreadCount() { // There's no portable way to detect the number of threads, so we just // return 0 to indicate that we cannot detect it. return 0; } #endif // GTEST_OS_LINUX #if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
+ show +
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
void SleepMilliseconds(int n) { ::Sleep(n); } AutoHandle::AutoHandle() : handle_(INVALID_HANDLE_VALUE) {} AutoHandle::AutoHandle(Handle handle) : handle_(handle) {} AutoHandle::~AutoHandle() { Reset(); } AutoHandle::Handle AutoHandle::Get() const { return handle_; } void AutoHandle::Reset() { Reset(INVALID_HANDLE_VALUE);
+ show +
301
302
303
304
305
306
307
308
309
310
} void AutoHandle::Reset(HANDLE handle) { // Resetting with the same handle we already own is invalid. if (handle_ != handle) { if (IsCloseable()) { ::CloseHandle(handle_); } handle_ = handle; } else {
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
size_t GetThreadCount() { // There's no portable way to detect the number of threads, so we just // return 0 to indicate that we cannot detect it. return 0; } #endif // GTEST_OS_LINUX #if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
+ show +
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
void SleepMilliseconds(int n) { ::Sleep(n); } AutoHandle::AutoHandle() : handle_(INVALID_HANDLE_VALUE) {} AutoHandle::AutoHandle(Handle handle) : handle_(handle) {} AutoHandle::~AutoHandle() { Reset(); } AutoHandle::Handle AutoHandle::Get() const { return handle_; } void AutoHandle::Reset() { Reset(INVALID_HANDLE_VALUE);
+ show +
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
} void AutoHandle::Reset(HANDLE handle) { // Resetting with the same handle we already own is invalid. if (handle_ != handle) { if (IsCloseable()) { ::CloseHandle(handle_); } handle_ = handle; } else {
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-port.cc
184
185
186
187
188
189
190
191
192
193
size_t GetThreadCount() { // There's no portable way to detect the number of threads, so we just // return 0 to indicate that we cannot detect it. return 0; } #endif // GTEST_OS_LINUX #if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
+ show +
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
void SleepMilliseconds(int n) { ::Sleep(n); } AutoHandle::AutoHandle() : handle_(INVALID_HANDLE_VALUE) {} AutoHandle::AutoHandle(Handle handle) : handle_(handle) {} AutoHandle::~AutoHandle() { Reset(); } AutoHandle::Handle AutoHandle::Get() const { return handle_; } void AutoHandle::Reset() { Reset(INVALID_HANDLE_VALUE);
+ show +
214
215
216
217
218
219
220
221
222
223
} void AutoHandle::Reset(HANDLE handle) { // Resetting with the same handle we already own is invalid. if (handle_ != handle) { if (IsCloseable()) { ::CloseHandle(handle_); } handle_ = handle; } else {
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-port.cc
169
170
171
172
173
174
175
176
177
178
size_t GetThreadCount() { // There's no portable way to detect the number of threads, so we just // return 0 to indicate that we cannot detect it. return 0; } #endif // GTEST_OS_LINUX #if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
+ show +
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
void SleepMilliseconds(int n) { ::Sleep(n); } AutoHandle::AutoHandle() : handle_(INVALID_HANDLE_VALUE) {} AutoHandle::AutoHandle(Handle handle) : handle_(handle) {} AutoHandle::~AutoHandle() { Reset(); } AutoHandle::Handle AutoHandle::Get() const { return handle_; } void AutoHandle::Reset() { Reset(INVALID_HANDLE_VALUE);
+ show +
199
200
201
202
203
204
205
206
207
208
} void AutoHandle::Reset(HANDLE handle) { // Resetting with the same handle we already own is invalid. if (handle_ != handle) { if (IsCloseable()) { ::CloseHandle(handle_); } handle_ = handle; } else {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-port.cc
169
170
171
172
173
174
175
176
177
178
size_t GetThreadCount() { // There's no portable way to detect the number of threads, so we just // return 0 to indicate that we cannot detect it. return 0; } #endif // GTEST_OS_LINUX #if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
+ show +
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
void SleepMilliseconds(int n) { ::Sleep(n); } AutoHandle::AutoHandle() : handle_(INVALID_HANDLE_VALUE) {} AutoHandle::AutoHandle(Handle handle) : handle_(handle) {} AutoHandle::~AutoHandle() { Reset(); } AutoHandle::Handle AutoHandle::Get() const { return handle_; } void AutoHandle::Reset() { Reset(INVALID_HANDLE_VALUE);
+ show +
199
200
201
202
203
204
205
206
207
208
} void AutoHandle::Reset(HANDLE handle) { // Resetting with the same handle we already own is invalid. if (handle_ != handle) { if (IsCloseable()) { ::CloseHandle(handle_); } handle_ = handle; } else {

[CVE-2020-0470_1.diff] gtest-port.cc #17
- Notification* thread_can_start) - : thread_(ThreadWithParamSupport::CreateThread(runnable, - thread_can_start)) { -} + Notification *thread_can_start) + : thread_( + ThreadWithParamSupport::CreateThread(runnable, thread_can_start)) {} -ThreadWithParamBase::~ThreadWithParamBase() { - Join(); -} +ThreadWithParamBase::~ThreadWithParamBase() { Join(); }
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-port.cc
325
326
327
328
329
330
331
332
333
334
// Prohibit instantiation. ThreadWithParamSupport(); GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParamSupport); }; } // namespace ThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,
+ show +
335
336
337
338
339
340
341
Notification* thread_can_start) : thread_(ThreadWithParamSupport::CreateThread(runnable, thread_can_start)) { } ThreadWithParamBase::~ThreadWithParamBase() { Join();
+ show +
342
343
344
345
346
347
348
349
350
351
} void ThreadWithParamBase::Join() { GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0) << "Failed to join the thread with error " << ::GetLastError() << "."; } // Maps a thread to a set of ThreadIdToThreadLocals that have values // instantiated on that thread and notifies them when the thread exits. A // ThreadLocal instance is expected to persist until all threads it has
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-port.cc
366
367
368
369
370
371
372
373
374
375
// Prohibit instantiation. ThreadWithParamSupport(); GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParamSupport); }; } // namespace ThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,
+ show +
376
377
378
379
380
381
382
Notification* thread_can_start) : thread_(ThreadWithParamSupport::CreateThread(runnable, thread_can_start)) { } ThreadWithParamBase::~ThreadWithParamBase() { Join();
+ show +
383
384
385
386
387
388
389
390
391
392
} void ThreadWithParamBase::Join() { GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0) << "Failed to join the thread with error " << ::GetLastError() << "."; } // Maps a thread to a set of ThreadIdToThreadLocals that have values // instantiated on that thread and notifies them when the thread exits. A // ThreadLocal instance is expected to persist until all threads it has
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-port.cc
325
326
327
328
329
330
331
332
333
334
// Prohibit instantiation. ThreadWithParamSupport(); GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParamSupport); }; } // namespace ThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,
+ show +
335
336
337
338
339
340
341
Notification* thread_can_start) : thread_(ThreadWithParamSupport::CreateThread(runnable, thread_can_start)) { } ThreadWithParamBase::~ThreadWithParamBase() { Join();
+ show +
342
343
344
345
346
347
348
349
350
351
} void ThreadWithParamBase::Join() { GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0) << "Failed to join the thread with error " << ::GetLastError() << "."; } // Maps a thread to a set of ThreadIdToThreadLocals that have values // instantiated on that thread and notifies them when the thread exits. A // ThreadLocal instance is expected to persist until all threads it has
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest-port.cc
505
506
507
508
509
510
511
512
513
514
// Prohibit instantiation. ThreadWithParamSupport(); GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParamSupport); }; } // namespace ThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,
+ show +
515
516
517
518
519
520
521
Notification* thread_can_start) : thread_(ThreadWithParamSupport::CreateThread(runnable, thread_can_start)) { } ThreadWithParamBase::~ThreadWithParamBase() { Join();
+ show +
522
523
524
525
526
527
528
529
530
531
} void ThreadWithParamBase::Join() { GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0) << "Failed to join the thread with error " << ::GetLastError() << "."; } // Maps a thread to a set of ThreadIdToThreadLocals that have values // instantiated on that thread and notifies them when the thread exits. A // ThreadLocal instance is expected to persist until all threads it has
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
// Prohibit instantiation. ThreadWithParamSupport(); GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParamSupport); }; } // namespace ThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,
+ show +
8929
8930
8931
8932
8933
8934
8935
Notification* thread_can_start) : thread_(ThreadWithParamSupport::CreateThread(runnable, thread_can_start)) { } ThreadWithParamBase::~ThreadWithParamBase() { Join();
+ show +
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
} void ThreadWithParamBase::Join() { GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0) << "Failed to join the thread with error " << ::GetLastError() << "."; } // Maps a thread to a set of ThreadIdToThreadLocals that have values // instantiated on that thread and notifies them when the thread exits. A // ThreadLocal instance is expected to persist until all threads it has
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-port.cc
422
423
424
425
426
427
428
429
430
431
// Prohibit instantiation. ThreadWithParamSupport(); GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParamSupport); }; } // namespace ThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,
+ show +
432
433
434
435
436
437
438
Notification* thread_can_start) : thread_(ThreadWithParamSupport::CreateThread(runnable, thread_can_start)) { } ThreadWithParamBase::~ThreadWithParamBase() { Join();
+ show +
439
440
441
442
443
444
445
446
447
448
} void ThreadWithParamBase::Join() { GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0) << "Failed to join the thread with error " << ::GetLastError() << "."; } // Maps a thread to a set of ThreadIdToThreadLocals that have values // instantiated on that thread and notifies them when the thread exits. A // ThreadLocal instance is expected to persist until all threads it has
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-port.cc
366
367
368
369
370
371
372
373
374
375
// Prohibit instantiation. ThreadWithParamSupport(); GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParamSupport); }; } // namespace ThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,
+ show +
376
377
378
379
380
381
382
Notification* thread_can_start) : thread_(ThreadWithParamSupport::CreateThread(runnable, thread_can_start)) { } ThreadWithParamBase::~ThreadWithParamBase() { Join();
+ show +
383
384
385
386
387
388
389
390
391
392
} void ThreadWithParamBase::Join() { GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0) << "Failed to join the thread with error " << ::GetLastError() << "."; } // Maps a thread to a set of ThreadIdToThreadLocals that have values // instantiated on that thread and notifies them when the thread exits. A // ThreadLocal instance is expected to persist until all threads it has
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-port.cc
366
367
368
369
370
371
372
373
374
375
// Prohibit instantiation. ThreadWithParamSupport(); GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParamSupport); }; } // namespace ThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,
+ show +
376
377
378
379
380
381
382
Notification* thread_can_start) : thread_(ThreadWithParamSupport::CreateThread(runnable, thread_can_start)) { } ThreadWithParamBase::~ThreadWithParamBase() { Join();
+ show +
383
384
385
386
387
388
389
390
391
392
} void ThreadWithParamBase::Join() { GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0) << "Failed to join the thread with error " << ::GetLastError() << "."; } // Maps a thread to a set of ThreadIdToThreadLocals that have values // instantiated on that thread and notifies them when the thread exits. A // ThreadLocal instance is expected to persist until all threads it has

[CVE-2020-0470_1.diff] gtest-port.cc #24
- const ThreadIdAndHandle* tah = - reinterpret_cast<const ThreadIdAndHandle*>(param); - GTEST_CHECK_( - ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0); + const ThreadIdAndHandle *tah = + reinterpret_cast<const ThreadIdAndHandle *>(param); + GTEST_CHECK_(::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r16/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-port.cc
470
471
472
473
474
475
476
477
478
479
// blocked by it. ::SetThreadPriority(watcher_thread, ::GetThreadPriority(::GetCurrentThread())); ::ResumeThread(watcher_thread); ::CloseHandle(watcher_thread); } // Monitors exit from a given thread and notifies those // ThreadIdToThreadLocals about thread termination. static DWORD WINAPI WatcherThreadFunc(LPVOID param) {
+ show +
480
481
482
483
const ThreadIdAndHandle* tah = reinterpret_cast<const ThreadIdAndHandle*>(param); GTEST_CHECK_( ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
+ show +
484
485
486
487
488
489
490
491
492
493
OnThreadExit(tah->first); ::CloseHandle(tah->second); delete tah; return 0; } // Returns map of thread local instances. static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() { mutex_.AssertHeld(); static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals;
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-port.cc
511
512
513
514
515
516
517
518
519
520
// blocked by it. ::SetThreadPriority(watcher_thread, ::GetThreadPriority(::GetCurrentThread())); ::ResumeThread(watcher_thread); ::CloseHandle(watcher_thread); } // Monitors exit from a given thread and notifies those // ThreadIdToThreadLocals about thread termination. static DWORD WINAPI WatcherThreadFunc(LPVOID param) {
+ show +
521
522
523
524
const ThreadIdAndHandle* tah = reinterpret_cast<const ThreadIdAndHandle*>(param); GTEST_CHECK_( ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
+ show +
525
526
527
528
529
530
531
532
533
534
OnThreadExit(tah->first); ::CloseHandle(tah->second); delete tah; return 0; } // Returns map of thread local instances. static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() { mutex_.AssertHeld(); static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals;
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/vulkan/src/tests/gtest-1.7.0/src/gtest-port.cc
470
471
472
473
474
475
476
477
478
479
// blocked by it. ::SetThreadPriority(watcher_thread, ::GetThreadPriority(::GetCurrentThread())); ::ResumeThread(watcher_thread); ::CloseHandle(watcher_thread); } // Monitors exit from a given thread and notifies those // ThreadIdToThreadLocals about thread termination. static DWORD WINAPI WatcherThreadFunc(LPVOID param) {
+ show +
480
481
482
483
const ThreadIdAndHandle* tah = reinterpret_cast<const ThreadIdAndHandle*>(param); GTEST_CHECK_( ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
+ show +
484
485
486
487
488
489
490
491
492
493
OnThreadExit(tah->first); ::CloseHandle(tah->second); delete tah; return 0; } // Returns map of thread local instances. static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() { mutex_.AssertHeld(); static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals;
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest-port.cc
650
651
652
653
654
655
656
657
658
659
// blocked by it. ::SetThreadPriority(watcher_thread, ::GetThreadPriority(::GetCurrentThread())); ::ResumeThread(watcher_thread); ::CloseHandle(watcher_thread); } // Monitors exit from a given thread and notifies those // ThreadIdToThreadLocals about thread termination. static DWORD WINAPI WatcherThreadFunc(LPVOID param) {
+ show +
660
661
662
663
const ThreadIdAndHandle* tah = reinterpret_cast<const ThreadIdAndHandle*>(param); GTEST_CHECK_( ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
+ show +
664
665
666
667
668
669
670
671
672
673
OnThreadExit(tah->first); ::CloseHandle(tah->second); delete tah; return 0; } // Returns map of thread local instances. static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() { mutex_.AssertHeld(); MemoryIsNotDeallocated memory_is_not_deallocated;
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
// blocked by it. ::SetThreadPriority(watcher_thread, ::GetThreadPriority(::GetCurrentThread())); ::ResumeThread(watcher_thread); ::CloseHandle(watcher_thread); } // Monitors exit from a given thread and notifies those // ThreadIdToThreadLocals about thread termination. static DWORD WINAPI WatcherThreadFunc(LPVOID param) {
+ show +
9074
9075
9076
9077
const ThreadIdAndHandle* tah = reinterpret_cast<const ThreadIdAndHandle*>(param); GTEST_CHECK_( ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
+ show +
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
OnThreadExit(tah->first); ::CloseHandle(tah->second); delete tah; return 0; } // Returns map of thread local instances. static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() { mutex_.AssertHeld(); static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-port.cc
567
568
569
570
571
572
573
574
575
576
// blocked by it. ::SetThreadPriority(watcher_thread, ::GetThreadPriority(::GetCurrentThread())); ::ResumeThread(watcher_thread); ::CloseHandle(watcher_thread); } // Monitors exit from a given thread and notifies those // ThreadIdToThreadLocals about thread termination. static DWORD WINAPI WatcherThreadFunc(LPVOID param) {
+ show +
577
578
579
580
const ThreadIdAndHandle* tah = reinterpret_cast<const ThreadIdAndHandle*>(param); GTEST_CHECK_( ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
+ show +
581
582
583
584
585
586
587
588
589
590
OnThreadExit(tah->first); ::CloseHandle(tah->second); delete tah; return 0; } // Returns map of thread local instances. static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() { mutex_.AssertHeld(); MemoryIsNotDeallocated memory_is_not_deallocated;
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-port.cc
511
512
513
514
515
516
517
518
519
520
// blocked by it. ::SetThreadPriority(watcher_thread, ::GetThreadPriority(::GetCurrentThread())); ::ResumeThread(watcher_thread); ::CloseHandle(watcher_thread); } // Monitors exit from a given thread and notifies those // ThreadIdToThreadLocals about thread termination. static DWORD WINAPI WatcherThreadFunc(LPVOID param) {
+ show +
521
522
523
524
const ThreadIdAndHandle* tah = reinterpret_cast<const ThreadIdAndHandle*>(param); GTEST_CHECK_( ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
+ show +
525
526
527
528
529
530
531
532
533
534
OnThreadExit(tah->first); ::CloseHandle(tah->second); delete tah; return 0; } // Returns map of thread local instances. static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() { mutex_.AssertHeld(); static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-port.cc
511
512
513
514
515
516
517
518
519
520
// blocked by it. ::SetThreadPriority(watcher_thread, ::GetThreadPriority(::GetCurrentThread())); ::ResumeThread(watcher_thread); ::CloseHandle(watcher_thread); } // Monitors exit from a given thread and notifies those // ThreadIdToThreadLocals about thread termination. static DWORD WINAPI WatcherThreadFunc(LPVOID param) {
+ show +
521
522
523
524
const ThreadIdAndHandle* tah = reinterpret_cast<const ThreadIdAndHandle*>(param); GTEST_CHECK_( ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
+ show +
525
526
527
528
529
530
531
532
533
534
OnThreadExit(tah->first); ::CloseHandle(tah->second); delete tah; return 0; } // Returns map of thread local instances. static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() { mutex_.AssertHeld(); static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals;

[CVE-2020-0478_1.diff] gtest-typed-test.h #7
-// given test case. -# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_ +// given test suite. +#define GTEST_TYPE_PARAMS_(TestSuiteName) gtest_type_params_##TestSuiteName##_ -// The 'Types' template argument below must have spaces around it -// since some compilers may choke on '>>' when passing a template -// instance (e.g. Types<int>) -# define TYPED_TEST_CASE(CaseName, Types) \ - typedef ::testing::internal::TypeList< Types >::type \ - GTEST_TYPE_PARAMS_(CaseName) +// Expands to the name of the typedef for the NameGenerator, responsible for +// creating the suffixes of the name. +#define GTEST_NAME_GENERATOR_(TestSuiteName) \ + gtest_type_params_##TestSuiteName##_NameGenerator -# define TYPED_TEST(CaseName, TestName) \ - template <typename gtest_TypeParam_> \ - class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \ - : public CaseName<gtest_TypeParam_> { \ - private: \ - typedef CaseName<gtest_TypeParam_> TestFixture; \ - typedef gtest_TypeParam_ TypeParam; \ - virtual void TestBody(); \ - }; \ - bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \ - ::testing::internal::TypeParameterizedTest< \ - CaseName, \ - ::testing::internal::TemplateSel< \ - GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \ - GTEST_TYPE_PARAMS_(CaseName)>::Register(\ - "", ::testing::internal::CodeLocation(__FILE__, __LINE__), \ - #CaseName, #TestName, 0); \ - template <typename gtest_TypeParam_> \ - void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody() +#define TYPED_TEST_SUITE(CaseName, Types, ...) \ + typedef ::testing::internal::GenerateTypeList<Types>::type \ + GTEST_TYPE_PARAMS_(CaseName); \ + typedef ::testing::internal::NameGeneratorSelector<__VA_ARGS__>::type \ + GTEST_NAME_GENERATOR_(CaseName) + +#define TYPED_TEST(CaseName, TestName) \ + static_assert(sizeof(GTEST_STRINGIFY_(TestName)) > 1, \ + "test-name must not be empty"); \ + template <typename gtest_TypeParam_> \ + class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \ + : public CaseName<gtest_TypeParam_> { \ + private: \ + typedef CaseName<gtest_TypeParam_> TestFixture; \ + typedef gtest_TypeParam_ TypeParam; \ + void TestBody() override; \ + }; \ + static bool gtest_##CaseName##_##TestName##_registered_ \ + GTEST_ATTRIBUTE_UNUSED_ = ::testing::internal::TypeParameterizedTest< \ + CaseName, \ + ::testing::internal::TemplateSel<GTEST_TEST_CLASS_NAME_(CaseName, \ + TestName)>, \ + GTEST_TYPE_PARAMS_( \ + CaseName)>::Register("", \ + ::testing::internal::CodeLocation( \ + __FILE__, __LINE__), \ + GTEST_STRINGIFY_(CaseName), \ + GTEST_STRINGIFY_(TestName), 0, \ + ::testing::internal::GenerateNames< \ + GTEST_NAME_GENERATOR_(CaseName), \ + GTEST_TYPE_PARAMS_(CaseName)>()); \ + template <typename gtest_TypeParam_> \ + void GTEST_TEST_CLASS_NAME_(CaseName, \ + TestName)<gtest_TypeParam_>::TestBody() + +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ +#define TYPED_TEST_CASE \ + static_assert(::testing::internal::TypedTestCaseIsDeprecated(), ""); \ + TYPED_TEST_SUITE +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest-typed-test.h
150
151
152
153
154
155
156
157
158
159
#include "gtest/internal/gtest-type-util.h" // Implements typed tests. #if GTEST_HAS_TYPED_TEST // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Expands to the name of the typedef for the type parameters of the // given test case.
+ show +
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_ // The 'Types' template argument below must have spaces around it // since some compilers may choke on '>>' when passing a template // instance (e.g. Types<int>) # define TYPED_TEST_CASE(CaseName, Types) \ typedef ::testing::internal::TypeList< Types >::type \ GTEST_TYPE_PARAMS_(CaseName) # define TYPED_TEST(CaseName, TestName) \ template <typename gtest_TypeParam_> \ class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \ : public CaseName<gtest_TypeParam_> { \ private: \ typedef CaseName<gtest_TypeParam_> TestFixture; \ typedef gtest_TypeParam_ TypeParam; \ virtual void TestBody(); \ }; \ bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \ ::testing::internal::TypeParameterizedTest< \ CaseName, \ ::testing::internal::TemplateSel< \ GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \ GTEST_TYPE_PARAMS_(CaseName)>::Register(\ "", ::testing::internal::CodeLocation(__FILE__, __LINE__), \ #CaseName, #TestName, 0); \ template <typename gtest_TypeParam_> \ void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
+ show +
188
189
190
191
192
193
194
195
196
197
#endif // GTEST_HAS_TYPED_TEST // Implements type-parameterized tests. #if GTEST_HAS_TYPED_TEST_P // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Expands to the namespace name that the type-parameterized tests for
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
18563
18564
18565
18566
18567
18568
18569
18570
18571
18572
// Implements typed tests. #if GTEST_HAS_TYPED_TEST // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Expands to the name of the typedef for the type parameters of the // given test case.
+ show +
18573
18574
18575
18576
18577
18578
18579
18580
18581
18582
18583
18584
18585
18586
18587
18588
18589
18590
18591
18592
18593
18594
18595
18596
18597
18598
18599
18600
# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_ // The 'Types' template argument below must have spaces around it // since some compilers may choke on '>>' when passing a template // instance (e.g. Types<int>) # define TYPED_TEST_CASE(CaseName, Types) \ typedef ::testing::internal::TypeList< Types >::type \ GTEST_TYPE_PARAMS_(CaseName) # define TYPED_TEST(CaseName, TestName) \ template <typename gtest_TypeParam_> \ class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \ : public CaseName<gtest_TypeParam_> { \ private: \ typedef CaseName<gtest_TypeParam_> TestFixture; \ typedef gtest_TypeParam_ TypeParam; \ virtual void TestBody(); \ }; \ bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \ ::testing::internal::TypeParameterizedTest< \ CaseName, \ ::testing::internal::TemplateSel< \ GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \ GTEST_TYPE_PARAMS_(CaseName)>::Register(\ "", ::testing::internal::CodeLocation(__FILE__, __LINE__), \ #CaseName, #TestName, 0); \ template <typename gtest_TypeParam_> \ void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
+ show +
18601
18602
18603
18604
18605
18606
18607
18608
18609
18610
#endif // GTEST_HAS_TYPED_TEST // Implements type-parameterized tests. #if GTEST_HAS_TYPED_TEST_P // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Expands to the namespace name that the type-parameterized tests for
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest-typed-test.h
150
151
152
153
154
155
156
157
158
159
#include "gtest/internal/gtest-type-util.h" // Implements typed tests. #if GTEST_HAS_TYPED_TEST // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Expands to the name of the typedef for the type parameters of the // given test case.
+ show +
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_ // The 'Types' template argument below must have spaces around it // since some compilers may choke on '>>' when passing a template // instance (e.g. Types<int>) # define TYPED_TEST_CASE(CaseName, Types) \ typedef ::testing::internal::TypeList< Types >::type \ GTEST_TYPE_PARAMS_(CaseName) # define TYPED_TEST(CaseName, TestName) \ template <typename gtest_TypeParam_> \ class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \ : public CaseName<gtest_TypeParam_> { \ private: \ typedef CaseName<gtest_TypeParam_> TestFixture; \ typedef gtest_TypeParam_ TypeParam; \ virtual void TestBody(); \ }; \ bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \ ::testing::internal::TypeParameterizedTest< \ CaseName, \ ::testing::internal::TemplateSel< \ GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \ GTEST_TYPE_PARAMS_(CaseName)>::Register(\ "", ::testing::internal::CodeLocation(__FILE__, __LINE__), \ #CaseName, #TestName, 0); \ template <typename gtest_TypeParam_> \ void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
+ show +
188
189
190
191
192
193
194
195
196
197
#endif // GTEST_HAS_TYPED_TEST // Implements type-parameterized tests. #if GTEST_HAS_TYPED_TEST_P // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Expands to the namespace name that the type-parameterized tests for
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest-typed-test.h
150
151
152
153
154
155
156
157
158
159
#include "gtest/internal/gtest-type-util.h" // Implements typed tests. #if GTEST_HAS_TYPED_TEST // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Expands to the name of the typedef for the type parameters of the // given test case.
+ show +
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_ // The 'Types' template argument below must have spaces around it // since some compilers may choke on '>>' when passing a template // instance (e.g. Types<int>) # define TYPED_TEST_CASE(CaseName, Types) \ typedef ::testing::internal::TypeList< Types >::type \ GTEST_TYPE_PARAMS_(CaseName) # define TYPED_TEST(CaseName, TestName) \ template <typename gtest_TypeParam_> \ class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \ : public CaseName<gtest_TypeParam_> { \ private: \ typedef CaseName<gtest_TypeParam_> TestFixture; \ typedef gtest_TypeParam_ TypeParam; \ virtual void TestBody(); \ }; \ bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \ ::testing::internal::TypeParameterizedTest< \ CaseName, \ ::testing::internal::TemplateSel< \ GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \ GTEST_TYPE_PARAMS_(CaseName)>::Register(\ "", ::testing::internal::CodeLocation(__FILE__, __LINE__), \ #CaseName, #TestName, 0); \ template <typename gtest_TypeParam_> \ void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
+ show +
188
189
190
191
192
193
194
195
196
197
#endif // GTEST_HAS_TYPED_TEST // Implements type-parameterized tests. #if GTEST_HAS_TYPED_TEST_P // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Expands to the namespace name that the type-parameterized tests for

[CVE-2020-0470_1.diff] gtest-typed-test.h #7
-// given test case. -# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_ +// given test suite. +#define GTEST_TYPE_PARAMS_(TestSuiteName) gtest_type_params_##TestSuiteName##_ -// The 'Types' template argument below must have spaces around it -// since some compilers may choke on '>>' when passing a template -// instance (e.g. Types<int>) -# define TYPED_TEST_CASE(CaseName, Types) \ - typedef ::testing::internal::TypeList< Types >::type \ - GTEST_TYPE_PARAMS_(CaseName) +// Expands to the name of the typedef for the NameGenerator, responsible for +// creating the suffixes of the name. +#define GTEST_NAME_GENERATOR_(TestSuiteName) \ + gtest_type_params_##TestSuiteName##_NameGenerator -# define TYPED_TEST(CaseName, TestName) \ - template <typename gtest_TypeParam_> \ - class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \ - : public CaseName<gtest_TypeParam_> { \ - private: \ - typedef CaseName<gtest_TypeParam_> TestFixture; \ - typedef gtest_TypeParam_ TypeParam; \ - virtual void TestBody(); \ - }; \ - bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \ - ::testing::internal::TypeParameterizedTest< \ - CaseName, \ - ::testing::internal::TemplateSel< \ - GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \ - GTEST_TYPE_PARAMS_(CaseName)>::Register(\ - "", ::testing::internal::CodeLocation(__FILE__, __LINE__), \ - #CaseName, #TestName, 0); \ - template <typename gtest_TypeParam_> \ - void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody() +#define TYPED_TEST_SUITE(CaseName, Types, ...) \ + typedef ::testing::internal::GenerateTypeList<Types>::type \ + GTEST_TYPE_PARAMS_(CaseName); \ + typedef ::testing::internal::NameGeneratorSelector<__VA_ARGS__>::type \ + GTEST_NAME_GENERATOR_(CaseName) + +#define TYPED_TEST(CaseName, TestName) \ + static_assert(sizeof(GTEST_STRINGIFY_(TestName)) > 1, \ + "test-name must not be empty"); \ + template <typename gtest_TypeParam_> \ + class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \ + : public CaseName<gtest_TypeParam_> { \ + private: \ + typedef CaseName<gtest_TypeParam_> TestFixture; \ + typedef gtest_TypeParam_ TypeParam; \ + void TestBody() override; \ + }; \ + static bool gtest_##CaseName##_##TestName##_registered_ \ + GTEST_ATTRIBUTE_UNUSED_ = ::testing::internal::TypeParameterizedTest< \ + CaseName, \ + ::testing::internal::TemplateSel<GTEST_TEST_CLASS_NAME_(CaseName, \ + TestName)>, \ + GTEST_TYPE_PARAMS_( \ + CaseName)>::Register("", \ + ::testing::internal::CodeLocation( \ + __FILE__, __LINE__), \ + GTEST_STRINGIFY_(CaseName), \ + GTEST_STRINGIFY_(TestName), 0, \ + ::testing::internal::GenerateNames< \ + GTEST_NAME_GENERATOR_(CaseName), \ + GTEST_TYPE_PARAMS_(CaseName)>()); \ + template <typename gtest_TypeParam_> \ + void GTEST_TEST_CLASS_NAME_(CaseName, \ + TestName)<gtest_TypeParam_>::TestBody() + +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ +#define TYPED_TEST_CASE \ + static_assert(::testing::internal::TypedTestCaseIsDeprecated(), ""); \ + TYPED_TEST_SUITE +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest-typed-test.h
150
151
152
153
154
155
156
157
158
159
#include "gtest/internal/gtest-type-util.h" // Implements typed tests. #if GTEST_HAS_TYPED_TEST // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Expands to the name of the typedef for the type parameters of the // given test case.
+ show +
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_ // The 'Types' template argument below must have spaces around it // since some compilers may choke on '>>' when passing a template // instance (e.g. Types<int>) # define TYPED_TEST_CASE(CaseName, Types) \ typedef ::testing::internal::TypeList< Types >::type \ GTEST_TYPE_PARAMS_(CaseName) # define TYPED_TEST(CaseName, TestName) \ template <typename gtest_TypeParam_> \ class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \ : public CaseName<gtest_TypeParam_> { \ private: \ typedef CaseName<gtest_TypeParam_> TestFixture; \ typedef gtest_TypeParam_ TypeParam; \ virtual void TestBody(); \ }; \ bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \ ::testing::internal::TypeParameterizedTest< \ CaseName, \ ::testing::internal::TemplateSel< \ GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \ GTEST_TYPE_PARAMS_(CaseName)>::Register(\ "", ::testing::internal::CodeLocation(__FILE__, __LINE__), \ #CaseName, #TestName, 0); \ template <typename gtest_TypeParam_> \ void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
+ show +
188
189
190
191
192
193
194
195
196
197
#endif // GTEST_HAS_TYPED_TEST // Implements type-parameterized tests. #if GTEST_HAS_TYPED_TEST_P // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Expands to the namespace name that the type-parameterized tests for
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
18563
18564
18565
18566
18567
18568
18569
18570
18571
18572
// Implements typed tests. #if GTEST_HAS_TYPED_TEST // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Expands to the name of the typedef for the type parameters of the // given test case.
+ show +
18573
18574
18575
18576
18577
18578
18579
18580
18581
18582
18583
18584
18585
18586
18587
18588
18589
18590
18591
18592
18593
18594
18595
18596
18597
18598
18599
18600
# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_ // The 'Types' template argument below must have spaces around it // since some compilers may choke on '>>' when passing a template // instance (e.g. Types<int>) # define TYPED_TEST_CASE(CaseName, Types) \ typedef ::testing::internal::TypeList< Types >::type \ GTEST_TYPE_PARAMS_(CaseName) # define TYPED_TEST(CaseName, TestName) \ template <typename gtest_TypeParam_> \ class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \ : public CaseName<gtest_TypeParam_> { \ private: \ typedef CaseName<gtest_TypeParam_> TestFixture; \ typedef gtest_TypeParam_ TypeParam; \ virtual void TestBody(); \ }; \ bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \ ::testing::internal::TypeParameterizedTest< \ CaseName, \ ::testing::internal::TemplateSel< \ GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \ GTEST_TYPE_PARAMS_(CaseName)>::Register(\ "", ::testing::internal::CodeLocation(__FILE__, __LINE__), \ #CaseName, #TestName, 0); \ template <typename gtest_TypeParam_> \ void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
+ show +
18601
18602
18603
18604
18605
18606
18607
18608
18609
18610
#endif // GTEST_HAS_TYPED_TEST // Implements type-parameterized tests. #if GTEST_HAS_TYPED_TEST_P // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Expands to the namespace name that the type-parameterized tests for
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest-typed-test.h
150
151
152
153
154
155
156
157
158
159
#include "gtest/internal/gtest-type-util.h" // Implements typed tests. #if GTEST_HAS_TYPED_TEST // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Expands to the name of the typedef for the type parameters of the // given test case.
+ show +
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_ // The 'Types' template argument below must have spaces around it // since some compilers may choke on '>>' when passing a template // instance (e.g. Types<int>) # define TYPED_TEST_CASE(CaseName, Types) \ typedef ::testing::internal::TypeList< Types >::type \ GTEST_TYPE_PARAMS_(CaseName) # define TYPED_TEST(CaseName, TestName) \ template <typename gtest_TypeParam_> \ class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \ : public CaseName<gtest_TypeParam_> { \ private: \ typedef CaseName<gtest_TypeParam_> TestFixture; \ typedef gtest_TypeParam_ TypeParam; \ virtual void TestBody(); \ }; \ bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \ ::testing::internal::TypeParameterizedTest< \ CaseName, \ ::testing::internal::TemplateSel< \ GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \ GTEST_TYPE_PARAMS_(CaseName)>::Register(\ "", ::testing::internal::CodeLocation(__FILE__, __LINE__), \ #CaseName, #TestName, 0); \ template <typename gtest_TypeParam_> \ void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
+ show +
188
189
190
191
192
193
194
195
196
197
#endif // GTEST_HAS_TYPED_TEST // Implements type-parameterized tests. #if GTEST_HAS_TYPED_TEST_P // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Expands to the namespace name that the type-parameterized tests for
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest-typed-test.h
150
151
152
153
154
155
156
157
158
159
#include "gtest/internal/gtest-type-util.h" // Implements typed tests. #if GTEST_HAS_TYPED_TEST // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Expands to the name of the typedef for the type parameters of the // given test case.
+ show +
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_ // The 'Types' template argument below must have spaces around it // since some compilers may choke on '>>' when passing a template // instance (e.g. Types<int>) # define TYPED_TEST_CASE(CaseName, Types) \ typedef ::testing::internal::TypeList< Types >::type \ GTEST_TYPE_PARAMS_(CaseName) # define TYPED_TEST(CaseName, TestName) \ template <typename gtest_TypeParam_> \ class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \ : public CaseName<gtest_TypeParam_> { \ private: \ typedef CaseName<gtest_TypeParam_> TestFixture; \ typedef gtest_TypeParam_ TypeParam; \ virtual void TestBody(); \ }; \ bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \ ::testing::internal::TypeParameterizedTest< \ CaseName, \ ::testing::internal::TemplateSel< \ GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \ GTEST_TYPE_PARAMS_(CaseName)>::Register(\ "", ::testing::internal::CodeLocation(__FILE__, __LINE__), \ #CaseName, #TestName, 0); \ template <typename gtest_TypeParam_> \ void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
+ show +
188
189
190
191
192
193
194
195
196
197
#endif // GTEST_HAS_TYPED_TEST // Implements type-parameterized tests. #if GTEST_HAS_TYPED_TEST_P // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Expands to the namespace name that the type-parameterized tests for

[CVE-2020-0478_1.diff] gtest-param-test.h #16
-// tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types +// std::tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types -// Combine can have up to 10 arguments. This number is currently limited -// by the maximum number of elements in the tuple implementation used by Google -// Test. +// Combine can have up to 10 arguments. -// This will instantiate tests in test case AnimalTest each one with +// This will instantiate tests in test suite AnimalTest each one with -// : public testing::TestWithParam<tuple<const char*, Color> > {...}; +// : public testing::TestWithParam<std::tuple<const char*, Color> > {...}; -// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest, -// Combine(Values("cat", "dog"), -// Values(BLACK, WHITE))); +// INSTANTIATE_TEST_SUITE_P(AnimalVariations, AnimalTest, +// Combine(Values("cat", "dog"), +// Values(BLACK, WHITE))); -// : public testing::TestWithParam<tuple<bool, bool> > { +// : public testing::TestWithParam<std::tuple<bool, bool> > { -// tie(external_flag_1, external_flag_2) = GetParam(); +// std::tie(external_flag_1, external_flag_2) = GetParam(); -// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest, -// Combine(Bool(), Bool())); +// INSTANTIATE_TEST_SUITE_P(TwoBoolSequence, FlagDependentTest, +// Combine(Bool(), Bool())); -template <typename Generator1, typename Generator2> -internal::CartesianProductHolder2<Generator1, Generator2> Combine( - const Generator1& g1, const Generator2& g2) { - return internal::CartesianProductHolder2<Generator1, Generator2>( - g1, g2); +template <typename... Generator> +internal::CartesianProductHolder<Generator...> Combine(const Generator &... g) { + return internal::CartesianProductHolder<Generator...>(g...); -template <typename Generator1, typename Generator2, typename Generator3> -internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3) { - return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>( - g1, g2, g3); -} +#define TEST_P(test_suite_name, test_name) \ + class GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) \ + : public test_suite_name { \ + public: \ + GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)() {} \ + void TestBody() override; \ + \ + private: \ + static int AddToRegistry() { \ + ::testing::UnitTest::GetInstance() \ + ->parameterized_test_registry() \ + .GetTestSuitePatternHolder<test_suite_name>( \ + GTEST_STRINGIFY_(test_suite_name), \ + ::testing::internal::CodeLocation(__FILE__, __LINE__)) \ + ->AddTestPattern( \ + GTEST_STRINGIFY_(test_suite_name), GTEST_STRINGIFY_(test_name), \ + new ::testing::internal::TestMetaFactory<GTEST_TEST_CLASS_NAME_( \ + test_suite_name, test_name)>()); \ + return 0; \ + } \ + static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \ + GTEST_DISALLOW_COPY_AND_ASSIGN_(GTEST_TEST_CLASS_NAME_(test_suite_name, \ + test_name)); \ + }; \ + int GTEST_TEST_CLASS_NAME_(test_suite_name, \ + test_name)::gtest_registering_dummy_ = \ + GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)::AddToRegistry(); \ + void GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)::TestBody() -template <typename Generator1, typename Generator2, typename Generator3, - typename Generator4> -internal::CartesianProductHolder4<Generator1, Generator2, Generator3, - Generator4> Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4) { - return internal::CartesianProductHolder4<Generator1, Generator2, Generator3, - Generator4>( - g1, g2, g3, g4); -} - -template <typename Generator1, typename Generator2, typename Generator3, - typename Generator4, typename Generator5> -internal::CartesianProductHolder5<Generator1, Generator2, Generator3, - Generator4, Generator5> Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5) { - return internal::CartesianProductHolder5<Generator1, Generator2, Generator3, - Generator4, Generator5>( - g1, g2, g3, g4, g5); -} - -template <typename Generator1, typename Generator2, typename Generator3, - typename Generator4, typename Generator5, typename Generator6> -internal::CartesianProductHolder6<Generator1, Generator2, Generator3, - Generator4, Generator5, Generator6> Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6) { - return internal::CartesianProductHolder6<Generator1, Generator2, Generator3, - Generator4, Generator5, Generator6>( - g1, g2, g3, g4, g5, g6); -} - -template <typename Generator1, typename Generator2, typename Generator3, - typename Generator4, typename Generator5, typename Generator6, - typename Generator7> -internal::CartesianProductHolder7<Generator1, Generator2, Generator3, - Generator4, Generator5, Generator6, Generator7> Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7) { - return internal::CartesianProductHolder7<Generator1, Generator2, Generator3, - Generator4, Generator5, Generator6, Generator7>( - g1, g2, g3, g4, g5, g6, g7); -} - -template <typename Generator1, typename Generator2, typename Generator3, - typename Generator4, typename Generator5, typename Generator6, - typename Generator7, typename Generator8> -internal::CartesianProductHolder8<Generator1, Generator2, Generator3, - Generator4, Generator5, Generator6, Generator7, Generator8> Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7, const Generator8& g8) { - return internal::CartesianProductHolder8<Generator1, Generator2, Generator3, - Generator4, Generator5, Generator6, Generator7, Generator8>( - g1, g2, g3, g4, g5, g6, g7, g8); -} - -template <typename Generator1, typename Generator2, typename Generator3, - typename Generator4, typename Generator5, typename Generator6, - typename Generator7, typename Generator8, typename Generator9> -internal::CartesianProductHolder9<Generator1, Generator2, Generator3, - Generator4, Generator5, Generator6, Generator7, Generator8, - Generator9> Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7, const Generator8& g8, const Generator9& g9) { - return internal::CartesianProductHolder9<Generator1, Generator2, Generator3, - Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>( - g1, g2, g3, g4, g5, g6, g7, g8, g9); -} - -template <typename Generator1, typename Generator2, typename Generator3, - typename Generator4, typename Generator5, typename Generator6, - typename Generator7, typename Generator8, typename Generator9, - typename Generator10> -internal::CartesianProductHolder10<Generator1, Generator2, Generator3, - Generator4, Generator5, Generator6, Generator7, Generator8, Generator9, - Generator10> Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7, const Generator8& g8, const Generator9& g9, - const Generator10& g10) { - return internal::CartesianProductHolder10<Generator1, Generator2, Generator3, - Generator4, Generator5, Generator6, Generator7, Generator8, Generator9, - Generator10>( - g1, g2, g3, g4, g5, g6, g7, g8, g9, g10); -} -# endif // GTEST_HAS_COMBINE - - - -# define TEST_P(test_case_name, test_name) \ - class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ - : public test_case_name { \ - public: \ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \ - virtual void TestBody(); \ - private: \ - static int AddToRegistry() { \ - ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ - GetTestCasePatternHolder<test_case_name>(\ - #test_case_name, \ - ::testing::internal::CodeLocation(\ - __FILE__, __LINE__))->AddTestPattern(\ - #test_case_name, \ - #test_name, \ - new ::testing::internal::TestMetaFactory< \ - GTEST_TEST_CLASS_NAME_(\ - test_case_name, test_name)>()); \ - return 0; \ - } \ - static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \ - GTEST_DISALLOW_COPY_AND_ASSIGN_(\ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \ - }; \ - int GTEST_TEST_CLASS_NAME_(test_case_name, \ - test_name)::gtest_registering_dummy_ = \ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \ - void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() - -// The optional last argument to INSTANTIATE_TEST_CASE_P allows the user -// to specify a function or functor that generates custom test name suffixes -// based on the test parameters. The function should accept one argument of -// type testing::TestParamInfo<class ParamType>, and return std::string. +// The last argument to INSTANTIATE_TEST_SUITE_P allows the user to specify +// generator and an optional function or functor that generates custom test name +// suffixes based on the test parameters. Such a function or functor should +// accept one argument of type testing::TestParamInfo<class ParamType>, and +// return std::string. -// returns the value of testing::PrintToString(GetParam()). It does not work -// for std::string or C strings. +// returns the value of testing::PrintToString(GetParam()). -// alphanumeric characters or underscore. +// alphanumeric characters or underscore. Because PrintToString adds quotes +// to std::string and C strings, it won't work for these types. -# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \ - ::testing::internal::ParamGenerator<test_case_name::ParamType> \ - gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \ - ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \ - const ::testing::TestParamInfo<test_case_name::ParamType>& info) { \ - return ::testing::internal::GetParamNameGen<test_case_name::ParamType> \ - (__VA_ARGS__)(info); \ - } \ - int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \ - ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ - GetTestCasePatternHolder<test_case_name>(\ - #test_case_name, \ - ::testing::internal::CodeLocation(\ - __FILE__, __LINE__))->AddTestCaseInstantiation(\ - #prefix, \ - >est_##prefix##test_case_name##_EvalGenerator_, \ - >est_##prefix##test_case_name##_EvalGenerateName_, \ - __FILE__, __LINE__) +#define GTEST_EXPAND_(arg) arg +#define GTEST_GET_FIRST_(first, ...) first +#define GTEST_GET_SECOND_(first, second, ...) second + +#define INSTANTIATE_TEST_SUITE_P(prefix, test_suite_name, ...) \ + static ::testing::internal::ParamGenerator<test_suite_name::ParamType> \ + gtest_##prefix##test_suite_name##_EvalGenerator_() { \ + return GTEST_EXPAND_(GTEST_GET_FIRST_(__VA_ARGS__, DUMMY_PARAM_)); \ + } \ + static ::std::string gtest_##prefix##test_suite_name##_EvalGenerateName_( \ + const ::testing::TestParamInfo<test_suite_name::ParamType> &info) { \ + if (::testing::internal::AlwaysFalse()) { \ + ::testing::internal::TestNotEmpty(GTEST_EXPAND_(GTEST_GET_SECOND_( \ + __VA_ARGS__, \ + ::testing::internal::DefaultParamName<test_suite_name::ParamType>, \ + DUMMY_PARAM_))); \ + auto t = std::make_tuple(__VA_ARGS__); \ + static_assert(std::tuple_size<decltype(t)>::value <= 2, \ + "Too Many Args!"); \ + } \ + return ((GTEST_EXPAND_(GTEST_GET_SECOND_( \ + __VA_ARGS__, \ + ::testing::internal::DefaultParamName<test_suite_name::ParamType>, \ + DUMMY_PARAM_))))(info); \ + } \ + static int gtest_##prefix##test_suite_name##_dummy_ \ + GTEST_ATTRIBUTE_UNUSED_ = \ + ::testing::UnitTest::GetInstance() \ + ->parameterized_test_registry() \ + .GetTestSuitePatternHolder<test_suite_name>( \ + GTEST_STRINGIFY_(test_suite_name), \ + ::testing::internal::CodeLocation(__FILE__, __LINE__)) \ + ->AddTestSuiteInstantiation( \ + GTEST_STRINGIFY_(prefix), \ + >est_##prefix##test_suite_name##_EvalGenerator_, \ + >est_##prefix##test_suite_name##_EvalGenerateName_, \ + __FILE__, __LINE__) + +// Allow Marking a Parameterized test class as not needing to be instantiated. +#define GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(T) \ + namespace gtest_do_not_use_outside_namespace_scope {} \ + static const ::testing::internal::MarkAsIgnored gtest_allow_ignore_##T( \ + GTEST_STRINGIFY_(T)) + +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ +#define INSTANTIATE_TEST_CASE_P \ + static_assert(::testing::internal::InstantiateTestCase_P_IsDeprecated(), \ + ""); \ + INSTANTIATE_TEST_SUITE_P +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ -#endif // GTEST_HAS_PARAM_TEST -
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
// tie(external_flag_1, external_flag_2) = GetParam(); // } // }; // // TEST_P(FlagDependentTest, TestFeature1) { // // Test your code using external_flag_1 and external_flag_2 here. // } // INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest, // Combine(Bool(), Bool())); //
+ show +
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
template <typename Generator1, typename Generator2> internal::CartesianProductHolder2<Generator1, Generator2> Combine( const Generator1& g1, const Generator2& g2) { return internal::CartesianProductHolder2<Generator1, Generator2>( g1, g2); } template <typename Generator1, typename Generator2, typename Generator3> internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine( const Generator1& g1, const Generator2& g2, const Generator3& g3) { return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>( g1, g2, g3); } template <typename Generator1, typename Generator2, typename Generator3, typename Generator4> internal::CartesianProductHolder4<Generator1, Generator2, Generator3, Generator4> Combine( const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4) { return internal::CartesianProductHolder4<Generator1, Generator2, Generator3, Generator4>( g1, g2, g3, g4); } template <typename Generator1, typename Generator2, typename Generator3, typename Generator4, typename Generator5> internal::CartesianProductHolder5<Generator1, Generator2, Generator3, Generator4, Generator5> Combine( const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4, const Generator5& g5) { return internal::CartesianProductHolder5<Generator1, Generator2, Generator3, Generator4, Generator5>( g1, g2, g3, g4, g5); } template <typename Generator1, typename Generator2, typename Generator3, typename Generator4, typename Generator5, typename Generator6> internal::CartesianProductHolder6<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6> Combine( const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4, const Generator5& g5, const Generator6& g6) { return internal::CartesianProductHolder6<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6>( g1, g2, g3, g4, g5, g6); } template <typename Generator1, typename Generator2, typename Generator3, typename Generator4, typename Generator5, typename Generator6, typename Generator7> internal::CartesianProductHolder7<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7> Combine( const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4, const Generator5& g5, const Generator6& g6, const Generator7& g7) { return internal::CartesianProductHolder7<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7>( g1, g2, g3, g4, g5, g6, g7); } template <typename Generator1, typename Generator2, typename Generator3, typename Generator4, typename Generator5, typename Generator6, typename Generator7, typename Generator8> internal::CartesianProductHolder8<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7, Generator8> Combine( const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4, const Generator5& g5, const Generator6& g6, const Generator7& g7, const Generator8& g8) { return internal::CartesianProductHolder8<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7, Generator8>( g1, g2, g3, g4, g5, g6, g7, g8); } template <typename Generator1, typename Generator2, typename Generator3, typename Generator4, typename Generator5, typename Generator6, typename Generator7, typename Generator8, typename Generator9> internal::CartesianProductHolder9<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7, Generator8, Generator9> Combine( const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4, const Generator5& g5, const Generator6& g6, const Generator7& g7, const Generator8& g8, const Generator9& g9) { return internal::CartesianProductHolder9<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>( g1, g2, g3, g4, g5, g6, g7, g8, g9); } template <typename Generator1, typename Generator2, typename Generator3, typename Generator4, typename Generator5, typename Generator6, typename Generator7, typename Generator8, typename Generator9, typename Generator10> internal::CartesianProductHolder10<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7, Generator8, Generator9, Generator10> Combine( const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4, const Generator5& g5, const Generator6& g6, const Generator7& g7, const Generator8& g8, const Generator9& g9, const Generator10& g10) { return internal::CartesianProductHolder10<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7, Generator8, Generator9, Generator10>( g1, g2, g3, g4, g5, g6, g7, g8, g9, g10); } # endif // GTEST_HAS_COMBINE # define TEST_P(test_case_name, test_name) \ class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ : public test_case_name { \ public: \ GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \ virtual void TestBody(); \ private: \ static int AddToRegistry() { \ ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ GetTestCasePatternHolder<test_case_name>(\ #test_case_name, \ ::testing::internal::CodeLocation(\ __FILE__, __LINE__))->AddTestPattern(\ #test_case_name, \ #test_name, \ new ::testing::internal::TestMetaFactory< \ GTEST_TEST_CLASS_NAME_(\ test_case_name, test_name)>()); \ return 0; \ } \ static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \ GTEST_DISALLOW_COPY_AND_ASSIGN_(\ GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \ }; \ int GTEST_TEST_CLASS_NAME_(test_case_name, \ test_name)::gtest_registering_dummy_ = \ GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \ void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() // The optional last argument to INSTANTIATE_TEST_CASE_P allows the user // to specify a function or functor that generates custom test name suffixes // based on the test parameters. The function should accept one argument of // type testing::TestParamInfo<class ParamType>, and return std::string. // // testing::PrintToStringParamName is a builtin test suffix generator that // returns the value of testing::PrintToString(GetParam()). It does not work // for std::string or C strings. // // Note: test names must be non-empty, unique, and may only contain ASCII // alphanumeric characters or underscore. # define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \ ::testing::internal::ParamGenerator<test_case_name::ParamType> \ gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \ ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \ const ::testing::TestParamInfo<test_case_name::ParamType>& info) { \ return ::testing::internal::GetParamNameGen<test_case_name::ParamType> \ (__VA_ARGS__)(info); \ } \ int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \ ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ GetTestCasePatternHolder<test_case_name>(\ #test_case_name, \ ::testing::internal::CodeLocation(\ __FILE__, __LINE__))->AddTestCaseInstantiation(\ #prefix, \ &gtest_##prefix##test_case_name##_EvalGenerator_, \ &gtest_##prefix##test_case_name##_EvalGenerateName_, \ __FILE__, __LINE__) } // namespace testing #endif // GTEST_HAS_PARAM_TEST
+ show +
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
#endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ // Copyright 2006, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright

[CVE-2020-0470_1.diff] gtest-param-test.h #16
-// tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types +// std::tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types -// Combine can have up to 10 arguments. This number is currently limited -// by the maximum number of elements in the tuple implementation used by Google -// Test. +// Combine can have up to 10 arguments. -// This will instantiate tests in test case AnimalTest each one with +// This will instantiate tests in test suite AnimalTest each one with -// : public testing::TestWithParam<tuple<const char*, Color> > {...}; +// : public testing::TestWithParam<std::tuple<const char*, Color> > {...}; -// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest, -// Combine(Values("cat", "dog"), -// Values(BLACK, WHITE))); +// INSTANTIATE_TEST_SUITE_P(AnimalVariations, AnimalTest, +// Combine(Values("cat", "dog"), +// Values(BLACK, WHITE))); -// : public testing::TestWithParam<tuple<bool, bool> > { +// : public testing::TestWithParam<std::tuple<bool, bool> > { -// tie(external_flag_1, external_flag_2) = GetParam(); +// std::tie(external_flag_1, external_flag_2) = GetParam(); -// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest, -// Combine(Bool(), Bool())); +// INSTANTIATE_TEST_SUITE_P(TwoBoolSequence, FlagDependentTest, +// Combine(Bool(), Bool())); -template <typename Generator1, typename Generator2> -internal::CartesianProductHolder2<Generator1, Generator2> Combine( - const Generator1& g1, const Generator2& g2) { - return internal::CartesianProductHolder2<Generator1, Generator2>( - g1, g2); +template <typename... Generator> +internal::CartesianProductHolder<Generator...> Combine(const Generator &... g) { + return internal::CartesianProductHolder<Generator...>(g...); -template <typename Generator1, typename Generator2, typename Generator3> -internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3) { - return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>( - g1, g2, g3); -} +#define TEST_P(test_suite_name, test_name) \ + class GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) \ + : public test_suite_name { \ + public: \ + GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)() {} \ + void TestBody() override; \ + \ + private: \ + static int AddToRegistry() { \ + ::testing::UnitTest::GetInstance() \ + ->parameterized_test_registry() \ + .GetTestSuitePatternHolder<test_suite_name>( \ + GTEST_STRINGIFY_(test_suite_name), \ + ::testing::internal::CodeLocation(__FILE__, __LINE__)) \ + ->AddTestPattern( \ + GTEST_STRINGIFY_(test_suite_name), GTEST_STRINGIFY_(test_name), \ + new ::testing::internal::TestMetaFactory<GTEST_TEST_CLASS_NAME_( \ + test_suite_name, test_name)>()); \ + return 0; \ + } \ + static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \ + GTEST_DISALLOW_COPY_AND_ASSIGN_(GTEST_TEST_CLASS_NAME_(test_suite_name, \ + test_name)); \ + }; \ + int GTEST_TEST_CLASS_NAME_(test_suite_name, \ + test_name)::gtest_registering_dummy_ = \ + GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)::AddToRegistry(); \ + void GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)::TestBody() -template <typename Generator1, typename Generator2, typename Generator3, - typename Generator4> -internal::CartesianProductHolder4<Generator1, Generator2, Generator3, - Generator4> Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4) { - return internal::CartesianProductHolder4<Generator1, Generator2, Generator3, - Generator4>( - g1, g2, g3, g4); -} - -template <typename Generator1, typename Generator2, typename Generator3, - typename Generator4, typename Generator5> -internal::CartesianProductHolder5<Generator1, Generator2, Generator3, - Generator4, Generator5> Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5) { - return internal::CartesianProductHolder5<Generator1, Generator2, Generator3, - Generator4, Generator5>( - g1, g2, g3, g4, g5); -} - -template <typename Generator1, typename Generator2, typename Generator3, - typename Generator4, typename Generator5, typename Generator6> -internal::CartesianProductHolder6<Generator1, Generator2, Generator3, - Generator4, Generator5, Generator6> Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6) { - return internal::CartesianProductHolder6<Generator1, Generator2, Generator3, - Generator4, Generator5, Generator6>( - g1, g2, g3, g4, g5, g6); -} - -template <typename Generator1, typename Generator2, typename Generator3, - typename Generator4, typename Generator5, typename Generator6, - typename Generator7> -internal::CartesianProductHolder7<Generator1, Generator2, Generator3, - Generator4, Generator5, Generator6, Generator7> Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7) { - return internal::CartesianProductHolder7<Generator1, Generator2, Generator3, - Generator4, Generator5, Generator6, Generator7>( - g1, g2, g3, g4, g5, g6, g7); -} - -template <typename Generator1, typename Generator2, typename Generator3, - typename Generator4, typename Generator5, typename Generator6, - typename Generator7, typename Generator8> -internal::CartesianProductHolder8<Generator1, Generator2, Generator3, - Generator4, Generator5, Generator6, Generator7, Generator8> Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7, const Generator8& g8) { - return internal::CartesianProductHolder8<Generator1, Generator2, Generator3, - Generator4, Generator5, Generator6, Generator7, Generator8>( - g1, g2, g3, g4, g5, g6, g7, g8); -} - -template <typename Generator1, typename Generator2, typename Generator3, - typename Generator4, typename Generator5, typename Generator6, - typename Generator7, typename Generator8, typename Generator9> -internal::CartesianProductHolder9<Generator1, Generator2, Generator3, - Generator4, Generator5, Generator6, Generator7, Generator8, - Generator9> Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7, const Generator8& g8, const Generator9& g9) { - return internal::CartesianProductHolder9<Generator1, Generator2, Generator3, - Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>( - g1, g2, g3, g4, g5, g6, g7, g8, g9); -} - -template <typename Generator1, typename Generator2, typename Generator3, - typename Generator4, typename Generator5, typename Generator6, - typename Generator7, typename Generator8, typename Generator9, - typename Generator10> -internal::CartesianProductHolder10<Generator1, Generator2, Generator3, - Generator4, Generator5, Generator6, Generator7, Generator8, Generator9, - Generator10> Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7, const Generator8& g8, const Generator9& g9, - const Generator10& g10) { - return internal::CartesianProductHolder10<Generator1, Generator2, Generator3, - Generator4, Generator5, Generator6, Generator7, Generator8, Generator9, - Generator10>( - g1, g2, g3, g4, g5, g6, g7, g8, g9, g10); -} -# endif // GTEST_HAS_COMBINE - - - -# define TEST_P(test_case_name, test_name) \ - class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ - : public test_case_name { \ - public: \ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \ - virtual void TestBody(); \ - private: \ - static int AddToRegistry() { \ - ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ - GetTestCasePatternHolder<test_case_name>(\ - #test_case_name, \ - ::testing::internal::CodeLocation(\ - __FILE__, __LINE__))->AddTestPattern(\ - #test_case_name, \ - #test_name, \ - new ::testing::internal::TestMetaFactory< \ - GTEST_TEST_CLASS_NAME_(\ - test_case_name, test_name)>()); \ - return 0; \ - } \ - static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \ - GTEST_DISALLOW_COPY_AND_ASSIGN_(\ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \ - }; \ - int GTEST_TEST_CLASS_NAME_(test_case_name, \ - test_name)::gtest_registering_dummy_ = \ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \ - void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() - -// The optional last argument to INSTANTIATE_TEST_CASE_P allows the user -// to specify a function or functor that generates custom test name suffixes -// based on the test parameters. The function should accept one argument of -// type testing::TestParamInfo<class ParamType>, and return std::string. +// The last argument to INSTANTIATE_TEST_SUITE_P allows the user to specify +// generator and an optional function or functor that generates custom test name +// suffixes based on the test parameters. Such a function or functor should +// accept one argument of type testing::TestParamInfo<class ParamType>, and +// return std::string. -// returns the value of testing::PrintToString(GetParam()). It does not work -// for std::string or C strings. +// returns the value of testing::PrintToString(GetParam()). -// alphanumeric characters or underscore. +// alphanumeric characters or underscore. Because PrintToString adds quotes +// to std::string and C strings, it won't work for these types. -# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \ - ::testing::internal::ParamGenerator<test_case_name::ParamType> \ - gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \ - ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \ - const ::testing::TestParamInfo<test_case_name::ParamType>& info) { \ - return ::testing::internal::GetParamNameGen<test_case_name::ParamType> \ - (__VA_ARGS__)(info); \ - } \ - int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \ - ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ - GetTestCasePatternHolder<test_case_name>(\ - #test_case_name, \ - ::testing::internal::CodeLocation(\ - __FILE__, __LINE__))->AddTestCaseInstantiation(\ - #prefix, \ - >est_##prefix##test_case_name##_EvalGenerator_, \ - >est_##prefix##test_case_name##_EvalGenerateName_, \ - __FILE__, __LINE__) +#define GTEST_EXPAND_(arg) arg +#define GTEST_GET_FIRST_(first, ...) first +#define GTEST_GET_SECOND_(first, second, ...) second + +#define INSTANTIATE_TEST_SUITE_P(prefix, test_suite_name, ...) \ + static ::testing::internal::ParamGenerator<test_suite_name::ParamType> \ + gtest_##prefix##test_suite_name##_EvalGenerator_() { \ + return GTEST_EXPAND_(GTEST_GET_FIRST_(__VA_ARGS__, DUMMY_PARAM_)); \ + } \ + static ::std::string gtest_##prefix##test_suite_name##_EvalGenerateName_( \ + const ::testing::TestParamInfo<test_suite_name::ParamType> &info) { \ + if (::testing::internal::AlwaysFalse()) { \ + ::testing::internal::TestNotEmpty(GTEST_EXPAND_(GTEST_GET_SECOND_( \ + __VA_ARGS__, \ + ::testing::internal::DefaultParamName<test_suite_name::ParamType>, \ + DUMMY_PARAM_))); \ + auto t = std::make_tuple(__VA_ARGS__); \ + static_assert(std::tuple_size<decltype(t)>::value <= 2, \ + "Too Many Args!"); \ + } \ + return ((GTEST_EXPAND_(GTEST_GET_SECOND_( \ + __VA_ARGS__, \ + ::testing::internal::DefaultParamName<test_suite_name::ParamType>, \ + DUMMY_PARAM_))))(info); \ + } \ + static int gtest_##prefix##test_suite_name##_dummy_ \ + GTEST_ATTRIBUTE_UNUSED_ = \ + ::testing::UnitTest::GetInstance() \ + ->parameterized_test_registry() \ + .GetTestSuitePatternHolder<test_suite_name>( \ + GTEST_STRINGIFY_(test_suite_name), \ + ::testing::internal::CodeLocation(__FILE__, __LINE__)) \ + ->AddTestSuiteInstantiation( \ + GTEST_STRINGIFY_(prefix), \ + >est_##prefix##test_suite_name##_EvalGenerator_, \ + >est_##prefix##test_suite_name##_EvalGenerateName_, \ + __FILE__, __LINE__) + +// Allow Marking a Parameterized test class as not needing to be instantiated. +#define GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(T) \ + namespace gtest_do_not_use_outside_namespace_scope {} \ + static const ::testing::internal::MarkAsIgnored gtest_allow_ignore_##T( \ + GTEST_STRINGIFY_(T)) + +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ +#define INSTANTIATE_TEST_CASE_P \ + static_assert(::testing::internal::InstantiateTestCase_P_IsDeprecated(), \ + ""); \ + INSTANTIATE_TEST_SUITE_P +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ -#endif // GTEST_HAS_PARAM_TEST -
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
// tie(external_flag_1, external_flag_2) = GetParam(); // } // }; // // TEST_P(FlagDependentTest, TestFeature1) { // // Test your code using external_flag_1 and external_flag_2 here. // } // INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest, // Combine(Bool(), Bool())); //
+ show +
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
template <typename Generator1, typename Generator2> internal::CartesianProductHolder2<Generator1, Generator2> Combine( const Generator1& g1, const Generator2& g2) { return internal::CartesianProductHolder2<Generator1, Generator2>( g1, g2); } template <typename Generator1, typename Generator2, typename Generator3> internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine( const Generator1& g1, const Generator2& g2, const Generator3& g3) { return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>( g1, g2, g3); } template <typename Generator1, typename Generator2, typename Generator3, typename Generator4> internal::CartesianProductHolder4<Generator1, Generator2, Generator3, Generator4> Combine( const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4) { return internal::CartesianProductHolder4<Generator1, Generator2, Generator3, Generator4>( g1, g2, g3, g4); } template <typename Generator1, typename Generator2, typename Generator3, typename Generator4, typename Generator5> internal::CartesianProductHolder5<Generator1, Generator2, Generator3, Generator4, Generator5> Combine( const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4, const Generator5& g5) { return internal::CartesianProductHolder5<Generator1, Generator2, Generator3, Generator4, Generator5>( g1, g2, g3, g4, g5); } template <typename Generator1, typename Generator2, typename Generator3, typename Generator4, typename Generator5, typename Generator6> internal::CartesianProductHolder6<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6> Combine( const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4, const Generator5& g5, const Generator6& g6) { return internal::CartesianProductHolder6<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6>( g1, g2, g3, g4, g5, g6); } template <typename Generator1, typename Generator2, typename Generator3, typename Generator4, typename Generator5, typename Generator6, typename Generator7> internal::CartesianProductHolder7<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7> Combine( const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4, const Generator5& g5, const Generator6& g6, const Generator7& g7) { return internal::CartesianProductHolder7<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7>( g1, g2, g3, g4, g5, g6, g7); } template <typename Generator1, typename Generator2, typename Generator3, typename Generator4, typename Generator5, typename Generator6, typename Generator7, typename Generator8> internal::CartesianProductHolder8<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7, Generator8> Combine( const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4, const Generator5& g5, const Generator6& g6, const Generator7& g7, const Generator8& g8) { return internal::CartesianProductHolder8<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7, Generator8>( g1, g2, g3, g4, g5, g6, g7, g8); } template <typename Generator1, typename Generator2, typename Generator3, typename Generator4, typename Generator5, typename Generator6, typename Generator7, typename Generator8, typename Generator9> internal::CartesianProductHolder9<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7, Generator8, Generator9> Combine( const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4, const Generator5& g5, const Generator6& g6, const Generator7& g7, const Generator8& g8, const Generator9& g9) { return internal::CartesianProductHolder9<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>( g1, g2, g3, g4, g5, g6, g7, g8, g9); } template <typename Generator1, typename Generator2, typename Generator3, typename Generator4, typename Generator5, typename Generator6, typename Generator7, typename Generator8, typename Generator9, typename Generator10> internal::CartesianProductHolder10<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7, Generator8, Generator9, Generator10> Combine( const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4, const Generator5& g5, const Generator6& g6, const Generator7& g7, const Generator8& g8, const Generator9& g9, const Generator10& g10) { return internal::CartesianProductHolder10<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7, Generator8, Generator9, Generator10>( g1, g2, g3, g4, g5, g6, g7, g8, g9, g10); } # endif // GTEST_HAS_COMBINE # define TEST_P(test_case_name, test_name) \ class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ : public test_case_name { \ public: \ GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \ virtual void TestBody(); \ private: \ static int AddToRegistry() { \ ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ GetTestCasePatternHolder<test_case_name>(\ #test_case_name, \ ::testing::internal::CodeLocation(\ __FILE__, __LINE__))->AddTestPattern(\ #test_case_name, \ #test_name, \ new ::testing::internal::TestMetaFactory< \ GTEST_TEST_CLASS_NAME_(\ test_case_name, test_name)>()); \ return 0; \ } \ static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \ GTEST_DISALLOW_COPY_AND_ASSIGN_(\ GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \ }; \ int GTEST_TEST_CLASS_NAME_(test_case_name, \ test_name)::gtest_registering_dummy_ = \ GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \ void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() // The optional last argument to INSTANTIATE_TEST_CASE_P allows the user // to specify a function or functor that generates custom test name suffixes // based on the test parameters. The function should accept one argument of // type testing::TestParamInfo<class ParamType>, and return std::string. // // testing::PrintToStringParamName is a builtin test suffix generator that // returns the value of testing::PrintToString(GetParam()). It does not work // for std::string or C strings. // // Note: test names must be non-empty, unique, and may only contain ASCII // alphanumeric characters or underscore. # define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \ ::testing::internal::ParamGenerator<test_case_name::ParamType> \ gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \ ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \ const ::testing::TestParamInfo<test_case_name::ParamType>& info) { \ return ::testing::internal::GetParamNameGen<test_case_name::ParamType> \ (__VA_ARGS__)(info); \ } \ int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \ ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ GetTestCasePatternHolder<test_case_name>(\ #test_case_name, \ ::testing::internal::CodeLocation(\ __FILE__, __LINE__))->AddTestCaseInstantiation(\ #prefix, \ &gtest_##prefix##test_case_name##_EvalGenerator_, \ &gtest_##prefix##test_case_name##_EvalGenerateName_, \ __FILE__, __LINE__) } // namespace testing #endif // GTEST_HAS_PARAM_TEST
+ show +
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
#endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ // Copyright 2006, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright

[CVE-2020-0478_1.diff] gtest.h #24
- // Returns the test case name. - const char* test_case_name() const { return test_case_name_.c_str(); } + // Returns the test suite name. + const char *test_suite_name() const { return test_suite_name_.c_str(); } + +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + const char *test_case_name() const { return test_suite_name(); } +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ - const char* name() const { return name_.c_str(); } + const char *name() const { return name_.c_str(); } - const char* type_param() const { - if (type_param_.get() != NULL) - return type_param_->c_str(); - return NULL; + const char *type_param() const { + if (type_param_.get() != nullptr) return type_param_->c_str(); + return nullptr; - const char* value_param() const { - if (value_param_.get() != NULL) - return value_param_->c_str(); - return NULL; + const char *value_param() const { + if (value_param_.get() != nullptr) return value_param_->c_str(); + return nullptr; - const char* file() const { return location_.file.c_str(); } + const char *file() const { return location_.file.c_str(); } + // Return true if this test should not be run because it's in another shard. + bool is_in_another_shard() const { return is_in_another_shard_; } + - // The full name of a test Bar in test case Foo is defined as + // The full name of a test Bar in test suite Foo is defined as
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest.h
641
642
643
644
645
646
647
648
649
650
// The constructor of TestInfo registers itself with the UnitTest // singleton such that the RUN_ALL_TESTS() macro knows which tests to // run. class GTEST_API_ TestInfo { public: // Destructs a TestInfo object. This function is not virtual, so // don't inherit from TestInfo. ~TestInfo(); // Returns the test case name.
+ show +
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
const char* test_case_name() const { return test_case_name_.c_str(); } // Returns the test name. const char* name() const { return name_.c_str(); } // Returns the name of the parameter type, or NULL if this is not a typed // or a type-parameterized test. const char* type_param() const { if (type_param_.get() != NULL) return type_param_->c_str(); return NULL; } // Returns the text representation of the value parameter, or NULL if this // is not a value-parameterized test. const char* value_param() const { if (value_param_.get() != NULL) return value_param_->c_str(); return NULL; } // Returns the file name where this test is defined. const char* file() const { return location_.file.c_str(); }
+ show +
674
675
676
677
678
679
680
681
682
683
// Returns the line where this test is defined. int line() const { return location_.line; } // Returns true if this test should run, that is if the test is not // disabled (or it is disabled but the also_run_disabled_tests flag has // been specified) and its full name matches the user-specified filter. // // Google Test allows the user to filter the tests by their full names. // The full name of a test Bar in test case Foo is defined as
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
19251
19252
19253
19254
19255
19256
19257
19258
19259
19260
// The constructor of TestInfo registers itself with the UnitTest // singleton such that the RUN_ALL_TESTS() macro knows which tests to // run. class GTEST_API_ TestInfo { public: // Destructs a TestInfo object. This function is not virtual, so // don't inherit from TestInfo. ~TestInfo(); // Returns the test case name.
+ show +
19261
19262
19263
19264
19265
19266
19267
19268
19269
19270
19271
19272
19273
19274
19275
19276
19277
19278
19279
19280
19281
19282
19283
const char* test_case_name() const { return test_case_name_.c_str(); } // Returns the test name. const char* name() const { return name_.c_str(); } // Returns the name of the parameter type, or NULL if this is not a typed // or a type-parameterized test. const char* type_param() const { if (type_param_.get() != NULL) return type_param_->c_str(); return NULL; } // Returns the text representation of the value parameter, or NULL if this // is not a value-parameterized test. const char* value_param() const { if (value_param_.get() != NULL) return value_param_->c_str(); return NULL; } // Returns the file name where this test is defined. const char* file() const { return location_.file.c_str(); }
+ show +
19284
19285
19286
19287
19288
19289
19290
19291
19292
19293
// Returns the line where this test is defined. int line() const { return location_.line; } // Returns true if this test should run, that is if the test is not // disabled (or it is disabled but the also_run_disabled_tests flag has // been specified) and its full name matches the user-specified filter. // // Google Test allows the user to filter the tests by their full names. // The full name of a test Bar in test case Foo is defined as
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/gtest.h
679
680
681
682
683
684
685
686
687
688
// The constructor of TestInfo registers itself with the UnitTest // singleton such that the RUN_ALL_TESTS() macro knows which tests to // run. class GTEST_API_ TestInfo { public: // Destructs a TestInfo object. This function is not virtual, so // don't inherit from TestInfo. ~TestInfo(); // Returns the test case name.
+ show +
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
const char* test_case_name() const { return test_case_name_.c_str(); } // Returns the test name. const char* name() const { return name_.c_str(); } // Returns the name of the parameter type, or NULL if this is not a typed // or a type-parameterized test. const char* type_param() const { if (type_param_.get() != NULL) return type_param_->c_str(); return NULL; } // Returns the text representation of the value parameter, or NULL if this // is not a value-parameterized test. const char* value_param() const { if (value_param_.get() != NULL) return value_param_->c_str(); return NULL; } // Returns the file name where this test is defined. const char* file() const { return location_.file.c_str(); }
+ show +
712
713
714
715
716
717
718
719
720
721
// Returns the line where this test is defined. int line() const { return location_.line; } // Return true if this test should not be run because it's in another shard. bool is_in_another_shard() const { return is_in_another_shard_; } // Returns true if this test should run, that is if the test is not // disabled (or it is disabled but the also_run_disabled_tests flag has // been specified) and its full name matches the user-specified filter.
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest.h
641
642
643
644
645
646
647
648
649
650
// The constructor of TestInfo registers itself with the UnitTest // singleton such that the RUN_ALL_TESTS() macro knows which tests to // run. class GTEST_API_ TestInfo { public: // Destructs a TestInfo object. This function is not virtual, so // don't inherit from TestInfo. ~TestInfo(); // Returns the test case name.
+ show +
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
const char* test_case_name() const { return test_case_name_.c_str(); } // Returns the test name. const char* name() const { return name_.c_str(); } // Returns the name of the parameter type, or NULL if this is not a typed // or a type-parameterized test. const char* type_param() const { if (type_param_.get() != NULL) return type_param_->c_str(); return NULL; } // Returns the text representation of the value parameter, or NULL if this // is not a value-parameterized test. const char* value_param() const { if (value_param_.get() != NULL) return value_param_->c_str(); return NULL; } // Returns the file name where this test is defined. const char* file() const { return location_.file.c_str(); }
+ show +
674
675
676
677
678
679
680
681
682
683
// Returns the line where this test is defined. int line() const { return location_.line; } // Returns true if this test should run, that is if the test is not // disabled (or it is disabled but the also_run_disabled_tests flag has // been specified) and its full name matches the user-specified filter. // // Google Test allows the user to filter the tests by their full names. // The full name of a test Bar in test case Foo is defined as
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest.h
641
642
643
644
645
646
647
648
649
650
// The constructor of TestInfo registers itself with the UnitTest // singleton such that the RUN_ALL_TESTS() macro knows which tests to // run. class GTEST_API_ TestInfo { public: // Destructs a TestInfo object. This function is not virtual, so // don't inherit from TestInfo. ~TestInfo(); // Returns the test case name.
+ show +
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
const char* test_case_name() const { return test_case_name_.c_str(); } // Returns the test name. const char* name() const { return name_.c_str(); } // Returns the name of the parameter type, or NULL if this is not a typed // or a type-parameterized test. const char* type_param() const { if (type_param_.get() != NULL) return type_param_->c_str(); return NULL; } // Returns the text representation of the value parameter, or NULL if this // is not a value-parameterized test. const char* value_param() const { if (value_param_.get() != NULL) return value_param_->c_str(); return NULL; } // Returns the file name where this test is defined. const char* file() const { return location_.file.c_str(); }
+ show +
674
675
676
677
678
679
680
681
682
683
// Returns the line where this test is defined. int line() const { return location_.line; } // Returns true if this test should run, that is if the test is not // disabled (or it is disabled but the also_run_disabled_tests flag has // been specified) and its full name matches the user-specified filter. // // Google Test allows the user to filter the tests by their full names. // The full name of a test Bar in test case Foo is defined as

[CVE-2020-0478_1.diff] gtest.h #47
-#define GTEST_IMPL_CMP_HELPER_(op_name, op)\ -template <typename T1, typename T2>\ -AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ - const T1& val1, const T2& val2) {\ - if (val1 op val2) {\ - return AssertionSuccess();\ - } else {\ - return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\ - }\ -}\ -GTEST_API_ AssertionResult CmpHelper##op_name(\ - const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2) +#define GTEST_IMPL_CMP_HELPER_(op_name, op) \ + template <typename T1, typename T2> \ + AssertionResult CmpHelper##op_name(const char *expr1, const char *expr2, \ + const T1 &val1, const T2 &val2) { \ + if (val1 op val2) { \ + return AssertionSuccess(); \ + } else { \ + return CmpHelperOpFailure(expr1, expr2, val1, val2, #op); \ + } \ + } \ + GTEST_API_ AssertionResult CmpHelper##op_name( \ + const char *expr1, const char *expr2, BiggestInt val1, BiggestInt val2)
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest.h
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste // of similar code. // // For each templatized helper function, we also define an overloaded // version for BiggestInt in order to reduce code bloat and allow // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled // with gcc 4. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
#define GTEST_IMPL_CMP_HELPER_(op_name, op)\ template <typename T1, typename T2>\ AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ const T1& val1, const T2& val2) {\ if (val1 op val2) {\ return AssertionSuccess();\ } else {\ return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\ }\ }\ GTEST_API_ AssertionResult CmpHelper##op_name(\ const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
+ show +
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. // Implements the helper function for {ASSERT|EXPECT}_NE GTEST_IMPL_CMP_HELPER_(NE, !=); // Implements the helper function for {ASSERT|EXPECT}_LE GTEST_IMPL_CMP_HELPER_(LE, <=); // Implements the helper function for {ASSERT|EXPECT}_LT GTEST_IMPL_CMP_HELPER_(LT, <); // Implements the helper function for {ASSERT|EXPECT}_GE
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/gtest.h
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste // of similar code. // // For each templatized helper function, we also define an overloaded // version for BiggestInt in order to reduce code bloat and allow // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled // with gcc 4. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
#define GTEST_IMPL_CMP_HELPER_(op_name, op)\ template <typename T1, typename T2>\ AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ const T1& val1, const T2& val2) {\ if (val1 op val2) {\ return AssertionSuccess();\ } else {\ return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\ }\ }\ GTEST_API_ AssertionResult CmpHelper##op_name(\ const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
+ show +
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. // Implements the helper function for {ASSERT|EXPECT}_NE GTEST_IMPL_CMP_HELPER_(NE, !=); // Implements the helper function for {ASSERT|EXPECT}_LE GTEST_IMPL_CMP_HELPER_(LE, <=); // Implements the helper function for {ASSERT|EXPECT}_LT GTEST_IMPL_CMP_HELPER_(LT, <); // Implements the helper function for {ASSERT|EXPECT}_GE
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
20106
20107
20108
20109
20110
20111
20112
20113
20114
20115
// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste // of similar code. // // For each templatized helper function, we also define an overloaded // version for BiggestInt in order to reduce code bloat and allow // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled // with gcc 4. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
20116
20117
20118
20119
20120
20121
20122
20123
20124
20125
20126
20127
#define GTEST_IMPL_CMP_HELPER_(op_name, op)\ template <typename T1, typename T2>\ AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ const T1& val1, const T2& val2) {\ if (val1 op val2) {\ return AssertionSuccess();\ } else {\ return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\ }\ }\ GTEST_API_ AssertionResult CmpHelper##op_name(\ const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
+ show +
20128
20129
20130
20131
20132
20133
20134
20135
20136
20137
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. // Implements the helper function for {ASSERT|EXPECT}_NE GTEST_IMPL_CMP_HELPER_(NE, !=); // Implements the helper function for {ASSERT|EXPECT}_LE GTEST_IMPL_CMP_HELPER_(LE, <=); // Implements the helper function for {ASSERT|EXPECT}_LT GTEST_IMPL_CMP_HELPER_(LT, <); // Implements the helper function for {ASSERT|EXPECT}_GE
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/gtest.h
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste // of similar code. // // For each templatized helper function, we also define an overloaded // version for BiggestInt in order to reduce code bloat and allow // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled // with gcc 4. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
#define GTEST_IMPL_CMP_HELPER_(op_name, op)\ template <typename T1, typename T2>\ AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ const T1& val1, const T2& val2) {\ if (val1 op val2) {\ return AssertionSuccess();\ } else {\ return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\ }\ }\ GTEST_API_ AssertionResult CmpHelper##op_name(\ const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
+ show +
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. // Implements the helper function for {ASSERT|EXPECT}_NE GTEST_IMPL_CMP_HELPER_(NE, !=); // Implements the helper function for {ASSERT|EXPECT}_LE GTEST_IMPL_CMP_HELPER_(LE, <=); // Implements the helper function for {ASSERT|EXPECT}_LT GTEST_IMPL_CMP_HELPER_(LT, <); // Implements the helper function for {ASSERT|EXPECT}_GE
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest.h
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste // of similar code. // // For each templatized helper function, we also define an overloaded // version for BiggestInt in order to reduce code bloat and allow // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled // with gcc 4. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
#define GTEST_IMPL_CMP_HELPER_(op_name, op)\ template <typename T1, typename T2>\ AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ const T1& val1, const T2& val2) {\ if (val1 op val2) {\ return AssertionSuccess();\ } else {\ return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\ }\ }\ GTEST_API_ AssertionResult CmpHelper##op_name(\ const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
+ show +
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. // Implements the helper function for {ASSERT|EXPECT}_NE GTEST_IMPL_CMP_HELPER_(NE, !=); // Implements the helper function for {ASSERT|EXPECT}_LE GTEST_IMPL_CMP_HELPER_(LE, <=); // Implements the helper function for {ASSERT|EXPECT}_LT GTEST_IMPL_CMP_HELPER_(LT, <); // Implements the helper function for {ASSERT|EXPECT}_GE
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest.h
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste // of similar code. // // For each templatized helper function, we also define an overloaded // version for BiggestInt in order to reduce code bloat and allow // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled // with gcc 4. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
#define GTEST_IMPL_CMP_HELPER_(op_name, op)\ template <typename T1, typename T2>\ AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ const T1& val1, const T2& val2) {\ if (val1 op val2) {\ return AssertionSuccess();\ } else {\ return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\ }\ }\ GTEST_API_ AssertionResult CmpHelper##op_name(\ const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
+ show +
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. // Implements the helper function for {ASSERT|EXPECT}_NE GTEST_IMPL_CMP_HELPER_(NE, !=); // Implements the helper function for {ASSERT|EXPECT}_LE GTEST_IMPL_CMP_HELPER_(LE, <=); // Implements the helper function for {ASSERT|EXPECT}_LT GTEST_IMPL_CMP_HELPER_(LT, <); // Implements the helper function for {ASSERT|EXPECT}_GE

[CVE-2020-0478_1.diff] gtest.h #48
-GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, - const char* s2_expression, - const char* s1, - const char* s2); +GTEST_API_ AssertionResult CmpHelperSTREQ(const char *s1_expression, + const char *s2_expression, + const char *s1, const char *s2); -GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression, - const char* s2_expression, - const char* s1, - const char* s2); +GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char *s1_expression, + const char *s2_expression, + const char *s1, const char *s2); -GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, - const char* s2_expression, - const char* s1, - const char* s2); +GTEST_API_ AssertionResult CmpHelperSTRNE(const char *s1_expression, + const char *s2_expression, + const char *s1, const char *s2); -GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression, - const char* s2_expression, - const char* s1, - const char* s2); - +GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char *s1_expression, + const char *s2_expression, + const char *s1, const char *s2); -GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, - const char* s2_expression, - const wchar_t* s1, - const wchar_t* s2); +GTEST_API_ AssertionResult CmpHelperSTREQ(const char *s1_expression, + const char *s2_expression, + const wchar_t *s1, const wchar_t *s2); -GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, - const char* s2_expression, - const wchar_t* s1, - const wchar_t* s2); +GTEST_API_ AssertionResult CmpHelperSTRNE(const char *s1_expression, + const char *s2_expression, + const wchar_t *s1, const wchar_t *s2);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest.h
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
// Implements the helper function for {ASSERT|EXPECT}_GE GTEST_IMPL_CMP_HELPER_(GE, >=); // Implements the helper function for {ASSERT|EXPECT}_GT GTEST_IMPL_CMP_HELPER_(GT, >); #undef GTEST_IMPL_CMP_HELPER_ // The helper function for {ASSERT|EXPECT}_STREQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASEEQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRNE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASENE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // Helper function for *_STREQ on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2); // Helper function for *_STRNE on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2);
+ show +
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
} // namespace internal // IsSubstring() and IsNotSubstring() are intended to be used as the // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by // themselves. They check whether needle is a substring of haystack // (NULL is considered a substring of itself only), and return an // appropriate error message when they fail. // // The {needle,haystack}_expr arguments are the stringified
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/gtest.h
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
// Implements the helper function for {ASSERT|EXPECT}_GE GTEST_IMPL_CMP_HELPER_(GE, >=); // Implements the helper function for {ASSERT|EXPECT}_GT GTEST_IMPL_CMP_HELPER_(GT, >); #undef GTEST_IMPL_CMP_HELPER_ // The helper function for {ASSERT|EXPECT}_STREQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASEEQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRNE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASENE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // Helper function for *_STREQ on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2); // Helper function for *_STRNE on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2);
+ show +
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
} // namespace internal // IsSubstring() and IsNotSubstring() are intended to be used as the // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by // themselves. They check whether needle is a substring of haystack // (NULL is considered a substring of itself only), and return an // appropriate error message when they fail. // // The {needle,haystack}_expr arguments are the stringified
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
20137
20138
20139
20140
20141
20142
20143
20144
20145
20146
// Implements the helper function for {ASSERT|EXPECT}_GE GTEST_IMPL_CMP_HELPER_(GE, >=); // Implements the helper function for {ASSERT|EXPECT}_GT GTEST_IMPL_CMP_HELPER_(GT, >); #undef GTEST_IMPL_CMP_HELPER_ // The helper function for {ASSERT|EXPECT}_STREQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
20147
20148
20149
20150
20151
20152
20153
20154
20155
20156
20157
20158
20159
20160
20161
20162
20163
20164
20165
20166
20167
20168
20169
20170
20171
20172
20173
20174
20175
20176
20177
20178
20179
20180
20181
20182
20183
20184
20185
20186
20187
20188
20189
20190
20191
GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASEEQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRNE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASENE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // Helper function for *_STREQ on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2); // Helper function for *_STRNE on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2);
+ show +
20192
20193
20194
20195
20196
20197
20198
20199
20200
20201
} // namespace internal // IsSubstring() and IsNotSubstring() are intended to be used as the // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by // themselves. They check whether needle is a substring of haystack // (NULL is considered a substring of itself only), and return an // appropriate error message when they fail. // // The {needle,haystack}_expr arguments are the stringified
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/gtest.h
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
// Implements the helper function for {ASSERT|EXPECT}_GE GTEST_IMPL_CMP_HELPER_(GE, >=); // Implements the helper function for {ASSERT|EXPECT}_GT GTEST_IMPL_CMP_HELPER_(GT, >); #undef GTEST_IMPL_CMP_HELPER_ // The helper function for {ASSERT|EXPECT}_STREQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASEEQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRNE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASENE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // Helper function for *_STREQ on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2); // Helper function for *_STRNE on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2);
+ show +
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
} // namespace internal // IsSubstring() and IsNotSubstring() are intended to be used as the // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by // themselves. They check whether needle is a substring of haystack // (NULL is considered a substring of itself only), and return an // appropriate error message when they fail. // // The {needle,haystack}_expr arguments are the stringified
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest.h
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
// Implements the helper function for {ASSERT|EXPECT}_GE GTEST_IMPL_CMP_HELPER_(GE, >=); // Implements the helper function for {ASSERT|EXPECT}_GT GTEST_IMPL_CMP_HELPER_(GT, >); #undef GTEST_IMPL_CMP_HELPER_ // The helper function for {ASSERT|EXPECT}_STREQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASEEQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRNE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASENE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // Helper function for *_STREQ on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2); // Helper function for *_STRNE on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2);
+ show +
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
} // namespace internal // IsSubstring() and IsNotSubstring() are intended to be used as the // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by // themselves. They check whether needle is a substring of haystack // (NULL is considered a substring of itself only), and return an // appropriate error message when they fail. // // The {needle,haystack}_expr arguments are the stringified
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest.h
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
// Implements the helper function for {ASSERT|EXPECT}_GE GTEST_IMPL_CMP_HELPER_(GE, >=); // Implements the helper function for {ASSERT|EXPECT}_GT GTEST_IMPL_CMP_HELPER_(GT, >); #undef GTEST_IMPL_CMP_HELPER_ // The helper function for {ASSERT|EXPECT}_STREQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASEEQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRNE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASENE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // Helper function for *_STREQ on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2); // Helper function for *_STRNE on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2);
+ show +
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
} // namespace internal // IsSubstring() and IsNotSubstring() are intended to be used as the // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by // themselves. They check whether needle is a substring of haystack // (NULL is considered a substring of itself only), and return an // appropriate error message when they fail. // // The {needle,haystack}_expr arguments are the stringified

[CVE-2020-0478_1.diff] gtest.h #50
-AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression, - const char* rhs_expression, - RawType lhs_value, - RawType rhs_value) { +AssertionResult CmpHelperFloatingPointEQ(const char *lhs_expression, + const char *rhs_expression, + RawType lhs_value, RawType rhs_value) {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest.h
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
namespace internal { // Helper template function for comparing floating-points. // // Template parameter: // // RawType: the raw floating-point type (either float or double) // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. template <typename RawType>
+ show +
1631
1632
1633
1634
AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression, const char* rhs_expression, RawType lhs_value, RawType rhs_value) {
+ show +
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value); if (lhs.AlmostEquals(rhs)) { return AssertionSuccess(); } ::std::stringstream lhs_ss; lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2) << lhs_value;
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/gtest.h
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
namespace internal { // Helper template function for comparing floating-points. // // Template parameter: // // RawType: the raw floating-point type (either float or double) // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. template <typename RawType>
+ show +
1725
1726
1727
1728
AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression, const char* rhs_expression, RawType lhs_value, RawType rhs_value) {
+ show +
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value); if (lhs.AlmostEquals(rhs)) { return AssertionSuccess(); } ::std::stringstream lhs_ss; lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2) << lhs_value;
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
20231
20232
20233
20234
20235
20236
20237
20238
20239
20240
namespace internal { // Helper template function for comparing floating-points. // // Template parameter: // // RawType: the raw floating-point type (either float or double) // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. template <typename RawType>
+ show +
20241
20242
20243
20244
AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression, const char* rhs_expression, RawType lhs_value, RawType rhs_value) {
+ show +
20245
20246
20247
20248
20249
20250
20251
20252
20253
20254
const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value); if (lhs.AlmostEquals(rhs)) { return AssertionSuccess(); } ::std::stringstream lhs_ss; lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2) << lhs_value;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/gtest.h
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
namespace internal { // Helper template function for comparing floating-points. // // Template parameter: // // RawType: the raw floating-point type (either float or double) // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. template <typename RawType>
+ show +
1682
1683
1684
1685
AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression, const char* rhs_expression, RawType lhs_value, RawType rhs_value) {
+ show +
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value); if (lhs.AlmostEquals(rhs)) { return AssertionSuccess(); } ::std::stringstream lhs_ss; lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2) << lhs_value;
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest.h
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
namespace internal { // Helper template function for comparing floating-points. // // Template parameter: // // RawType: the raw floating-point type (either float or double) // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. template <typename RawType>
+ show +
1631
1632
1633
1634
AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression, const char* rhs_expression, RawType lhs_value, RawType rhs_value) {
+ show +
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value); if (lhs.AlmostEquals(rhs)) { return AssertionSuccess(); } ::std::stringstream lhs_ss; lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2) << lhs_value;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest.h
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
namespace internal { // Helper template function for comparing floating-points. // // Template parameter: // // RawType: the raw floating-point type (either float or double) // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. template <typename RawType>
+ show +
1631
1632
1633
1634
AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression, const char* rhs_expression, RawType lhs_value, RawType rhs_value) {
+ show +
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value); if (lhs.AlmostEquals(rhs)) { return AssertionSuccess(); } ::std::stringstream lhs_ss; lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2) << lhs_value;

[CVE-2020-0470_1.diff] gtest.h #24
- // Returns the test case name. - const char* test_case_name() const { return test_case_name_.c_str(); } + // Returns the test suite name. + const char *test_suite_name() const { return test_suite_name_.c_str(); } + +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + const char *test_case_name() const { return test_suite_name(); } +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ - const char* name() const { return name_.c_str(); } + const char *name() const { return name_.c_str(); } - const char* type_param() const { - if (type_param_.get() != NULL) - return type_param_->c_str(); - return NULL; + const char *type_param() const { + if (type_param_.get() != nullptr) return type_param_->c_str(); + return nullptr; - const char* value_param() const { - if (value_param_.get() != NULL) - return value_param_->c_str(); - return NULL; + const char *value_param() const { + if (value_param_.get() != nullptr) return value_param_->c_str(); + return nullptr; - const char* file() const { return location_.file.c_str(); } + const char *file() const { return location_.file.c_str(); } + // Return true if this test should not be run because it's in another shard. + bool is_in_another_shard() const { return is_in_another_shard_; } + - // The full name of a test Bar in test case Foo is defined as + // The full name of a test Bar in test suite Foo is defined as
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest.h
641
642
643
644
645
646
647
648
649
650
// The constructor of TestInfo registers itself with the UnitTest // singleton such that the RUN_ALL_TESTS() macro knows which tests to // run. class GTEST_API_ TestInfo { public: // Destructs a TestInfo object. This function is not virtual, so // don't inherit from TestInfo. ~TestInfo(); // Returns the test case name.
+ show +
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
const char* test_case_name() const { return test_case_name_.c_str(); } // Returns the test name. const char* name() const { return name_.c_str(); } // Returns the name of the parameter type, or NULL if this is not a typed // or a type-parameterized test. const char* type_param() const { if (type_param_.get() != NULL) return type_param_->c_str(); return NULL; } // Returns the text representation of the value parameter, or NULL if this // is not a value-parameterized test. const char* value_param() const { if (value_param_.get() != NULL) return value_param_->c_str(); return NULL; } // Returns the file name where this test is defined. const char* file() const { return location_.file.c_str(); }
+ show +
674
675
676
677
678
679
680
681
682
683
// Returns the line where this test is defined. int line() const { return location_.line; } // Returns true if this test should run, that is if the test is not // disabled (or it is disabled but the also_run_disabled_tests flag has // been specified) and its full name matches the user-specified filter. // // Google Test allows the user to filter the tests by their full names. // The full name of a test Bar in test case Foo is defined as
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
19251
19252
19253
19254
19255
19256
19257
19258
19259
19260
// The constructor of TestInfo registers itself with the UnitTest // singleton such that the RUN_ALL_TESTS() macro knows which tests to // run. class GTEST_API_ TestInfo { public: // Destructs a TestInfo object. This function is not virtual, so // don't inherit from TestInfo. ~TestInfo(); // Returns the test case name.
+ show +
19261
19262
19263
19264
19265
19266
19267
19268
19269
19270
19271
19272
19273
19274
19275
19276
19277
19278
19279
19280
19281
19282
19283
const char* test_case_name() const { return test_case_name_.c_str(); } // Returns the test name. const char* name() const { return name_.c_str(); } // Returns the name of the parameter type, or NULL if this is not a typed // or a type-parameterized test. const char* type_param() const { if (type_param_.get() != NULL) return type_param_->c_str(); return NULL; } // Returns the text representation of the value parameter, or NULL if this // is not a value-parameterized test. const char* value_param() const { if (value_param_.get() != NULL) return value_param_->c_str(); return NULL; } // Returns the file name where this test is defined. const char* file() const { return location_.file.c_str(); }
+ show +
19284
19285
19286
19287
19288
19289
19290
19291
19292
19293
// Returns the line where this test is defined. int line() const { return location_.line; } // Returns true if this test should run, that is if the test is not // disabled (or it is disabled but the also_run_disabled_tests flag has // been specified) and its full name matches the user-specified filter. // // Google Test allows the user to filter the tests by their full names. // The full name of a test Bar in test case Foo is defined as
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/gtest.h
679
680
681
682
683
684
685
686
687
688
// The constructor of TestInfo registers itself with the UnitTest // singleton such that the RUN_ALL_TESTS() macro knows which tests to // run. class GTEST_API_ TestInfo { public: // Destructs a TestInfo object. This function is not virtual, so // don't inherit from TestInfo. ~TestInfo(); // Returns the test case name.
+ show +
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
const char* test_case_name() const { return test_case_name_.c_str(); } // Returns the test name. const char* name() const { return name_.c_str(); } // Returns the name of the parameter type, or NULL if this is not a typed // or a type-parameterized test. const char* type_param() const { if (type_param_.get() != NULL) return type_param_->c_str(); return NULL; } // Returns the text representation of the value parameter, or NULL if this // is not a value-parameterized test. const char* value_param() const { if (value_param_.get() != NULL) return value_param_->c_str(); return NULL; } // Returns the file name where this test is defined. const char* file() const { return location_.file.c_str(); }
+ show +
712
713
714
715
716
717
718
719
720
721
// Returns the line where this test is defined. int line() const { return location_.line; } // Return true if this test should not be run because it's in another shard. bool is_in_another_shard() const { return is_in_another_shard_; } // Returns true if this test should run, that is if the test is not // disabled (or it is disabled but the also_run_disabled_tests flag has // been specified) and its full name matches the user-specified filter.
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest.h
641
642
643
644
645
646
647
648
649
650
// The constructor of TestInfo registers itself with the UnitTest // singleton such that the RUN_ALL_TESTS() macro knows which tests to // run. class GTEST_API_ TestInfo { public: // Destructs a TestInfo object. This function is not virtual, so // don't inherit from TestInfo. ~TestInfo(); // Returns the test case name.
+ show +
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
const char* test_case_name() const { return test_case_name_.c_str(); } // Returns the test name. const char* name() const { return name_.c_str(); } // Returns the name of the parameter type, or NULL if this is not a typed // or a type-parameterized test. const char* type_param() const { if (type_param_.get() != NULL) return type_param_->c_str(); return NULL; } // Returns the text representation of the value parameter, or NULL if this // is not a value-parameterized test. const char* value_param() const { if (value_param_.get() != NULL) return value_param_->c_str(); return NULL; } // Returns the file name where this test is defined. const char* file() const { return location_.file.c_str(); }
+ show +
674
675
676
677
678
679
680
681
682
683
// Returns the line where this test is defined. int line() const { return location_.line; } // Returns true if this test should run, that is if the test is not // disabled (or it is disabled but the also_run_disabled_tests flag has // been specified) and its full name matches the user-specified filter. // // Google Test allows the user to filter the tests by their full names. // The full name of a test Bar in test case Foo is defined as
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest.h
641
642
643
644
645
646
647
648
649
650
// The constructor of TestInfo registers itself with the UnitTest // singleton such that the RUN_ALL_TESTS() macro knows which tests to // run. class GTEST_API_ TestInfo { public: // Destructs a TestInfo object. This function is not virtual, so // don't inherit from TestInfo. ~TestInfo(); // Returns the test case name.
+ show +
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
const char* test_case_name() const { return test_case_name_.c_str(); } // Returns the test name. const char* name() const { return name_.c_str(); } // Returns the name of the parameter type, or NULL if this is not a typed // or a type-parameterized test. const char* type_param() const { if (type_param_.get() != NULL) return type_param_->c_str(); return NULL; } // Returns the text representation of the value parameter, or NULL if this // is not a value-parameterized test. const char* value_param() const { if (value_param_.get() != NULL) return value_param_->c_str(); return NULL; } // Returns the file name where this test is defined. const char* file() const { return location_.file.c_str(); }
+ show +
674
675
676
677
678
679
680
681
682
683
// Returns the line where this test is defined. int line() const { return location_.line; } // Returns true if this test should run, that is if the test is not // disabled (or it is disabled but the also_run_disabled_tests flag has // been specified) and its full name matches the user-specified filter. // // Google Test allows the user to filter the tests by their full names. // The full name of a test Bar in test case Foo is defined as

[CVE-2020-0470_1.diff] gtest.h #47
-#define GTEST_IMPL_CMP_HELPER_(op_name, op)\ -template <typename T1, typename T2>\ -AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ - const T1& val1, const T2& val2) {\ - if (val1 op val2) {\ - return AssertionSuccess();\ - } else {\ - return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\ - }\ -}\ -GTEST_API_ AssertionResult CmpHelper##op_name(\ - const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2) +#define GTEST_IMPL_CMP_HELPER_(op_name, op) \ + template <typename T1, typename T2> \ + AssertionResult CmpHelper##op_name(const char *expr1, const char *expr2, \ + const T1 &val1, const T2 &val2) { \ + if (val1 op val2) { \ + return AssertionSuccess(); \ + } else { \ + return CmpHelperOpFailure(expr1, expr2, val1, val2, #op); \ + } \ + } \ + GTEST_API_ AssertionResult CmpHelper##op_name( \ + const char *expr1, const char *expr2, BiggestInt val1, BiggestInt val2)
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest.h
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste // of similar code. // // For each templatized helper function, we also define an overloaded // version for BiggestInt in order to reduce code bloat and allow // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled // with gcc 4. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
#define GTEST_IMPL_CMP_HELPER_(op_name, op)\ template <typename T1, typename T2>\ AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ const T1& val1, const T2& val2) {\ if (val1 op val2) {\ return AssertionSuccess();\ } else {\ return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\ }\ }\ GTEST_API_ AssertionResult CmpHelper##op_name(\ const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
+ show +
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. // Implements the helper function for {ASSERT|EXPECT}_NE GTEST_IMPL_CMP_HELPER_(NE, !=); // Implements the helper function for {ASSERT|EXPECT}_LE GTEST_IMPL_CMP_HELPER_(LE, <=); // Implements the helper function for {ASSERT|EXPECT}_LT GTEST_IMPL_CMP_HELPER_(LT, <); // Implements the helper function for {ASSERT|EXPECT}_GE
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/gtest.h
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste // of similar code. // // For each templatized helper function, we also define an overloaded // version for BiggestInt in order to reduce code bloat and allow // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled // with gcc 4. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
#define GTEST_IMPL_CMP_HELPER_(op_name, op)\ template <typename T1, typename T2>\ AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ const T1& val1, const T2& val2) {\ if (val1 op val2) {\ return AssertionSuccess();\ } else {\ return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\ }\ }\ GTEST_API_ AssertionResult CmpHelper##op_name(\ const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
+ show +
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. // Implements the helper function for {ASSERT|EXPECT}_NE GTEST_IMPL_CMP_HELPER_(NE, !=); // Implements the helper function for {ASSERT|EXPECT}_LE GTEST_IMPL_CMP_HELPER_(LE, <=); // Implements the helper function for {ASSERT|EXPECT}_LT GTEST_IMPL_CMP_HELPER_(LT, <); // Implements the helper function for {ASSERT|EXPECT}_GE
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
20106
20107
20108
20109
20110
20111
20112
20113
20114
20115
// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste // of similar code. // // For each templatized helper function, we also define an overloaded // version for BiggestInt in order to reduce code bloat and allow // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled // with gcc 4. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
20116
20117
20118
20119
20120
20121
20122
20123
20124
20125
20126
20127
#define GTEST_IMPL_CMP_HELPER_(op_name, op)\ template <typename T1, typename T2>\ AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ const T1& val1, const T2& val2) {\ if (val1 op val2) {\ return AssertionSuccess();\ } else {\ return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\ }\ }\ GTEST_API_ AssertionResult CmpHelper##op_name(\ const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
+ show +
20128
20129
20130
20131
20132
20133
20134
20135
20136
20137
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. // Implements the helper function for {ASSERT|EXPECT}_NE GTEST_IMPL_CMP_HELPER_(NE, !=); // Implements the helper function for {ASSERT|EXPECT}_LE GTEST_IMPL_CMP_HELPER_(LE, <=); // Implements the helper function for {ASSERT|EXPECT}_LT GTEST_IMPL_CMP_HELPER_(LT, <); // Implements the helper function for {ASSERT|EXPECT}_GE
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/gtest.h
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste // of similar code. // // For each templatized helper function, we also define an overloaded // version for BiggestInt in order to reduce code bloat and allow // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled // with gcc 4. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
#define GTEST_IMPL_CMP_HELPER_(op_name, op)\ template <typename T1, typename T2>\ AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ const T1& val1, const T2& val2) {\ if (val1 op val2) {\ return AssertionSuccess();\ } else {\ return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\ }\ }\ GTEST_API_ AssertionResult CmpHelper##op_name(\ const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
+ show +
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. // Implements the helper function for {ASSERT|EXPECT}_NE GTEST_IMPL_CMP_HELPER_(NE, !=); // Implements the helper function for {ASSERT|EXPECT}_LE GTEST_IMPL_CMP_HELPER_(LE, <=); // Implements the helper function for {ASSERT|EXPECT}_LT GTEST_IMPL_CMP_HELPER_(LT, <); // Implements the helper function for {ASSERT|EXPECT}_GE
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest.h
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste // of similar code. // // For each templatized helper function, we also define an overloaded // version for BiggestInt in order to reduce code bloat and allow // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled // with gcc 4. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
#define GTEST_IMPL_CMP_HELPER_(op_name, op)\ template <typename T1, typename T2>\ AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ const T1& val1, const T2& val2) {\ if (val1 op val2) {\ return AssertionSuccess();\ } else {\ return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\ }\ }\ GTEST_API_ AssertionResult CmpHelper##op_name(\ const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
+ show +
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. // Implements the helper function for {ASSERT|EXPECT}_NE GTEST_IMPL_CMP_HELPER_(NE, !=); // Implements the helper function for {ASSERT|EXPECT}_LE GTEST_IMPL_CMP_HELPER_(LE, <=); // Implements the helper function for {ASSERT|EXPECT}_LT GTEST_IMPL_CMP_HELPER_(LT, <); // Implements the helper function for {ASSERT|EXPECT}_GE
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest.h
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste // of similar code. // // For each templatized helper function, we also define an overloaded // version for BiggestInt in order to reduce code bloat and allow // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled // with gcc 4. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
#define GTEST_IMPL_CMP_HELPER_(op_name, op)\ template <typename T1, typename T2>\ AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ const T1& val1, const T2& val2) {\ if (val1 op val2) {\ return AssertionSuccess();\ } else {\ return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\ }\ }\ GTEST_API_ AssertionResult CmpHelper##op_name(\ const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
+ show +
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. // Implements the helper function for {ASSERT|EXPECT}_NE GTEST_IMPL_CMP_HELPER_(NE, !=); // Implements the helper function for {ASSERT|EXPECT}_LE GTEST_IMPL_CMP_HELPER_(LE, <=); // Implements the helper function for {ASSERT|EXPECT}_LT GTEST_IMPL_CMP_HELPER_(LT, <); // Implements the helper function for {ASSERT|EXPECT}_GE

[CVE-2020-0470_1.diff] gtest.h #48
-GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, - const char* s2_expression, - const char* s1, - const char* s2); +GTEST_API_ AssertionResult CmpHelperSTREQ(const char *s1_expression, + const char *s2_expression, + const char *s1, const char *s2); -GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression, - const char* s2_expression, - const char* s1, - const char* s2); +GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char *s1_expression, + const char *s2_expression, + const char *s1, const char *s2); -GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, - const char* s2_expression, - const char* s1, - const char* s2); +GTEST_API_ AssertionResult CmpHelperSTRNE(const char *s1_expression, + const char *s2_expression, + const char *s1, const char *s2); -GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression, - const char* s2_expression, - const char* s1, - const char* s2); - +GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char *s1_expression, + const char *s2_expression, + const char *s1, const char *s2); -GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, - const char* s2_expression, - const wchar_t* s1, - const wchar_t* s2); +GTEST_API_ AssertionResult CmpHelperSTREQ(const char *s1_expression, + const char *s2_expression, + const wchar_t *s1, const wchar_t *s2); -GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, - const char* s2_expression, - const wchar_t* s1, - const wchar_t* s2); +GTEST_API_ AssertionResult CmpHelperSTRNE(const char *s1_expression, + const char *s2_expression, + const wchar_t *s1, const wchar_t *s2);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest.h
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
// Implements the helper function for {ASSERT|EXPECT}_GE GTEST_IMPL_CMP_HELPER_(GE, >=); // Implements the helper function for {ASSERT|EXPECT}_GT GTEST_IMPL_CMP_HELPER_(GT, >); #undef GTEST_IMPL_CMP_HELPER_ // The helper function for {ASSERT|EXPECT}_STREQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASEEQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRNE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASENE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // Helper function for *_STREQ on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2); // Helper function for *_STRNE on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2);
+ show +
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
} // namespace internal // IsSubstring() and IsNotSubstring() are intended to be used as the // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by // themselves. They check whether needle is a substring of haystack // (NULL is considered a substring of itself only), and return an // appropriate error message when they fail. // // The {needle,haystack}_expr arguments are the stringified
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/gtest.h
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
// Implements the helper function for {ASSERT|EXPECT}_GE GTEST_IMPL_CMP_HELPER_(GE, >=); // Implements the helper function for {ASSERT|EXPECT}_GT GTEST_IMPL_CMP_HELPER_(GT, >); #undef GTEST_IMPL_CMP_HELPER_ // The helper function for {ASSERT|EXPECT}_STREQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASEEQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRNE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASENE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // Helper function for *_STREQ on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2); // Helper function for *_STRNE on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2);
+ show +
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
} // namespace internal // IsSubstring() and IsNotSubstring() are intended to be used as the // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by // themselves. They check whether needle is a substring of haystack // (NULL is considered a substring of itself only), and return an // appropriate error message when they fail. // // The {needle,haystack}_expr arguments are the stringified
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
20137
20138
20139
20140
20141
20142
20143
20144
20145
20146
// Implements the helper function for {ASSERT|EXPECT}_GE GTEST_IMPL_CMP_HELPER_(GE, >=); // Implements the helper function for {ASSERT|EXPECT}_GT GTEST_IMPL_CMP_HELPER_(GT, >); #undef GTEST_IMPL_CMP_HELPER_ // The helper function for {ASSERT|EXPECT}_STREQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
20147
20148
20149
20150
20151
20152
20153
20154
20155
20156
20157
20158
20159
20160
20161
20162
20163
20164
20165
20166
20167
20168
20169
20170
20171
20172
20173
20174
20175
20176
20177
20178
20179
20180
20181
20182
20183
20184
20185
20186
20187
20188
20189
20190
20191
GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASEEQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRNE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASENE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // Helper function for *_STREQ on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2); // Helper function for *_STRNE on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2);
+ show +
20192
20193
20194
20195
20196
20197
20198
20199
20200
20201
} // namespace internal // IsSubstring() and IsNotSubstring() are intended to be used as the // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by // themselves. They check whether needle is a substring of haystack // (NULL is considered a substring of itself only), and return an // appropriate error message when they fail. // // The {needle,haystack}_expr arguments are the stringified
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/gtest.h
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
// Implements the helper function for {ASSERT|EXPECT}_GE GTEST_IMPL_CMP_HELPER_(GE, >=); // Implements the helper function for {ASSERT|EXPECT}_GT GTEST_IMPL_CMP_HELPER_(GT, >); #undef GTEST_IMPL_CMP_HELPER_ // The helper function for {ASSERT|EXPECT}_STREQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASEEQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRNE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASENE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // Helper function for *_STREQ on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2); // Helper function for *_STRNE on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2);
+ show +
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
} // namespace internal // IsSubstring() and IsNotSubstring() are intended to be used as the // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by // themselves. They check whether needle is a substring of haystack // (NULL is considered a substring of itself only), and return an // appropriate error message when they fail. // // The {needle,haystack}_expr arguments are the stringified
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest.h
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
// Implements the helper function for {ASSERT|EXPECT}_GE GTEST_IMPL_CMP_HELPER_(GE, >=); // Implements the helper function for {ASSERT|EXPECT}_GT GTEST_IMPL_CMP_HELPER_(GT, >); #undef GTEST_IMPL_CMP_HELPER_ // The helper function for {ASSERT|EXPECT}_STREQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASEEQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRNE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASENE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // Helper function for *_STREQ on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2); // Helper function for *_STRNE on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2);
+ show +
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
} // namespace internal // IsSubstring() and IsNotSubstring() are intended to be used as the // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by // themselves. They check whether needle is a substring of haystack // (NULL is considered a substring of itself only), and return an // appropriate error message when they fail. // // The {needle,haystack}_expr arguments are the stringified
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest.h
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
// Implements the helper function for {ASSERT|EXPECT}_GE GTEST_IMPL_CMP_HELPER_(GE, >=); // Implements the helper function for {ASSERT|EXPECT}_GT GTEST_IMPL_CMP_HELPER_(GT, >); #undef GTEST_IMPL_CMP_HELPER_ // The helper function for {ASSERT|EXPECT}_STREQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+ show +
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASEEQ. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRNE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // The helper function for {ASSERT|EXPECT}_STRCASENE. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression, const char* s2_expression, const char* s1, const char* s2); // Helper function for *_STREQ on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2); // Helper function for *_STRNE on wide strings. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, const char* s2_expression, const wchar_t* s1, const wchar_t* s2);
+ show +
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
} // namespace internal // IsSubstring() and IsNotSubstring() are intended to be used as the // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by // themselves. They check whether needle is a substring of haystack // (NULL is considered a substring of itself only), and return an // appropriate error message when they fail. // // The {needle,haystack}_expr arguments are the stringified

[CVE-2020-0470_1.diff] gtest.h #50
-AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression, - const char* rhs_expression, - RawType lhs_value, - RawType rhs_value) { +AssertionResult CmpHelperFloatingPointEQ(const char *lhs_expression, + const char *rhs_expression, + RawType lhs_value, RawType rhs_value) {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/gtest.h
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
namespace internal { // Helper template function for comparing floating-points. // // Template parameter: // // RawType: the raw floating-point type (either float or double) // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. template <typename RawType>
+ show +
1631
1632
1633
1634
AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression, const char* rhs_expression, RawType lhs_value, RawType rhs_value) {
+ show +
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value); if (lhs.AlmostEquals(rhs)) { return AssertionSuccess(); } ::std::stringstream lhs_ss; lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2) << lhs_value;
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/gtest.h
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
namespace internal { // Helper template function for comparing floating-points. // // Template parameter: // // RawType: the raw floating-point type (either float or double) // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. template <typename RawType>
+ show +
1725
1726
1727
1728
AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression, const char* rhs_expression, RawType lhs_value, RawType rhs_value) {
+ show +
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value); if (lhs.AlmostEquals(rhs)) { return AssertionSuccess(); } ::std::stringstream lhs_ss; lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2) << lhs_value;
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
20231
20232
20233
20234
20235
20236
20237
20238
20239
20240
namespace internal { // Helper template function for comparing floating-points. // // Template parameter: // // RawType: the raw floating-point type (either float or double) // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. template <typename RawType>
+ show +
20241
20242
20243
20244
AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression, const char* rhs_expression, RawType lhs_value, RawType rhs_value) {
+ show +
20245
20246
20247
20248
20249
20250
20251
20252
20253
20254
const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value); if (lhs.AlmostEquals(rhs)) { return AssertionSuccess(); } ::std::stringstream lhs_ss; lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2) << lhs_value;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/gtest.h
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
namespace internal { // Helper template function for comparing floating-points. // // Template parameter: // // RawType: the raw floating-point type (either float or double) // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. template <typename RawType>
+ show +
1682
1683
1684
1685
AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression, const char* rhs_expression, RawType lhs_value, RawType rhs_value) {
+ show +
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value); if (lhs.AlmostEquals(rhs)) { return AssertionSuccess(); } ::std::stringstream lhs_ss; lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2) << lhs_value;
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/gtest.h
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
namespace internal { // Helper template function for comparing floating-points. // // Template parameter: // // RawType: the raw floating-point type (either float or double) // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. template <typename RawType>
+ show +
1631
1632
1633
1634
AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression, const char* rhs_expression, RawType lhs_value, RawType rhs_value) {
+ show +
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value); if (lhs.AlmostEquals(rhs)) { return AssertionSuccess(); } ::std::stringstream lhs_ss; lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2) << lhs_value;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/gtest.h
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
namespace internal { // Helper template function for comparing floating-points. // // Template parameter: // // RawType: the raw floating-point type (either float or double) // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. template <typename RawType>
+ show +
1631
1632
1633
1634
AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression, const char* rhs_expression, RawType lhs_value, RawType rhs_value) {
+ show +
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value); if (lhs.AlmostEquals(rhs)) { return AssertionSuccess(); } ::std::stringstream lhs_ss; lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2) << lhs_value;

[CVE-2020-0478_1.diff] gtest-port.h #20
-# define GTEST_INTENTIONAL_CONST_COND_PUSH_() \ - GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127) -# define GTEST_INTENTIONAL_CONST_COND_POP_() \ - GTEST_DISABLE_MSC_WARNINGS_POP_() +#define GTEST_INTENTIONAL_CONST_COND_PUSH_() \ + GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127) +#define GTEST_INTENTIONAL_CONST_COND_POP_() GTEST_DISABLE_MSC_WARNINGS_POP_()
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/internal/gtest-port.h
925
926
927
928
929
930
931
932
933
934
#endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC // MS C++ compiler emits warning when a conditional expression is compile time // constant. In some contexts this warning is false positive and needs to be // suppressed. Use the following two macros in such cases: // // GTEST_INTENTIONAL_CONST_COND_PUSH_() // while (true) { // GTEST_INTENTIONAL_CONST_COND_POP_() // }
+ show +
935
936
937
938
# define GTEST_INTENTIONAL_CONST_COND_PUSH_() \ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127) # define GTEST_INTENTIONAL_CONST_COND_POP_() \ GTEST_DISABLE_MSC_WARNINGS_POP_()
+ show +
939
940
941
942
943
944
945
946
947
948
// Determine whether the compiler supports Microsoft's Structured Exception // Handling. This is supported by several Windows compilers but generally // does not exist on any other system. #ifndef GTEST_HAS_SEH // The user didn't tell us, so we need to figure it out. # if defined(_MSC_VER) || defined(__BORLANDC__) // These two compilers are known to support SEH. # define GTEST_HAS_SEH 1
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/internal/gtest-port.h
716
717
718
719
720
721
722
723
724
725
#endif // __GNUC__ && !COMPILER_ICC // MS C++ compiler emits warning when a conditional expression is compile time // constant. In some contexts this warning is false positive and needs to be // suppressed. Use the following two macros in such cases: // // GTEST_INTENTIONAL_CONST_COND_PUSH_() // while (true) { // GTEST_INTENTIONAL_CONST_COND_POP_() // }
+ show +
726
727
728
729
# define GTEST_INTENTIONAL_CONST_COND_PUSH_() \ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127) # define GTEST_INTENTIONAL_CONST_COND_POP_() \ GTEST_DISABLE_MSC_WARNINGS_POP_()
+ show +
730
731
732
733
734
735
736
737
738
739
// Determine whether the compiler supports Microsoft's Structured Exception // Handling. This is supported by several Windows compilers but generally // does not exist on any other system. #ifndef GTEST_HAS_SEH // The user didn't tell us, so we need to figure it out. # if defined(_MSC_VER) || defined(__BORLANDC__) // These two compilers are known to support SEH. # define GTEST_HAS_SEH 1
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
#endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC // MS C++ compiler emits warning when a conditional expression is compile time // constant. In some contexts this warning is false positive and needs to be // suppressed. Use the following two macros in such cases: // // GTEST_INTENTIONAL_CONST_COND_PUSH_() // while (true) { // GTEST_INTENTIONAL_CONST_COND_POP_() // }
+ show +
2179
2180
2181
2182
# define GTEST_INTENTIONAL_CONST_COND_PUSH_() \ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127) # define GTEST_INTENTIONAL_CONST_COND_POP_() \ GTEST_DISABLE_MSC_WARNINGS_POP_()
+ show +
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
// Determine whether the compiler supports Microsoft's Structured Exception // Handling. This is supported by several Windows compilers but generally // does not exist on any other system. #ifndef GTEST_HAS_SEH // The user didn't tell us, so we need to figure it out. # if defined(_MSC_VER) || defined(__BORLANDC__) // These two compilers are known to support SEH. # define GTEST_HAS_SEH 1
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/internal/gtest-port.h
945
946
947
948
949
950
951
952
953
954
#endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC // MS C++ compiler emits warning when a conditional expression is compile time // constant. In some contexts this warning is false positive and needs to be // suppressed. Use the following two macros in such cases: // // GTEST_INTENTIONAL_CONST_COND_PUSH_() // while (true) { // GTEST_INTENTIONAL_CONST_COND_POP_() // }
+ show +
955
956
957
958
# define GTEST_INTENTIONAL_CONST_COND_PUSH_() \ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127) # define GTEST_INTENTIONAL_CONST_COND_POP_() \ GTEST_DISABLE_MSC_WARNINGS_POP_()
+ show +
959
960
961
962
963
964
965
966
967
968
// Determine whether the compiler supports Microsoft's Structured Exception // Handling. This is supported by several Windows compilers but generally // does not exist on any other system. #ifndef GTEST_HAS_SEH // The user didn't tell us, so we need to figure it out. # if defined(_MSC_VER) || defined(__BORLANDC__) // These two compilers are known to support SEH. # define GTEST_HAS_SEH 1
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/internal/gtest-port.h
887
888
889
890
891
892
893
894
895
896
#endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC // MS C++ compiler emits warning when a conditional expression is compile time // constant. In some contexts this warning is false positive and needs to be // suppressed. Use the following two macros in such cases: // // GTEST_INTENTIONAL_CONST_COND_PUSH_() // while (true) { // GTEST_INTENTIONAL_CONST_COND_POP_() // }
+ show +
897
898
899
900
# define GTEST_INTENTIONAL_CONST_COND_PUSH_() \ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127) # define GTEST_INTENTIONAL_CONST_COND_POP_() \ GTEST_DISABLE_MSC_WARNINGS_POP_()
+ show +
901
902
903
904
905
906
907
908
909
910
// Determine whether the compiler supports Microsoft's Structured Exception // Handling. This is supported by several Windows compilers but generally // does not exist on any other system. #ifndef GTEST_HAS_SEH // The user didn't tell us, so we need to figure it out. # if defined(_MSC_VER) || defined(__BORLANDC__) // These two compilers are known to support SEH. # define GTEST_HAS_SEH 1
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/internal/gtest-port.h
887
888
889
890
891
892
893
894
895
896
#endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC // MS C++ compiler emits warning when a conditional expression is compile time // constant. In some contexts this warning is false positive and needs to be // suppressed. Use the following two macros in such cases: // // GTEST_INTENTIONAL_CONST_COND_PUSH_() // while (true) { // GTEST_INTENTIONAL_CONST_COND_POP_() // }
+ show +
897
898
899
900
# define GTEST_INTENTIONAL_CONST_COND_PUSH_() \ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127) # define GTEST_INTENTIONAL_CONST_COND_POP_() \ GTEST_DISABLE_MSC_WARNINGS_POP_()
+ show +
901
902
903
904
905
906
907
908
909
910
// Determine whether the compiler supports Microsoft's Structured Exception // Handling. This is supported by several Windows compilers but generally // does not exist on any other system. #ifndef GTEST_HAS_SEH // The user didn't tell us, so we need to figure it out. # if defined(_MSC_VER) || defined(__BORLANDC__) // These two compilers are known to support SEH. # define GTEST_HAS_SEH 1

[CVE-2020-0478_1.diff] gtest-port.h #32
- nanosleep(&time, NULL); + nanosleep(&time, nullptr); -# endif // GTEST_HAS_PTHREAD +#endif // GTEST_HAS_PTHREAD -# if GTEST_HAS_NOTIFICATION_ +#if GTEST_HAS_NOTIFICATION_ -# elif GTEST_HAS_PTHREAD +#elif GTEST_HAS_PTHREAD
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/internal/gtest-port.h
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
#if GTEST_IS_THREADSAFE # if GTEST_HAS_PTHREAD // Sleeps for (roughly) n milliseconds. This function is only for testing // Google Test's own constructs. Don't use it in user tests, either // directly or indirectly. inline void SleepMilliseconds(int n) { const timespec time = { 0, // 0 seconds. n * 1000L * 1000L, // And n ms. };
+ show +
1495
1496
1497
1498
1499
1500
1501
1502
1503
nanosleep(&time, NULL); } # endif // GTEST_HAS_PTHREAD # if GTEST_HAS_NOTIFICATION_ // Notification has already been imported into the namespace. // Nothing to do here. # elif GTEST_HAS_PTHREAD
+ show +
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
// Allows a controller thread to pause execution of newly created // threads until notified. Instances of this class must be created // and destroyed in the controller thread. // // This class is only for testing Google Test's own constructs. Do not // use it in user tests, either directly or indirectly. class Notification { public: Notification() : notified_(false) { GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
#if GTEST_IS_THREADSAFE # if GTEST_HAS_PTHREAD // Sleeps for (roughly) n milliseconds. This function is only for testing // Google Test's own constructs. Don't use it in user tests, either // directly or indirectly. inline void SleepMilliseconds(int n) { const timespec time = { 0, // 0 seconds. n * 1000L * 1000L, // And n ms. };
+ show +
2735
2736
2737
2738
2739
2740
2741
2742
2743
nanosleep(&time, NULL); } # endif // GTEST_HAS_PTHREAD # if GTEST_HAS_NOTIFICATION_ // Notification has already been imported into the namespace. // Nothing to do here. # elif GTEST_HAS_PTHREAD
+ show +
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
// Allows a controller thread to pause execution of newly created // threads until notified. Instances of this class must be created // and destroyed in the controller thread. // // This class is only for testing Google Test's own constructs. Do not // use it in user tests, either directly or indirectly. class Notification { public: Notification() : notified_(false) { GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/internal/gtest-port.h
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
#if GTEST_IS_THREADSAFE # if GTEST_HAS_PTHREAD // Sleeps for (roughly) n milliseconds. This function is only for testing // Google Test's own constructs. Don't use it in user tests, either // directly or indirectly. inline void SleepMilliseconds(int n) { const timespec time = { 0, // 0 seconds. n * 1000L * 1000L, // And n ms. };
+ show +
1586
1587
1588
1589
1590
1591
1592
1593
1594
nanosleep(&time, NULL); } # endif // GTEST_HAS_PTHREAD # if GTEST_HAS_NOTIFICATION_ // Notification has already been imported into the namespace. // Nothing to do here. # elif GTEST_HAS_PTHREAD
+ show +
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
// Allows a controller thread to pause execution of newly created // threads until notified. Instances of this class must be created // and destroyed in the controller thread. // // This class is only for testing Google Test's own constructs. Do not // use it in user tests, either directly or indirectly. class Notification { public: Notification() : notified_(false) { GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/internal/gtest-port.h
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
#if GTEST_IS_THREADSAFE # if GTEST_HAS_PTHREAD // Sleeps for (roughly) n milliseconds. This function is only for testing // Google Test's own constructs. Don't use it in user tests, either // directly or indirectly. inline void SleepMilliseconds(int n) { const timespec time = { 0, // 0 seconds. n * 1000L * 1000L, // And n ms. };
+ show +
1453
1454
1455
1456
1457
1458
1459
1460
1461
nanosleep(&time, NULL); } # endif // GTEST_HAS_PTHREAD # if GTEST_HAS_NOTIFICATION_ // Notification has already been imported into the namespace. // Nothing to do here. # elif GTEST_HAS_PTHREAD
+ show +
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
// Allows a controller thread to pause execution of newly created // threads until notified. Instances of this class must be created // and destroyed in the controller thread. // // This class is only for testing Google Test's own constructs. Do not // use it in user tests, either directly or indirectly. class Notification { public: Notification() : notified_(false) { GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/internal/gtest-port.h
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
#if GTEST_IS_THREADSAFE # if GTEST_HAS_PTHREAD // Sleeps for (roughly) n milliseconds. This function is only for testing // Google Test's own constructs. Don't use it in user tests, either // directly or indirectly. inline void SleepMilliseconds(int n) { const timespec time = { 0, // 0 seconds. n * 1000L * 1000L, // And n ms. };
+ show +
1466
1467
1468
1469
1470
1471
1472
1473
1474
nanosleep(&time, NULL); } # endif // GTEST_HAS_PTHREAD # if GTEST_HAS_NOTIFICATION_ // Notification has already been imported into the namespace. // Nothing to do here. # elif GTEST_HAS_PTHREAD
+ show +
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
// Allows a controller thread to pause execution of newly created // threads until notified. Instances of this class must be created // and destroyed in the controller thread. // // This class is only for testing Google Test's own constructs. Do not // use it in user tests, either directly or indirectly. class Notification { public: Notification() : notified_(false) { GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));

[CVE-2020-0470_1.diff] gtest-port.h #20
-# define GTEST_INTENTIONAL_CONST_COND_PUSH_() \ - GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127) -# define GTEST_INTENTIONAL_CONST_COND_POP_() \ - GTEST_DISABLE_MSC_WARNINGS_POP_() +#define GTEST_INTENTIONAL_CONST_COND_PUSH_() \ + GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127) +#define GTEST_INTENTIONAL_CONST_COND_POP_() GTEST_DISABLE_MSC_WARNINGS_POP_()
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/internal/gtest-port.h
925
926
927
928
929
930
931
932
933
934
#endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC // MS C++ compiler emits warning when a conditional expression is compile time // constant. In some contexts this warning is false positive and needs to be // suppressed. Use the following two macros in such cases: // // GTEST_INTENTIONAL_CONST_COND_PUSH_() // while (true) { // GTEST_INTENTIONAL_CONST_COND_POP_() // }
+ show +
935
936
937
938
# define GTEST_INTENTIONAL_CONST_COND_PUSH_() \ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127) # define GTEST_INTENTIONAL_CONST_COND_POP_() \ GTEST_DISABLE_MSC_WARNINGS_POP_()
+ show +
939
940
941
942
943
944
945
946
947
948
// Determine whether the compiler supports Microsoft's Structured Exception // Handling. This is supported by several Windows compilers but generally // does not exist on any other system. #ifndef GTEST_HAS_SEH // The user didn't tell us, so we need to figure it out. # if defined(_MSC_VER) || defined(__BORLANDC__) // These two compilers are known to support SEH. # define GTEST_HAS_SEH 1
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/include/gtest/internal/gtest-port.h
716
717
718
719
720
721
722
723
724
725
#endif // __GNUC__ && !COMPILER_ICC // MS C++ compiler emits warning when a conditional expression is compile time // constant. In some contexts this warning is false positive and needs to be // suppressed. Use the following two macros in such cases: // // GTEST_INTENTIONAL_CONST_COND_PUSH_() // while (true) { // GTEST_INTENTIONAL_CONST_COND_POP_() // }
+ show +
726
727
728
729
# define GTEST_INTENTIONAL_CONST_COND_PUSH_() \ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127) # define GTEST_INTENTIONAL_CONST_COND_POP_() \ GTEST_DISABLE_MSC_WARNINGS_POP_()
+ show +
730
731
732
733
734
735
736
737
738
739
// Determine whether the compiler supports Microsoft's Structured Exception // Handling. This is supported by several Windows compilers but generally // does not exist on any other system. #ifndef GTEST_HAS_SEH // The user didn't tell us, so we need to figure it out. # if defined(_MSC_VER) || defined(__BORLANDC__) // These two compilers are known to support SEH. # define GTEST_HAS_SEH 1
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
#endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC // MS C++ compiler emits warning when a conditional expression is compile time // constant. In some contexts this warning is false positive and needs to be // suppressed. Use the following two macros in such cases: // // GTEST_INTENTIONAL_CONST_COND_PUSH_() // while (true) { // GTEST_INTENTIONAL_CONST_COND_POP_() // }
+ show +
2179
2180
2181
2182
# define GTEST_INTENTIONAL_CONST_COND_PUSH_() \ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127) # define GTEST_INTENTIONAL_CONST_COND_POP_() \ GTEST_DISABLE_MSC_WARNINGS_POP_()
+ show +
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
// Determine whether the compiler supports Microsoft's Structured Exception // Handling. This is supported by several Windows compilers but generally // does not exist on any other system. #ifndef GTEST_HAS_SEH // The user didn't tell us, so we need to figure it out. # if defined(_MSC_VER) || defined(__BORLANDC__) // These two compilers are known to support SEH. # define GTEST_HAS_SEH 1
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/internal/gtest-port.h
945
946
947
948
949
950
951
952
953
954
#endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC // MS C++ compiler emits warning when a conditional expression is compile time // constant. In some contexts this warning is false positive and needs to be // suppressed. Use the following two macros in such cases: // // GTEST_INTENTIONAL_CONST_COND_PUSH_() // while (true) { // GTEST_INTENTIONAL_CONST_COND_POP_() // }
+ show +
955
956
957
958
# define GTEST_INTENTIONAL_CONST_COND_PUSH_() \ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127) # define GTEST_INTENTIONAL_CONST_COND_POP_() \ GTEST_DISABLE_MSC_WARNINGS_POP_()
+ show +
959
960
961
962
963
964
965
966
967
968
// Determine whether the compiler supports Microsoft's Structured Exception // Handling. This is supported by several Windows compilers but generally // does not exist on any other system. #ifndef GTEST_HAS_SEH // The user didn't tell us, so we need to figure it out. # if defined(_MSC_VER) || defined(__BORLANDC__) // These two compilers are known to support SEH. # define GTEST_HAS_SEH 1
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/internal/gtest-port.h
887
888
889
890
891
892
893
894
895
896
#endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC // MS C++ compiler emits warning when a conditional expression is compile time // constant. In some contexts this warning is false positive and needs to be // suppressed. Use the following two macros in such cases: // // GTEST_INTENTIONAL_CONST_COND_PUSH_() // while (true) { // GTEST_INTENTIONAL_CONST_COND_POP_() // }
+ show +
897
898
899
900
# define GTEST_INTENTIONAL_CONST_COND_PUSH_() \ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127) # define GTEST_INTENTIONAL_CONST_COND_POP_() \ GTEST_DISABLE_MSC_WARNINGS_POP_()
+ show +
901
902
903
904
905
906
907
908
909
910
// Determine whether the compiler supports Microsoft's Structured Exception // Handling. This is supported by several Windows compilers but generally // does not exist on any other system. #ifndef GTEST_HAS_SEH // The user didn't tell us, so we need to figure it out. # if defined(_MSC_VER) || defined(__BORLANDC__) // These two compilers are known to support SEH. # define GTEST_HAS_SEH 1
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/internal/gtest-port.h
887
888
889
890
891
892
893
894
895
896
#endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC // MS C++ compiler emits warning when a conditional expression is compile time // constant. In some contexts this warning is false positive and needs to be // suppressed. Use the following two macros in such cases: // // GTEST_INTENTIONAL_CONST_COND_PUSH_() // while (true) { // GTEST_INTENTIONAL_CONST_COND_POP_() // }
+ show +
897
898
899
900
# define GTEST_INTENTIONAL_CONST_COND_PUSH_() \ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127) # define GTEST_INTENTIONAL_CONST_COND_POP_() \ GTEST_DISABLE_MSC_WARNINGS_POP_()
+ show +
901
902
903
904
905
906
907
908
909
910
// Determine whether the compiler supports Microsoft's Structured Exception // Handling. This is supported by several Windows compilers but generally // does not exist on any other system. #ifndef GTEST_HAS_SEH // The user didn't tell us, so we need to figure it out. # if defined(_MSC_VER) || defined(__BORLANDC__) // These two compilers are known to support SEH. # define GTEST_HAS_SEH 1

[CVE-2020-0470_1.diff] gtest-port.h #32
- nanosleep(&time, NULL); + nanosleep(&time, nullptr); -# endif // GTEST_HAS_PTHREAD +#endif // GTEST_HAS_PTHREAD -# if GTEST_HAS_NOTIFICATION_ +#if GTEST_HAS_NOTIFICATION_ -# elif GTEST_HAS_PTHREAD +#elif GTEST_HAS_PTHREAD
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/internal/gtest-port.h
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
#if GTEST_IS_THREADSAFE # if GTEST_HAS_PTHREAD // Sleeps for (roughly) n milliseconds. This function is only for testing // Google Test's own constructs. Don't use it in user tests, either // directly or indirectly. inline void SleepMilliseconds(int n) { const timespec time = { 0, // 0 seconds. n * 1000L * 1000L, // And n ms. };
+ show +
1495
1496
1497
1498
1499
1500
1501
1502
1503
nanosleep(&time, NULL); } # endif // GTEST_HAS_PTHREAD # if GTEST_HAS_NOTIFICATION_ // Notification has already been imported into the namespace. // Nothing to do here. # elif GTEST_HAS_PTHREAD
+ show +
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
// Allows a controller thread to pause execution of newly created // threads until notified. Instances of this class must be created // and destroyed in the controller thread. // // This class is only for testing Google Test's own constructs. Do not // use it in user tests, either directly or indirectly. class Notification { public: Notification() : notified_(false) { GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
#if GTEST_IS_THREADSAFE # if GTEST_HAS_PTHREAD // Sleeps for (roughly) n milliseconds. This function is only for testing // Google Test's own constructs. Don't use it in user tests, either // directly or indirectly. inline void SleepMilliseconds(int n) { const timespec time = { 0, // 0 seconds. n * 1000L * 1000L, // And n ms. };
+ show +
2735
2736
2737
2738
2739
2740
2741
2742
2743
nanosleep(&time, NULL); } # endif // GTEST_HAS_PTHREAD # if GTEST_HAS_NOTIFICATION_ // Notification has already been imported into the namespace. // Nothing to do here. # elif GTEST_HAS_PTHREAD
+ show +
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
// Allows a controller thread to pause execution of newly created // threads until notified. Instances of this class must be created // and destroyed in the controller thread. // // This class is only for testing Google Test's own constructs. Do not // use it in user tests, either directly or indirectly. class Notification { public: Notification() : notified_(false) { GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/internal/gtest-port.h
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
#if GTEST_IS_THREADSAFE # if GTEST_HAS_PTHREAD // Sleeps for (roughly) n milliseconds. This function is only for testing // Google Test's own constructs. Don't use it in user tests, either // directly or indirectly. inline void SleepMilliseconds(int n) { const timespec time = { 0, // 0 seconds. n * 1000L * 1000L, // And n ms. };
+ show +
1586
1587
1588
1589
1590
1591
1592
1593
1594
nanosleep(&time, NULL); } # endif // GTEST_HAS_PTHREAD # if GTEST_HAS_NOTIFICATION_ // Notification has already been imported into the namespace. // Nothing to do here. # elif GTEST_HAS_PTHREAD
+ show +
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
// Allows a controller thread to pause execution of newly created // threads until notified. Instances of this class must be created // and destroyed in the controller thread. // // This class is only for testing Google Test's own constructs. Do not // use it in user tests, either directly or indirectly. class Notification { public: Notification() : notified_(false) { GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/internal/gtest-port.h
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
#if GTEST_IS_THREADSAFE # if GTEST_HAS_PTHREAD // Sleeps for (roughly) n milliseconds. This function is only for testing // Google Test's own constructs. Don't use it in user tests, either // directly or indirectly. inline void SleepMilliseconds(int n) { const timespec time = { 0, // 0 seconds. n * 1000L * 1000L, // And n ms. };
+ show +
1453
1454
1455
1456
1457
1458
1459
1460
1461
nanosleep(&time, NULL); } # endif // GTEST_HAS_PTHREAD # if GTEST_HAS_NOTIFICATION_ // Notification has already been imported into the namespace. // Nothing to do here. # elif GTEST_HAS_PTHREAD
+ show +
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
// Allows a controller thread to pause execution of newly created // threads until notified. Instances of this class must be created // and destroyed in the controller thread. // // This class is only for testing Google Test's own constructs. Do not // use it in user tests, either directly or indirectly. class Notification { public: Notification() : notified_(false) { GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/internal/gtest-port.h
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
#if GTEST_IS_THREADSAFE # if GTEST_HAS_PTHREAD // Sleeps for (roughly) n milliseconds. This function is only for testing // Google Test's own constructs. Don't use it in user tests, either // directly or indirectly. inline void SleepMilliseconds(int n) { const timespec time = { 0, // 0 seconds. n * 1000L * 1000L, // And n ms. };
+ show +
1466
1467
1468
1469
1470
1471
1472
1473
1474
nanosleep(&time, NULL); } # endif // GTEST_HAS_PTHREAD # if GTEST_HAS_NOTIFICATION_ // Notification has already been imported into the namespace. // Nothing to do here. # elif GTEST_HAS_PTHREAD
+ show +
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
// Allows a controller thread to pause execution of newly created // threads until notified. Instances of this class must be created // and destroyed in the controller thread. // // This class is only for testing Google Test's own constructs. Do not // use it in user tests, either directly or indirectly. class Notification { public: Notification() : notified_(false) { GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));

[CVE-2020-0478_1.diff] gtest-internal.h #20
- // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase, + // specified in INSTANTIATE_TYPED_TEST_SUITE_P(Prefix, TestSuite, - static bool Register(const char* prefix, - CodeLocation code_location, - const char* case_name, const char* test_names, - int index) { + static bool Register(const char *prefix, const CodeLocation &code_location, + const char *case_name, const char *test_names, int index, + const std::vector<std::string> &type_names = + GenerateNames<DefaultNameGenerator, Types>()) {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/internal/gtest-internal.h
620
621
622
623
624
625
626
627
628
629
// // Implementation note: The GTEST_TEMPLATE_ macro declares a template // template parameter. It's defined in gtest-type-util.h. template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types> class TypeParameterizedTest { public: // 'index' is the index of the test in the type list 'Types' // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase, // Types). Valid values for 'index' are [0, N - 1] where N is the // length of Types.
+ show +
630
631
632
633
static bool Register(const char* prefix, CodeLocation code_location, const char* case_name, const char* test_names, int index) {
+ show +
634
635
636
637
638
639
640
641
642
643
typedef typename Types::Head Type; typedef Fixture<Type> FixtureClass; typedef typename GTEST_BIND_(TestSel, Type) TestClass; // First, registers the first type-parameterized test in the type // list. MakeAndRegisterTestInfo( (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/" + StreamableToString(index)).c_str(), StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(),
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
// // Implementation note: The GTEST_TEMPLATE_ macro declares a template // template parameter. It's defined in gtest-type-util.h. template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types> class TypeParameterizedTest { public: // 'index' is the index of the test in the type list 'Types' // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase, // Types). Valid values for 'index' are [0, N - 1] where N is the // length of Types.
+ show +
8375
8376
8377
8378
static bool Register(const char* prefix, CodeLocation code_location, const char* case_name, const char* test_names, int index) {
+ show +
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
typedef typename Types::Head Type; typedef Fixture<Type> FixtureClass; typedef typename GTEST_BIND_(TestSel, Type) TestClass; // First, registers the first type-parameterized test in the type // list. MakeAndRegisterTestInfo( (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/" + StreamableToString(index)).c_str(), StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(),
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/internal/gtest-internal.h
619
620
621
622
623
624
625
626
627
628
// // Implementation note: The GTEST_TEMPLATE_ macro declares a template // template parameter. It's defined in gtest-type-util.h. template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types> class TypeParameterizedTest { public: // 'index' is the index of the test in the type list 'Types' // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase, // Types). Valid values for 'index' are [0, N - 1] where N is the // length of Types.
+ show +
629
630
631
632
static bool Register(const char* prefix, CodeLocation code_location, const char* case_name, const char* test_names, int index) {
+ show +
633
634
635
636
637
638
639
640
641
642
typedef typename Types::Head Type; typedef Fixture<Type> FixtureClass; typedef typename GTEST_BIND_(TestSel, Type) TestClass; // First, registers the first type-parameterized test in the type // list. MakeAndRegisterTestInfo( (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/" + StreamableToString(index)).c_str(), StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(),
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/internal/gtest-internal.h
619
620
621
622
623
624
625
626
627
628
// // Implementation note: The GTEST_TEMPLATE_ macro declares a template // template parameter. It's defined in gtest-type-util.h. template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types> class TypeParameterizedTest { public: // 'index' is the index of the test in the type list 'Types' // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase, // Types). Valid values for 'index' are [0, N - 1] where N is the // length of Types.
+ show +
629
630
631
632
static bool Register(const char* prefix, CodeLocation code_location, const char* case_name, const char* test_names, int index) {
+ show +
633
634
635
636
637
638
639
640
641
642
typedef typename Types::Head Type; typedef Fixture<Type> FixtureClass; typedef typename GTEST_BIND_(TestSel, Type) TestClass; // First, registers the first type-parameterized test in the type // list. MakeAndRegisterTestInfo( (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/" + StreamableToString(index)).c_str(), StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(),

[CVE-2020-0470_1.diff] gtest-internal.h #20
- // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase, + // specified in INSTANTIATE_TYPED_TEST_SUITE_P(Prefix, TestSuite, - static bool Register(const char* prefix, - CodeLocation code_location, - const char* case_name, const char* test_names, - int index) { + static bool Register(const char *prefix, const CodeLocation &code_location, + const char *case_name, const char *test_names, int index, + const std::vector<std::string> &type_names = + GenerateNames<DefaultNameGenerator, Types>()) {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/internal/gtest-internal.h
620
621
622
623
624
625
626
627
628
629
// // Implementation note: The GTEST_TEMPLATE_ macro declares a template // template parameter. It's defined in gtest-type-util.h. template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types> class TypeParameterizedTest { public: // 'index' is the index of the test in the type list 'Types' // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase, // Types). Valid values for 'index' are [0, N - 1] where N is the // length of Types.
+ show +
630
631
632
633
static bool Register(const char* prefix, CodeLocation code_location, const char* case_name, const char* test_names, int index) {
+ show +
634
635
636
637
638
639
640
641
642
643
typedef typename Types::Head Type; typedef Fixture<Type> FixtureClass; typedef typename GTEST_BIND_(TestSel, Type) TestClass; // First, registers the first type-parameterized test in the type // list. MakeAndRegisterTestInfo( (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/" + StreamableToString(index)).c_str(), StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(),
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
// // Implementation note: The GTEST_TEMPLATE_ macro declares a template // template parameter. It's defined in gtest-type-util.h. template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types> class TypeParameterizedTest { public: // 'index' is the index of the test in the type list 'Types' // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase, // Types). Valid values for 'index' are [0, N - 1] where N is the // length of Types.
+ show +
8375
8376
8377
8378
static bool Register(const char* prefix, CodeLocation code_location, const char* case_name, const char* test_names, int index) {
+ show +
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
typedef typename Types::Head Type; typedef Fixture<Type> FixtureClass; typedef typename GTEST_BIND_(TestSel, Type) TestClass; // First, registers the first type-parameterized test in the type // list. MakeAndRegisterTestInfo( (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/" + StreamableToString(index)).c_str(), StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(),
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/internal/gtest-internal.h
619
620
621
622
623
624
625
626
627
628
// // Implementation note: The GTEST_TEMPLATE_ macro declares a template // template parameter. It's defined in gtest-type-util.h. template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types> class TypeParameterizedTest { public: // 'index' is the index of the test in the type list 'Types' // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase, // Types). Valid values for 'index' are [0, N - 1] where N is the // length of Types.
+ show +
629
630
631
632
static bool Register(const char* prefix, CodeLocation code_location, const char* case_name, const char* test_names, int index) {
+ show +
633
634
635
636
637
638
639
640
641
642
typedef typename Types::Head Type; typedef Fixture<Type> FixtureClass; typedef typename GTEST_BIND_(TestSel, Type) TestClass; // First, registers the first type-parameterized test in the type // list. MakeAndRegisterTestInfo( (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/" + StreamableToString(index)).c_str(), StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(),
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/internal/gtest-internal.h
619
620
621
622
623
624
625
626
627
628
// // Implementation note: The GTEST_TEMPLATE_ macro declares a template // template parameter. It's defined in gtest-type-util.h. template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types> class TypeParameterizedTest { public: // 'index' is the index of the test in the type list 'Types' // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase, // Types). Valid values for 'index' are [0, N - 1] where N is the // length of Types.
+ show +
629
630
631
632
static bool Register(const char* prefix, CodeLocation code_location, const char* case_name, const char* test_names, int index) {
+ show +
633
634
635
636
637
638
639
640
641
642
typedef typename Types::Head Type; typedef Fixture<Type> FixtureClass; typedef typename GTEST_BIND_(TestSel, Type) TestClass; // First, registers the first type-parameterized test in the type // list. MakeAndRegisterTestInfo( (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/" + StreamableToString(index)).c_str(), StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(),

[CVE-2020-0478_1.diff] gtest-param-util.h #3
-// +// Utility Functions + -// fixture class for the same test case. This may happen when +// fixture class for the same test suite. This may happen when -GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name, - CodeLocation code_location); +GTEST_API_ void ReportInvalidTestSuiteType(const char *test_suite_name, + CodeLocation code_location); -template <typename> class ParamGeneratorInterface; -template <typename> class ParamGenerator; +template <typename> +class ParamGeneratorInterface; +template <typename> +class ParamGenerator;
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/internal/gtest-param-util.h
74
75
76
77
78
79
80
81
82
83
}; namespace internal { // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Outputs a message explaining invalid registration of different // fixture class for the same test case. This may happen when // TEST_P macro is used to define two tests with the same name // but in different namespaces.
+ show +
84
85
86
87
88
GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name, CodeLocation code_location); template <typename> class ParamGeneratorInterface; template <typename> class ParamGenerator;
+ show +
89
90
91
92
93
94
95
96
97
98
// Interface for iterating over elements provided by an implementation // of ParamGeneratorInterface<T>. template <typename T> class ParamIteratorInterface { public: virtual ~ParamIteratorInterface() {} // A pointer to the base generator instance. // Used only for the purposes of iterator comparison // to make sure that two iterators belong to the same generator.
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
}; namespace internal { // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Outputs a message explaining invalid registration of different // fixture class for the same test case. This may happen when // TEST_P macro is used to define two tests with the same name // but in different namespaces.
+ show +
11138
11139
11140
11141
11142
GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name, CodeLocation code_location); template <typename> class ParamGeneratorInterface; template <typename> class ParamGenerator;
+ show +
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
// Interface for iterating over elements provided by an implementation // of ParamGeneratorInterface<T>. template <typename T> class ParamIteratorInterface { public: virtual ~ParamIteratorInterface() {} // A pointer to the base generator instance. // Used only for the purposes of iterator comparison // to make sure that two iterators belong to the same generator.
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/internal/gtest-param-util.h
70
71
72
73
74
75
76
77
78
79
}; namespace internal { // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Outputs a message explaining invalid registration of different // fixture class for the same test case. This may happen when // TEST_P macro is used to define two tests with the same name // but in different namespaces.
+ show +
80
81
82
83
84
GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name, CodeLocation code_location); template <typename> class ParamGeneratorInterface; template <typename> class ParamGenerator;
+ show +
85
86
87
88
89
90
91
92
93
94
// Interface for iterating over elements provided by an implementation // of ParamGeneratorInterface<T>. template <typename T> class ParamIteratorInterface { public: virtual ~ParamIteratorInterface() {} // A pointer to the base generator instance. // Used only for the purposes of iterator comparison // to make sure that two iterators belong to the same generator.
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/internal/gtest-param-util.h
74
75
76
77
78
79
80
81
82
83
}; namespace internal { // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Outputs a message explaining invalid registration of different // fixture class for the same test case. This may happen when // TEST_P macro is used to define two tests with the same name // but in different namespaces.
+ show +
84
85
86
87
88
GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name, CodeLocation code_location); template <typename> class ParamGeneratorInterface; template <typename> class ParamGenerator;
+ show +
89
90
91
92
93
94
95
96
97
98
// Interface for iterating over elements provided by an implementation // of ParamGeneratorInterface<T>. template <typename T> class ParamIteratorInterface { public: virtual ~ParamIteratorInterface() {} // A pointer to the base generator instance. // Used only for the purposes of iterator comparison // to make sure that two iterators belong to the same generator.
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util.h
74
75
76
77
78
79
80
81
82
83
}; namespace internal { // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Outputs a message explaining invalid registration of different // fixture class for the same test case. This may happen when // TEST_P macro is used to define two tests with the same name // but in different namespaces.
+ show +
84
85
86
87
88
GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name, CodeLocation code_location); template <typename> class ParamGeneratorInterface; template <typename> class ParamGenerator;
+ show +
89
90
91
92
93
94
95
96
97
98
// Interface for iterating over elements provided by an implementation // of ParamGeneratorInterface<T>. template <typename T> class ParamIteratorInterface { public: virtual ~ParamIteratorInterface() {} // A pointer to the base generator instance. // Used only for the purposes of iterator comparison // to make sure that two iterators belong to the same generator.

[CVE-2020-0470_1.diff] gtest-param-util.h #3
-// +// Utility Functions + -// fixture class for the same test case. This may happen when +// fixture class for the same test suite. This may happen when -GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name, - CodeLocation code_location); +GTEST_API_ void ReportInvalidTestSuiteType(const char *test_suite_name, + CodeLocation code_location); -template <typename> class ParamGeneratorInterface; -template <typename> class ParamGenerator; +template <typename> +class ParamGeneratorInterface; +template <typename> +class ParamGenerator;
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/include/gtest/internal/gtest-param-util.h
74
75
76
77
78
79
80
81
82
83
}; namespace internal { // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Outputs a message explaining invalid registration of different // fixture class for the same test case. This may happen when // TEST_P macro is used to define two tests with the same name // but in different namespaces.
+ show +
84
85
86
87
88
GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name, CodeLocation code_location); template <typename> class ParamGeneratorInterface; template <typename> class ParamGenerator;
+ show +
89
90
91
92
93
94
95
96
97
98
// Interface for iterating over elements provided by an implementation // of ParamGeneratorInterface<T>. template <typename T> class ParamIteratorInterface { public: virtual ~ParamIteratorInterface() {} // A pointer to the base generator instance. // Used only for the purposes of iterator comparison // to make sure that two iterators belong to the same generator.
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
}; namespace internal { // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Outputs a message explaining invalid registration of different // fixture class for the same test case. This may happen when // TEST_P macro is used to define two tests with the same name // but in different namespaces.
+ show +
11138
11139
11140
11141
11142
GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name, CodeLocation code_location); template <typename> class ParamGeneratorInterface; template <typename> class ParamGenerator;
+ show +
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
// Interface for iterating over elements provided by an implementation // of ParamGeneratorInterface<T>. template <typename T> class ParamIteratorInterface { public: virtual ~ParamIteratorInterface() {} // A pointer to the base generator instance. // Used only for the purposes of iterator comparison // to make sure that two iterators belong to the same generator.
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/include/gtest/internal/gtest-param-util.h
70
71
72
73
74
75
76
77
78
79
}; namespace internal { // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Outputs a message explaining invalid registration of different // fixture class for the same test case. This may happen when // TEST_P macro is used to define two tests with the same name // but in different namespaces.
+ show +
80
81
82
83
84
GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name, CodeLocation code_location); template <typename> class ParamGeneratorInterface; template <typename> class ParamGenerator;
+ show +
85
86
87
88
89
90
91
92
93
94
// Interface for iterating over elements provided by an implementation // of ParamGeneratorInterface<T>. template <typename T> class ParamIteratorInterface { public: virtual ~ParamIteratorInterface() {} // A pointer to the base generator instance. // Used only for the purposes of iterator comparison // to make sure that two iterators belong to the same generator.
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/include/gtest/internal/gtest-param-util.h
74
75
76
77
78
79
80
81
82
83
}; namespace internal { // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Outputs a message explaining invalid registration of different // fixture class for the same test case. This may happen when // TEST_P macro is used to define two tests with the same name // but in different namespaces.
+ show +
84
85
86
87
88
GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name, CodeLocation code_location); template <typename> class ParamGeneratorInterface; template <typename> class ParamGenerator;
+ show +
89
90
91
92
93
94
95
96
97
98
// Interface for iterating over elements provided by an implementation // of ParamGeneratorInterface<T>. template <typename T> class ParamIteratorInterface { public: virtual ~ParamIteratorInterface() {} // A pointer to the base generator instance. // Used only for the purposes of iterator comparison // to make sure that two iterators belong to the same generator.
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util.h
74
75
76
77
78
79
80
81
82
83
}; namespace internal { // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Outputs a message explaining invalid registration of different // fixture class for the same test case. This may happen when // TEST_P macro is used to define two tests with the same name // but in different namespaces.
+ show +
84
85
86
87
88
GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name, CodeLocation code_location); template <typename> class ParamGeneratorInterface; template <typename> class ParamGenerator;
+ show +
89
90
91
92
93
94
95
96
97
98
// Interface for iterating over elements provided by an implementation // of ParamGeneratorInterface<T>. template <typename T> class ParamIteratorInterface { public: virtual ~ParamIteratorInterface() {} // A pointer to the base generator instance. // Used only for the purposes of iterator comparison // to make sure that two iterators belong to the same generator.

[CVE-2020-0478_1.diff] gtest-port.cc #44
-GTEST_DISABLE_MSC_WARNINGS_POP_() +GTEST_DISABLE_MSC_DEPRECATED_POP_() -static CapturedStream* g_captured_stderr = NULL; -static CapturedStream* g_captured_stdout = NULL; +static CapturedStream *g_captured_stderr = nullptr; +static CapturedStream *g_captured_stdout = nullptr; -void CaptureStream(int fd, const char* stream_name, CapturedStream** stream) { - if (*stream != NULL) { +static void CaptureStream(int fd, const char *stream_name, + CapturedStream **stream) { + if (*stream != nullptr) {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-port.cc
988
989
990
991
992
993
994
995
996
997
private: const int fd_; // A stream to capture. int uncaptured_fd_; // Name of the temporary file holding the stderr output. ::std::string filename_; GTEST_DISALLOW_COPY_AND_ASSIGN_(CapturedStream); };
+ show +
998
999
1000
1001
1002
1003
1004
1005
GTEST_DISABLE_MSC_WARNINGS_POP_() static CapturedStream* g_captured_stderr = NULL; static CapturedStream* g_captured_stdout = NULL; // Starts capturing an output stream (stdout/stderr). void CaptureStream(int fd, const char* stream_name, CapturedStream** stream) { if (*stream != NULL) {
+ show +
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
GTEST_LOG_(FATAL) << "Only one " << stream_name << " capturer can exist at a time."; } *stream = new CapturedStream(fd); } // Stops capturing the output stream and returns the captured string. std::string GetCapturedStream(CapturedStream** captured_stream) { const std::string content = (*captured_stream)->GetCapturedString();
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
private: const int fd_; // A stream to capture. int uncaptured_fd_; // Name of the temporary file holding the stderr output. ::std::string filename_; GTEST_DISALLOW_COPY_AND_ASSIGN_(CapturedStream); };
+ show +
9565
9566
9567
9568
9569
9570
9571
9572
GTEST_DISABLE_MSC_WARNINGS_POP_() static CapturedStream* g_captured_stderr = NULL; static CapturedStream* g_captured_stdout = NULL; // Starts capturing an output stream (stdout/stderr). void CaptureStream(int fd, const char* stream_name, CapturedStream** stream) { if (*stream != NULL) {
+ show +
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
GTEST_LOG_(FATAL) << "Only one " << stream_name << " capturer can exist at a time."; } *stream = new CapturedStream(fd); } // Stops capturing the output stream and returns the captured string. std::string GetCapturedStream(CapturedStream** captured_stream) { const std::string content = (*captured_stream)->GetCapturedString();
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-port.cc
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
private: const int fd_; // A stream to capture. int uncaptured_fd_; // Name of the temporary file holding the stderr output. ::std::string filename_; GTEST_DISALLOW_COPY_AND_ASSIGN_(CapturedStream); };
+ show +
1012
1013
1014
1015
1016
1017
1018
1019
GTEST_DISABLE_MSC_WARNINGS_POP_() static CapturedStream* g_captured_stderr = NULL; static CapturedStream* g_captured_stdout = NULL; // Starts capturing an output stream (stdout/stderr). void CaptureStream(int fd, const char* stream_name, CapturedStream** stream) { if (*stream != NULL) {
+ show +
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
GTEST_LOG_(FATAL) << "Only one " << stream_name << " capturer can exist at a time."; } *stream = new CapturedStream(fd); } // Stops capturing the output stream and returns the captured string. std::string GetCapturedStream(CapturedStream** captured_stream) { const std::string content = (*captured_stream)->GetCapturedString();
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-port.cc
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
private: const int fd_; // A stream to capture. int uncaptured_fd_; // Name of the temporary file holding the stderr output. ::std::string filename_; GTEST_DISALLOW_COPY_AND_ASSIGN_(CapturedStream); };
+ show +
1012
1013
1014
1015
1016
1017
1018
1019
GTEST_DISABLE_MSC_WARNINGS_POP_() static CapturedStream* g_captured_stderr = NULL; static CapturedStream* g_captured_stdout = NULL; // Starts capturing an output stream (stdout/stderr). void CaptureStream(int fd, const char* stream_name, CapturedStream** stream) { if (*stream != NULL) {
+ show +
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
GTEST_LOG_(FATAL) << "Only one " << stream_name << " capturer can exist at a time."; } *stream = new CapturedStream(fd); } // Stops capturing the output stream and returns the captured string. std::string GetCapturedStream(CapturedStream** captured_stream) { const std::string content = (*captured_stream)->GetCapturedString();

[CVE-2020-0470_1.diff] gtest-port.cc #44
-GTEST_DISABLE_MSC_WARNINGS_POP_() +GTEST_DISABLE_MSC_DEPRECATED_POP_() -static CapturedStream* g_captured_stderr = NULL; -static CapturedStream* g_captured_stdout = NULL; +static CapturedStream *g_captured_stderr = nullptr; +static CapturedStream *g_captured_stdout = nullptr; -void CaptureStream(int fd, const char* stream_name, CapturedStream** stream) { - if (*stream != NULL) { +static void CaptureStream(int fd, const char *stream_name, + CapturedStream **stream) { + if (*stream != nullptr) {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-port.cc
988
989
990
991
992
993
994
995
996
997
private: const int fd_; // A stream to capture. int uncaptured_fd_; // Name of the temporary file holding the stderr output. ::std::string filename_; GTEST_DISALLOW_COPY_AND_ASSIGN_(CapturedStream); };
+ show +
998
999
1000
1001
1002
1003
1004
1005
GTEST_DISABLE_MSC_WARNINGS_POP_() static CapturedStream* g_captured_stderr = NULL; static CapturedStream* g_captured_stdout = NULL; // Starts capturing an output stream (stdout/stderr). void CaptureStream(int fd, const char* stream_name, CapturedStream** stream) { if (*stream != NULL) {
+ show +
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
GTEST_LOG_(FATAL) << "Only one " << stream_name << " capturer can exist at a time."; } *stream = new CapturedStream(fd); } // Stops capturing the output stream and returns the captured string. std::string GetCapturedStream(CapturedStream** captured_stream) { const std::string content = (*captured_stream)->GetCapturedString();
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
private: const int fd_; // A stream to capture. int uncaptured_fd_; // Name of the temporary file holding the stderr output. ::std::string filename_; GTEST_DISALLOW_COPY_AND_ASSIGN_(CapturedStream); };
+ show +
9565
9566
9567
9568
9569
9570
9571
9572
GTEST_DISABLE_MSC_WARNINGS_POP_() static CapturedStream* g_captured_stderr = NULL; static CapturedStream* g_captured_stdout = NULL; // Starts capturing an output stream (stdout/stderr). void CaptureStream(int fd, const char* stream_name, CapturedStream** stream) { if (*stream != NULL) {
+ show +
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
GTEST_LOG_(FATAL) << "Only one " << stream_name << " capturer can exist at a time."; } *stream = new CapturedStream(fd); } // Stops capturing the output stream and returns the captured string. std::string GetCapturedStream(CapturedStream** captured_stream) { const std::string content = (*captured_stream)->GetCapturedString();
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-port.cc
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
private: const int fd_; // A stream to capture. int uncaptured_fd_; // Name of the temporary file holding the stderr output. ::std::string filename_; GTEST_DISALLOW_COPY_AND_ASSIGN_(CapturedStream); };
+ show +
1012
1013
1014
1015
1016
1017
1018
1019
GTEST_DISABLE_MSC_WARNINGS_POP_() static CapturedStream* g_captured_stderr = NULL; static CapturedStream* g_captured_stdout = NULL; // Starts capturing an output stream (stdout/stderr). void CaptureStream(int fd, const char* stream_name, CapturedStream** stream) { if (*stream != NULL) {
+ show +
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
GTEST_LOG_(FATAL) << "Only one " << stream_name << " capturer can exist at a time."; } *stream = new CapturedStream(fd); } // Stops capturing the output stream and returns the captured string. std::string GetCapturedStream(CapturedStream** captured_stream) { const std::string content = (*captured_stream)->GetCapturedString();
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-port.cc
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
private: const int fd_; // A stream to capture. int uncaptured_fd_; // Name of the temporary file holding the stderr output. ::std::string filename_; GTEST_DISALLOW_COPY_AND_ASSIGN_(CapturedStream); };
+ show +
1012
1013
1014
1015
1016
1017
1018
1019
GTEST_DISABLE_MSC_WARNINGS_POP_() static CapturedStream* g_captured_stderr = NULL; static CapturedStream* g_captured_stdout = NULL; // Starts capturing an output stream (stdout/stderr). void CaptureStream(int fd, const char* stream_name, CapturedStream** stream) { if (*stream != NULL) {
+ show +
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
GTEST_LOG_(FATAL) << "Only one " << stream_name << " capturer can exist at a time."; } *stream = new CapturedStream(fd); } // Stops capturing the output stream and returns the captured string. std::string GetCapturedStream(CapturedStream** captured_stream) { const std::string content = (*captured_stream)->GetCapturedString();

[CVE-2020-0478_1.diff] gtest-printers.cc #11
+ // Remember if any characters required hex escaping. + if (is_previous_hex) { + print_format = kHexEscape; + } + return print_format; -GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ -GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ -GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ -static void UniversalPrintCharArray( - const CharType* begin, size_t len, ostream* os) { +GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ + GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_ + GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ static void + UniversalPrintCharArray(const CharType *begin, size_t len, + ostream *os) {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-printers.cc
276
277
278
279
280
281
282
283
284
285
*os << "\" " << kQuoteBegin; } is_previous_hex = PrintAsStringLiteralTo(cur, os) == kHexEscape; } *os << "\""; } // Prints a (const) char/wchar_t array of 'len' elements, starting at address // 'begin'. CharType must be either char or wchar_t. template <typename CharType>
+ show +
286
287
288
289
290
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ static void UniversalPrintCharArray( const CharType* begin, size_t len, ostream* os) {
+ show +
291
292
293
294
295
296
297
298
299
300
// The code // const char kFoo[] = "foo"; // generates an array of 4, not 3, elements, with the last one being '\0'. // // Therefore when printing a char array, we don't print the last element if // it's '\0', such that the output matches the string literal as it's // written in the source code. if (len > 0 && begin[len - 1] == '\0') { PrintCharsAsStringTo(begin, len - 1, os); return;
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest-printers.cc
281
282
283
284
285
286
287
288
289
290
print_format = kHexEscape; } } *os << "\""; return print_format; } // Prints a (const) char/wchar_t array of 'len' elements, starting at address // 'begin'. CharType must be either char or wchar_t. template <typename CharType>
+ show +
291
292
293
294
295
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ static void UniversalPrintCharArray( const CharType* begin, size_t len, ostream* os) {
+ show +
296
297
298
299
300
301
302
303
304
305
// The code // const char kFoo[] = "foo"; // generates an array of 4, not 3, elements, with the last one being '\0'. // // Therefore when printing a char array, we don't print the last element if // it's '\0', such that the output matches the string literal as it's // written in the source code. if (len > 0 && begin[len - 1] == '\0') { PrintCharsAsStringTo(begin, len - 1, os); return;
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
*os << "\" " << kQuoteBegin; } is_previous_hex = PrintAsStringLiteralTo(cur, os) == kHexEscape; } *os << "\""; } // Prints a (const) char/wchar_t array of 'len' elements, starting at address // 'begin'. CharType must be either char or wchar_t. template <typename CharType>
+ show +
10093
10094
10095
10096
10097
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ static void UniversalPrintCharArray( const CharType* begin, size_t len, ostream* os) {
+ show +
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
// The code // const char kFoo[] = "foo"; // generates an array of 4, not 3, elements, with the last one being '\0'. // // Therefore when printing a char array, we don't print the last element if // it's '\0', such that the output matches the string literal as it's // written in the source code. if (len > 0 && begin[len - 1] == '\0') { PrintCharsAsStringTo(begin, len - 1, os); return;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-printers.cc
282
283
284
285
286
287
288
289
290
291
print_format = kHexEscape; } } *os << "\""; return print_format; } // Prints a (const) char/wchar_t array of 'len' elements, starting at address // 'begin'. CharType must be either char or wchar_t. template <typename CharType>
+ show +
292
293
294
295
296
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ static void UniversalPrintCharArray( const CharType* begin, size_t len, ostream* os) {
+ show +
297
298
299
300
301
302
303
304
305
306
// The code // const char kFoo[] = "foo"; // generates an array of 4, not 3, elements, with the last one being '\0'. // // Therefore when printing a char array, we don't print the last element if // it's '\0', such that the output matches the string literal as it's // written in the source code. if (len > 0 && begin[len - 1] == '\0') { PrintCharsAsStringTo(begin, len - 1, os); return;
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-printers.cc
273
274
275
276
277
278
279
280
281
282
*os << "\" " << kQuoteBegin; } is_previous_hex = PrintAsStringLiteralTo(cur, os) == kHexEscape; } *os << "\""; } // Prints a (const) char/wchar_t array of 'len' elements, starting at address // 'begin'. CharType must be either char or wchar_t. template <typename CharType>
+ show +
283
284
285
286
287
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ static void UniversalPrintCharArray( const CharType* begin, size_t len, ostream* os) {
+ show +
288
289
290
291
292
293
294
295
296
297
// The code // const char kFoo[] = "foo"; // generates an array of 4, not 3, elements, with the last one being '\0'. // // Therefore when printing a char array, we don't print the last element if // it's '\0', such that the output matches the string literal as it's // written in the source code. if (len > 0 && begin[len - 1] == '\0') { PrintCharsAsStringTo(begin, len - 1, os); return;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-printers.cc
273
274
275
276
277
278
279
280
281
282
*os << "\" " << kQuoteBegin; } is_previous_hex = PrintAsStringLiteralTo(cur, os) == kHexEscape; } *os << "\""; } // Prints a (const) char/wchar_t array of 'len' elements, starting at address // 'begin'. CharType must be either char or wchar_t. template <typename CharType>
+ show +
283
284
285
286
287
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ static void UniversalPrintCharArray( const CharType* begin, size_t len, ostream* os) {
+ show +
288
289
290
291
292
293
294
295
296
297
// The code // const char kFoo[] = "foo"; // generates an array of 4, not 3, elements, with the last one being '\0'. // // Therefore when printing a char array, we don't print the last element if // it's '\0', such that the output matches the string literal as it's // written in the source code. if (len > 0 && begin[len - 1] == '\0') { PrintCharsAsStringTo(begin, len - 1, os); return;

[CVE-2020-0470_1.diff] gtest-printers.cc #11
+ // Remember if any characters required hex escaping. + if (is_previous_hex) { + print_format = kHexEscape; + } + return print_format; -GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ -GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ -GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ -static void UniversalPrintCharArray( - const CharType* begin, size_t len, ostream* os) { +GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ + GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_ + GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ static void + UniversalPrintCharArray(const CharType *begin, size_t len, + ostream *os) {
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest-printers.cc
276
277
278
279
280
281
282
283
284
285
*os << "\" " << kQuoteBegin; } is_previous_hex = PrintAsStringLiteralTo(cur, os) == kHexEscape; } *os << "\""; } // Prints a (const) char/wchar_t array of 'len' elements, starting at address // 'begin'. CharType must be either char or wchar_t. template <typename CharType>
+ show +
286
287
288
289
290
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ static void UniversalPrintCharArray( const CharType* begin, size_t len, ostream* os) {
+ show +
291
292
293
294
295
296
297
298
299
300
// The code // const char kFoo[] = "foo"; // generates an array of 4, not 3, elements, with the last one being '\0'. // // Therefore when printing a char array, we don't print the last element if // it's '\0', such that the output matches the string literal as it's // written in the source code. if (len > 0 && begin[len - 1] == '\0') { PrintCharsAsStringTo(begin, len - 1, os); return;
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest-printers.cc
281
282
283
284
285
286
287
288
289
290
print_format = kHexEscape; } } *os << "\""; return print_format; } // Prints a (const) char/wchar_t array of 'len' elements, starting at address // 'begin'. CharType must be either char or wchar_t. template <typename CharType>
+ show +
291
292
293
294
295
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ static void UniversalPrintCharArray( const CharType* begin, size_t len, ostream* os) {
+ show +
296
297
298
299
300
301
302
303
304
305
// The code // const char kFoo[] = "foo"; // generates an array of 4, not 3, elements, with the last one being '\0'. // // Therefore when printing a char array, we don't print the last element if // it's '\0', such that the output matches the string literal as it's // written in the source code. if (len > 0 && begin[len - 1] == '\0') { PrintCharsAsStringTo(begin, len - 1, os); return;
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
*os << "\" " << kQuoteBegin; } is_previous_hex = PrintAsStringLiteralTo(cur, os) == kHexEscape; } *os << "\""; } // Prints a (const) char/wchar_t array of 'len' elements, starting at address // 'begin'. CharType must be either char or wchar_t. template <typename CharType>
+ show +
10093
10094
10095
10096
10097
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ static void UniversalPrintCharArray( const CharType* begin, size_t len, ostream* os) {
+ show +
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
// The code // const char kFoo[] = "foo"; // generates an array of 4, not 3, elements, with the last one being '\0'. // // Therefore when printing a char array, we don't print the last element if // it's '\0', such that the output matches the string literal as it's // written in the source code. if (len > 0 && begin[len - 1] == '\0') { PrintCharsAsStringTo(begin, len - 1, os); return;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest-printers.cc
282
283
284
285
286
287
288
289
290
291
print_format = kHexEscape; } } *os << "\""; return print_format; } // Prints a (const) char/wchar_t array of 'len' elements, starting at address // 'begin'. CharType must be either char or wchar_t. template <typename CharType>
+ show +
292
293
294
295
296
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ static void UniversalPrintCharArray( const CharType* begin, size_t len, ostream* os) {
+ show +
297
298
299
300
301
302
303
304
305
306
// The code // const char kFoo[] = "foo"; // generates an array of 4, not 3, elements, with the last one being '\0'. // // Therefore when printing a char array, we don't print the last element if // it's '\0', such that the output matches the string literal as it's // written in the source code. if (len > 0 && begin[len - 1] == '\0') { PrintCharsAsStringTo(begin, len - 1, os); return;
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest-printers.cc
273
274
275
276
277
278
279
280
281
282
*os << "\" " << kQuoteBegin; } is_previous_hex = PrintAsStringLiteralTo(cur, os) == kHexEscape; } *os << "\""; } // Prints a (const) char/wchar_t array of 'len' elements, starting at address // 'begin'. CharType must be either char or wchar_t. template <typename CharType>
+ show +
283
284
285
286
287
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ static void UniversalPrintCharArray( const CharType* begin, size_t len, ostream* os) {
+ show +
288
289
290
291
292
293
294
295
296
297
// The code // const char kFoo[] = "foo"; // generates an array of 4, not 3, elements, with the last one being '\0'. // // Therefore when printing a char array, we don't print the last element if // it's '\0', such that the output matches the string literal as it's // written in the source code. if (len > 0 && begin[len - 1] == '\0') { PrintCharsAsStringTo(begin, len - 1, os); return;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest-printers.cc
273
274
275
276
277
278
279
280
281
282
*os << "\" " << kQuoteBegin; } is_previous_hex = PrintAsStringLiteralTo(cur, os) == kHexEscape; } *os << "\""; } // Prints a (const) char/wchar_t array of 'len' elements, starting at address // 'begin'. CharType must be either char or wchar_t. template <typename CharType>
+ show +
283
284
285
286
287
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ static void UniversalPrintCharArray( const CharType* begin, size_t len, ostream* os) {
+ show +
288
289
290
291
292
293
294
295
296
297
// The code // const char kFoo[] = "foo"; // generates an array of 4, not 3, elements, with the last one being '\0'. // // Therefore when printing a char array, we don't print the last element if // it's '\0', such that the output matches the string literal as it's // written in the source code. if (len > 0 && begin[len - 1] == '\0') { PrintCharsAsStringTo(begin, len - 1, os); return;

[CVE-2020-0478_1.diff] gtest.cc #46
- const std::vector<std::string> lhs_lines = - SplitEscapedString(lhs_value); - const std::vector<std::string> rhs_lines = - SplitEscapedString(rhs_value); + const std::vector<std::string> lhs_lines = SplitEscapedString(lhs_value); + const std::vector<std::string> rhs_lines = SplitEscapedString(rhs_value);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest.cc
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
msg << "\n " << rhs_expression; if (rhs_value != rhs_expression) { msg << "\n Which is: " << rhs_value; } if (ignoring_case) { msg << "\nIgnoring case"; } if (!lhs_value.empty() && !rhs_value.empty()) {
+ show +
1331
1332
1333
1334
const std::vector<std::string> lhs_lines = SplitEscapedString(lhs_value); const std::vector<std::string> rhs_lines = SplitEscapedString(rhs_value);
+ show +
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
if (lhs_lines.size() > 1 || rhs_lines.size() > 1) { msg << "\nWith diff:\n" << edit_distance::CreateUnifiedDiff(lhs_lines, rhs_lines); } } return AssertionFailure() << msg; } // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest.cc
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
msg << "\n " << rhs_expression; if (rhs_value != rhs_expression) { msg << "\n Which is: " << rhs_value; } if (ignoring_case) { msg << "\nIgnoring case"; } if (!lhs_value.empty() && !rhs_value.empty()) {
+ show +
1354
1355
1356
1357
const std::vector<std::string> lhs_lines = SplitEscapedString(lhs_value); const std::vector<std::string> rhs_lines = SplitEscapedString(rhs_value);
+ show +
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
if (lhs_lines.size() > 1 || rhs_lines.size() > 1) { msg << "\nWith diff:\n" << edit_distance::CreateUnifiedDiff(lhs_lines, rhs_lines); } } return AssertionFailure() << msg; } // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
msg << "\nTo be equal to: " << rhs_expression; if (rhs_value != rhs_expression) { msg << "\n Which is: " << rhs_value; } if (ignoring_case) { msg << "\nIgnoring case"; } if (!lhs_value.empty() && !rhs_value.empty()) {
+ show +
2780
2781
2782
2783
const std::vector<std::string> lhs_lines = SplitEscapedString(lhs_value); const std::vector<std::string> rhs_lines = SplitEscapedString(rhs_value);
+ show +
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
if (lhs_lines.size() > 1 || rhs_lines.size() > 1) { msg << "\nWith diff:\n" << edit_distance::CreateUnifiedDiff(lhs_lines, rhs_lines); } } return AssertionFailure() << msg; } // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest.cc
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
msg << "\n " << rhs_expression; if (rhs_value != rhs_expression) { msg << "\n Which is: " << rhs_value; } if (ignoring_case) { msg << "\nIgnoring case"; } if (!lhs_value.empty() && !rhs_value.empty()) {
+ show +
1377
1378
1379
1380
const std::vector<std::string> lhs_lines = SplitEscapedString(lhs_value); const std::vector<std::string> rhs_lines = SplitEscapedString(rhs_value);
+ show +
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
if (lhs_lines.size() > 1 || rhs_lines.size() > 1) { msg << "\nWith diff:\n" << edit_distance::CreateUnifiedDiff(lhs_lines, rhs_lines); } } return AssertionFailure() << msg; } // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest.cc
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
msg << "\nTo be equal to: " << rhs_expression; if (rhs_value != rhs_expression) { msg << "\n Which is: " << rhs_value; } if (ignoring_case) { msg << "\nIgnoring case"; } if (!lhs_value.empty() && !rhs_value.empty()) {
+ show +
1332
1333
1334
1335
const std::vector<std::string> lhs_lines = SplitEscapedString(lhs_value); const std::vector<std::string> rhs_lines = SplitEscapedString(rhs_value);
+ show +
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
if (lhs_lines.size() > 1 || rhs_lines.size() > 1) { msg << "\nWith diff:\n" << edit_distance::CreateUnifiedDiff(lhs_lines, rhs_lines); } } return AssertionFailure() << msg; } // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest.cc
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
msg << "\nTo be equal to: " << rhs_expression; if (rhs_value != rhs_expression) { msg << "\n Which is: " << rhs_value; } if (ignoring_case) { msg << "\nIgnoring case"; } if (!lhs_value.empty() && !rhs_value.empty()) {
+ show +
1333
1334
1335
1336
const std::vector<std::string> lhs_lines = SplitEscapedString(lhs_value); const std::vector<std::string> rhs_lines = SplitEscapedString(rhs_value);
+ show +
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
if (lhs_lines.size() > 1 || rhs_lines.size() > 1) { msg << "\nWith diff:\n" << edit_distance::CreateUnifiedDiff(lhs_lines, rhs_lines); } } return AssertionFailure() << msg; } // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.

[CVE-2020-0470_1.diff] gtest.cc #46
- const std::vector<std::string> lhs_lines = - SplitEscapedString(lhs_value); - const std::vector<std::string> rhs_lines = - SplitEscapedString(rhs_value); + const std::vector<std::string> lhs_lines = SplitEscapedString(lhs_value); + const std::vector<std::string> rhs_lines = SplitEscapedString(rhs_value);
/media/esteban/ACOS/ResurrectionX/prebuilts/ndk/r18/sources/third_party/googletest/src/gtest.cc
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
msg << "\n " << rhs_expression; if (rhs_value != rhs_expression) { msg << "\n Which is: " << rhs_value; } if (ignoring_case) { msg << "\nIgnoring case"; } if (!lhs_value.empty() && !rhs_value.empty()) {
+ show +
1331
1332
1333
1334
const std::vector<std::string> lhs_lines = SplitEscapedString(lhs_value); const std::vector<std::string> rhs_lines = SplitEscapedString(rhs_value);
+ show +
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
if (lhs_lines.size() > 1 || rhs_lines.size() > 1) { msg << "\nWith diff:\n" << edit_distance::CreateUnifiedDiff(lhs_lines, rhs_lines); } } return AssertionFailure() << msg; } // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
/media/esteban/ACOS/ResurrectionX/external/googletest/googletest/src/gtest.cc
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
msg << "\n " << rhs_expression; if (rhs_value != rhs_expression) { msg << "\n Which is: " << rhs_value; } if (ignoring_case) { msg << "\nIgnoring case"; } if (!lhs_value.empty() && !rhs_value.empty()) {
+ show +
1354
1355
1356
1357
const std::vector<std::string> lhs_lines = SplitEscapedString(lhs_value); const std::vector<std::string> rhs_lines = SplitEscapedString(rhs_value);
+ show +
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
if (lhs_lines.size() > 1 || rhs_lines.size() > 1) { msg << "\nWith diff:\n" << edit_distance::CreateUnifiedDiff(lhs_lines, rhs_lines); } } return AssertionFailure() << msg; } // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest-all.cc
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
msg << "\nTo be equal to: " << rhs_expression; if (rhs_value != rhs_expression) { msg << "\n Which is: " << rhs_value; } if (ignoring_case) { msg << "\nIgnoring case"; } if (!lhs_value.empty() && !rhs_value.empty()) {
+ show +
2780
2781
2782
2783
const std::vector<std::string> lhs_lines = SplitEscapedString(lhs_value); const std::vector<std::string> rhs_lines = SplitEscapedString(rhs_value);
+ show +
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
if (lhs_lines.size() > 1 || rhs_lines.size() > 1) { msg << "\nWith diff:\n" << edit_distance::CreateUnifiedDiff(lhs_lines, rhs_lines); } } return AssertionFailure() << msg; } // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/googletest/src/src/gtest.cc
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
msg << "\n " << rhs_expression; if (rhs_value != rhs_expression) { msg << "\n Which is: " << rhs_value; } if (ignoring_case) { msg << "\nIgnoring case"; } if (!lhs_value.empty() && !rhs_value.empty()) {
+ show +
1377
1378
1379
1380
const std::vector<std::string> lhs_lines = SplitEscapedString(lhs_value); const std::vector<std::string> rhs_lines = SplitEscapedString(rhs_value);
+ show +
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
if (lhs_lines.size() > 1 || rhs_lines.size() > 1) { msg << "\nWith diff:\n" << edit_distance::CreateUnifiedDiff(lhs_lines, rhs_lines); } } return AssertionFailure() << msg; } // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
/media/esteban/ACOS/ResurrectionX/external/mesa3d/src/gtest/src/gtest.cc
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
msg << "\nTo be equal to: " << rhs_expression; if (rhs_value != rhs_expression) { msg << "\n Which is: " << rhs_value; } if (ignoring_case) { msg << "\nIgnoring case"; } if (!lhs_value.empty() && !rhs_value.empty()) {
+ show +
1332
1333
1334
1335
const std::vector<std::string> lhs_lines = SplitEscapedString(lhs_value); const std::vector<std::string> rhs_lines = SplitEscapedString(rhs_value);
+ show +
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
if (lhs_lines.size() > 1 || rhs_lines.size() > 1) { msg << "\nWith diff:\n" << edit_distance::CreateUnifiedDiff(lhs_lines, rhs_lines); } } return AssertionFailure() << msg; } // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest.cc
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
msg << "\nTo be equal to: " << rhs_expression; if (rhs_value != rhs_expression) { msg << "\n Which is: " << rhs_value; } if (ignoring_case) { msg << "\nIgnoring case"; } if (!lhs_value.empty() && !rhs_value.empty()) {
+ show +
1333
1334
1335
1336
const std::vector<std::string> lhs_lines = SplitEscapedString(lhs_value); const std::vector<std::string> rhs_lines = SplitEscapedString(rhs_value);
+ show +
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
if (lhs_lines.size() > 1 || rhs_lines.size() > 1) { msg << "\nWith diff:\n" << edit_distance::CreateUnifiedDiff(lhs_lines, rhs_lines); } } return AssertionFailure() << msg; } // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.

[CVE-2023-40093_1.diff] BUILD.gn #2
+ cflags_cc = [] - defines = [ - "PNG_PREFIX", - "PNG_USE_READ_MACROS", - ] + defines = []
/media/esteban/ACOS/ResurrectionX/external/pdfium/samples/BUILD.gn
8
9
10
11
12
13
14
15
16
17
group("samples") { testonly = true deps = [ ":pdfium_test", ] } config("pdfium_samples_config") { cflags = [] ldflags = []
+ show +
18
19
20
21
defines = [ "PNG_PREFIX", "PNG_USE_READ_MACROS", ]
+ show +
22
23
24
25
26
27
28
29
30
31
include_dirs = [ ".." ] if (pdf_enable_v8) { defines += [ "PDF_ENABLE_V8" ] } if (pdf_enable_xfa) { defines += [ "PDF_ENABLE_XFA" ] } if (pdf_use_skia) { defines += [ "PDF_ENABLE_SKIA" ] }
/media/esteban/ACOS/ResurrectionX/external/pdfium/testing/libfuzzer/BUILD.gn
1
2
3
4
5
6
7
8
9
# Copyright 2016 The PDFium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import("../../pdfium.gni") config("libfuzzer_config") { configs = [ "../..:pdfium_core_config" ]
+ show +
10
11
12
13
defines = [ "PNG_PREFIX", "PNG_USE_READ_MACROS", ]
+ show +
14
15
16
17
18
19
20
21
22
23
include_dirs = [ "../.." ] if (pdf_enable_v8) { defines += [ "PDF_ENABLE_V8" ] } if (pdf_enable_xfa) { defines += [ "PDF_ENABLE_XFA" ] } } group("libfuzzer") {

[CVE-2021-0536_1.diff] WiFiInstaller.java #3
- mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE); - mPasspointConfig = ConfigParser.parsePasspointConfig(mimeType, data); - dropFile(Uri.parse(uriString), getApplicationContext()); - - if (mPasspointConfig == null) { - Log.w(TAG, "failed to build passpoint configuration"); - doNotInstall = true; - } else if (mPasspointConfig.getHomeSp() == null) { - Log.w(TAG, "Passpoint profile missing HomeSP information"); - doNotInstall = true; + // Make sure that the input is valid + if (data == null || data.length == 0 || TextUtils.isEmpty(uriString)) { + Log.e(TAG, "Invalid inputs"); + return; + + // Verify MIME type before parsing + if (!TextUtils.equals(mimeType, TYPE_WIFI_CONFIG)) { + Log.e(TAG, "Unexpected MIME type: " + mimeType); + EventLog.writeEvent(0x534e4554, "176756691", -1, "Invalid mime-type"); + return; + } + + mPasspointConfig = ConfigParser.parsePasspointConfig(mimeType, data); + if (mPasspointConfig == null) { + Log.e(TAG, "Failed to build Passpoint configuration"); + EventLog.writeEvent(0x534e4554, "176756691", -1, "Invalid data in file " + + uriString); + return; + } + if (mPasspointConfig.getHomeSp() == null) { + Log.e(TAG, "Passpoint profile missing HomeSP information"); + } else { + // Passpoint configuration parsed successfully and valid. Mark to be installed. + mIsPasspointConfigurationValid = true; + } + // Delete the file only if the Passpoint configuration was parsed successfully + dropFile(Uri.parse(uriString), getApplicationContext());
/media/esteban/ACOS/ResurrectionX/packages/apps/CertInstaller/src/com/android/certinstaller/WiFiInstaller.java
38
39
40
41
42
43
44
45
46
47
super.onCreate(savedStates); Bundle bundle = getIntent().getExtras(); String uriString = bundle.getString(CertInstallerMain.WIFI_CONFIG_FILE); String mimeType = bundle.getString(CertInstallerMain.WIFI_CONFIG); byte[] data = bundle.getByteArray(CertInstallerMain.WIFI_CONFIG_DATA); Log.d(TAG, "WiFi data for " + CertInstallerMain.WIFI_CONFIG + ": " + mimeType + " is " + (data != null ? data.length : "-"));
+ show +
48
49
50
51
52
53
54
55
56
57
mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE); mPasspointConfig = ConfigParser.parsePasspointConfig(mimeType, data); dropFile(Uri.parse(uriString), getApplicationContext()); if (mPasspointConfig == null) { Log.w(TAG, "failed to build passpoint configuration"); doNotInstall = true; } else if (mPasspointConfig.getHomeSp() == null) { Log.w(TAG, "Passpoint profile missing HomeSP information"); doNotInstall = true;
+ show +
58
59
60
61
62
63
64
65
66
67
} } @Override protected void onResume() { super.onResume(); createMainDialog(); } /**

[CVE-2023-21035_1.diff] BackupHelper.java #15
+ /** Signing certificate information for a backed up package. */ + private static class BackupSigningInfoState { + @NonNull + private final Set<byte[]> mCurrentCertDigests; + @NonNull + private final Set<byte[]> mPastCertDigests; + + private BackupSigningInfoState(@NonNull Set<byte[]> currentCertDigests, + @NonNull Set<byte[]> pastCertDigests) { + mCurrentCertDigests = currentCertDigests; + mPastCertDigests = pastCertDigests; + } + + /** + * Write this state as XML. + * + * @param serializer the file to write to + */ + void writeAsXml(@NonNull XmlSerializer serializer) throws IOException { + serializer.startTag(null, TAG_SIGNING_INFO); + + for (byte[] digest : mCurrentCertDigests) { + serializer.startTag(null, TAG_CURRENT_CERTIFICATE); + serializer.attribute( + null, ATTR_CERTIFICATE_DIGEST, + Base64.encodeToString(digest, Base64.NO_WRAP)); + serializer.endTag(null, TAG_CURRENT_CERTIFICATE); + } + + for (byte[] digest : mPastCertDigests) { + serializer.startTag(null, TAG_PAST_CERTIFICATE); + serializer.attribute( + null, ATTR_CERTIFICATE_DIGEST, + Base64.encodeToString(digest, Base64.NO_WRAP)); + serializer.endTag(null, TAG_PAST_CERTIFICATE); + } + + serializer.endTag(null, TAG_SIGNING_INFO); + } + + /** + * Parse the signing information state from XML. + * + * @param parser the data to read + * + * @return the signing information state + */ + @NonNull + static BackupSigningInfoState parseFromXml(@NonNull XmlPullParser parser) + throws IOException, XmlPullParserException { + Set<byte[]> currentCertDigests = new HashSet<>(); + Set<byte[]> pastCertDigests = new HashSet<>(); + + while (true) { + switch (parser.next()) { + case START_TAG: + switch (parser.getName()) { + case TAG_CURRENT_CERTIFICATE: + String currentCertDigest = + parser.getAttributeValue( + null, ATTR_CERTIFICATE_DIGEST); + if (currentCertDigest == null) { + throw new XmlPullParserException( + "Found " + TAG_CURRENT_CERTIFICATE + " without " + + ATTR_CERTIFICATE_DIGEST); + } + currentCertDigests.add( + Base64.decode(currentCertDigest, Base64.NO_WRAP)); + skipToEndOfTag(parser); + break; + case TAG_PAST_CERTIFICATE: + String pastCertDigest = + parser.getAttributeValue( + null, ATTR_CERTIFICATE_DIGEST); + if (pastCertDigest == null) { + throw new XmlPullParserException( + "Found " + TAG_PAST_CERTIFICATE + " without " + + ATTR_CERTIFICATE_DIGEST); + } + pastCertDigests.add( + Base64.decode(pastCertDigest, Base64.NO_WRAP)); + skipToEndOfTag(parser); + break; + default: + Log.w(LOG_TAG, "Found unexpected tag " + parser.getName()); + skipToEndOfTag(parser); + } + + break; + case END_TAG: + return new BackupSigningInfoState( + currentCertDigests, + pastCertDigests); + default: + throw new XmlPullParserException("Could not parse signing info"); + } + } + } + + /** + * Construct the signing information state from a {@link SigningInfo} instance. + * + * @param signingInfo the {@link SigningInfo} instance + * + * @return the state + */ + @NonNull + static BackupSigningInfoState fromSigningInfo(@NonNull SigningInfo signingInfo) { + Set<byte[]> currentCertDigests = new HashSet<>(); + Set<byte[]> pastCertDigests = new HashSet<>(); + + Signature[] apkContentsSigners = signingInfo.getApkContentsSigners(); + for (int i = 0; i < apkContentsSigners.length; i++) { + currentCertDigests.add( + computeSha256DigestBytes(apkContentsSigners[i].toByteArray())); + } + + if (signingInfo.hasPastSigningCertificates()) { + Signature[] signingCertificateHistory = signingInfo.getSigningCertificateHistory(); + for (int i = 0; i < signingCertificateHistory.length; i++) { + pastCertDigests.add( + computeSha256DigestBytes(signingCertificateHistory[i].toByteArray())); + } + } + + return new BackupSigningInfoState(currentCertDigests, pastCertDigests); + } + } + - final @NonNull String mPackageName; - private final @NonNull ArrayList<BackupPermissionState> mPermissionsToRestore; + @NonNull + final String mPackageName; + @NonNull + private final ArrayList<BackupPermissionState> mPermissionsToRestore; + @Nullable + private final BackupSigningInfoState mBackupSigningInfoState; - private BackupPackageState(@NonNull String packageName, - @NonNull ArrayList<BackupPermissionState> permissionsToRestore) { + private BackupPackageState( + @NonNull String packageName, + @NonNull ArrayList<BackupPermissionState> permissionsToRestore, + @Nullable BackupSigningInfoState backupSigningInfoState) { + mBackupSigningInfoState = backupSigningInfoState;
/media/esteban/ACOS/ResurrectionX/packages/apps/PermissionController/src/com/android/packageinstaller/permission/service/BackupHelper.java
590
591
592
593
594
595
596
597
598
599
perm.setUserSet(mIsUserSet); } } } /** * State that needs to be backed up for a package. */ private static class BackupPackageState {
+ show +
600
601
602
603
604
final @NonNull String mPackageName; private final @NonNull ArrayList<BackupPermissionState> mPermissionsToRestore; private BackupPackageState(@NonNull String packageName, @NonNull ArrayList<BackupPermissionState> permissionsToRestore) {
+ show +
605
606
607
608
609
610
611
612
613
614
mPackageName = packageName; mPermissionsToRestore = permissionsToRestore; } /** * Parse a package state from XML. * * @param parser The data to read * @param context a context to use * @param backupPlatformVersion The platform version the backup was created on

[CVE-2021-0952_1.diff] PhotoSelectionHandler.java #3
+ intent.setPackage(intentHandler.activityInfo.packageName); - private boolean hasIntentHandler(Intent intent) { - final List<ResolveInfo> resolveInfo = mContext.getPackageManager() - .queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); - return resolveInfo != null && resolveInfo.size() > 0; + private ResolveInfo getIntentHandler(Intent intent) { + final List<ResolveInfo> resolveInfos = mContext.getPackageManager() + .queryIntentActivities(intent, + PackageManager.MATCH_DEFAULT_ONLY | PackageManager.MATCH_SYSTEM_ONLY); + return (resolveInfos != null && resolveInfos.size() > 0) ? resolveInfos.get(0) : null;
/media/esteban/ACOS/ResurrectionX/packages/apps/Contacts/src/com/android/contacts/detail/PhotoSelectionHandler.java
315
316
317
318
319
320
321
322
323
324
/** * Constructs an intent for picking a photo from Gallery, and returning the bitmap. */ private Intent getPhotoPickIntent(Uri outputUri) { final Intent intent = new Intent(Intent.ACTION_PICK, null); intent.setType("image/*"); ContactPhotoUtils.addPhotoPickerExtras(intent, outputUri); return intent; }
+ show +
325
326
327
328
private boolean hasIntentHandler(Intent intent) { final List<ResolveInfo> resolveInfo = mContext.getPackageManager() .queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); return resolveInfo != null && resolveInfo.size() > 0;
+ show +
329
330
331
332
333
334
335
336
337
338
} /** * Constructs an intent for image cropping. */ private Intent getCropImageIntent(Uri inputUri, Uri outputUri) { Intent intent = new Intent("com.android.camera.action.CROP"); intent.setDataAndType(inputUri, "image/*"); ContactPhotoUtils.addPhotoPickerExtras(intent, outputUri); ContactPhotoUtils.addCropExtras(intent, mPhotoPickSize);

[CVE-2021-0952_1.diff] AttachPhotoActivity.java #3
+ intent.setPackage(intentHandler.activityInfo.packageName); - private boolean hasIntentHandler(Intent intent) { - final List<ResolveInfo> resolveInfo = getPackageManager() - .queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); - return resolveInfo != null && resolveInfo.size() > 0; + private ResolveInfo getIntentHandler(Intent intent) { + final List<ResolveInfo> resolveInfos = getPackageManager() + .queryIntentActivities(intent, + PackageManager.MATCH_DEFAULT_ONLY | PackageManager.MATCH_SYSTEM_ONLY); + return (resolveInfos != null && resolveInfos.size() > 0) ? resolveInfos.get(0) : null;
/media/esteban/ACOS/ResurrectionX/packages/apps/Contacts/src/com/android/contacts/activities/AttachPhotoActivity.java
230
231
232
233
234
235
236
237
238
239
} loadContact(mContactUri, new Listener() { @Override public void onContactLoaded(Contact contact) { saveContact(contact); } }); } }
+ show +
240
241
242
243
private boolean hasIntentHandler(Intent intent) { final List<ResolveInfo> resolveInfo = getPackageManager() .queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); return resolveInfo != null && resolveInfo.size() > 0;
+ show +
244
245
246
247
248
249
250
251
252
253
} // TODO: consider moving this to ContactLoader, especially if we keep adding similar // code elsewhere (ViewNotificationService is another case). The only concern is that, // although this is convenient, it isn't quite as robust as using LoaderManager... for // instance, the loader doesn't persist across Activity restarts. private void loadContact(Uri contactUri, final Listener listener) { final ContactLoader loader = new ContactLoader(this, contactUri, true); loader.registerListener(0, new OnLoadCompleteListener<Contact>() { @Override

[CVE-2021-39707_1.diff] AppRestrictionsFragment.java #4
- // Activity can be started if intent resolves to multiple activities - List<ResolveInfo> resolveInfos = AppRestrictionsFragment.this.mPackageManager - .queryIntentActivities(intent, 0 /* no flags */); - if (resolveInfos.size() != 1) { - return; + ResolveInfo resolveInfo = mPackageManager.resolveActivity( + intent, PackageManager.MATCH_DEFAULT_ONLY); + + if (resolveInfo == null) { + throw new ActivityNotFoundException("No result for resolving " + intent); - ActivityInfo activityInfo = resolveInfos.get(0).activityInfo; + ActivityInfo activityInfo = resolveInfo.activityInfo; + " is not allowed to start activity " + intent);
/media/esteban/ACOS/ResurrectionX/packages/apps/TvSettings/Settings/src/com/android/tv/settings/users/AppRestrictionsFragment.java
552
553
554
555
556
557
558
559
560
561
} } } private void assertSafeToStartCustomActivity(Intent intent, String packageName) { // Activity can be started if it belongs to the same app if (intent.getPackage() != null && intent.getPackage().equals(packageName)) { return; } // Activity can be started if intent resolves to multiple activities
+ show +
562
563
564
565
566
567
568
List<ResolveInfo> resolveInfos = AppRestrictionsFragment.this.mPackageManager .queryIntentActivities(intent, 0 /* no flags */); if (resolveInfos.size() != 1) { return; } // Prevent potential privilege escalation ActivityInfo activityInfo = resolveInfos.get(0).activityInfo;
+ show +
569
570
571
572
573
574
575
576
577
578
if (!packageName.equals(activityInfo.packageName)) { throw new SecurityException("Application " + packageName + " is not allowed to start activity " + intent); } } @Override public boolean onPreferenceTreeClick(Preference preference) { if (preference instanceof AppRestrictionsPreference) { AppRestrictionsPreference pref = (AppRestrictionsPreference) preference;
/media/esteban/ACOS/ResurrectionX/packages/apps/Settings/src/com/android/settings/users/AppRestrictionsFragment.java
643
644
645
646
647
648
649
650
651
652
} } } private void assertSafeToStartCustomActivity(Intent intent) { // Activity can be started if it belongs to the same app if (intent.getPackage() != null && intent.getPackage().equals(packageName)) { return; } // Activity can be started if intent resolves to multiple activities
+ show +
653
654
655
656
657
658
659
List<ResolveInfo> resolveInfos = AppRestrictionsFragment.this.mPackageManager .queryIntentActivities(intent, 0 /* no flags */); if (resolveInfos.size() != 1) { return; } // Prevent potential privilege escalation ActivityInfo activityInfo = resolveInfos.get(0).activityInfo;
+ show +
660
661
662
663
664
665
666
667
668
669
if (!packageName.equals(activityInfo.packageName)) { throw new SecurityException("Application " + packageName + " is not allowed to start activity " + intent); } } } private void onRestrictionsReceived(AppRestrictionsPreference preference, ArrayList<RestrictionEntry> restrictions) { // Remove any earlier restrictions
/media/esteban/ACOS/ResurrectionX/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/users/AppRestrictionsFragment.java
643
644
645
646
647
648
649
650
651
652
} } } private void assertSafeToStartCustomActivity(Intent intent) { // Activity can be started if it belongs to the same app if (intent.getPackage() != null && intent.getPackage().equals(packageName)) { return; } // Activity can be started if intent resolves to multiple activities
+ show +
653
654
655
656
657
658
659
List<ResolveInfo> resolveInfos = AppRestrictionsFragment.this.mPackageManager .queryIntentActivities(intent, 0 /* no flags */); if (resolveInfos.size() != 1) { return; } // Prevent potential privilege escalation ActivityInfo activityInfo = resolveInfos.get(0).activityInfo;
+ show +
660
661
662
663
664
665
666
667
668
669
if (!packageName.equals(activityInfo.packageName)) { throw new SecurityException("Application " + packageName + " is not allowed to start activity " + intent); } } } private void onRestrictionsReceived(AppRestrictionsPreference preference, ArrayList<RestrictionEntry> restrictions) { // Remove any earlier restrictions

[CVE-2023-21141_1.diff] Receiver.java #3
+import android.os.UserManager; + } else if (Intent.ACTION_USER_FOREGROUND.equals(intent.getAction())) { + boolean developerOptionsEnabled = (1 == + Settings.Global.getInt(context.getContentResolver(), + Settings.Global.DEVELOPMENT_SETTINGS_ENABLED , 0)); + boolean isAdminUser = context.getSystemService(UserManager.class).isAdminUser(); + updateStorageProvider(context, developerOptionsEnabled && isAdminUser); - - ComponentName name = new ComponentName(context, - StorageProvider.class); - context.getPackageManager().setComponentEnabledSetting(name, - developerOptionsEnabled - ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED - : PackageManager.COMPONENT_ENABLED_STATE_DISABLED, - PackageManager.DONT_KILL_APP); + boolean isAdminUser = context.getSystemService(UserManager.class) + .isAdminUser(); + updateStorageProvider(context, developerOptionsEnabled && isAdminUser);
/media/esteban/ACOS/ResurrectionX/packages/apps/Traceur/src/com/google/android/traceur/Receiver.java
187
188
189
190
191
192
193
194
195
196
ContentObserver developerOptionsObserver = new ContentObserver(new Handler()) { @Override public void onChange(boolean selfChange) { super.onChange(selfChange); boolean developerOptionsEnabled = (1 == Settings.Global.getInt(context.getContentResolver(), Settings.Global.DEVELOPMENT_SETTINGS_ENABLED , 0));
+ show +
197
198
199
200
201
202
203
ComponentName name = new ComponentName(context, StorageProvider.class); context.getPackageManager().setComponentEnabledSetting(name, developerOptionsEnabled ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED : PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
+ show +
204
205
206
207
208
209
210
211
212
213
if (!developerOptionsEnabled) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); prefs.edit().putBoolean( context.getString(R.string.pref_key_quick_setting), false) .commit(); updateQuickSettings(context); } }

[CVE-2023-21142_1.diff] Receiver.java #3
+import android.os.UserManager; + } else if (Intent.ACTION_USER_FOREGROUND.equals(intent.getAction())) { + boolean developerOptionsEnabled = (1 == + Settings.Global.getInt(context.getContentResolver(), + Settings.Global.DEVELOPMENT_SETTINGS_ENABLED , 0)); + boolean isAdminUser = context.getSystemService(UserManager.class).isAdminUser(); + updateStorageProvider(context, developerOptionsEnabled && isAdminUser); - - ComponentName name = new ComponentName(context, - StorageProvider.class); - context.getPackageManager().setComponentEnabledSetting(name, - developerOptionsEnabled - ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED - : PackageManager.COMPONENT_ENABLED_STATE_DISABLED, - PackageManager.DONT_KILL_APP); + boolean isAdminUser = context.getSystemService(UserManager.class) + .isAdminUser(); + updateStorageProvider(context, developerOptionsEnabled && isAdminUser);
/media/esteban/ACOS/ResurrectionX/packages/apps/Traceur/src/com/google/android/traceur/Receiver.java
187
188
189
190
191
192
193
194
195
196
ContentObserver developerOptionsObserver = new ContentObserver(new Handler()) { @Override public void onChange(boolean selfChange) { super.onChange(selfChange); boolean developerOptionsEnabled = (1 == Settings.Global.getInt(context.getContentResolver(), Settings.Global.DEVELOPMENT_SETTINGS_ENABLED , 0));
+ show +
197
198
199
200
201
202
203
ComponentName name = new ComponentName(context, StorageProvider.class); context.getPackageManager().setComponentEnabledSetting(name, developerOptionsEnabled ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED : PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
+ show +
204
205
206
207
208
209
210
211
212
213
if (!developerOptionsEnabled) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); prefs.edit().putBoolean( context.getString(R.string.pref_key_quick_setting), false) .commit(); updateQuickSettings(context); } }

[CVE-2024-49742_1.diff] NotificationAccessConfirmationActivity.java #4
+import java.util.List; + + // Check NLS service info. + String requiredPermission = Manifest.permission.BIND_NOTIFICATION_LISTENER_SERVICE; + Intent NLSIntent = new Intent(NotificationListenerService.SERVICE_INTERFACE); + List<ResolveInfo> matchedServiceList = getPackageManager().queryIntentServicesAsUser( + NLSIntent, /* flags */ 0, mUserId); + boolean hasNLSIntentFilter = false; + for (ResolveInfo service : matchedServiceList) { + if (service.serviceInfo.packageName.equals(mComponentName.getPackageName())) { + if (!requiredPermission.equals(service.serviceInfo.permission)) { + Slog.e(LOG_TAG, "Service " + mComponentName + " lacks permission " + + requiredPermission); + finish(); + return; + } + hasNLSIntentFilter = true; + break; + } + } + if (!hasNLSIntentFilter) { + Slog.e(LOG_TAG, "Service " + mComponentName + " lacks an intent-filter action " + + "for android.service.notification.NotificationListenerService."); + finish(); + return; + } + - String requiredPermission = Manifest.permission.BIND_NOTIFICATION_LISTENER_SERVICE; - try { - ServiceInfo serviceInfo = getPackageManager().getServiceInfo(mComponentName, 0); - if (!requiredPermission.equals(serviceInfo.permission)) { - Slog.e(LOG_TAG, - "Service " + mComponentName + " lacks permission " + requiredPermission); - return; - } - } catch (PackageManager.NameNotFoundException e) { - Slog.e(LOG_TAG, "Failed to get service info for " + mComponentName, e); - return; - } -
/media/esteban/ACOS/ResurrectionX/packages/apps/Settings/src/com/android/settings/notification/NotificationAccessConfirmationActivity.java
92
93
94
95
96
97
98
99
100
101
} @Override public void onPause() { getWindow().clearFlags( WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS); super.onPause(); } private void onAllow() {
+ show +
102
103
104
105
106
107
108
109
110
111
112
String requiredPermission = Manifest.permission.BIND_NOTIFICATION_LISTENER_SERVICE; try { ServiceInfo serviceInfo = getPackageManager().getServiceInfo(mComponentName, 0); if (!requiredPermission.equals(serviceInfo.permission)) { Slog.e(LOG_TAG, "Service " + mComponentName + " lacks permission " + requiredPermission); return; } } catch (PackageManager.NameNotFoundException e) { Slog.e(LOG_TAG, "Failed to get service info for " + mComponentName, e); return;
+ show +
113
114
115
116
117
118
119
120
121
122
} mNm.setNotificationListenerAccessGranted(mComponentName, true); finish(); } @Override public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { return AlertActivity.dispatchPopulateAccessibilityEvent(this, event);
/media/esteban/ACOS/ResurrectionX/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/notification/NotificationAccessConfirmationActivity.java
88
89
90
91
92
93
94
95
96
97
} @Override public void onPause() { getWindow().clearFlags( WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS); super.onPause(); } private void onAllow() {
+ show +
98
99
100
101
102
103
104
105
106
107
108
String requiredPermission = Manifest.permission.BIND_NOTIFICATION_LISTENER_SERVICE; try { ServiceInfo serviceInfo = getPackageManager().getServiceInfo(mComponentName, 0); if (!requiredPermission.equals(serviceInfo.permission)) { Slog.e(LOG_TAG, "Service " + mComponentName + " lacks permission " + requiredPermission); return; } } catch (PackageManager.NameNotFoundException e) { Slog.e(LOG_TAG, "Failed to get service info for " + mComponentName, e); return;
+ show +
109
110
111
112
113
114
115
116
117
118
} mNm.setNotificationListenerAccessGranted(mComponentName, true); finish(); } @Override public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { return AlertActivity.dispatchPopulateAccessibilityEvent(this, event);

[CVE-2021-1012_1.diff] NotificationAccessDetails.java #2
- protected void setIntentAndFinish(boolean appChanged) { - Log.i(TAG, "appChanged=" + appChanged); - Intent intent = new Intent(); - intent.putExtra(ManageApplications.APP_CHG, appChanged); - SettingsActivity sa = (SettingsActivity) getActivity(); - sa.finishPreferencePanel(Activity.RESULT_OK, intent); - } -
/media/esteban/ACOS/ResurrectionX/packages/apps/Settings/src/com/android/settings/applications/AppInfoBase.java
151
152
153
154
155
156
157
158
159
160
Log.e(TAG, "Exception when retrieving package:" + mAppEntry.info.packageName, e); } } else { Log.w(TAG, "Missing AppEntry; maybe reinstalling?"); mPackageInfo = null; } return mPackageName; }
+ show +
161
162
163
164
165
166
protected void setIntentAndFinish(boolean appChanged) { Log.i(TAG, "appChanged=" + appChanged); Intent intent = new Intent(); intent.putExtra(ManageApplications.APP_CHG, appChanged); SettingsActivity sa = (SettingsActivity) getActivity(); sa.finishPreferencePanel(Activity.RESULT_OK, intent);
+ show +
167
168
169
170
171
172
173
174
175
176
mFinishing = true; } protected void showDialogInner(int id, int moveErrorCode) { DialogFragment newFragment = MyAlertDialogFragment.newInstance(id, moveErrorCode); newFragment.setTargetFragment(this, 0); newFragment.show(getFragmentManager(), "dialog " + id); } protected abstract boolean refreshUi();
/media/esteban/ACOS/ResurrectionX/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/applications/AppInfoBase.java
151
152
153
154
155
156
157
158
159
160
Log.e(TAG, "Exception when retrieving package:" + mAppEntry.info.packageName, e); } } else { Log.w(TAG, "Missing AppEntry; maybe reinstalling?"); mPackageInfo = null; } return mPackageName; }
+ show +
161
162
163
164
165
166
protected void setIntentAndFinish(boolean appChanged) { Log.i(TAG, "appChanged=" + appChanged); Intent intent = new Intent(); intent.putExtra(ManageApplications.APP_CHG, appChanged); SettingsActivity sa = (SettingsActivity) getActivity(); sa.finishPreferencePanel(Activity.RESULT_OK, intent);
+ show +
167
168
169
170
171
172
173
174
175
176
mFinishing = true; } protected void showDialogInner(int id, int moveErrorCode) { DialogFragment newFragment = MyAlertDialogFragment.newInstance(id, moveErrorCode); newFragment.setTargetFragment(this, 0); newFragment.show(getFragmentManager(), "dialog " + id); } protected abstract boolean refreshUi();

[CVE-2023-35677_1.diff] DeviceAdminAdd.java #8
- restrictedAction.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - if (!mActionButton.isEnabled()) { - showPolicyTransparencyDialogIfRequired(); - return; - } - if (mAdding) { - addAndFinish(); - } else if (isManagedProfile(mDeviceAdmin) - && mDeviceAdmin.getComponent().equals(mDPM.getProfileOwner())) { - final int userId = UserHandle.myUserId(); - UserDialogs.createRemoveDialog(DeviceAdminAdd.this, userId, - new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - UserManager um = UserManager.get(DeviceAdminAdd.this); - um.removeUser(userId); - finish(); - } - } - ).show(); - } else if (mUninstalling) { - mDPM.uninstallPackageWithActiveAdmins(mDeviceAdmin.getPackageName()); - finish(); - } else if (!mWaitingForRemoveMsg) { - try { - // Don't allow the admin to put a dialog up in front - // of us while we interact with the user. - ActivityManager.getService().stopAppSwitches(); - } catch (RemoteException e) { - } - mWaitingForRemoveMsg = true; - mDPM.getRemoveWarning(mDeviceAdmin.getComponent(), - new RemoteCallback(new RemoteCallback.OnResultListener() { - @Override - public void onResult(Bundle result) { - CharSequence msg = result != null - ? result.getCharSequence( - DeviceAdminReceiver.EXTRA_DISABLE_WARNING) - : null; - continueRemoveAction(msg); - } - }, mHandler)); - // Don't want to wait too long. - getWindow().getDecorView().getHandler().postDelayed(new Runnable() { - @Override public void run() { - continueRemoveAction(null); - } - }, 2*1000); - } + + final View.OnClickListener restrictedActionClickListener = v -> { + if (!mActionButton.isEnabled()) { + showPolicyTransparencyDialogIfRequired(); + return; + if (mAdding) { + addAndFinish(); + } else if (isManagedProfile(mDeviceAdmin) + && mDeviceAdmin.getComponent().equals(mDPM.getProfileOwner())) { + final int userId = UserHandle.myUserId(); + UserDialogs.createRemoveDialog(DeviceAdminAdd.this, userId, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + UserManager um = UserManager.get(DeviceAdminAdd.this); + um.removeUser(userId); + finish(); + } + } + ).show(); + } else if (mUninstalling) { + mDPM.uninstallPackageWithActiveAdmins(mDeviceAdmin.getPackageName()); + finish(); + } else if (!mWaitingForRemoveMsg) { + try { + // Don't allow the admin to put a dialog up in front + // of us while we interact with the user. + ActivityManager.getService().stopAppSwitches(); + } catch (RemoteException e) { + } + mWaitingForRemoveMsg = true; + mDPM.getRemoveWarning(mDeviceAdmin.getComponent(), + new RemoteCallback(new RemoteCallback.OnResultListener() { + @Override + public void onResult(Bundle result) { + CharSequence msg = result != null + ? result.getCharSequence( + DeviceAdminReceiver.EXTRA_DISABLE_WARNING) + : null; + continueRemoveAction(msg); + } + }, mHandler)); + // Don't want to wait too long. + getWindow().getDecorView().getHandler().postDelayed( + () -> continueRemoveAction(null), 2 * 1000); + } + }; + restrictedAction.setOnKeyListener((view, keyCode, keyEvent) -> { + if ((keyEvent.getFlags() & KeyEvent.FLAG_FROM_SYSTEM) == 0) { + Log.e(TAG, "Can not activate device-admin with KeyEvent from non-system app."); + // Consume event to suppress click. + return true; + } + // Fallback to view click handler. + return false; + restrictedAction.setOnClickListener(restrictedActionClickListener);
/media/esteban/ACOS/ResurrectionX/packages/apps/Settings/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminAdd.java
396
397
398
399
400
401
402
403
404
405
mDeviceAdmin.getActivityInfo().applicationInfo.uid); mDPM.uninstallPackageWithActiveAdmins(mDeviceAdmin.getPackageName()); finish(); } }); mActionButton = (Button) findViewById(R.id.action_button); final View restrictedAction = findViewById(R.id.restricted_action); restrictedAction.setFilterTouchesWhenObscured(true);
+ show +
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
restrictedAction.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { if (!mActionButton.isEnabled()) { showPolicyTransparencyDialogIfRequired(); return; } if (mAdding) { addAndFinish(); } else if (isManagedProfile(mDeviceAdmin) && mDeviceAdmin.getComponent().equals(mDPM.getProfileOwner())) { final int userId = UserHandle.myUserId(); UserDialogs.createRemoveDialog(DeviceAdminAdd.this, userId, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { UserManager um = UserManager.get(DeviceAdminAdd.this); um.removeUser(userId); finish(); } } ).show(); } else if (mUninstalling) { mDPM.uninstallPackageWithActiveAdmins(mDeviceAdmin.getPackageName()); finish(); } else if (!mWaitingForRemoveMsg) { try { // Don't allow the admin to put a dialog up in front // of us while we interact with the user. ActivityManager.getService().stopAppSwitches(); } catch (RemoteException e) { } mWaitingForRemoveMsg = true; mDPM.getRemoveWarning(mDeviceAdmin.getComponent(), new RemoteCallback(new RemoteCallback.OnResultListener() { @Override public void onResult(Bundle result) { CharSequence msg = result != null ? result.getCharSequence( DeviceAdminReceiver.EXTRA_DISABLE_WARNING) : null; continueRemoveAction(msg); } }, mHandler)); // Don't want to wait too long. getWindow().getDecorView().getHandler().postDelayed(new Runnable() { @Override public void run() { continueRemoveAction(null); } }, 2*1000);
+ show +
455
456
457
458
459
460
461
462
463
464
} } }); } /** * Shows a dialog to explain why the button is disabled if required. */ private void showPolicyTransparencyDialogIfRequired() { if (isManagedProfile(mDeviceAdmin)
/media/esteban/ACOS/ResurrectionX/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/applications/specialaccess/deviceadmin/DeviceAdminAdd.java
343
344
345
346
347
348
349
350
351
352
mDeviceAdmin.getActivityInfo().applicationInfo.uid); mDPM.uninstallPackageWithActiveAdmins(mDeviceAdmin.getPackageName()); finish(); } }); mActionButton = (Button) findViewById(R.id.action_button); final View restrictedAction = findViewById(R.id.restricted_action); restrictedAction.setFilterTouchesWhenObscured(true);
+ show +
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
restrictedAction.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { if (!mActionButton.isEnabled()) { showPolicyTransparencyDialogIfRequired(); return; } if (mAdding) { addAndFinish(); } else if (isManagedProfile(mDeviceAdmin) && mDeviceAdmin.getComponent().equals(mDPM.getProfileOwner())) { final int userId = UserHandle.myUserId(); UserDialogs.createRemoveDialog(DeviceAdminAdd.this, userId, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { UserManager um = UserManager.get(DeviceAdminAdd.this); um.removeUser(userId); finish(); } } ).show(); } else if (mUninstalling) { mDPM.uninstallPackageWithActiveAdmins(mDeviceAdmin.getPackageName()); finish(); } else if (!mWaitingForRemoveMsg) { try { // Don't allow the admin to put a dialog up in front // of us while we interact with the user. ActivityManager.getService().stopAppSwitches(); } catch (RemoteException e) { } mWaitingForRemoveMsg = true; mDPM.getRemoveWarning(mDeviceAdmin.getComponent(), new RemoteCallback(new RemoteCallback.OnResultListener() { @Override public void onResult(Bundle result) { CharSequence msg = result != null ? result.getCharSequence( DeviceAdminReceiver.EXTRA_DISABLE_WARNING) : null; continueRemoveAction(msg); } }, mHandler)); // Don't want to wait too long. getWindow().getDecorView().getHandler().postDelayed(new Runnable() { @Override public void run() { continueRemoveAction(null); } }, 2*1000);
+ show +
402
403
404
405
406
407
408
409
410
411
} } }); } /** * Shows a dialog to explain why the button is disabled if required. */ private void showPolicyTransparencyDialogIfRequired() { if (isManagedProfile(mDeviceAdmin)

[CVE-2023-40113_1.diff] MmsSmsDatabaseHelper.java #1
+ public static String CREATE_ADDR_TABLE_STR = + "CREATE TABLE " + MmsProvider.TABLE_ADDR + " (" + + Addr._ID + " INTEGER PRIMARY KEY," + + Addr.MSG_ID + " INTEGER," + + Addr.CONTACT_ID + " INTEGER," + + Addr.ADDRESS + " TEXT," + + Addr.TYPE + " INTEGER," + + Addr.CHARSET + " INTEGER);"; + + @VisibleForTesting + public static String CREATE_PART_TABLE_STR = + "CREATE TABLE " + MmsProvider.TABLE_PART + " (" + + Part._ID + " INTEGER PRIMARY KEY AUTOINCREMENT," + + Part.MSG_ID + " INTEGER," + + Part.SEQ + " INTEGER DEFAULT 0," + + Part.CONTENT_TYPE + " TEXT," + + Part.NAME + " TEXT," + + Part.CHARSET + " INTEGER," + + Part.CONTENT_DISPOSITION + " TEXT," + + Part.FILENAME + " TEXT," + + Part.CONTENT_ID + " TEXT," + + Part.CONTENT_LOCATION + " TEXT," + + Part.CT_START + " INTEGER," + + Part.CT_TYPE + " TEXT," + + Part._DATA + " TEXT," + + Part.TEXT + " TEXT);"; + + public static String CREATE_PDU_TABLE_STR = + "CREATE TABLE " + MmsProvider.TABLE_PDU + " (" + + Mms._ID + " INTEGER PRIMARY KEY AUTOINCREMENT," + + Mms.THREAD_ID + " INTEGER," + + Mms.DATE + " INTEGER," + + Mms.DATE_SENT + " INTEGER DEFAULT 0," + + Mms.MESSAGE_BOX + " INTEGER," + + Mms.READ + " INTEGER DEFAULT 0," + + Mms.MESSAGE_ID + " TEXT," + + Mms.SUBJECT + " TEXT," + + Mms.SUBJECT_CHARSET + " INTEGER," + + Mms.CONTENT_TYPE + " TEXT," + + Mms.CONTENT_LOCATION + " TEXT," + + Mms.EXPIRY + " INTEGER," + + Mms.MESSAGE_CLASS + " TEXT," + + Mms.MESSAGE_TYPE + " INTEGER," + + Mms.MMS_VERSION + " INTEGER," + + Mms.MESSAGE_SIZE + " INTEGER," + + Mms.PRIORITY + " INTEGER," + + Mms.READ_REPORT + " INTEGER," + + Mms.REPORT_ALLOWED + " INTEGER," + + Mms.RESPONSE_STATUS + " INTEGER," + + Mms.STATUS + " INTEGER," + + Mms.TRANSACTION_ID + " TEXT," + + Mms.RETRIEVE_STATUS + " INTEGER," + + Mms.RETRIEVE_TEXT + " TEXT," + + Mms.RETRIEVE_TEXT_CHARSET + " INTEGER," + + Mms.READ_STATUS + " INTEGER," + + Mms.CONTENT_CLASS + " INTEGER," + + Mms.RESPONSE_TEXT + " TEXT," + + Mms.DELIVERY_TIME + " INTEGER," + + Mms.DELIVERY_REPORT + " INTEGER," + + Mms.LOCKED + " INTEGER DEFAULT 0," + + Mms.SUBSCRIPTION_ID + " INTEGER DEFAULT " + + SubscriptionManager.INVALID_SUBSCRIPTION_ID + ", " + + Mms.SEEN + " INTEGER DEFAULT 0," + + Mms.CREATOR + " TEXT," + + Mms.TEXT_ONLY + " INTEGER DEFAULT 0);"; + + @VisibleForTesting + public static String CREATE_RATE_TABLE_STR = + "CREATE TABLE " + MmsProvider.TABLE_RATE + " (" + + Rate.SENT_TIME + " INTEGER);"; + + @VisibleForTesting + public static String CREATE_DRM_TABLE_STR = + "CREATE TABLE " + MmsProvider.TABLE_DRM + " (" + + BaseColumns._ID + " INTEGER PRIMARY KEY," + + "_data TEXT);"; + + @VisibleForTesting - db.execSQL("CREATE TABLE " + MmsProvider.TABLE_PDU + " (" + - Mms._ID + " INTEGER PRIMARY KEY AUTOINCREMENT," + - Mms.THREAD_ID + " INTEGER," + - Mms.DATE + " INTEGER," + - Mms.DATE_SENT + " INTEGER DEFAULT 0," + - Mms.MESSAGE_BOX + " INTEGER," + - Mms.READ + " INTEGER DEFAULT 0," + - Mms.MESSAGE_ID + " TEXT," + - Mms.SUBJECT + " TEXT," + - Mms.SUBJECT_CHARSET + " INTEGER," + - Mms.CONTENT_TYPE + " TEXT," + - Mms.CONTENT_LOCATION + " TEXT," + - Mms.EXPIRY + " INTEGER," + - Mms.MESSAGE_CLASS + " TEXT," + - Mms.MESSAGE_TYPE + " INTEGER," + - Mms.MMS_VERSION + " INTEGER," + - Mms.MESSAGE_SIZE + " INTEGER," + - Mms.PRIORITY + " INTEGER," + - Mms.READ_REPORT + " INTEGER," + - Mms.REPORT_ALLOWED + " INTEGER," + - Mms.RESPONSE_STATUS + " INTEGER," + - Mms.STATUS + " INTEGER," + - Mms.TRANSACTION_ID + " TEXT," + - Mms.RETRIEVE_STATUS + " INTEGER," + - Mms.RETRIEVE_TEXT + " TEXT," + - Mms.RETRIEVE_TEXT_CHARSET + " INTEGER," + - Mms.READ_STATUS + " INTEGER," + - Mms.CONTENT_CLASS + " INTEGER," + - Mms.RESPONSE_TEXT + " TEXT," + - Mms.DELIVERY_TIME + " INTEGER," + - Mms.DELIVERY_REPORT + " INTEGER," + - Mms.LOCKED + " INTEGER DEFAULT 0," + - Mms.SUBSCRIPTION_ID + " INTEGER DEFAULT " - + SubscriptionManager.INVALID_SUBSCRIPTION_ID + ", " + - Mms.SEEN + " INTEGER DEFAULT 0," + - Mms.CREATOR + " TEXT," + - Mms.TEXT_ONLY + " INTEGER DEFAULT 0" + - ");"); + db.execSQL(CREATE_PDU_TABLE_STR); - db.execSQL("CREATE TABLE " + MmsProvider.TABLE_ADDR + " (" + - Addr._ID + " INTEGER PRIMARY KEY," + - Addr.MSG_ID + " INTEGER," + - Addr.CONTACT_ID + " INTEGER," + - Addr.ADDRESS + " TEXT," + - Addr.TYPE + " INTEGER," + - Addr.CHARSET + " INTEGER);"); + db.execSQL(CREATE_ADDR_TABLE_STR); - db.execSQL("CREATE TABLE " + MmsProvider.TABLE_PART + " (" + - Part._ID + " INTEGER PRIMARY KEY AUTOINCREMENT," + - Part.MSG_ID + " INTEGER," + - Part.SEQ + " INTEGER DEFAULT 0," + - Part.CONTENT_TYPE + " TEXT," + - Part.NAME + " TEXT," + - Part.CHARSET + " INTEGER," + - Part.CONTENT_DISPOSITION + " TEXT," + - Part.FILENAME + " TEXT," + - Part.CONTENT_ID + " TEXT," + - Part.CONTENT_LOCATION + " TEXT," + - Part.CT_START + " INTEGER," + - Part.CT_TYPE + " TEXT," + - Part._DATA + " TEXT," + - Part.TEXT + " TEXT);"); + db.execSQL(CREATE_PART_TABLE_STR); - db.execSQL("CREATE TABLE " + MmsProvider.TABLE_RATE + " (" + - Rate.SENT_TIME + " INTEGER);"); + db.execSQL(CREATE_RATE_TABLE_STR); - db.execSQL("CREATE TABLE " + MmsProvider.TABLE_DRM + " (" + - BaseColumns._ID + " INTEGER PRIMARY KEY," + - "_data TEXT);"); + db.execSQL(CREATE_DRM_TABLE_STR);
/media/esteban/ACOS/ResurrectionX/packages/providers/TelephonyProvider/src/com/android/providers/telephony/MmsSmsDatabaseHelper.java
718
719
720
721
722
723
724
725
726
727
db.execSQL("CREATE INDEX IF NOT EXISTS addrMsgIdIndex ON addr (msg_id)"); } catch (Exception ex) { Log.e(TAG, "got exception creating indices: " + ex.toString()); } } @VisibleForTesting void createMmsTables(SQLiteDatabase db) { // N.B.: Whenever the columns here are changed, the columns in // {@ref MmsSmsProvider} must be changed to match.
+ show +
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
db.execSQL("CREATE TABLE " + MmsProvider.TABLE_PDU + " (" + Mms._ID + " INTEGER PRIMARY KEY AUTOINCREMENT," + Mms.THREAD_ID + " INTEGER," + Mms.DATE + " INTEGER," + Mms.DATE_SENT + " INTEGER DEFAULT 0," + Mms.MESSAGE_BOX + " INTEGER," + Mms.READ + " INTEGER DEFAULT 0," + Mms.MESSAGE_ID + " TEXT," + Mms.SUBJECT + " TEXT," + Mms.SUBJECT_CHARSET + " INTEGER," + Mms.CONTENT_TYPE + " TEXT," + Mms.CONTENT_LOCATION + " TEXT," + Mms.EXPIRY + " INTEGER," + Mms.MESSAGE_CLASS + " TEXT," + Mms.MESSAGE_TYPE + " INTEGER," + Mms.MMS_VERSION + " INTEGER," + Mms.MESSAGE_SIZE + " INTEGER," + Mms.PRIORITY + " INTEGER," + Mms.READ_REPORT + " INTEGER," + Mms.REPORT_ALLOWED + " INTEGER," + Mms.RESPONSE_STATUS + " INTEGER," + Mms.STATUS + " INTEGER," + Mms.TRANSACTION_ID + " TEXT," + Mms.RETRIEVE_STATUS + " INTEGER," + Mms.RETRIEVE_TEXT + " TEXT," + Mms.RETRIEVE_TEXT_CHARSET + " INTEGER," + Mms.READ_STATUS + " INTEGER," + Mms.CONTENT_CLASS + " INTEGER," + Mms.RESPONSE_TEXT + " TEXT," + Mms.DELIVERY_TIME + " INTEGER," + Mms.DELIVERY_REPORT + " INTEGER," + Mms.LOCKED + " INTEGER DEFAULT 0," + Mms.SUBSCRIPTION_ID + " INTEGER DEFAULT " + SubscriptionManager.INVALID_SUBSCRIPTION_ID + ", " + Mms.SEEN + " INTEGER DEFAULT 0," + Mms.CREATOR + " TEXT," + Mms.TEXT_ONLY + " INTEGER DEFAULT 0" + ");"); db.execSQL("CREATE TABLE " + MmsProvider.TABLE_ADDR + " (" + Addr._ID + " INTEGER PRIMARY KEY," + Addr.MSG_ID + " INTEGER," + Addr.CONTACT_ID + " INTEGER," + Addr.ADDRESS + " TEXT," + Addr.TYPE + " INTEGER," + Addr.CHARSET + " INTEGER);"); db.execSQL("CREATE TABLE " + MmsProvider.TABLE_PART + " (" + Part._ID + " INTEGER PRIMARY KEY AUTOINCREMENT," + Part.MSG_ID + " INTEGER," + Part.SEQ + " INTEGER DEFAULT 0," + Part.CONTENT_TYPE + " TEXT," + Part.NAME + " TEXT," + Part.CHARSET + " INTEGER," + Part.CONTENT_DISPOSITION + " TEXT," + Part.FILENAME + " TEXT," + Part.CONTENT_ID + " TEXT," + Part.CONTENT_LOCATION + " TEXT," + Part.CT_START + " INTEGER," + Part.CT_TYPE + " TEXT," + Part._DATA + " TEXT," + Part.TEXT + " TEXT);"); db.execSQL("CREATE TABLE " + MmsProvider.TABLE_RATE + " (" + Rate.SENT_TIME + " INTEGER);"); db.execSQL("CREATE TABLE " + MmsProvider.TABLE_DRM + " (" + BaseColumns._ID + " INTEGER PRIMARY KEY," + "_data TEXT);");
+ show +
797
798
799
800
801
802
803
804
805
806
// Restricted view of pdu table, only sent/received messages without wap pushes db.execSQL("CREATE VIEW " + MmsProvider.VIEW_PDU_RESTRICTED + " AS " + "SELECT * FROM " + MmsProvider.TABLE_PDU + " WHERE " + "(" + Mms.MESSAGE_BOX + "=" + Mms.MESSAGE_BOX_INBOX + " OR " + Mms.MESSAGE_BOX + "=" + Mms.MESSAGE_BOX_SENT + ")" + " AND " + "(" + Mms.MESSAGE_TYPE + "!=" + PduHeaders.MESSAGE_TYPE_NOTIFICATION_IND + ");"); }

[CVE-2023-21283_1.diff] TelecomSystemTest.java #1
+ return mLatestParcelableConnection; - protected ParcelableCall makeConferenceCall() throws Exception { - IdPair callId1 = startAndMakeActiveOutgoingCall("650-555-1212", - mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA); + protected ParcelableCall makeConferenceCall( + Intent callIntentExtras1, Intent callIntentExtras2) throws Exception { + IdPair callId1 = startAndMakeActiveOutgoingCallWithExtras("650-555-1212", + mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA, callIntentExtras1); - IdPair callId2 = startAndMakeActiveOutgoingCall("650-555-1213", - mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA); + IdPair callId2 = startAndMakeActiveOutgoingCallWithExtras("650-555-1213", + mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA, callIntentExtras2);
/media/esteban/ACOS/ResurrectionX/packages/services/Telecomm/tests/src/com/android/server/telecom/tests/TelecomSystemTest.java
375
376
377
378
379
380
381
382
383
384
@Override public void tearDown() throws Exception { mTelecomSystem.getCallsManager().getCallAudioManager() .getCallAudioRouteStateMachine().quitNow(); mTelecomSystem.getCallsManager().getCallAudioManager() .getCallAudioModeStateMachine().quitNow(); mTelecomSystem = null; super.tearDown(); }
+ show +
385
386
387
388
389
390
protected ParcelableCall makeConferenceCall() throws Exception { IdPair callId1 = startAndMakeActiveOutgoingCall("650-555-1212", mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA); IdPair callId2 = startAndMakeActiveOutgoingCall("650-555-1213", mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA);
+ show +
391
392
393
394
395
396
397
398
399
400
IInCallAdapter inCallAdapter = mInCallServiceFixtureX.getInCallAdapter(); inCallAdapter.conference(callId1.mCallId, callId2.mCallId); // Wait for the handler in ConnectionService waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT); ParcelableCall call1 = mInCallServiceFixtureX.getCall(callId1.mCallId); ParcelableCall call2 = mInCallServiceFixtureX.getCall(callId2.mCallId); // Check that the two calls end up with a parent in the end assertNotNull(call1.getParentCallId()); assertNotNull(call2.getParentCallId());

[CVE-2023-21103_1.diff] PhoneAccountRegistrar.java #6
- ByteArrayOutputStream stream = new ByteArrayOutputStream(); - value.writeToStream(stream); - byte[] iconByteArray = stream.toByteArray(); - String text = Base64.encodeToString(iconByteArray, 0, iconByteArray.length, 0); - + String text = writeIconToBase64String(value); + public static String writeIconToBase64String(Icon icon) throws IOException { + ByteArrayOutputStream stream = new ByteArrayOutputStream(); + icon.writeToStream(stream); + byte[] iconByteArray = stream.toByteArray(); + return Base64.encodeToString(iconByteArray, 0, iconByteArray.length, 0); + } +
/media/esteban/ACOS/ResurrectionX/packages/services/Telecomm/src/com/android/server/telecom/PhoneAccountRegistrar.java
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
serializer.text(Objects.toString(value)); serializer.endTag(null, TAG_VALUE); } } serializer.endTag(null, tagName); } protected void writeIconIfNonNull(String tagName, Icon value, XmlSerializer serializer) throws IOException { if (value != null) {
+ show +
1464
1465
1466
1467
ByteArrayOutputStream stream = new ByteArrayOutputStream(); value.writeToStream(stream); byte[] iconByteArray = stream.toByteArray(); String text = Base64.encodeToString(iconByteArray, 0, iconByteArray.length, 0);
+ show +
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
serializer.startTag(null, tagName); serializer.text(text); serializer.endTag(null, tagName); } } protected void writeLong(String tagName, long value, XmlSerializer serializer) throws IOException { serializer.startTag(null, tagName);

[CVE-2023-21111_1.diff] PhoneAccountRegistrar.java #6
- ByteArrayOutputStream stream = new ByteArrayOutputStream(); - value.writeToStream(stream); - byte[] iconByteArray = stream.toByteArray(); - String text = Base64.encodeToString(iconByteArray, 0, iconByteArray.length, 0); - + String text = writeIconToBase64String(value); + public static String writeIconToBase64String(Icon icon) throws IOException { + ByteArrayOutputStream stream = new ByteArrayOutputStream(); + icon.writeToStream(stream); + byte[] iconByteArray = stream.toByteArray(); + return Base64.encodeToString(iconByteArray, 0, iconByteArray.length, 0); + } +
/media/esteban/ACOS/ResurrectionX/packages/services/Telecomm/src/com/android/server/telecom/PhoneAccountRegistrar.java
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
serializer.text(Objects.toString(value)); serializer.endTag(null, TAG_VALUE); } } serializer.endTag(null, tagName); } protected void writeIconIfNonNull(String tagName, Icon value, XmlSerializer serializer) throws IOException { if (value != null) {
+ show +
1464
1465
1466
1467
ByteArrayOutputStream stream = new ByteArrayOutputStream(); value.writeToStream(stream); byte[] iconByteArray = stream.toByteArray(); String text = Base64.encodeToString(iconByteArray, 0, iconByteArray.length, 0);
+ show +
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
serializer.startTag(null, tagName); serializer.text(text); serializer.endTag(null, tagName); } } protected void writeLong(String tagName, long value, XmlSerializer serializer) throws IOException { serializer.startTag(null, tagName);

[CVE-2020-0201_1.diff] WifiConfigController.java #1
- public static final int WIFI_PEAP_PHASE2_NONE = 0; - public static final int WIFI_PEAP_PHASE2_MSCHAPV2 = 1; - public static final int WIFI_PEAP_PHASE2_GTC = 2; - public static final int WIFI_PEAP_PHASE2_SIM = 3; - public static final int WIFI_PEAP_PHASE2_AKA = 4; - public static final int WIFI_PEAP_PHASE2_AKA_PRIME = 5; + public static final int WIFI_PEAP_PHASE2_MSCHAPV2 = 0; + public static final int WIFI_PEAP_PHASE2_GTC = 1; + public static final int WIFI_PEAP_PHASE2_SIM = 2; + public static final int WIFI_PEAP_PHASE2_AKA = 3; + public static final int WIFI_PEAP_PHASE2_AKA_PRIME = 4; + /* These values come from "wifi_ttls_phase2_entries" resource array */ + public static final int WIFI_TTLS_PHASE2_PAP = 0; + public static final int WIFI_TTLS_PHASE2_MSCHAP = 1; + public static final int WIFI_TTLS_PHASE2_MSCHAPV2 = 2; + public static final int WIFI_TTLS_PHASE2_GTC = 3; - private ArrayAdapter<String> mPhase2PeapAdapter; - /* Full list of phase2 methods */ - private ArrayAdapter<String> mPhase2FullAdapter; + private ArrayAdapter<CharSequence> mPhase2PeapAdapter; + /* Phase2 methods supported by TTLS are limited */ + private ArrayAdapter<CharSequence> mPhase2TtlsAdapter;
/media/esteban/ACOS/ResurrectionX/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/wifi/WifiConfigController.java
107
108
109
110
111
112
113
114
115
116
/* These values come from "wifi_eap_method" resource array */ public static final int WIFI_EAP_METHOD_PEAP = 0; public static final int WIFI_EAP_METHOD_TLS = 1; public static final int WIFI_EAP_METHOD_TTLS = 2; public static final int WIFI_EAP_METHOD_PWD = 3; public static final int WIFI_EAP_METHOD_SIM = 4; public static final int WIFI_EAP_METHOD_AKA = 5; public static final int WIFI_EAP_METHOD_AKA_PRIME = 6; /* These values come from "wifi_peap_phase2_entries" resource array */
+ show +
117
118
119
120
121
122
123
124
125
126
127
128
public static final int WIFI_PEAP_PHASE2_NONE = 0; public static final int WIFI_PEAP_PHASE2_MSCHAPV2 = 1; public static final int WIFI_PEAP_PHASE2_GTC = 2; public static final int WIFI_PEAP_PHASE2_SIM = 3; public static final int WIFI_PEAP_PHASE2_AKA = 4; public static final int WIFI_PEAP_PHASE2_AKA_PRIME = 5; /* Phase2 methods supported by PEAP are limited */ private ArrayAdapter<String> mPhase2PeapAdapter; /* Full list of phase2 methods */ private ArrayAdapter<String> mPhase2FullAdapter;
+ show +
129
130
131
132
133
134
135
136
137
138
// e.g. AccessPoint.SECURITY_NONE @VisibleForTesting int mAccessPointSecurity; private TextView mPasswordView; private ImageButton mSsidScanButton; private ImageButton mPasswordScanButton; private String mUnspecifiedCertString; private String mMultipleCertSetString;

[CVE-2020-0238_1.diff] AccountTypePreferenceLoader.java #1
- if (resolvedActivityInfo.exported) { - if (resolvedActivityInfo.permission == null) { - return true; // exported activity without permission. - } else if (pm.checkPermission(resolvedActivityInfo.permission, - authDesc.packageName) == PackageManager.PERMISSION_GRANTED) { - return true; - } - } + // Allows to launch only authenticator owned activities.
/media/esteban/ACOS/ResurrectionX/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/accounts/AccountTypePreferenceLoader.java
190
191
192
193
194
195
196
197
198
199
private boolean isSafeIntent(PackageManager pm, Intent intent, String acccountType) { AuthenticatorDescription authDesc = mAuthenticatorHelper.getAccountTypeDescription(acccountType); ResolveInfo resolveInfo = pm.resolveActivityAsUser(intent, 0, mUserHandle.getIdentifier()); if (resolveInfo == null) { return false; } ActivityInfo resolvedActivityInfo = resolveInfo.activityInfo; ApplicationInfo resolvedAppInfo = resolvedActivityInfo.applicationInfo; try {
+ show +
200
201
202
203
204
205
if (resolvedActivityInfo.exported) { if (resolvedActivityInfo.permission == null) { return true; // exported activity without permission. } else if (pm.checkPermission(resolvedActivityInfo.permission, authDesc.packageName) == PackageManager.PERMISSION_GRANTED) { return true;
+ show +
206
207
208
209
210
211
212
213
214
215
} } ApplicationInfo authenticatorAppInf = pm.getApplicationInfo(authDesc.packageName, 0); return resolvedAppInfo.uid == authenticatorAppInf.uid; } catch (NameNotFoundException e) { Log.e(TAG, "Intent considered unsafe due to exception.", e); return false; }

[CVE-2021-0591_1.diff] BluetoothPermissionRequest.java #2
- mReturnPackage = intent.getStringExtra(BluetoothDevice.EXTRA_PACKAGE_NAME); - mReturnClass = intent.getStringExtra(BluetoothDevice.EXTRA_CLASS_NAME); - if (DEBUG) Log.d(TAG, "onReceive request type: " + mRequestType + " return " - + mReturnPackage + "," + mReturnClass); + if (DEBUG) { + Log.d(TAG, "onReceive request type: " + mRequestType); + }
/media/esteban/ACOS/ResurrectionX/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/bluetooth/BluetoothPermissionRequest.java
70
71
72
73
74
75
76
77
78
79
UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE); // skip the notification for managed profiles. if (um.isManagedProfile()) { if (DEBUG) Log.d(TAG, "Blocking notification for managed profile."); return; } // convert broadcast intent into activity intent (same action string) mDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); mRequestType = intent.getIntExtra(BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE, BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION);
+ show +
80
81
82
83
84
mReturnPackage = intent.getStringExtra(BluetoothDevice.EXTRA_PACKAGE_NAME); mReturnClass = intent.getStringExtra(BluetoothDevice.EXTRA_CLASS_NAME); if (DEBUG) Log.d(TAG, "onReceive request type: " + mRequestType + " return " + mReturnPackage + "," + mReturnClass);
+ show +
85
86
87
88
89
90
91
92
93
94
// Even if the user has already made the choice, Bluetooth still may not know that if // the user preference data have not been migrated from Settings app's shared // preferences to Bluetooth app's. In that case, Bluetooth app broadcasts an // ACTION_CONNECTION_ACCESS_REQUEST intent to ask to Settings app. // // If that happens, 'checkUserChoice()' here will do migration because it finds or // creates a 'CachedBluetoothDevice' object for the device. // // After migration is done, 'checkUserChoice()' replies to the request by sending an

[CVE-2021-0593_1.diff] BluetoothPermissionRequest.java #2
- mReturnPackage = intent.getStringExtra(BluetoothDevice.EXTRA_PACKAGE_NAME); - mReturnClass = intent.getStringExtra(BluetoothDevice.EXTRA_CLASS_NAME); - if (DEBUG) Log.d(TAG, "onReceive request type: " + mRequestType + " return " - + mReturnPackage + "," + mReturnClass); + if (DEBUG) { + Log.d(TAG, "onReceive request type: " + mRequestType); + }
/media/esteban/ACOS/ResurrectionX/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/bluetooth/BluetoothPermissionRequest.java
70
71
72
73
74
75
76
77
78
79
UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE); // skip the notification for managed profiles. if (um.isManagedProfile()) { if (DEBUG) Log.d(TAG, "Blocking notification for managed profile."); return; } // convert broadcast intent into activity intent (same action string) mDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); mRequestType = intent.getIntExtra(BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE, BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION);
+ show +
80
81
82
83
84
mReturnPackage = intent.getStringExtra(BluetoothDevice.EXTRA_PACKAGE_NAME); mReturnClass = intent.getStringExtra(BluetoothDevice.EXTRA_CLASS_NAME); if (DEBUG) Log.d(TAG, "onReceive request type: " + mRequestType + " return " + mReturnPackage + "," + mReturnClass);
+ show +
85
86
87
88
89
90
91
92
93
94
// Even if the user has already made the choice, Bluetooth still may not know that if // the user preference data have not been migrated from Settings app's shared // preferences to Bluetooth app's. In that case, Bluetooth app broadcasts an // ACTION_CONNECTION_ACCESS_REQUEST intent to ask to Settings app. // // If that happens, 'checkUserChoice()' here will do migration because it finds or // creates a 'CachedBluetoothDevice' object for the device. // // After migration is done, 'checkUserChoice()' replies to the request by sending an

[CVE-2019-2228_1.diff] md5.c #2
-#define T1 0xd76aa478 -#define T2 0xe8c7b756 -#define T3 0x242070db -#define T4 0xc1bdceee -#define T5 0xf57c0faf -#define T6 0x4787c62a -#define T7 0xa8304613 -#define T8 0xfd469501 -#define T9 0x698098d8 -#define T10 0x8b44f7af -#define T11 0xffff5bb1 -#define T12 0x895cd7be -#define T13 0x6b901122 -#define T14 0xfd987193 -#define T15 0xa679438e -#define T16 0x49b40821 -#define T17 0xf61e2562 -#define T18 0xc040b340 -#define T19 0x265e5a51 -#define T20 0xe9b6c7aa -#define T21 0xd62f105d -#define T22 0x02441453 -#define T23 0xd8a1e681 -#define T24 0xe7d3fbc8 -#define T25 0x21e1cde6 -#define T26 0xc33707d6 -#define T27 0xf4d50d87 -#define T28 0x455a14ed -#define T29 0xa9e3e905 -#define T30 0xfcefa3f8 -#define T31 0x676f02d9 -#define T32 0x8d2a4c8a -#define T33 0xfffa3942 -#define T34 0x8771f681 -#define T35 0x6d9d6122 -#define T36 0xfde5380c -#define T37 0xa4beea44 -#define T38 0x4bdecfa9 -#define T39 0xf6bb4b60 -#define T40 0xbebfbc70 -#define T41 0x289b7ec6 -#define T42 0xeaa127fa -#define T43 0xd4ef3085 -#define T44 0x04881d05 -#define T45 0xd9d4d039 -#define T46 0xe6db99e5 -#define T47 0x1fa27cf8 -#define T48 0xc4ac5665 -#define T49 0xf4292244 -#define T50 0x432aff97 -#define T51 0xab9423a7 -#define T52 0xfc93a039 -#define T53 0x655b59c3 -#define T54 0x8f0ccc92 -#define T55 0xffeff47d -#define T56 0x85845dd1 -#define T57 0x6fa87e4f -#define T58 0xfe2ce6e0 -#define T59 0xa3014314 -#define T60 0x4e0811a1 -#define T61 0xf7537e82 -#define T62 0xbd3af235 -#define T63 0x2ad7d2bb -#define T64 0xeb86d391 +#if !defined(__APPLE__) && !defined(HAVE_GNUTLS) +# define T1 0xd76aa478 +# define T2 0xe8c7b756 +# define T3 0x242070db +# define T4 0xc1bdceee +# define T5 0xf57c0faf +# define T6 0x4787c62a +# define T7 0xa8304613 +# define T8 0xfd469501 +# define T9 0x698098d8 +# define T10 0x8b44f7af +# define T11 0xffff5bb1 +# define T12 0x895cd7be +# define T13 0x6b901122 +# define T14 0xfd987193 +# define T15 0xa679438e +# define T16 0x49b40821 +# define T17 0xf61e2562 +# define T18 0xc040b340 +# define T19 0x265e5a51 +# define T20 0xe9b6c7aa +# define T21 0xd62f105d +# define T22 0x02441453 +# define T23 0xd8a1e681 +# define T24 0xe7d3fbc8 +# define T25 0x21e1cde6 +# define T26 0xc33707d6 +# define T27 0xf4d50d87 +# define T28 0x455a14ed +# define T29 0xa9e3e905 +# define T30 0xfcefa3f8 +# define T31 0x676f02d9 +# define T32 0x8d2a4c8a +# define T33 0xfffa3942 +# define T34 0x8771f681 +# define T35 0x6d9d6122 +# define T36 0xfde5380c +# define T37 0xa4beea44 +# define T38 0x4bdecfa9 +# define T39 0xf6bb4b60 +# define T40 0xbebfbc70 +# define T41 0x289b7ec6 +# define T42 0xeaa127fa +# define T43 0xd4ef3085 +# define T44 0x04881d05 +# define T45 0xd9d4d039 +# define T46 0xe6db99e5 +# define T47 0x1fa27cf8 +# define T48 0xc4ac5665 +# define T49 0xf4292244 +# define T50 0x432aff97 +# define T51 0xab9423a7 +# define T52 0xfc93a039 +# define T53 0x655b59c3 +# define T54 0x8f0ccc92 +# define T55 0xffeff47d +# define T56 0x85845dd1 +# define T57 0x6fa87e4f +# define T58 0xfe2ce6e0 +# define T59 0xa3014314 +# define T60 0x4e0811a1 +# define T61 0xf7537e82 +# define T62 0xbd3af235 +# define T63 0x2ad7d2bb +# define T64 0xeb86d391
/media/esteban/ACOS/ResurrectionX/external/libcups/cups/md5.c
37
38
39
40
41
42
43
44
45
46
1999-11-04 lpd Edited comments slightly for automatic TOC extraction. 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5). 1999-05-03 lpd Original version. */ #include "md5-private.h" #include "string-private.h" #if !defined(__APPLE__) && !defined(HAVE_GNUTLS)
+ show +
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# define T1 0xd76aa478 # define T2 0xe8c7b756 # define T3 0x242070db # define T4 0xc1bdceee # define T5 0xf57c0faf # define T6 0x4787c62a # define T7 0xa8304613 # define T8 0xfd469501 # define T9 0x698098d8 # define T10 0x8b44f7af # define T11 0xffff5bb1 # define T12 0x895cd7be # define T13 0x6b901122 # define T14 0xfd987193 # define T15 0xa679438e # define T16 0x49b40821 # define T17 0xf61e2562 # define T18 0xc040b340 # define T19 0x265e5a51 # define T20 0xe9b6c7aa # define T21 0xd62f105d # define T22 0x02441453 # define T23 0xd8a1e681 # define T24 0xe7d3fbc8 # define T25 0x21e1cde6 # define T26 0xc33707d6 # define T27 0xf4d50d87 # define T28 0x455a14ed # define T29 0xa9e3e905 # define T30 0xfcefa3f8 # define T31 0x676f02d9 # define T32 0x8d2a4c8a # define T33 0xfffa3942 # define T34 0x8771f681 # define T35 0x6d9d6122 # define T36 0xfde5380c # define T37 0xa4beea44 # define T38 0x4bdecfa9 # define T39 0xf6bb4b60 # define T40 0xbebfbc70 # define T41 0x289b7ec6 # define T42 0xeaa127fa # define T43 0xd4ef3085 # define T44 0x04881d05 # define T45 0xd9d4d039 # define T46 0xe6db99e5 # define T47 0x1fa27cf8 # define T48 0xc4ac5665 # define T49 0xf4292244 # define T50 0x432aff97 # define T51 0xab9423a7 # define T52 0xfc93a039 # define T53 0x655b59c3 # define T54 0x8f0ccc92 # define T55 0xffeff47d # define T56 0x85845dd1 # define T57 0x6fa87e4f # define T58 0xfe2ce6e0 # define T59 0xa3014314 # define T60 0x4e0811a1 # define T61 0xf7537e82 # define T62 0xbd3af235 # define T63 0x2ad7d2bb # define T64 0xeb86d391
+ show +
111
112
113
114
115
116
117
118
119
120
static void _cups_md5_process(_cups_md5_state_t *pms, const unsigned char *data /*[64]*/) { unsigned int a = pms->abcd[0], b = pms->abcd[1], c = pms->abcd[2], d = pms->abcd[3]; unsigned int t; # ifndef ARCH_IS_BIG_ENDIAN

[CVE-2019-2228_1.diff] md5.c #3
-#ifndef ARCH_IS_BIG_ENDIAN -# define ARCH_IS_BIG_ENDIAN 1 /* slower, default implementation */ -#endif -#if ARCH_IS_BIG_ENDIAN +# ifndef ARCH_IS_BIG_ENDIAN +# define ARCH_IS_BIG_ENDIAN 1 /* slower, default implementation */ +# endif +# if ARCH_IS_BIG_ENDIAN
/media/esteban/ACOS/ResurrectionX/external/libcups/cups/md5.c
110
111
112
113
114
115
116
117
118
119
# define T64 0xeb86d391 static void _cups_md5_process(_cups_md5_state_t *pms, const unsigned char *data /*[64]*/) { unsigned int a = pms->abcd[0], b = pms->abcd[1], c = pms->abcd[2], d = pms->abcd[3]; unsigned int t;
+ show +
120
121
122
123
# ifndef ARCH_IS_BIG_ENDIAN # define ARCH_IS_BIG_ENDIAN 1 /* slower, default implementation */ # endif # if ARCH_IS_BIG_ENDIAN
+ show +
124
125
126
127
128
129
130
131
132
133
/* * On big-endian machines, we must arrange the bytes in the right * order. (This also works on machines of unknown byte order.) */ unsigned int X[16]; const unsigned char *xp = data; int i; for (i = 0; i < 16; ++i, xp += 4)

[CVE-2019-2228_1.diff] md5.c #5
-#endif +# endif -#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) +# define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) -#define F(x, y, z) (((x) & (y)) | (~(x) & (z))) -#define SET(a, b, c, d, k, s, Ti)\ +# define F(x, y, z) (((x) & (y)) | (~(x) & (z))) +# define SET(a, b, c, d, k, s, Ti)\
/media/esteban/ACOS/ResurrectionX/external/libcups/cups/md5.c
144
145
146
147
148
149
150
151
152
153
const unsigned int *X; if (!((data - (const unsigned char *)0) & 3)) { /* data are properly aligned */ X = (const unsigned int *)data; } else { /* not aligned */ memcpy(xbuf, data, 64); X = xbuf; }
+ show +
154
155
156
157
158
159
160
161
162
# endif # define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) /* Round 1. */ /* Let [abcd k s i] denote the operation a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */ # define F(x, y, z) (((x) & (y)) | (~(x) & (z))) # define SET(a, b, c, d, k, s, Ti)\
+ show +
163
164
165
166
167
168
169
170
171
172
t = a + F(b,c,d) + X[k] + Ti;\ a = ROTATE_LEFT(t, s) + b /* Do the following 16 operations. */ SET(a, b, c, d, 0, 7, T1); SET(d, a, b, c, 1, 12, T2); SET(c, d, a, b, 2, 17, T3); SET(b, c, d, a, 3, 22, T4); SET(a, b, c, d, 4, 7, T5); SET(d, a, b, c, 5, 12, T6); SET(c, d, a, b, 6, 17, T7);
/media/esteban/ACOS/ResurrectionX/external/python/cpython2/Modules/md5.c
185
186
187
188
189
190
191
192
193
194
int i; # if BYTE_ORDER == 0 X = xbuf; /* (dynamic only) */ # else # define xbuf X /* (static only) */ # endif for (i = 0; i < 16; ++i, xp += 4) xbuf[i] = xp[0] + (xp[1] << 8) + (xp[2] << 16) + (xp[3] << 24); }
+ show +
195
196
197
198
199
200
201
202
203
204
#endif } #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) /* Round 1. */ /* Let [abcd k s i] denote the operation a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */ #define F(x, y, z) (((x) & (y)) | (~(x) & (z))) #define SET(a, b, c, d, k, s, Ti)\
+ show +
205
206
207
208
209
210
211
212
213
214
t = a + F(b,c,d) + X[k] + Ti;\ a = ROTATE_LEFT(t, s) + b /* Do the following 16 operations. */ SET(a, b, c, d, 0, 7, T1); SET(d, a, b, c, 1, 12, T2); SET(c, d, a, b, 2, 17, T3); SET(b, c, d, a, 3, 22, T4); SET(a, b, c, d, 4, 7, T5); SET(d, a, b, c, 5, 12, T6); SET(c, d, a, b, 6, 17, T7);

[CVE-2019-2228_1.diff] file-private.h #3
-struct _cups_file_s /**** CUPS file structure... ****/ - -{ - int fd; /* File descriptor */ - char mode, /* Mode ('r' or 'w') */ - compressed, /* Compression used? */ - is_stdio, /* stdin/out/err? */ - eof, /* End of file? */ - buf[4096], /* Buffer */ - *ptr, /* Pointer into buffer */ - *end; /* End of buffer data */ - off_t pos, /* Position in file */ - bufpos; /* File position for start of buffer */ - -#ifdef HAVE_LIBZ - z_stream stream; /* (De)compression stream */ - Bytef cbuf[4096]; /* (De)compression buffer */ - uLong crc; /* (De)compression CRC */ -#endif /* HAVE_LIBZ */ - - char *printf_buffer; /* cupsFilePrintf buffer */ - size_t printf_size; /* Size of cupsFilePrintf buffer */ -}; -
/media/esteban/ACOS/ResurrectionX/external/libcups/cups/file.c
28
29
30
31
32
33
34
35
36
37
# ifdef HAVE_LIBZ # include <zlib.h> # endif /* HAVE_LIBZ */ /* * Internal structures... */
+ show +
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
struct _cups_file_s /**** CUPS file structure... ****/ { int fd; /* File descriptor */ char mode, /* Mode ('r' or 'w') */ compressed, /* Compression used? */ is_stdio, /* stdin/out/err? */ eof, /* End of file? */ buf[4096], /* Buffer */ *ptr, /* Pointer into buffer */ *end; /* End of buffer data */ off_t pos, /* Position in file */ bufpos; /* File position for start of buffer */ #ifdef HAVE_LIBZ z_stream stream; /* (De)compression stream */ Bytef cbuf[4096]; /* (De)compression buffer */ uLong crc; /* (De)compression CRC */ #endif /* HAVE_LIBZ */ char *printf_buffer; /* cupsFilePrintf buffer */ size_t printf_size; /* Size of cupsFilePrintf buffer */ };
+ show +
61
62
63
64
65
66
67
68
69
70
/* * Local functions... */ #ifdef HAVE_LIBZ static ssize_t cups_compress(cups_file_t *fp, const char *buf, size_t bytes); #endif /* HAVE_LIBZ */ static ssize_t cups_fill(cups_file_t *fp);

[CVE-2019-2228_1.diff] http-private.h #6
-# endif /* !WIN32 */ - -# ifdef HAVE_LIBZ -# include <zlib.h> -# endif /* HAVE_LIBZ */ +# endif /* !_WIN32 */
/media/esteban/ACOS/ResurrectionX/external/libcups/cups/http.c
25
26
27
28
29
30
31
32
33
34
#include <math.h> #ifdef _WIN32 # include <tchar.h> #else # include <signal.h> # include <sys/time.h> # include <sys/resource.h> #endif /* _WIN32 */ #ifdef HAVE_POLL # include <poll.h>
+ show +
35
36
37
38
#endif /* HAVE_POLL */ # ifdef HAVE_LIBZ # include <zlib.h> # endif /* HAVE_LIBZ */
+ show +
39
40
41
42
43
44
45
46
47
48
/* * Local functions... */ static void http_add_field(http_t *http, http_field_t field, const char *value, int append); #ifdef HAVE_LIBZ static void http_content_coding_finish(http_t *http); static void http_content_coding_start(http_t *http,

[CVE-2019-2228_1.diff] usersys.c #12
- cc->encryption = (http_encryption_t)-1; - cc->trust_first = -1; - cc->any_root = -1; - cc->expired_certs = -1; - cc->validate_certs = -1; +#ifdef HAVE_SSL + cc->ssl_min_version = _HTTP_TLS_1_0; + cc->ssl_max_version = _HTTP_TLS_MAX; +#endif /* HAVE_SSL */ + cc->encryption = (http_encryption_t)-1; + cc->trust_first = -1; + cc->any_root = -1; + cc->expired_certs = -1; + cc->validate_certs = -1;
/media/esteban/ACOS/ResurrectionX/external/libcups/cups/usersys.c
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
/* * Clear all values to "not set"... */ memset(cc, 0, sizeof(_cups_client_conf_t)); #ifdef HAVE_SSL cc->ssl_min_version = _HTTP_TLS_1_0; cc->ssl_max_version = _HTTP_TLS_MAX; #endif /* HAVE_SSL */
+ show +
1173
1174
1175
1176
1177
cc->encryption = (http_encryption_t)-1; cc->trust_first = -1; cc->any_root = -1; cc->expired_certs = -1; cc->validate_certs = -1;
+ show +
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
/* * Load settings from the org.cups.PrintingPrefs plist (which trump * everything...) */ #if defined(__APPLE__) && defined(HAVE_SSL) char sval[1024]; /* String value */ int bval; /* Boolean value */

[CVE-2020-0478_1.diff] gtest-typed-test.h #8
-// the given type-parameterized test case are defined in. The exact +// the given type-parameterized test suite are defined in. The exact -# define GTEST_CASE_NAMESPACE_(TestCaseName) \ - gtest_case_##TestCaseName##_ +#define GTEST_SUITE_NAMESPACE_(TestSuiteName) gtest_suite_##TestSuiteName##_ -// the defined tests in the given test case. -# define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \ - gtest_typed_test_case_p_state_##TestCaseName##_ +// the defined tests in the given test suite. +#define GTEST_TYPED_TEST_SUITE_P_STATE_(TestSuiteName) \ + gtest_typed_test_suite_p_state_##TestSuiteName##_ -// the registered tests in the given test case. -# define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \ - gtest_registered_test_names_##TestCaseName##_ +// the registered tests in the given test suite. +#define GTEST_REGISTERED_TEST_NAMES_(TestSuiteName) \ + gtest_registered_test_names_##TestSuiteName##_ -# define TYPED_TEST_CASE_P(CaseName) \ - static ::testing::internal::TypedTestCasePState \ - GTEST_TYPED_TEST_CASE_P_STATE_(CaseName) +#define TYPED_TEST_SUITE_P(SuiteName) \ + static ::testing::internal::TypedTestSuitePState \ + GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName) -# define TYPED_TEST_P(CaseName, TestName) \ - namespace GTEST_CASE_NAMESPACE_(CaseName) { \ - template <typename gtest_TypeParam_> \ - class TestName : public CaseName<gtest_TypeParam_> { \ - private: \ - typedef CaseName<gtest_TypeParam_> TestFixture; \ - typedef gtest_TypeParam_ TypeParam; \ - virtual void TestBody(); \ - }; \ - static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \ - GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\ - __FILE__, __LINE__, #CaseName, #TestName); \ - } \ - template <typename gtest_TypeParam_> \ - void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody() +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ +#define TYPED_TEST_CASE_P \ + static_assert(::testing::internal::TypedTestCase_P_IsDeprecated(), ""); \ + TYPED_TEST_SUITE_P +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ -# define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \ - namespace GTEST_CASE_NAMESPACE_(CaseName) { \ - typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \ - } \ - static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \ - GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\ - __FILE__, __LINE__, #__VA_ARGS__) +#define TYPED_TEST_P(SuiteName, TestName) \ + namespace GTEST_SUITE_NAMESPACE_(SuiteName) { \ + template <typename gtest_TypeParam_> \ + class TestName : public SuiteName<gtest_TypeParam_> { \ + private: \ + typedef SuiteName<gtest_TypeParam_> TestFixture; \ + typedef gtest_TypeParam_ TypeParam; \ + void TestBody() override; \ + }; \ + static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \ + GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName).AddTestName( \ + __FILE__, __LINE__, GTEST_STRINGIFY_(SuiteName), \ + GTEST_STRINGIFY_(TestName)); \ + } \ + template <typename gtest_TypeParam_> \ + void GTEST_SUITE_NAMESPACE_( \ + SuiteName)::TestName<gtest_TypeParam_>::TestBody() -// The 'Types' template argument below must have spaces around it -// since some compilers may choke on '>>' when passing a template -// instance (e.g. Types<int>) -# define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \ - bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \ - ::testing::internal::TypeParameterizedTestCase<CaseName, \ - GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \ - ::testing::internal::TypeList< Types >::type>::Register(\ - #Prefix, \ - ::testing::internal::CodeLocation(__FILE__, __LINE__), \ - >EST_TYPED_TEST_CASE_P_STATE_(CaseName), \ - #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName)) +// Note: this won't work correctly if the trailing arguments are macros. +#define REGISTER_TYPED_TEST_SUITE_P(SuiteName, ...) \ + namespace GTEST_SUITE_NAMESPACE_(SuiteName) { \ + typedef ::testing::internal::Templates<__VA_ARGS__> gtest_AllTests_; \ + } \ + static const char *const GTEST_REGISTERED_TEST_NAMES_( \ + SuiteName) GTEST_ATTRIBUTE_UNUSED_ = \ + GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName).VerifyRegisteredTestNames( \ + GTEST_STRINGIFY_(SuiteName), __FILE__, __LINE__, #__VA_ARGS__) + +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ +#define REGISTER_TYPED_TEST_CASE_P \ + static_assert(::testing::internal::RegisterTypedTestCase_P_IsDeprecated(), \ + ""); \ + REGISTER_TYPED_TEST_SUITE_P +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + +#define INSTANTIATE_TYPED_TEST_SUITE_P(Prefix, SuiteName, Types, ...) \ + static_assert(sizeof(GTEST_STRINGIFY_(Prefix)) > 1, \ + "test-suit-prefix must not be empty"); \ + static bool gtest_##Prefix##_##SuiteName GTEST_ATTRIBUTE_UNUSED_ = \ + ::testing::internal::TypeParameterizedTestSuite< \ + SuiteName, GTEST_SUITE_NAMESPACE_(SuiteName)::gtest_AllTests_, \ + ::testing::internal::GenerateTypeList<Types>::type>:: \ + Register(GTEST_STRINGIFY_(Prefix), \ + ::testing::internal::CodeLocation(__FILE__, __LINE__), \ + >EST_TYPED_TEST_SUITE_P_STATE_(SuiteName), \ + GTEST_STRINGIFY_(SuiteName), \ + GTEST_REGISTERED_TEST_NAMES_(SuiteName), \ + ::testing::internal::GenerateNames< \ + ::testing::internal::NameGeneratorSelector< \ + __VA_ARGS__>::type, \ + ::testing::internal::GenerateTypeList<Types>::type>()) + +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ +#define INSTANTIATE_TYPED_TEST_CASE_P \ + static_assert( \ + ::testing::internal::InstantiateTypedTestCase_P_IsDeprecated(), ""); \ + INSTANTIATE_TYPED_TEST_SUITE_P +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
18603
18604
18605
18606
18607
18608
18609
18610
18611
18612
// Implements type-parameterized tests. #if GTEST_HAS_TYPED_TEST_P // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Expands to the namespace name that the type-parameterized tests for // the given type-parameterized test case are defined in. The exact // name of the namespace is subject to change without notice.
+ show +
18613
18614
18615
18616
18617
18618
18619
18620
18621
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
18647
18648
18649
18650
18651
18652
18653
18654
18655
18656
18657
18658
18659
18660
18661
18662
18663
18664
18665
18666
18667
18668
18669
18670
18671
18672
# define GTEST_CASE_NAMESPACE_(TestCaseName) \ gtest_case_##TestCaseName##_ // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Expands to the name of the variable used to remember the names of // the defined tests in the given test case. # define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \ gtest_typed_test_case_p_state_##TestCaseName##_ // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY. // // Expands to the name of the variable used to remember the names of // the registered tests in the given test case. # define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \ gtest_registered_test_names_##TestCaseName##_ // The variables defined in the type-parameterized test macros are // static as typically these macros are used in a .h file that can be // #included in multiple translation units linked together. # define TYPED_TEST_CASE_P(CaseName) \ static ::testing::internal::TypedTestCasePState \ GTEST_TYPED_TEST_CASE_P_STATE_(CaseName) # define TYPED_TEST_P(CaseName, TestName) \ namespace GTEST_CASE_NAMESPACE_(CaseName) { \ template <typename gtest_TypeParam_> \ class TestName : public CaseName<gtest_TypeParam_> { \ private: \ typedef CaseName<gtest_TypeParam_> TestFixture; \ typedef gtest_TypeParam_ TypeParam; \ virtual void TestBody(); \ }; \ static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \ GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\ __FILE__, __LINE__, #CaseName, #TestName); \ } \ template <typename gtest_TypeParam_> \ void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody() # define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \ namespace GTEST_CASE_NAMESPACE_(CaseName) { \ typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \ } \ static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \ GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\ __FILE__, __LINE__, #__VA_ARGS__) // The 'Types' template argument below must have spaces around it // since some compilers may choke on '>>' when passing a template // instance (e.g. Types<int>) # define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \ bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \ ::testing::internal::TypeParameterizedTestCase<CaseName, \ GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \ ::testing::internal::TypeList< Types >::type>::Register(\ #Prefix, \ ::testing::internal::CodeLocation(__FILE__, __LINE__), \ &GTEST_TYPED_TEST_CASE_P_STATE_(CaseName), \ #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
+ show +
18673
18674
18675
18676
18677
18678
18679
18680
18681
18682
#endif // GTEST_HAS_TYPED_TEST_P #endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ // Depending on the platform, different string classes are available. // On Linux, in addition to ::std::string, Google also makes use of // class ::string, which has the same interface as ::std::string, but // has a different implementation. //

[CVE-2020-0470_1.diff] gtest-typed-test.h #8
-// the given type-parameterized test case are defined in. The exact +// the given type-parameterized test suite are defined in. The exact -# define GTEST_CASE_NAMESPACE_(TestCaseName) \ - gtest_case_##TestCaseName##_ +#define GTEST_SUITE_NAMESPACE_(TestSuiteName) gtest_suite_##TestSuiteName##_ -// the defined tests in the given test case. -# define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \ - gtest_typed_test_case_p_state_##TestCaseName##_ +// the defined tests in the given test suite. +#define GTEST_TYPED_TEST_SUITE_P_STATE_(TestSuiteName) \ + gtest_typed_test_suite_p_state_##TestSuiteName##_ -// the registered tests in the given test case. -# define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \ - gtest_registered_test_names_##TestCaseName##_ +// the registered tests in the given test suite. +#define GTEST_REGISTERED_TEST_NAMES_(TestSuiteName) \ + gtest_registered_test_names_##TestSuiteName##_ -# define TYPED_TEST_CASE_P(CaseName) \ - static ::testing::internal::TypedTestCasePState \ - GTEST_TYPED_TEST_CASE_P_STATE_(CaseName) +#define TYPED_TEST_SUITE_P(SuiteName) \ + static ::testing::internal::TypedTestSuitePState \ + GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName) -# define TYPED_TEST_P(CaseName, TestName) \ - namespace GTEST_CASE_NAMESPACE_(CaseName) { \ - template <typename gtest_TypeParam_> \ - class TestName : public CaseName<gtest_TypeParam_> { \ - private: \ - typedef CaseName<gtest_TypeParam_> TestFixture; \ - typedef gtest_TypeParam_ TypeParam; \ - virtual void TestBody(); \ - }; \ - static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \ - GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\ - __FILE__, __LINE__, #CaseName, #TestName); \ - } \ - template <typename gtest_TypeParam_> \ - void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody() +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ +#define TYPED_TEST_CASE_P \ + static_assert(::testing::internal::TypedTestCase_P_IsDeprecated(), ""); \ + TYPED_TEST_SUITE_P +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ -# define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \ - namespace GTEST_CASE_NAMESPACE_(CaseName) { \ - typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \ - } \ - static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \ - GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\ - __FILE__, __LINE__, #__VA_ARGS__) +#define TYPED_TEST_P(SuiteName, TestName) \ + namespace GTEST_SUITE_NAMESPACE_(SuiteName) { \ + template <typename gtest_TypeParam_> \ + class TestName : public SuiteName<gtest_TypeParam_> { \ + private: \ + typedef SuiteName<gtest_TypeParam_> TestFixture; \ + typedef gtest_TypeParam_ TypeParam; \ + void TestBody() override; \ + }; \ + static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \ + GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName).AddTestName( \ + __FILE__, __LINE__, GTEST_STRINGIFY_(SuiteName), \ + GTEST_STRINGIFY_(TestName)); \ + } \ + template <typename gtest_TypeParam_> \ + void GTEST_SUITE_NAMESPACE_( \ + SuiteName)::TestName<gtest_TypeParam_>::TestBody() -// The 'Types' template argument below must have spaces around it -// since some compilers may choke on '>>' when passing a template -// instance (e.g. Types<int>) -# define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \ - bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \ - ::testing::internal::TypeParameterizedTestCase<CaseName, \ - GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \ - ::testing::internal::TypeList< Types >::type>::Register(\ - #Prefix, \ - ::testing::internal::CodeLocation(__FILE__, __LINE__), \ - >EST_TYPED_TEST_CASE_P_STATE_(CaseName), \ - #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName)) +// Note: this won't work correctly if the trailing arguments are macros. +#define REGISTER_TYPED_TEST_SUITE_P(SuiteName, ...) \ + namespace GTEST_SUITE_NAMESPACE_(SuiteName) { \ + typedef ::testing::internal::Templates<__VA_ARGS__> gtest_AllTests_; \ + } \ + static const char *const GTEST_REGISTERED_TEST_NAMES_( \ + SuiteName) GTEST_ATTRIBUTE_UNUSED_ = \ + GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName).VerifyRegisteredTestNames( \ + GTEST_STRINGIFY_(SuiteName), __FILE__, __LINE__, #__VA_ARGS__) + +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ +#define REGISTER_TYPED_TEST_CASE_P \ + static_assert(::testing::internal::RegisterTypedTestCase_P_IsDeprecated(), \ + ""); \ + REGISTER_TYPED_TEST_SUITE_P +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + +#define INSTANTIATE_TYPED_TEST_SUITE_P(Prefix, SuiteName, Types, ...) \ + static_assert(sizeof(GTEST_STRINGIFY_(Prefix)) > 1, \ + "test-suit-prefix must not be empty"); \ + static bool gtest_##Prefix##_##SuiteName GTEST_ATTRIBUTE_UNUSED_ = \ + ::testing::internal::TypeParameterizedTestSuite< \ + SuiteName, GTEST_SUITE_NAMESPACE_(SuiteName)::gtest_AllTests_, \ + ::testing::internal::GenerateTypeList<Types>::type>:: \ + Register(GTEST_STRINGIFY_(Prefix), \ + ::testing::internal::CodeLocation(__FILE__, __LINE__), \ + >EST_TYPED_TEST_SUITE_P_STATE_(SuiteName), \ + GTEST_STRINGIFY_(SuiteName), \ + GTEST_REGISTERED_TEST_NAMES_(SuiteName), \ + ::testing::internal::GenerateNames< \ + ::testing::internal::NameGeneratorSelector< \ + __VA_ARGS__>::type, \ + ::testing::internal::GenerateTypeList<Types>::type>()) + +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ +#define INSTANTIATE_TYPED_TEST_CASE_P \ + static_assert( \ + ::testing::internal::InstantiateTypedTestCase_P_IsDeprecated(), ""); \ + INSTANTIATE_TYPED_TEST_SUITE_P +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
/media/esteban/ACOS/ResurrectionX/external/epid-sdk/ext/gtest/gtest.h
18603
18604
18605
18606
18607
18608
18609
18610
18611
18612
// Implements type-parameterized tests. #if GTEST_HAS_TYPED_TEST_P // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Expands to the namespace name that the type-parameterized tests for // the given type-parameterized test case are defined in. The exact // name of the namespace is subject to change without notice.
+ show +
18613
18614
18615
18616
18617
18618
18619
18620
18621
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
18647
18648
18649
18650
18651
18652
18653
18654
18655
18656
18657
18658
18659
18660
18661
18662
18663
18664
18665
18666
18667
18668
18669
18670
18671
18672
# define GTEST_CASE_NAMESPACE_(TestCaseName) \ gtest_case_##TestCaseName##_ // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Expands to the name of the variable used to remember the names of // the defined tests in the given test case. # define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \ gtest_typed_test_case_p_state_##TestCaseName##_ // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY. // // Expands to the name of the variable used to remember the names of // the registered tests in the given test case. # define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \ gtest_registered_test_names_##TestCaseName##_ // The variables defined in the type-parameterized test macros are // static as typically these macros are used in a .h file that can be // #included in multiple translation units linked together. # define TYPED_TEST_CASE_P(CaseName) \ static ::testing::internal::TypedTestCasePState \ GTEST_TYPED_TEST_CASE_P_STATE_(CaseName) # define TYPED_TEST_P(CaseName, TestName) \ namespace GTEST_CASE_NAMESPACE_(CaseName) { \ template <typename gtest_TypeParam_> \ class TestName : public CaseName<gtest_TypeParam_> { \ private: \ typedef CaseName<gtest_TypeParam_> TestFixture; \ typedef gtest_TypeParam_ TypeParam; \ virtual void TestBody(); \ }; \ static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \ GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\ __FILE__, __LINE__, #CaseName, #TestName); \ } \ template <typename gtest_TypeParam_> \ void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody() # define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \ namespace GTEST_CASE_NAMESPACE_(CaseName) { \ typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \ } \ static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \ GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\ __FILE__, __LINE__, #__VA_ARGS__) // The 'Types' template argument below must have spaces around it // since some compilers may choke on '>>' when passing a template // instance (e.g. Types<int>) # define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \ bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \ ::testing::internal::TypeParameterizedTestCase<CaseName, \ GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \ ::testing::internal::TypeList< Types >::type>::Register(\ #Prefix, \ ::testing::internal::CodeLocation(__FILE__, __LINE__), \ &GTEST_TYPED_TEST_CASE_P_STATE_(CaseName), \ #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
+ show +
18673
18674
18675
18676
18677
18678
18679
18680
18681
18682
#endif // GTEST_HAS_TYPED_TEST_P #endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ // Depending on the platform, different string classes are available. // On Linux, in addition to ::std::string, Google also makes use of // class ::string, which has the same interface as ::std::string, but // has a different implementation. //

[CVE-2023-40093_1.diff] fx_crypt.cpp #4
+ uint32_t A = ctx->state[0]; + uint32_t B = ctx->state[1]; + uint32_t C = ctx->state[2]; + uint32_t D = ctx->state[3]; - A = ctx->state[0]; - B = ctx->state[1]; - C = ctx->state[2]; - D = ctx->state[3];
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fdrm/crypto/fx_crypt_sha.cpp
304
305
306
307
308
309
310
311
312
313
GET_FX_64WORD(W[6], data, 48); GET_FX_64WORD(W[7], data, 56); GET_FX_64WORD(W[8], data, 64); GET_FX_64WORD(W[9], data, 72); GET_FX_64WORD(W[10], data, 80); GET_FX_64WORD(W[11], data, 88); GET_FX_64WORD(W[12], data, 96); GET_FX_64WORD(W[13], data, 104); GET_FX_64WORD(W[14], data, 112); GET_FX_64WORD(W[15], data, 120);
+ show +
314
315
316
317
A = ctx->state[0]; B = ctx->state[1]; C = ctx->state[2]; D = ctx->state[3];
+ show +
318
319
320
321
322
323
324
325
326
327
E = ctx->state[4]; F = ctx->state[5]; G = ctx->state[6]; H = ctx->state[7]; for (int i = 0; i < 10; ++i) { uint64_t temp[8]; if (i < 2) { temp[0] = W[i * 8]; temp[1] = W[i * 8 + 1]; temp[2] = W[i * 8 + 2];
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fdrm/crypto/fx_crypt.cpp
47
48
49
50
51
52
53
54
55
56
GET_UINT32(X[12], data, 48); GET_UINT32(X[13], data, 52); GET_UINT32(X[14], data, 56); GET_UINT32(X[15], data, 60); #define S(x, n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n))) #define P(a, b, c, d, k, s, t) \ { \ a += F(b, c, d) + X[k] + t; \ a = S(a, s) + b; \ }
+ show +
57
58
59
60
A = ctx->state[0]; B = ctx->state[1]; C = ctx->state[2]; D = ctx->state[3];
+ show +
61
62
63
64
65
66
67
68
69
70
#define F(x, y, z) (z ^ (x & (y ^ z))) P(A, B, C, D, 0, 7, 0xD76AA478); P(D, A, B, C, 1, 12, 0xE8C7B756); P(C, D, A, B, 2, 17, 0x242070DB); P(B, C, D, A, 3, 22, 0xC1BDCEEE); P(A, B, C, D, 4, 7, 0xF57C0FAF); P(D, A, B, C, 5, 12, 0x4787C62A); P(C, D, A, B, 6, 17, 0xA8304613); P(B, C, D, A, 7, 22, 0xFD469501); P(A, B, C, D, 8, 7, 0x698098D8);
/media/esteban/ACOS/ResurrectionX/external/vim/src/sha256.c
97
98
99
100
101
102
103
104
105
106
S0(W[t - 15]) + W[t - 16] \ ) #define P(a,b,c,d,e,f,g,h,x,K) \ { \ temp1 = h + S3(e) + F1(e, f, g) + K + x; \ temp2 = S2(a) + F0(a, b, c); \ d += temp1; h = temp1 + temp2; \ }
+ show +
107
108
109
110
A = ctx->state[0]; B = ctx->state[1]; C = ctx->state[2]; D = ctx->state[3];
+ show +
111
112
113
114
115
116
117
118
119
120
E = ctx->state[4]; F = ctx->state[5]; G = ctx->state[6]; H = ctx->state[7]; P( A, B, C, D, E, F, G, H, W[ 0], 0x428A2F98); P( H, A, B, C, D, E, F, G, W[ 1], 0x71374491); P( G, H, A, B, C, D, E, F, W[ 2], 0xB5C0FBCF); P( F, G, H, A, B, C, D, E, W[ 3], 0xE9B5DBA5); P( E, F, G, H, A, B, C, D, W[ 4], 0x3956C25B);
/media/esteban/ACOS/ResurrectionX/external/u-boot/lib/sha256.c
95
96
97
98
99
100
101
102
103
104
W[t] = S1(W[t - 2]) + W[t - 7] + \ S0(W[t - 15]) + W[t - 16] \ ) #define P(a,b,c,d,e,f,g,h,x,K) { \ temp1 = h + S3(e) + F1(e,f,g) + K + x; \ temp2 = S2(a) + F0(a,b,c); \ d += temp1; h = temp1 + temp2; \ }
+ show +
105
106
107
108
A = ctx->state[0]; B = ctx->state[1]; C = ctx->state[2]; D = ctx->state[3];
+ show +
109
110
111
112
113
114
115
116
117
118
E = ctx->state[4]; F = ctx->state[5]; G = ctx->state[6]; H = ctx->state[7]; P(A, B, C, D, E, F, G, H, W[0], 0x428A2F98); P(H, A, B, C, D, E, F, G, W[1], 0x71374491); P(G, H, A, B, C, D, E, F, W[2], 0xB5C0FBCF); P(F, G, H, A, B, C, D, E, W[3], 0xE9B5DBA5); P(E, F, G, H, A, B, C, D, W[4], 0x3956C25B);
/media/esteban/ACOS/ResurrectionX/external/u-boot/lib/sha1.c
91
92
93
94
95
96
97
98
99
100
#define R(t) ( \ temp = W[(t - 3) & 0x0F] ^ W[(t - 8) & 0x0F] ^ \ W[(t - 14) & 0x0F] ^ W[ t & 0x0F], \ ( W[t & 0x0F] = S(temp,1) ) \ ) #define P(a,b,c,d,e,x) { \ e += S(a,5) + F(b,c,d) + K + x; b = S(b,30); \ }
+ show +
101
102
103
104
A = ctx->state[0]; B = ctx->state[1]; C = ctx->state[2]; D = ctx->state[3];
+ show +
105
106
107
108
109
110
111
112
113
114
E = ctx->state[4]; #define F(x,y,z) (z ^ (x & (y ^ z))) #define K 0x5A827999 P (A, B, C, D, E, W[0]); P (E, A, B, C, D, W[1]); P (D, E, A, B, C, W[2]); P (C, D, E, A, B, W[3]); P (B, C, D, E, A, W[4]);
/media/esteban/ACOS/ResurrectionX/external/vboot_reference/firmware/lib/cryptolib/sha1.c
29
30
31
32
33
34
35
36
37
38
} static uint32_t ror31(uint32_t val) { return (val >> 31) | (val << 1); } static void SHA1_Transform(SHA1_CTX* ctx) { uint32_t W[80]; register uint32_t A, B, C, D, E; int t;
+ show +
39
40
41
42
A = ctx->state[0]; B = ctx->state[1]; C = ctx->state[2]; D = ctx->state[3];
+ show +
43
44
45
46
47
48
49
50
51
52
E = ctx->state[4]; #define SHA_F1(A,B,C,D,E,t) \ E += ror27(A) + \ (W[t] = bswap_32(ctx->buf.w[t])) + \ (D^(B&(C^D))) + 0x5A827999; \ B = ror2(B); for (t = 0; t < 15; t += 5) { SHA_F1(A,B,C,D,E,t + 0);
/media/esteban/ACOS/ResurrectionX/external/vboot_reference/firmware/lib/cryptolib/sha1.c
186
187
188
189
190
191
192
193
194
195
tmp |= *p++ << 16; tmp |= *p++ << 8; tmp |= *p++; W[t] = tmp; } for(; t < 80; t++) { W[t] = rol(1,W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16]); }
+ show +
196
197
198
199
A = ctx->state[0]; B = ctx->state[1]; C = ctx->state[2]; D = ctx->state[3];
+ show +
200
201
202
203
204
205
206
207
208
209
E = ctx->state[4]; for(t = 0; t < 80; t++) { uint32_t tmp = rol(5,A) + E + W[t]; if (t < 20) tmp += (D^(B&(C^D))) + 0x5A827999; else if ( t < 40) tmp += (B^C^D) + 0x6ED9EBA1; else if ( t < 60)
/media/esteban/ACOS/ResurrectionX/external/vboot_reference/firmware/2lib/2sha1.c
36
37
38
39
40
41
42
43
44
45
return (val >> 31) | (val << 1); } static void sha1_transform(struct vb2_sha1_context *ctx) { /* Note that this array uses 80*4=320 bytes of stack */ uint32_t W[80]; register uint32_t A, B, C, D, E; int t;
+ show +
46
47
48
49
A = ctx->state[0]; B = ctx->state[1]; C = ctx->state[2]; D = ctx->state[3];
+ show +
50
51
52
53
54
55
56
57
58
59
E = ctx->state[4]; #define SHA_F1(A,B,C,D,E,t) \ E += ror27(A) + \ (W[t] = bswap_32(ctx->buf.w[t])) + \ (D^(B&(C^D))) + 0x5A827999; \ B = ror2(B); for (t = 0; t < 15; t += 5) { SHA_F1(A,B,C,D,E,t + 0);
/media/esteban/ACOS/ResurrectionX/external/vboot_reference/firmware/2lib/2sha1.c
199
200
201
202
203
204
205
206
207
208
tmp |= *p++ << 16; tmp |= *p++ << 8; tmp |= *p++; W[t] = tmp; } for(; t < 80; t++) { W[t] = rol(1,W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16]); }
+ show +
209
210
211
212
A = ctx->state[0]; B = ctx->state[1]; C = ctx->state[2]; D = ctx->state[3];
+ show +
213
214
215
216
217
218
219
220
221
222
E = ctx->state[4]; for(t = 0; t < 80; t++) { uint32_t tmp = rol(5,A) + E + W[t]; if (t < 20) tmp += (D^(B&(C^D))) + 0x5A827999; else if ( t < 40) tmp += (B^C^D) + 0x6ED9EBA1; else if ( t < 60)

[CVE-2023-40093_1.diff] fx_crypt_sha.cpp #3
+#include <string.h> + -#define SHA384_P(a, b, c, d, e, f, g, h, x, K) \ - { \ - temp1 = h + SHA384_S3(e) + SHA384_F1(e, f, g) + K + x; \ - temp2 = SHA384_S2(a) + SHA384_F0(a, b, c); \ - d += temp1; \ - h = temp1 + temp2; \ +#define SHA384_P(a, b, c, d, e, f, g, h, x, K) \ + { \ + uint64_t temp1 = h + SHA384_S3(e) + SHA384_F1(e, f, g) + K + x; \ + uint64_t temp2 = SHA384_S2(a) + SHA384_F0(a, b, c); \ + d += temp1; \ + h = temp1 + temp2; \
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fdrm/crypto/fx_crypt_sha.cpp
25
26
27
28
29
30
31
32
33
34
#define SHA384_F1(x, y, z) (z ^ (x & (y ^ z))) #define SHA384_SHR(x, n) (x >> n) #define SHA384_ROTR(x, n) (SHA384_SHR(x, n) | x << (64 - n)) #define SHA384_S0(x) (SHA384_ROTR(x, 1) ^ SHA384_ROTR(x, 8) ^ SHA384_SHR(x, 7)) #define SHA384_S1(x) \ (SHA384_ROTR(x, 19) ^ SHA384_ROTR(x, 61) ^ SHA384_SHR(x, 6)) #define SHA384_S2(x) \ (SHA384_ROTR(x, 28) ^ SHA384_ROTR(x, 34) ^ SHA384_ROTR(x, 39)) #define SHA384_S3(x) \ (SHA384_ROTR(x, 14) ^ SHA384_ROTR(x, 18) ^ SHA384_ROTR(x, 41))
+ show +
35
36
37
38
39
40
#define SHA384_P(a, b, c, d, e, f, g, h, x, K) \ { \ temp1 = h + SHA384_S3(e) + SHA384_F1(e, f, g) + K + x; \ temp2 = SHA384_S2(a) + SHA384_F0(a, b, c); \ d += temp1; \ h = temp1 + temp2; \
+ show +
41
42
43
44
45
46
47
48
49
50
} #define SHA384_R(t) \ (W[t] = SHA384_S1(W[t - 2]) + W[t - 7] + SHA384_S0(W[t - 15]) + W[t - 16]) #define GET_FX_64WORD(n, b, i) \ { \ (n) = ((uint64_t)(b)[(i)] << 56) | ((uint64_t)(b)[(i) + 1] << 48) | \ ((uint64_t)(b)[(i) + 2] << 40) | ((uint64_t)(b)[(i) + 3] << 32) | \ ((uint64_t)(b)[(i) + 4] << 24) | ((uint64_t)(b)[(i) + 5] << 16) | \ ((uint64_t)(b)[(i) + 6] << 8) | ((uint64_t)(b)[(i) + 7]); \

[CVE-2023-40093_1.diff] fx_crypt_sha.cpp #4
-#define PS(a, b, c, d, e, f, g, h, x, K) \ - { \ - temp1 = h + S3(e) + F1(e, f, g) + K + x; \ - temp2 = S2(a) + F0(a, b, c); \ - d += temp1; \ - h = temp1 + temp2; \ +#define PS(a, b, c, d, e, f, g, h, x, K) \ + { \ + uint32_t temp1 = h + S3(e) + F1(e, f, g) + K + x; \ + uint32_t temp2 = S2(a) + F0(a, b, c); \ + d += temp1; \ + h = temp1 + temp2; \
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fdrm/crypto/fx_crypt_sha.cpp
63
64
65
66
67
68
69
70
71
72
#define SHR(x, n) ((x & 0xFFFFFFFF) >> n) #define ROTR(x, n) (SHR(x, n) | (x << (32 - n))) #define S0(x) (ROTR(x, 7) ^ ROTR(x, 18) ^ SHR(x, 3)) #define S1(x) (ROTR(x, 17) ^ ROTR(x, 19) ^ SHR(x, 10)) #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22)) #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25)) #define F0(x, y, z) ((x & y) | (z & (x | y))) #define F1(x, y, z) (z ^ (x & (y ^ z))) #define R(t) (W[t] = S1(W[t - 2]) + W[t - 7] + S0(W[t - 15]) + W[t - 16])
+ show +
73
74
75
76
77
78
#define PS(a, b, c, d, e, f, g, h, x, K) \ { \ temp1 = h + S3(e) + F1(e, f, g) + K + x; \ temp2 = S2(a) + F0(a, b, c); \ d += temp1; \ h = temp1 + temp2; \
+ show +
79
80
81
82
83
84
85
86
87
88
} namespace { void SHA_Core_Init(unsigned int h[5]) { h[0] = 0x67452301; h[1] = 0xefcdab89; h[2] = 0x98badcfe; h[3] = 0x10325476; h[4] = 0xc3d2e1f0;

[CVE-2023-40093_1.diff] fx_crypt_sha.cpp #6
- a = digest[0]; - b = digest[1]; - c = digest[2]; - d = digest[3]; - e = digest[4]; + unsigned int a = digest[0]; + unsigned int b = digest[1]; + unsigned int c = digest[2]; + unsigned int d = digest[3]; + unsigned int e = digest[4];
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fdrm/crypto/fx_crypt_sha.cpp
92
93
94
95
96
97
98
99
100
101
unsigned int w[80]; unsigned int a, b, c, d, e; int t; for (t = 0; t < 16; t++) { w[t] = block[t]; } for (t = 16; t < 80; t++) { unsigned int tmp = w[t - 3] ^ w[t - 8] ^ w[t - 14] ^ w[t - 16]; w[t] = rol(tmp, 1); }
+ show +
102
103
104
105
106
a = digest[0]; b = digest[1]; c = digest[2]; d = digest[3]; e = digest[4];
+ show +
107
108
109
110
111
112
113
114
115
116
for (t = 0; t < 20; t++) { unsigned int tmp = rol(a, 5) + ((b & c) | (d & ~b)) + e + w[t] + 0x5a827999; e = d; d = c; c = rol(b, 30); b = a; a = tmp; } for (t = 20; t < 40; t++) { unsigned int tmp = rol(a, 5) + (b ^ c ^ d) + e + w[t] + 0x6ed9eba1;

[CVE-2023-40093_1.diff] fx_crypt_sha.cpp #7
- uint32_t temp1; - uint32_t temp2; - uint32_t A = ctx->state[0]; - uint32_t B = ctx->state[1]; - uint32_t C = ctx->state[2]; - uint32_t D = ctx->state[3]; - uint32_t E = ctx->state[4]; - uint32_t F = ctx->state[5]; - uint32_t G = ctx->state[6]; - uint32_t H = ctx->state[7]; + uint32_t A = static_cast<uint32_t>(ctx->state[0]); + uint32_t B = static_cast<uint32_t>(ctx->state[1]); + uint32_t C = static_cast<uint32_t>(ctx->state[2]); + uint32_t D = static_cast<uint32_t>(ctx->state[3]); + uint32_t E = static_cast<uint32_t>(ctx->state[4]); + uint32_t F = static_cast<uint32_t>(ctx->state[5]); + uint32_t G = static_cast<uint32_t>(ctx->state[6]); + uint32_t H = static_cast<uint32_t>(ctx->state[7]);
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fdrm/crypto/fx_crypt_sha.cpp
156
157
158
159
160
161
162
163
164
165
SHA_GET_UINT32(W[7], data, 28); SHA_GET_UINT32(W[8], data, 32); SHA_GET_UINT32(W[9], data, 36); SHA_GET_UINT32(W[10], data, 40); SHA_GET_UINT32(W[11], data, 44); SHA_GET_UINT32(W[12], data, 48); SHA_GET_UINT32(W[13], data, 52); SHA_GET_UINT32(W[14], data, 56); SHA_GET_UINT32(W[15], data, 60);
+ show +
166
167
168
169
170
171
172
173
174
175
uint32_t temp1; uint32_t temp2; uint32_t A = ctx->state[0]; uint32_t B = ctx->state[1]; uint32_t C = ctx->state[2]; uint32_t D = ctx->state[3]; uint32_t E = ctx->state[4]; uint32_t F = ctx->state[5]; uint32_t G = ctx->state[6]; uint32_t H = ctx->state[7];
+ show +
176
177
178
179
180
181
182
183
184
185
PS(A, B, C, D, E, F, G, H, W[0], 0x428A2F98); PS(H, A, B, C, D, E, F, G, W[1], 0x71374491); PS(G, H, A, B, C, D, E, F, W[2], 0xB5C0FBCF); PS(F, G, H, A, B, C, D, E, W[3], 0xE9B5DBA5); PS(E, F, G, H, A, B, C, D, W[4], 0x3956C25B); PS(D, E, F, G, H, A, B, C, W[5], 0x59F111F1); PS(C, D, E, F, G, H, A, B, W[6], 0x923F82A4); PS(B, C, D, E, F, G, H, A, W[7], 0xAB1C5ED5); PS(A, B, C, D, E, F, G, H, W[8], 0xD807AA98); PS(H, A, B, C, D, E, F, G, W[9], 0x12835B01);

[CVE-2023-40093_1.diff] fx_crypt_sha.cpp #9
- A = ctx->state[0]; - B = ctx->state[1]; - C = ctx->state[2]; - D = ctx->state[3]; - E = ctx->state[4]; - F = ctx->state[5]; - G = ctx->state[6]; - H = ctx->state[7]; + uint64_t A = ctx->state[0]; + uint64_t B = ctx->state[1]; + uint64_t C = ctx->state[2]; + uint64_t D = ctx->state[3]; + uint64_t E = ctx->state[4]; + uint64_t F = ctx->state[5]; + uint64_t G = ctx->state[6]; + uint64_t H = ctx->state[7];
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fdrm/crypto/fx_crypt_sha.cpp
304
305
306
307
308
309
310
311
312
313
GET_FX_64WORD(W[6], data, 48); GET_FX_64WORD(W[7], data, 56); GET_FX_64WORD(W[8], data, 64); GET_FX_64WORD(W[9], data, 72); GET_FX_64WORD(W[10], data, 80); GET_FX_64WORD(W[11], data, 88); GET_FX_64WORD(W[12], data, 96); GET_FX_64WORD(W[13], data, 104); GET_FX_64WORD(W[14], data, 112); GET_FX_64WORD(W[15], data, 120);
+ show +
314
315
316
317
318
319
320
321
A = ctx->state[0]; B = ctx->state[1]; C = ctx->state[2]; D = ctx->state[3]; E = ctx->state[4]; F = ctx->state[5]; G = ctx->state[6]; H = ctx->state[7];
+ show +
322
323
324
325
326
327
328
329
330
331
for (int i = 0; i < 10; ++i) { uint64_t temp[8]; if (i < 2) { temp[0] = W[i * 8]; temp[1] = W[i * 8 + 1]; temp[2] = W[i * 8 + 2]; temp[3] = W[i * 8 + 3]; temp[4] = W[i * 8 + 4]; temp[5] = W[i * 8 + 5]; temp[6] = W[i * 8 + 6];
/media/esteban/ACOS/ResurrectionX/external/vim/src/sha256.c
97
98
99
100
101
102
103
104
105
106
S0(W[t - 15]) + W[t - 16] \ ) #define P(a,b,c,d,e,f,g,h,x,K) \ { \ temp1 = h + S3(e) + F1(e, f, g) + K + x; \ temp2 = S2(a) + F0(a, b, c); \ d += temp1; h = temp1 + temp2; \ }
+ show +
107
108
109
110
111
112
113
114
A = ctx->state[0]; B = ctx->state[1]; C = ctx->state[2]; D = ctx->state[3]; E = ctx->state[4]; F = ctx->state[5]; G = ctx->state[6]; H = ctx->state[7];
+ show +
115
116
117
118
119
120
121
122
123
124
P( A, B, C, D, E, F, G, H, W[ 0], 0x428A2F98); P( H, A, B, C, D, E, F, G, W[ 1], 0x71374491); P( G, H, A, B, C, D, E, F, W[ 2], 0xB5C0FBCF); P( F, G, H, A, B, C, D, E, W[ 3], 0xE9B5DBA5); P( E, F, G, H, A, B, C, D, W[ 4], 0x3956C25B); P( D, E, F, G, H, A, B, C, W[ 5], 0x59F111F1); P( C, D, E, F, G, H, A, B, W[ 6], 0x923F82A4); P( B, C, D, E, F, G, H, A, W[ 7], 0xAB1C5ED5); P( A, B, C, D, E, F, G, H, W[ 8], 0xD807AA98);
/media/esteban/ACOS/ResurrectionX/external/u-boot/lib/sha256.c
95
96
97
98
99
100
101
102
103
104
W[t] = S1(W[t - 2]) + W[t - 7] + \ S0(W[t - 15]) + W[t - 16] \ ) #define P(a,b,c,d,e,f,g,h,x,K) { \ temp1 = h + S3(e) + F1(e,f,g) + K + x; \ temp2 = S2(a) + F0(a,b,c); \ d += temp1; h = temp1 + temp2; \ }
+ show +
105
106
107
108
109
110
111
112
A = ctx->state[0]; B = ctx->state[1]; C = ctx->state[2]; D = ctx->state[3]; E = ctx->state[4]; F = ctx->state[5]; G = ctx->state[6]; H = ctx->state[7];
+ show +
113
114
115
116
117
118
119
120
121
122
P(A, B, C, D, E, F, G, H, W[0], 0x428A2F98); P(H, A, B, C, D, E, F, G, W[1], 0x71374491); P(G, H, A, B, C, D, E, F, W[2], 0xB5C0FBCF); P(F, G, H, A, B, C, D, E, W[3], 0xE9B5DBA5); P(E, F, G, H, A, B, C, D, W[4], 0x3956C25B); P(D, E, F, G, H, A, B, C, W[5], 0x59F111F1); P(C, D, E, F, G, H, A, B, W[6], 0x923F82A4); P(B, C, D, E, F, G, H, A, W[7], 0xAB1C5ED5); P(A, B, C, D, E, F, G, H, W[8], 0xD807AA98);

[CVE-2023-40093_1.diff] fx_crypt_aes.cpp #2
+#include <string.h> + +#include "core/fxcrt/fx_system.h" +#include "third_party/base/check.h" +#include "third_party/base/check_op.h" + -#define GET_32BIT_MSB_FIRST(cp) \ - (((unsigned long)(unsigned char)(cp)[3]) | \ - ((unsigned long)(unsigned char)(cp)[2] << 8) | \ - ((unsigned long)(unsigned char)(cp)[1] << 16) | \ - ((unsigned long)(unsigned char)(cp)[0] << 24))
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fdrm/crypto/fx_crypt_aes.cpp
1
2
3
4
5
6
7
8
9
// Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "core/fdrm/crypto/fx_crypt.h" #define mulby2(x) (((x & 0x7F) << 1) ^ (x & 0x80 ? 0x1B : 0))
+ show +
10
11
12
13
14
#define GET_32BIT_MSB_FIRST(cp) \ (((unsigned long)(unsigned char)(cp)[3]) | \ ((unsigned long)(unsigned char)(cp)[2] << 8) | \ ((unsigned long)(unsigned char)(cp)[1] << 16) | \ ((unsigned long)(unsigned char)(cp)[0] << 24))
+ show +
15
16
17
18
19
20
21
22
23
24
#define PUT_32BIT_MSB_FIRST(cp, value) \ do { \ (cp)[3] = (value); \ (cp)[2] = (value) >> 8; \ (cp)[1] = (value) >> 16; \ (cp)[0] = (value) >> 24; \ } while (0) namespace {

[CVE-2023-40093_1.diff] fx_crypt_aes.cpp #8
- int a, b, c, d; - a = (temp >> 24) & 0xFF; - b = (temp >> 16) & 0xFF; - c = (temp >> 8) & 0xFF; - d = (temp >> 0) & 0xFF; + int a = (temp >> 24) & 0xFF; + int b = (temp >> 16) & 0xFF; + int c = (temp >> 8) & 0xFF; + int d = (temp >> 0) & 0xFF;
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fdrm/crypto/fx_crypt_aes.cpp
708
709
710
711
712
713
714
715
716
717
a = (temp >> 16) & 0xFF; b = (temp >> 8) & 0xFF; c = (temp >> 0) & 0xFF; d = (temp >> 24) & 0xFF; temp = Sbox[a] ^ rconst; temp = (temp << 8) | Sbox[b]; temp = (temp << 8) | Sbox[c]; temp = (temp << 8) | Sbox[d]; rconst = mulby2(rconst); } else if (i % Nk == 4 && Nk > 6) {
+ show +
718
719
720
721
722
int a, b, c, d; a = (temp >> 24) & 0xFF; b = (temp >> 16) & 0xFF; c = (temp >> 8) & 0xFF; d = (temp >> 0) & 0xFF;
+ show +
723
724
725
726
727
728
729
730
731
732
temp = Sbox[a]; temp = (temp << 8) | Sbox[b]; temp = (temp << 8) | Sbox[c]; temp = (temp << 8) | Sbox[d]; } ctx->keysched[i] = ctx->keysched[i - Nk] ^ temp; } } for (i = 0; i <= ctx->Nr; i++) { for (j = 0; j < ctx->Nb; j++) {
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fdrm/crypto/fx_crypt_aes.cpp
726
727
728
729
730
731
732
733
734
735
temp = (temp << 8) | Sbox[d]; } ctx->keysched[i] = ctx->keysched[i - Nk] ^ temp; } } for (i = 0; i <= ctx->Nr; i++) { for (j = 0; j < ctx->Nb; j++) { unsigned int temp; temp = ctx->keysched[(ctx->Nr - i) * ctx->Nb + j]; if (i != 0 && i != ctx->Nr) {
+ show +
736
737
738
739
740
int a, b, c, d; a = (temp >> 24) & 0xFF; b = (temp >> 16) & 0xFF; c = (temp >> 8) & 0xFF; d = (temp >> 0) & 0xFF;
+ show +
741
742
743
744
745
746
747
748
749
750
temp = D0[Sbox[a]]; temp ^= D1[Sbox[b]]; temp ^= D2[Sbox[c]]; temp ^= D3[Sbox[d]]; } ctx->invkeysched[i * ctx->Nb + j] = temp; } } } void aes_decrypt(CRYPT_aes_context* ctx, unsigned int* block) {

[CVE-2023-40093_1.diff] fx_codec_def.h #2
-enum FXCODEC_STATUS { - FXCODEC_STATUS_ERROR = -1, - FXCODEC_STATUS_FRAME_READY, - FXCODEC_STATUS_FRAME_TOBECONTINUE, - FXCODEC_STATUS_DECODE_READY, - FXCODEC_STATUS_DECODE_TOBECONTINUE, - FXCODEC_STATUS_DECODE_FINISH, -#ifdef PDF_ENABLE_XFA - FXCODEC_STATUS_ERR_MEMORY, -#endif // PDF_ENABLE_XFA - FXCODEC_STATUS_ERR_READ, - FXCODEC_STATUS_ERR_FLUSH, - FXCODEC_STATUS_ERR_FORMAT, - FXCODEC_STATUS_ERR_PARAMS +enum class FXCODEC_STATUS { + kError = -1, + kFrameReady, + kFrameToBeContinued, + kDecodeReady, + kDecodeToBeContinued, + kDecodeFinished,
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxcodec/fx_codec_def.h
1
2
3
4
5
6
7
8
9
// Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef CORE_FXCODEC_FX_CODEC_DEF_H_ #define CORE_FXCODEC_FX_CODEC_DEF_H_
+ show +
10
11
12
13
14
15
16
17
18
19
20
21
22
23
enum FXCODEC_STATUS { FXCODEC_STATUS_ERROR = -1, FXCODEC_STATUS_FRAME_READY, FXCODEC_STATUS_FRAME_TOBECONTINUE, FXCODEC_STATUS_DECODE_READY, FXCODEC_STATUS_DECODE_TOBECONTINUE, FXCODEC_STATUS_DECODE_FINISH, #ifdef PDF_ENABLE_XFA FXCODEC_STATUS_ERR_MEMORY, #endif // PDF_ENABLE_XFA FXCODEC_STATUS_ERR_READ, FXCODEC_STATUS_ERR_FLUSH, FXCODEC_STATUS_ERR_FORMAT, FXCODEC_STATUS_ERR_PARAMS
+ show +
24
25
26
27
28
29
30
31
32
33
}; #ifdef PDF_ENABLE_XFA enum FXCODEC_IMAGE_TYPE { FXCODEC_IMAGE_UNKNOWN = 0, FXCODEC_IMAGE_BMP, FXCODEC_IMAGE_JPG, FXCODEC_IMAGE_PNG, FXCODEC_IMAGE_GIF, FXCODEC_IMAGE_TIF,

[CVE-2023-40093_1.diff] JBig2_TrdProc.cpp #12
- pIAFS = pdfium::MakeUnique<CJBig2_ArithIntDecoder>(); - pIADS = pdfium::MakeUnique<CJBig2_ArithIntDecoder>(); - pIAIT = pdfium::MakeUnique<CJBig2_ArithIntDecoder>(); - pIARI = pdfium::MakeUnique<CJBig2_ArithIntDecoder>(); - pIARDW = pdfium::MakeUnique<CJBig2_ArithIntDecoder>(); - pIARDH = pdfium::MakeUnique<CJBig2_ArithIntDecoder>(); - pIARDX = pdfium::MakeUnique<CJBig2_ArithIntDecoder>(); - pIARDY = pdfium::MakeUnique<CJBig2_ArithIntDecoder>(); - pIAID = pdfium::MakeUnique<CJBig2_ArithIaidDecoder>(SBSYMCODELEN); + pIAFS = std::make_unique<CJBig2_ArithIntDecoder>(); + pIADS = std::make_unique<CJBig2_ArithIntDecoder>(); + pIAIT = std::make_unique<CJBig2_ArithIntDecoder>(); + pIARI = std::make_unique<CJBig2_ArithIntDecoder>(); + pIARDW = std::make_unique<CJBig2_ArithIntDecoder>(); + pIARDH = std::make_unique<CJBig2_ArithIntDecoder>(); + pIARDX = std::make_unique<CJBig2_ArithIntDecoder>(); + pIARDY = std::make_unique<CJBig2_ArithIntDecoder>(); + pIAID = std::make_unique<CJBig2_ArithIaidDecoder>(SBSYMCODELEN);
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxcodec/jbig2/JBig2_TrdProc.cpp
240
241
242
243
244
245
246
247
248
249
pIADS = pIDS->IADS; pIAIT = pIDS->IAIT; pIARI = pIDS->IARI; pIARDW = pIDS->IARDW; pIARDH = pIDS->IARDH; pIARDX = pIDS->IARDX; pIARDY = pIDS->IARDY; pIAID = pIDS->IAID; } else { pIADT = pdfium::MakeUnique<CJBig2_ArithIntDecoder>();
+ show +
250
251
252
253
254
255
256
257
258
pIAFS = pdfium::MakeUnique<CJBig2_ArithIntDecoder>(); pIADS = pdfium::MakeUnique<CJBig2_ArithIntDecoder>(); pIAIT = pdfium::MakeUnique<CJBig2_ArithIntDecoder>(); pIARI = pdfium::MakeUnique<CJBig2_ArithIntDecoder>(); pIARDW = pdfium::MakeUnique<CJBig2_ArithIntDecoder>(); pIARDH = pdfium::MakeUnique<CJBig2_ArithIntDecoder>(); pIARDX = pdfium::MakeUnique<CJBig2_ArithIntDecoder>(); pIARDY = pdfium::MakeUnique<CJBig2_ArithIntDecoder>(); pIAID = pdfium::MakeUnique<CJBig2_ArithIaidDecoder>(SBSYMCODELEN);
+ show +
259
260
261
262
263
264
265
266
267
268
} auto SBREG = pdfium::MakeUnique<CJBig2_Image>(SBW, SBH); SBREG->fill(SBDEFPIXEL); int32_t INITIAL_STRIPT; if (!pIADT->decode(pArithDecoder, &INITIAL_STRIPT)) return nullptr; FX_SAFE_INT32 STRIPT = INITIAL_STRIPT; STRIPT *= SBSTRIPS; STRIPT = -STRIPT;

[CVE-2023-40093_1.diff] JBig2_GrdProc.cpp #43
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE; - return FXCODEC_STATUS_DECODE_TOBECONTINUE; + m_ProgressiveStatus = FXCODEC_STATUS::kDecodeToBeContinued; + return FXCODEC_STATUS::kDecodeToBeContinued; - m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH; - return FXCODEC_STATUS_DECODE_FINISH; + m_ProgressiveStatus = FXCODEC_STATUS::kDecodeFinished; + return FXCODEC_STATUS::kDecodeFinished;
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxcodec/jbig2/JBig2_GrdProc.cpp
834
835
836
837
838
839
840
841
842
843
cVal1 |= bVal << (7 - k); CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal | ((line2 >> (7 - k)) & 0x0010)); } m_pLine[nLineBytes] = cVal1; } } m_pLine += nStride; if (pPause && pPause->NeedToPauseNow()) { m_loopIndex++;
+ show +
844
845
846
847
848
849
m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE; return FXCODEC_STATUS_DECODE_TOBECONTINUE; } } m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH; return FXCODEC_STATUS_DECODE_FINISH;
+ show +
850
851
852
853
854
855
856
857
858
859
} FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template0_unopt( CJBig2_Image* pImage, CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* gbContext, IFX_PauseIndicator* pPause) { for (; m_loopIndex < GBH; m_loopIndex++) { if (TPGDON) { if (pArithDecoder->IsComplete())
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxcodec/jbig2/JBig2_GrdProc.cpp
892
893
894
895
896
897
898
899
900
901
} line1 = ((line1 << 1) | pImage->getPixel(w + 2, m_loopIndex - 2)) & 0x07; line2 = ((line2 << 1) | pImage->getPixel(w + 3, m_loopIndex - 1)) & 0x1f; line3 = ((line3 << 1) | bVal) & 0x0f; } } if (pPause && pPause->NeedToPauseNow()) { m_loopIndex++;
+ show +
902
903
904
905
906
907
m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE; return FXCODEC_STATUS_DECODE_TOBECONTINUE; } } m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH; return FXCODEC_STATUS_DECODE_FINISH;
+ show +
908
909
910
911
912
913
914
915
916
917
} FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template1_opt3( CJBig2_Image* pImage, CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* gbContext, IFX_PauseIndicator* pPause) { if (!m_pLine) m_pLine = pImage->data(); int32_t nStride = pImage->stride();
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxcodec/jbig2/JBig2_GrdProc.cpp
993
994
995
996
997
998
999
1000
1001
1002
cVal1 |= bVal << (7 - k); CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal | ((line2 >> (8 - k)) & 0x0008); } m_pLine[nLineBytes] = cVal1; } } m_pLine += nStride; if (pPause && pPause->NeedToPauseNow()) { m_loopIndex++;
+ show +
1003
1004
1005
1006
1007
1008
m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE; return FXCODEC_STATUS_DECODE_TOBECONTINUE; } } m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH; return FXCODEC_STATUS_DECODE_FINISH;
+ show +
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
} FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template1_unopt( CJBig2_Image* pImage, CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* gbContext, IFX_PauseIndicator* pPause) { for (uint32_t h = 0; h < GBH; h++) { if (TPGDON) { if (pArithDecoder->IsComplete())
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxcodec/jbig2/JBig2_GrdProc.cpp
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
if (bVal) { pImage->setPixel(w, h, bVal); } line1 = ((line1 << 1) | pImage->getPixel(w + 3, h - 2)) & 0x0f; line2 = ((line2 << 1) | pImage->getPixel(w + 3, h - 1)) & 0x1f; line3 = ((line3 << 1) | bVal) & 0x07; } } if (pPause && pPause->NeedToPauseNow()) { m_loopIndex++;
+ show +
1057
1058
1059
1060
1061
1062
m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE; return FXCODEC_STATUS_DECODE_TOBECONTINUE; } } m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH; return FXCODEC_STATUS_DECODE_FINISH;
+ show +
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
} FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template2_opt3( CJBig2_Image* pImage, CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* gbContext, IFX_PauseIndicator* pPause) { if (!m_pLine) m_pLine = pImage->data(); int32_t nStride = pImage->stride();
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxcodec/jbig2/JBig2_GrdProc.cpp
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
cVal1 |= bVal << (7 - k); CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal | (((line2 >> (10 - k))) & 0x0004); } m_pLine[nLineBytes] = cVal1; } } m_pLine += nStride; if (pPause && m_loopIndex % 50 == 0 && pPause->NeedToPauseNow()) { m_loopIndex++;
+ show +
1158
1159
1160
1161
1162
1163
m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE; return FXCODEC_STATUS_DECODE_TOBECONTINUE; } } m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH; return FXCODEC_STATUS_DECODE_FINISH;
+ show +
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
} FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template2_unopt( CJBig2_Image* pImage, CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* gbContext, IFX_PauseIndicator* pPause) { for (; m_loopIndex < GBH; m_loopIndex++) { if (TPGDON) { if (pArithDecoder->IsComplete())
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxcodec/jbig2/JBig2_GrdProc.cpp
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
} line1 = ((line1 << 1) | pImage->getPixel(w + 2, m_loopIndex - 2)) & 0x07; line2 = ((line2 << 1) | pImage->getPixel(w + 2, m_loopIndex - 1)) & 0x0f; line3 = ((line3 << 1) | bVal) & 0x03; } } if (pPause && pPause->NeedToPauseNow()) { m_loopIndex++;
+ show +
1212
1213
1214
1215
1216
1217
m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE; return FXCODEC_STATUS_DECODE_TOBECONTINUE; } } m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH; return FXCODEC_STATUS_DECODE_FINISH;
+ show +
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
} FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template3_opt3( CJBig2_Image* pImage, CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* gbContext, IFX_PauseIndicator* pPause) { if (!m_pLine) m_pLine = pImage->data(); int32_t nStride = pImage->stride();
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxcodec/jbig2/JBig2_GrdProc.cpp
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal1 |= bVal << (7 - k); CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal; } m_pLine[nLineBytes] = cVal1; } } m_pLine += nStride; if (pPause && pPause->NeedToPauseNow()) { m_loopIndex++;
+ show +
1299
1300
1301
1302
1303
1304
m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE; return FXCODEC_STATUS_DECODE_TOBECONTINUE; } } m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH; return FXCODEC_STATUS_DECODE_FINISH;
+ show +
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
} FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template3_unopt( CJBig2_Image* pImage, CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* gbContext, IFX_PauseIndicator* pPause) { for (; m_loopIndex < GBH; m_loopIndex++) { if (TPGDON) { if (pArithDecoder->IsComplete())

[CVE-2023-40093_1.diff] cfx_barcode.h #2
+#include <stdint.h> + -#include "core/fxcrt/fx_coordinates.h" -#include "core/fxcrt/fx_string.h" -#include "core/fxcrt/fx_system.h" -#include "core/fxge/fx_dib.h" +#include "core/fxcrt/widestring.h" +#include "core/fxge/dib/fx_dib.h"
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/render/cpdf_textrenderer.h
2
3
4
5
6
7
8
9
10
11
// Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef CORE_FPDFAPI_RENDER_CPDF_TEXTRENDERER_H_ #define CORE_FPDFAPI_RENDER_CPDF_TEXTRENDERER_H_ #include <vector>
+ show +
12
13
14
15
#include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" #include "core/fxge/fx_dib.h"
+ show +
16
17
18
19
20
21
22
23
24
25
class CFX_RenderDevice; class CFX_GraphStateData; class CFX_PathData; class CPDF_RenderOptions; class CPDF_Font; class CPDF_TextRenderer { public: static void DrawTextString(CFX_RenderDevice* pDevice,
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfdoc/cpdf_defaultappearance.h
1
2
3
4
5
6
7
8
9
10
// Copyright 2016 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef CORE_FPDFDOC_CPDF_DEFAULTAPPEARANCE_H_ #define CORE_FPDFDOC_CPDF_DEFAULTAPPEARANCE_H_ #include "core/fpdfdoc/cpdf_defaultappearance.h"
+ show +
11
12
13
14
#include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" #include "core/fxge/fx_dib.h"
+ show +
15
16
17
18
19
20
21
22
23
24
enum class BorderStyle { SOLID, DASH, BEVELED, INSET, UNDERLINE }; enum class PaintOperation { STROKE, FILL }; class CPDF_DefaultAppearance { public: CPDF_DefaultAppearance() {} explicit CPDF_DefaultAppearance(const ByteString& csDA) : m_csDA(csDA) {} CPDF_DefaultAppearance(const CPDF_DefaultAppearance& cDA) {
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/cbc_code39.h
1
2
3
4
5
6
7
8
9
// Copyright 2016 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FXBARCODE_CBC_CODE39_H_ #define FXBARCODE_CBC_CODE39_H_
+ show +
10
11
12
13
#include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" #include "core/fxge/fx_dib.h"
+ show +
14
15
16
17
18
19
20
21
22
23
#include "fxbarcode/cbc_onecode.h" class CBC_OnedCode39Writer; class CBC_Code39 : public CBC_OneCode { public: CBC_Code39(); ~CBC_Code39() override; // CBC_OneCode:
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/cbc_ean13.h
1
2
3
4
5
6
7
8
9
// Copyright 2016 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FXBARCODE_CBC_EAN13_H_ #define FXBARCODE_CBC_EAN13_H_
+ show +
10
11
12
13
#include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" #include "core/fxge/fx_dib.h"
+ show +
14
15
16
17
18
19
20
21
22
23
#include "fxbarcode/cbc_onecode.h" class CBC_OnedEAN13Writer; class CBC_EAN13 : public CBC_OneCode { public: CBC_EAN13(); ~CBC_EAN13() override; // CBC_OneCode:
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fwl/cfx_barcode.h
2
3
4
5
6
7
8
9
10
11
// Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef XFA_FWL_CFX_BARCODE_H_ #define XFA_FWL_CFX_BARCODE_H_ #include <memory>
+ show +
12
13
14
15
#include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" #include "core/fxge/fx_dib.h"
+ show +
16
17
18
19
20
21
22
23
24
25
#include "fxbarcode/BC_Library.h" class CBC_CodeBase; class CFX_Font; class CFX_RenderDevice; class CFX_Matrix; class CFX_Barcode { public: CFX_Barcode();

[CVE-2023-40093_1.diff] cpdf_rendershading.cpp #21
- Coon_Bezier m1, m2; - m1.BezierInterpol(D1, D2, C1, C2); - m2.BezierInterpol(C1, C2, D1, D2); - Coon_Bezier m1f = m1.first_half(); - Coon_Bezier m1s = m1.second_half(); - Coon_Bezier m2f = m2.first_half(); - Coon_Bezier m2s = m2.second_half(); + CoonBezier m1; + CoonBezier m2; + m1.InitFromBezierInterpolation(D1, D2, C1, C2); + m2.InitFromBezierInterpolation(C1, C2, D1, D2); + CoonBezier m1f = m1.first_half(); + CoonBezier m1s = m1.second_half(); + CoonBezier m2f = m2.first_half(); + CoonBezier m2s = m2.second_half();
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/render/cpdf_renderstatus.cpp
795
796
797
798
799
800
801
802
803
804
d_right < COONCOLOR_THRESHOLD) { Coon_Bezier m2; m2.BezierInterpol(C1, C2, D1, D2); x_scale *= 2; left *= 2; Draw(x_scale, y_scale, left, bottom, C1.first_half(), C2.first_half(), D1, m2); Draw(x_scale, y_scale, left + 1, bottom, C1.second_half(), C2.second_half(), m2, D2); } else {
+ show +
805
806
807
808
809
810
811
Coon_Bezier m1, m2; m1.BezierInterpol(D1, D2, C1, C2); m2.BezierInterpol(C1, C2, D1, D2); Coon_Bezier m1f = m1.first_half(); Coon_Bezier m1s = m1.second_half(); Coon_Bezier m2f = m2.first_half(); Coon_Bezier m2s = m2.second_half();
+ show +
812
813
814
815
816
817
818
819
820
821
x_scale *= 2; y_scale *= 2; left *= 2; bottom *= 2; Draw(x_scale, y_scale, left, bottom, C1.first_half(), m1f, D1.first_half(), m2f); Draw(x_scale, y_scale, left, bottom + 1, m1f, C2.first_half(), D1.second_half(), m2s); Draw(x_scale, y_scale, left + 1, bottom, C1.second_half(), m1s, m2f, D2.first_half());

[CVE-2023-40093_1.diff] cpdf_rendershading.cpp #23
- memcpy(coords, tempCoords, sizeof(tempCoords)); - Coon_Color tempColors[2]; - tempColors[0] = patch.patch_colors[flag]; - tempColors[1] = patch.patch_colors[(flag + 1) % 4]; - memcpy(patch.patch_colors, tempColors, sizeof(Coon_Color) * 2); + fxcrt::spancpy(pdfium::make_span(coords), pdfium::make_span(tempCoords)); + CoonColor tempColors[2] = { + tempColors[0] = patch.patch_colors[flag], + tempColors[1] = patch.patch_colors[(flag + 1) % 4]}; + fxcrt::spancpy(pdfium::make_span(patch.patch_colors), + pdfium::make_span(tempColors));
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/render/cpdf_renderstatus.cpp
862
863
864
865
866
867
868
869
870
871
break; uint32_t flag = stream.ReadFlag(); int iStartPoint = 0, iStartColor = 0, i = 0; if (flag) { iStartPoint = 4; iStartColor = 2; CFX_PointF tempCoords[4]; for (i = 0; i < 4; i++) { tempCoords[i] = coords[(flag * 3 + i) % 12]; }
+ show +
872
873
874
875
876
memcpy(coords, tempCoords, sizeof(tempCoords)); Coon_Color tempColors[2]; tempColors[0] = patch.patch_colors[flag]; tempColors[1] = patch.patch_colors[(flag + 1) % 4]; memcpy(patch.patch_colors, tempColors, sizeof(Coon_Color) * 2);
+ show +
877
878
879
880
881
882
883
884
885
886
} for (i = iStartPoint; i < point_count; i++) { if (!stream.CanReadCoords()) break; coords[i] = pObject2Bitmap->Transform(stream.ReadCoords()); } for (i = iStartColor; i < 4; i++) { if (!stream.CanReadColor()) break;

[CVE-2023-40093_1.diff] cpdf_color.cpp #2
-#include "core/fpdfapi/page/cpdf_docpagedata.h" +#include <utility> + -#include "core/fpdfapi/parser/cpdf_array.h" -#include "core/fpdfapi/parser/cpdf_document.h" -#include "core/fxcrt/fx_system.h" +#include "third_party/base/check.h"
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/page/cpdf_color.cpp
1
2
3
4
5
6
7
8
// Copyright 2016 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "core/fpdfapi/page/cpdf_color.h"
+ show +
9
10
11
12
#include "core/fpdfapi/page/cpdf_docpagedata.h" #include "core/fpdfapi/parser/cpdf_array.h" #include "core/fpdfapi/parser/cpdf_document.h" #include "core/fxcrt/fx_system.h"
+ show +
13
14
15
16
17
18
19
20
21
22
CPDF_Color::CPDF_Color() {} CPDF_Color::~CPDF_Color() { ReleaseBuffer(); ReleaseColorSpace(); } bool CPDF_Color::IsPattern() const { return m_pCS && IsPatternInternal();

[CVE-2023-40093_1.diff] cpdf_pageobject.h #3
+// Represents an object within the page, like a form or image. Not to be +// confused with the PDF spec's page object that lives in a page tree, which is +// represented by CPDF_Page. - enum Type { - TEXT = 1, - PATH, - IMAGE, - SHADING, - FORM, + // Values must match corresponding values in //public. + enum class Type { + kText = 1, + kPath, + kImage, + kShading, + kForm,
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/page/cpdf_pageobject.h
13
14
15
16
17
18
19
20
21
22
#include "core/fxcrt/fx_system.h" class CPDF_TextObject; class CPDF_PathObject; class CPDF_ImageObject; class CPDF_ShadingObject; class CPDF_FormObject; class CPDF_PageObject : public CPDF_GraphicStates { public:
+ show +
23
24
25
26
27
28
enum Type { TEXT = 1, PATH, IMAGE, SHADING, FORM,
+ show +
29
30
31
32
33
34
35
36
37
38
}; CPDF_PageObject(); ~CPDF_PageObject() override; virtual Type GetType() const = 0; virtual void Transform(const CFX_Matrix& matrix) = 0; virtual bool IsText() const; virtual bool IsPath() const; virtual bool IsImage() const;

[CVE-2023-40093_1.diff] cpdf_textobject.h #2
+#include <stddef.h> +#include <stdint.h> + +#include "core/fxcrt/fx_coordinates.h" -#include "core/fxcrt/fx_system.h" -class CPDF_TextObjectItem { - public: - CPDF_TextObjectItem(); - ~CPDF_TextObjectItem(); - - uint32_t m_CharCode; - CFX_PointF m_Origin; -}; - + struct Item { + Item(); + Item(const Item& that); + ~Item(); + + uint32_t m_CharCode = 0; + CFX_PointF m_Origin; + }; + - // CPDF_PageObject + // CPDF_PageObject:
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/page/cpdf_textobject.h
5
6
7
8
9
10
11
12
13
14
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef CORE_FPDFAPI_PAGE_CPDF_TEXTOBJECT_H_ #define CORE_FPDFAPI_PAGE_CPDF_TEXTOBJECT_H_ #include <memory> #include <vector> #include "core/fpdfapi/page/cpdf_pageobject.h" #include "core/fxcrt/fx_string.h"
+ show +
15
16
17
18
19
20
21
22
23
24
#include "core/fxcrt/fx_system.h" class CPDF_TextObjectItem { public: CPDF_TextObjectItem(); ~CPDF_TextObjectItem(); uint32_t m_CharCode; CFX_PointF m_Origin; };
+ show +
25
26
27
28
29
30
31
32
33
34
class CPDF_TextObject : public CPDF_PageObject { public: CPDF_TextObject(); ~CPDF_TextObject() override; // CPDF_PageObject Type GetType() const override; void Transform(const CFX_Matrix& matrix) override; bool IsText() const override;

[CVE-2023-40093_1.diff] cpdf_cmap.h #2
+#include <stdint.h> + +#include "core/fxcrt/fixed_zeroed_data_vector.h" +#include "core/fxcrt/unowned_ptr.h" -struct FXCMAP_CMap; +namespace fxcmap { +struct CMap; +} -enum CIDCoding : uint8_t { - CIDCODING_UNKNOWN = 0, - CIDCODING_GB, - CIDCODING_BIG5, - CIDCODING_JIS, - CIDCODING_KOREA, - CIDCODING_UCS2, - CIDCODING_CID, - CIDCODING_UTF16, +enum class CIDCoding : uint8_t { + kUNKNOWN = 0, + kGB, + kBIG5, + kJIS, + kKOREA, + kUCS2, + kCID, + kUTF16, + static constexpr size_t kDirectMapTableSize = 65536; +
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/font/cpdf_cmap.h
6
7
8
9
10
11
12
13
14
15
#ifndef CORE_FPDFAPI_FONT_CPDF_CMAP_H_ #define CORE_FPDFAPI_FONT_CPDF_CMAP_H_ #include <vector> #include "core/fpdfapi/font/cpdf_cidfont.h" #include "core/fxcrt/retain_ptr.h" class CPDF_CMapManager;
+ show +
16
17
18
19
20
21
22
23
24
25
26
struct FXCMAP_CMap; enum CIDCoding : uint8_t { CIDCODING_UNKNOWN = 0, CIDCODING_GB, CIDCODING_BIG5, CIDCODING_JIS, CIDCODING_KOREA, CIDCODING_UCS2, CIDCODING_CID, CIDCODING_UTF16,
+ show +
27
28
29
30
31
32
33
34
35
36
}; class CPDF_CMap : public Retainable { public: enum CodingScheme : uint8_t { OneByte, TwoBytes, MixedTwoBytes, MixedFourBytes };

[CVE-2023-40093_1.diff] cpdf_font.cpp #3
-#include "core/fxcrt/fx_memory.h" +#include "core/fxcrt/fx_codepage.h" +#include "core/fxcrt/fx_safe_types.h" +#include "core/fxcrt/stl_util.h" +#include "core/fxge/cfx_substfont.h" +#include "core/fxge/freetype/fx_freetype.h" -#include "core/fxge/fx_freetype.h" -#include "third_party/base/logging.h" -#include "third_party/base/ptr_util.h" -#include "third_party/base/stl_util.h" +#include "third_party/base/check.h" +#include "third_party/base/numerics/safe_conversions.h"
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/font/cpdf_font.cpp
16
17
18
19
20
21
22
23
24
25
#include "core/fpdfapi/font/cpdf_truetypefont.h" #include "core/fpdfapi/font/cpdf_type1font.h" #include "core/fpdfapi/font/cpdf_type3font.h" #include "core/fpdfapi/page/cpdf_docpagedata.h" #include "core/fpdfapi/page/cpdf_pagemodule.h" #include "core/fpdfapi/parser/cpdf_array.h" #include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_document.h" #include "core/fpdfapi/parser/cpdf_name.h" #include "core/fpdfapi/parser/cpdf_stream_acc.h"
+ show +
26
27
28
29
30
#include "core/fxcrt/fx_memory.h" #include "core/fxge/fx_freetype.h" #include "third_party/base/logging.h" #include "third_party/base/ptr_util.h" #include "third_party/base/stl_util.h"
+ show +
31
32
33
34
35
36
37
38
39
40
namespace { const uint8_t kChineseFontNames[][5] = {{0xCB, 0xCE, 0xCC, 0xE5, 0x00}, {0xBF, 0xAC, 0xCC, 0xE5, 0x00}, {0xBA, 0xDA, 0xCC, 0xE5, 0x00}, {0xB7, 0xC2, 0xCB, 0xCE, 0x00}, {0xD0, 0xC2, 0xCB, 0xCE, 0x00}}; void GetPredefinedEncoding(const ByteString& value, int* basemap) {

[CVE-2023-40093_1.diff] cpdf_font.cpp #9
- if (m_FontBBox.top < rect.top) { - m_FontBBox.top = rect.top; - } - if (m_FontBBox.right < rect.right) { - m_FontBBox.right = rect.right; - } - if (m_FontBBox.left > rect.left) { - m_FontBBox.left = rect.left; - } - if (m_FontBBox.bottom > rect.bottom) { - m_FontBBox.bottom = rect.bottom; - } + m_FontBBox.left = std::min(m_FontBBox.left, rect.left); + m_FontBBox.top = std::max(m_FontBBox.top, rect.top); + m_FontBBox.right = std::max(m_FontBBox.right, rect.right); + m_FontBBox.bottom = std::min(m_FontBBox.bottom, rect.bottom);
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/font/cpdf_font.cpp
244
245
246
247
248
249
250
251
252
253
bool bFirst = true; for (int i = 0; i < 256; i++) { FX_RECT rect = GetCharBBox(i); if (rect.left == rect.right) { continue; } if (bFirst) { m_FontBBox = rect; bFirst = false; } else {
+ show +
254
255
256
257
258
259
260
261
262
263
264
if (m_FontBBox.top < rect.top) { m_FontBBox.top = rect.top; } if (m_FontBBox.right < rect.right) { m_FontBBox.right = rect.right; } if (m_FontBBox.left > rect.left) { m_FontBBox.left = rect.left; } if (m_FontBBox.bottom > rect.bottom) { m_FontBBox.bottom = rect.bottom;
+ show +
265
266
267
268
269
270
271
272
273
274
} } } } } if (m_Ascent == 0 && m_Descent == 0) { FX_RECT rect = GetCharBBox('A'); m_Ascent = rect.bottom == rect.top ? m_FontBBox.top : rect.top; rect = GetCharBBox('g'); m_Descent = rect.bottom == rect.top ? m_FontBBox.bottom : rect.bottom;

[CVE-2023-40093_1.diff] cpdf_hint_tables.h #3
- // Owned by |m_pDataAvail|. - UnownedPtr<CPDF_ReadValidator> m_pValidator; - - // Owned by |m_pDataAvail|. - UnownedPtr<CPDF_LinearizedHeader> const m_pLinearized; - - uint32_t m_nFirstPageSharedObjs; - FX_FILESIZE m_szFirstPageObjOffset; - + uint32_t m_nFirstPageSharedObjs = 0; + FX_FILESIZE m_szFirstPageObjOffset = 0; + UnownedPtr<CPDF_ReadValidator> m_pValidator; + UnownedPtr<const CPDF_LinearizedHeader> const m_pLinearized;
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/parser/cpdf_hint_tables.h
43
44
45
46
47
48
49
50
51
52
virtual int GetNumberOfPages() const; virtual int GetFirstPageObjectNumber() const; virtual int GetFirstPageNumber() const; virtual int ReadPrimaryHintStreamOffset() const; virtual int ReadPrimaryHintStreamLength() const; uint32_t GetItemLength(uint32_t index, const std::vector<FX_FILESIZE>& szArray) const; // Owned by |m_pDataAvail|.
+ show +
53
54
55
56
57
58
59
UnownedPtr<CPDF_ReadValidator> m_pValidator; // Owned by |m_pDataAvail|. UnownedPtr<CPDF_LinearizedHeader> const m_pLinearized; uint32_t m_nFirstPageSharedObjs; FX_FILESIZE m_szFirstPageObjOffset;
+ show +
60
61
62
63
64
65
66
67
68
std::vector<uint32_t> m_dwDeltaNObjsArray; std::vector<uint32_t> m_dwNSharedObjsArray; std::vector<uint32_t> m_dwSharedObjNumArray; std::vector<uint32_t> m_dwIdentifierArray; std::vector<FX_FILESIZE> m_szPageOffsetArray; std::vector<FX_FILESIZE> m_szSharedObjOffsetArray; }; #endif // CORE_FPDFAPI_PARSER_CPDF_HINT_TABLES_H_

[CVE-2023-40093_1.diff] cpdf_cross_ref_avail_unittest.cpp #3
- auto cross_ref_avail = pdfium::MakeUnique<CPDF_CrossRefAvail>( - parser.get(), last_crossref_offset); + auto cross_ref_avail = + std::make_unique<CPDF_CrossRefAvail>(parser.get(), last_crossref_offset); - EXPECT_EQ(CPDF_DataAvail::DataAvailable, cross_ref_avail->CheckAvail()); + EXPECT_EQ(CPDF_DataAvail::kDataAvailable, cross_ref_avail->CheckAvail()); -TEST(CPDF_CrossRefAvailTest, CheckCrossRefStream) { +TEST(CrossRefAvailTest, CheckCrossRefStream) {
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/parser/cpdf_cross_ref_avail_unittest.cpp
35
36
37
38
39
40
41
42
43
44
"0000000000 00007 f \n" "0000000331 00000 n \n" "0000000409 00000 n \n" "trailer\n" "<</Root 14 0 R/ID " "[<afbb0f593c2d2aea5b519cb61da1c17b><4f9bb2e7978401808f8f1f2a75c322c8>]" "/Info 15 0 R/Size 16>>"; const FX_FILESIZE last_crossref_offset = 0; auto parser = MakeParserForBuffer(xref_table, FX_ArraySize(xref_table));
+ show +
45
46
47
48
49
50
51
auto cross_ref_avail = pdfium::MakeUnique<CPDF_CrossRefAvail>( parser.get(), last_crossref_offset); EXPECT_EQ(CPDF_DataAvail::DataAvailable, cross_ref_avail->CheckAvail()); } TEST(CPDF_CrossRefAvailTest, CheckCrossRefStream) {
+ show +
52
53
54
55
56
57
58
59
60
61
const unsigned char xref_stream[] = "16 0 obj\n" "<</Filter /FlateDecode>>" " stream \n" "STREAM DATA STREAM DATA STREAM DATA\n" "endstream\n" "endobj\n"; const FX_FILESIZE last_crossref_offset = 0; auto parser = MakeParserForBuffer(xref_stream, FX_ArraySize(xref_stream));

[CVE-2023-40093_1.diff] cpdf_cross_ref_avail_unittest.cpp #4
- auto cross_ref_avail = pdfium::MakeUnique<CPDF_CrossRefAvail>( - parser.get(), last_crossref_offset); + auto cross_ref_avail = + std::make_unique<CPDF_CrossRefAvail>(parser.get(), last_crossref_offset); - EXPECT_EQ(CPDF_DataAvail::DataAvailable, cross_ref_avail->CheckAvail()); + EXPECT_EQ(CPDF_DataAvail::kDataAvailable, cross_ref_avail->CheckAvail()); -TEST(CPDF_CrossRefAvailTest, IncorrectStartOffset) { +TEST(CrossRefAvailTest, IncorrectStartOffset) {
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/parser/cpdf_cross_ref_avail_unittest.cpp
52
53
54
55
56
57
58
59
60
61
const unsigned char xref_stream[] = "16 0 obj\n" "<</Filter /FlateDecode>>" " stream \n" "STREAM DATA STREAM DATA STREAM DATA\n" "endstream\n" "endobj\n"; const FX_FILESIZE last_crossref_offset = 0; auto parser = MakeParserForBuffer(xref_stream, FX_ArraySize(xref_stream));
+ show +
62
63
64
65
66
67
68
auto cross_ref_avail = pdfium::MakeUnique<CPDF_CrossRefAvail>( parser.get(), last_crossref_offset); EXPECT_EQ(CPDF_DataAvail::DataAvailable, cross_ref_avail->CheckAvail()); } TEST(CPDF_CrossRefAvailTest, IncorrectStartOffset) {
+ show +
69
70
71
72
73
74
75
76
77
78
const unsigned char xref_stream[] = "16 0 obj\n" "<</Filter /FlateDecode>>" " stream \n" "STREAM DATA STREAM DATA STREAM DATA\n" "endstream\n" "endobj\n"; const FX_FILESIZE last_crossref_offset = 70000;

[CVE-2023-40093_1.diff] cpdf_cross_ref_avail_unittest.cpp #5
- auto cross_ref_avail = pdfium::MakeUnique<CPDF_CrossRefAvail>( - parser.get(), last_crossref_offset); + auto cross_ref_avail = + std::make_unique<CPDF_CrossRefAvail>(parser.get(), last_crossref_offset); - EXPECT_EQ(CPDF_DataAvail::DataError, cross_ref_avail->CheckAvail()); + EXPECT_EQ(CPDF_DataAvail::kDataError, cross_ref_avail->CheckAvail()); -TEST(CPDF_CrossRefAvailTest, IncorrectPrevOffset) { +TEST(CrossRefAvailTest, IncorrectPrevOffset) {
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/parser/cpdf_cross_ref_avail_unittest.cpp
70
71
72
73
74
75
76
77
78
79
"16 0 obj\n" "<</Filter /FlateDecode>>" " stream \n" "STREAM DATA STREAM DATA STREAM DATA\n" "endstream\n" "endobj\n"; const FX_FILESIZE last_crossref_offset = 70000; auto parser = MakeParserForBuffer(xref_stream, FX_ArraySize(xref_stream));
+ show +
80
81
82
83
84
85
86
auto cross_ref_avail = pdfium::MakeUnique<CPDF_CrossRefAvail>( parser.get(), last_crossref_offset); EXPECT_EQ(CPDF_DataAvail::DataError, cross_ref_avail->CheckAvail()); } TEST(CPDF_CrossRefAvailTest, IncorrectPrevOffset) {
+ show +
87
88
89
90
91
92
93
94
95
96
const unsigned char xref_stream[] = "16 0 obj\n" "<</Type /XRef /Prev 70000>>" " stream \n" "STREAM DATA STREAM DATA STREAM DATA\n" "endstream\n" "endobj\n"; const FX_FILESIZE last_crossref_offset = 0; auto parser = MakeParserForBuffer(xref_stream, FX_ArraySize(xref_stream));

[CVE-2023-40093_1.diff] cpdf_cross_ref_avail_unittest.cpp #6
- auto cross_ref_avail = pdfium::MakeUnique<CPDF_CrossRefAvail>( - parser.get(), last_crossref_offset); - EXPECT_EQ(CPDF_DataAvail::DataError, cross_ref_avail->CheckAvail()); + auto cross_ref_avail = + std::make_unique<CPDF_CrossRefAvail>(parser.get(), last_crossref_offset); + EXPECT_EQ(CPDF_DataAvail::kDataError, cross_ref_avail->CheckAvail()); -TEST(CPDF_CrossRefAvailTest, IncorrectPrevStreamOffset) { +TEST(CrossRefAvailTest, IncorrectPrevStreamOffset) {
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/parser/cpdf_cross_ref_avail_unittest.cpp
87
88
89
90
91
92
93
94
95
96
const unsigned char xref_stream[] = "16 0 obj\n" "<</Type /XRef /Prev 70000>>" " stream \n" "STREAM DATA STREAM DATA STREAM DATA\n" "endstream\n" "endobj\n"; const FX_FILESIZE last_crossref_offset = 0; auto parser = MakeParserForBuffer(xref_stream, FX_ArraySize(xref_stream));
+ show +
97
98
99
100
101
102
auto cross_ref_avail = pdfium::MakeUnique<CPDF_CrossRefAvail>( parser.get(), last_crossref_offset); EXPECT_EQ(CPDF_DataAvail::DataError, cross_ref_avail->CheckAvail()); } TEST(CPDF_CrossRefAvailTest, IncorrectPrevStreamOffset) {
+ show +
103
104
105
106
107
108
109
110
111
112
const unsigned char xref_table[] = "xref \n" "0 6 \n" "0000000003 65535 f \n" "0000000017 00000 n \n" "0000000081 00000 n \n" "0000000000 00007 f \n" "0000000331 00000 n \n" "0000000409 00000 n \n" "trailer\n"

[CVE-2023-40093_1.diff] cpdf_cross_ref_avail_unittest.cpp #8
- auto cross_ref_avail = pdfium::MakeUnique<CPDF_CrossRefAvail>( - parser.get(), last_crossref_offset); - EXPECT_EQ(CPDF_DataAvail::DataAvailable, cross_ref_avail->CheckAvail()); + auto cross_ref_avail = + std::make_unique<CPDF_CrossRefAvail>(parser.get(), last_crossref_offset); + EXPECT_EQ(CPDF_DataAvail::kDataAvailable, cross_ref_avail->CheckAvail()); -TEST(CPDF_CrossRefAvailTest, ThreeCrossRefV5) { +TEST(CrossRefAvailTest, ThreeCrossRefV5) {
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/parser/cpdf_cross_ref_avail_unittest.cpp
174
175
176
177
178
179
180
181
182
183
"<</Root 14 0 R/ID " "[<afbb0f593c2d2aea5b519cb61da1c17b><" "4f9bb2e7978401808f8f1f2a75c322c8>]" "/Info 15 0 R/Size 16" "/Prev ") + FXSYS_itoa(prev_offset, int_buffer, 10) + ">>\n"; const FX_FILESIZE last_crossref_offset = cur_offset; auto parser = MakeParserForBuffer( reinterpret_cast<const unsigned char*>(table.data()), table.size());
+ show +
184
185
186
187
188
189
auto cross_ref_avail = pdfium::MakeUnique<CPDF_CrossRefAvail>( parser.get(), last_crossref_offset); EXPECT_EQ(CPDF_DataAvail::DataAvailable, cross_ref_avail->CheckAvail()); } TEST(CPDF_CrossRefAvailTest, ThreeCrossRefV5) {
+ show +
190
191
192
193
194
195
196
197
198
199
char int_buffer[100]; int prev_offset = 0; int cur_offset = 0; std::string table = "pdf blah blah blah\n"; prev_offset = cur_offset; cur_offset = static_cast<int>(table.size()); table += "16 0 obj\n" "<</Type /XRef>>" " stream \n"

[CVE-2023-40093_1.diff] cpdf_cross_ref_avail_unittest.cpp #9
- auto cross_ref_avail = pdfium::MakeUnique<CPDF_CrossRefAvail>( - parser.get(), last_crossref_offset); - EXPECT_EQ(CPDF_DataAvail::DataAvailable, cross_ref_avail->CheckAvail()); + auto cross_ref_avail = + std::make_unique<CPDF_CrossRefAvail>(parser.get(), last_crossref_offset); + EXPECT_EQ(CPDF_DataAvail::kDataAvailable, cross_ref_avail->CheckAvail()); -TEST(CPDF_CrossRefAvailTest, Mixed) { +TEST(CrossRefAvailTest, Mixed) {
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/parser/cpdf_cross_ref_avail_unittest.cpp
222
223
224
225
226
227
228
229
230
231
FXSYS_itoa(prev_offset, int_buffer, 10) + ">>" " stream \n" "STREAM DATA STREAM DATA STREAM DATA favav\n" "endstream\n" "endobj\n"; const FX_FILESIZE last_crossref_offset = cur_offset; auto parser = MakeParserForBuffer( reinterpret_cast<const unsigned char*>(table.data()), table.size());
+ show +
232
233
234
235
236
237
auto cross_ref_avail = pdfium::MakeUnique<CPDF_CrossRefAvail>( parser.get(), last_crossref_offset); EXPECT_EQ(CPDF_DataAvail::DataAvailable, cross_ref_avail->CheckAvail()); } TEST(CPDF_CrossRefAvailTest, Mixed) {
+ show +
238
239
240
241
242
243
244
245
246
247
char int_buffer[100]; std::string table = "pdf blah blah blah\n"; const int first_v5_table_offset = static_cast<int>(table.size()); table += "16 0 obj\n" "<</Type /XRef>>" " stream \n" "STREAM DATA STREAM DATA STREAM DATA ahfcuabfkuabfu\n" "endstream\n"

[CVE-2023-40093_1.diff] cpdf_cross_ref_avail_unittest.cpp #10
- auto cross_ref_avail = pdfium::MakeUnique<CPDF_CrossRefAvail>( - parser.get(), last_crossref_offset); - EXPECT_EQ(CPDF_DataAvail::DataAvailable, cross_ref_avail->CheckAvail()); + auto cross_ref_avail = + std::make_unique<CPDF_CrossRefAvail>(parser.get(), last_crossref_offset); + EXPECT_EQ(CPDF_DataAvail::kDataAvailable, cross_ref_avail->CheckAvail()); -TEST(CPDF_CrossRefAvailTest, CrossRefV5IsNotStream) { +TEST(CrossRefAvailTest, CrossRefV5IsNotStream) {
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/parser/cpdf_cross_ref_avail_unittest.cpp
272
273
274
275
276
277
278
279
280
281
"[<afbb0f593c2d2aea5b519cb61da1c17b><" "4f9bb2e7978401808f8f1f2a75c322c8>]" "/Info 15 0 R/Size 16" "/Prev ") + FXSYS_itoa(second_v4_table_offset, int_buffer, 10) + " /XRefStm " + FXSYS_itoa(first_v5_table_offset, int_buffer, 10) + ">>\n"; const FX_FILESIZE last_crossref_offset = last_v4_table_offset; auto parser = MakeParserForBuffer( reinterpret_cast<const unsigned char*>(table.data()), table.size());
+ show +
282
283
284
285
286
287
auto cross_ref_avail = pdfium::MakeUnique<CPDF_CrossRefAvail>( parser.get(), last_crossref_offset); EXPECT_EQ(CPDF_DataAvail::DataAvailable, cross_ref_avail->CheckAvail()); } TEST(CPDF_CrossRefAvailTest, CrossRefV5IsNotStream) {
+ show +
288
289
290
291
292
293
294
295
296
297
const unsigned char invalid_xref_stream[] = "16 0 obj\n" "[/array /object]\n" "endstream\n" "endobj\n"; const FX_FILESIZE last_crossref_offset = 0; auto parser = MakeParserForBuffer(invalid_xref_stream, FX_ArraySize(invalid_xref_stream)); auto cross_ref_avail = pdfium::MakeUnique<CPDF_CrossRefAvail>(

[CVE-2023-40093_1.diff] cpdf_cross_ref_avail_unittest.cpp #11
- auto cross_ref_avail = pdfium::MakeUnique<CPDF_CrossRefAvail>( - parser.get(), last_crossref_offset); - EXPECT_EQ(CPDF_DataAvail::DataError, cross_ref_avail->CheckAvail()); + auto cross_ref_avail = + std::make_unique<CPDF_CrossRefAvail>(parser.get(), last_crossref_offset); + EXPECT_EQ(CPDF_DataAvail::kDataError, cross_ref_avail->CheckAvail()); -TEST(CPDF_CrossRefAvailTest, CrossRefV4WithEncryptRef) { +TEST(CrossRefAvailTest, CrossRefV4WithEncryptRef) {
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/parser/cpdf_cross_ref_avail_unittest.cpp
287
288
289
290
291
292
293
294
295
296
TEST(CPDF_CrossRefAvailTest, CrossRefV5IsNotStream) { const unsigned char invalid_xref_stream[] = "16 0 obj\n" "[/array /object]\n" "endstream\n" "endobj\n"; const FX_FILESIZE last_crossref_offset = 0; auto parser = MakeParserForBuffer(invalid_xref_stream, FX_ArraySize(invalid_xref_stream));
+ show +
297
298
299
300
301
302
auto cross_ref_avail = pdfium::MakeUnique<CPDF_CrossRefAvail>( parser.get(), last_crossref_offset); EXPECT_EQ(CPDF_DataAvail::DataError, cross_ref_avail->CheckAvail()); } TEST(CPDF_CrossRefAvailTest, CrossRefV4WithEncryptRef) {
+ show +
303
304
305
306
307
308
309
310
311
312
const unsigned char xref_table[] = "xref \n" "0 6 \n" "0000000003 65535 f \n" "0000000017 00000 n \n" "0000000081 00000 n \n" "0000000000 00007 f \n" "0000000331 00000 n \n" "0000000409 00000 n \n" "trailer\n"

[CVE-2023-40093_1.diff] cpdf_cross_ref_avail_unittest.cpp #12
- auto cross_ref_avail = pdfium::MakeUnique<CPDF_CrossRefAvail>( - parser.get(), last_crossref_offset); - EXPECT_EQ(CPDF_DataAvail::DataError, cross_ref_avail->CheckAvail()); + auto cross_ref_avail = + std::make_unique<CPDF_CrossRefAvail>(parser.get(), last_crossref_offset); + EXPECT_EQ(CPDF_DataAvail::kDataError, cross_ref_avail->CheckAvail()); -TEST(CPDF_CrossRefAvailTest, CrossRefStreamWithEncryptRef) { +TEST(CrossRefAvailTest, CrossRefStreamWithEncryptRef) {
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/parser/cpdf_cross_ref_avail_unittest.cpp
310
311
312
313
314
315
316
317
318
319
"0000000331 00000 n \n" "0000000409 00000 n \n" "trailer\n" "<</Root 14 0 R/ID " "[<afbb0f593c2d2aea5b519cb61da1c17b><4f9bb2e7978401808f8f1f2a75c322c8>]" "/Encrypt 77 0 R" "/Info 15 0 R/Size 16>>"; const FX_FILESIZE last_crossref_offset = 0; auto parser = MakeParserForBuffer(xref_table, FX_ArraySize(xref_table));
+ show +
320
321
322
323
324
325
auto cross_ref_avail = pdfium::MakeUnique<CPDF_CrossRefAvail>( parser.get(), last_crossref_offset); EXPECT_EQ(CPDF_DataAvail::DataError, cross_ref_avail->CheckAvail()); } TEST(CPDF_CrossRefAvailTest, CrossRefStreamWithEncryptRef) {
+ show +
326
327
328
329
330
331
332
333
334
335
const unsigned char xref_stream[] = "16 0 obj\n" "<</Filter /FlateDecode /Encrypt 77 0 R>>" " stream \n" "STREAM DATA STREAM DATA STREAM DATA\n" "endstream\n" "endobj\n"; const FX_FILESIZE last_crossref_offset = 0; auto parser = MakeParserForBuffer(xref_stream, FX_ArraySize(xref_stream));

[CVE-2023-40093_1.diff] cpdf_object.h #6
- static const bool value = std::is_same<T, CPDF_Array>::value || - std::is_same<T, CPDF_Dictionary>::value || - std::is_same<T, CPDF_Name>::value || - std::is_same<T, CPDF_String>::value; + static constexpr bool value = std::is_same<T, CPDF_Array>::value || + std::is_same<T, CPDF_Dictionary>::value || + std::is_same<T, CPDF_Name>::value || + std::is_same<T, CPDF_String>::value;
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/parser/cpdf_object.h
112
113
114
115
116
117
118
119
120
121
uint32_t m_ObjNum; private: CPDF_Object(const CPDF_Object& src) {} uint32_t m_GenNum; }; template <typename T> struct CanInternStrings {
+ show +
122
123
124
125
static const bool value = std::is_same<T, CPDF_Array>::value || std::is_same<T, CPDF_Dictionary>::value || std::is_same<T, CPDF_Name>::value || std::is_same<T, CPDF_String>::value;
+ show +
126
127
128
}; #endif // CORE_FPDFAPI_PARSER_CPDF_OBJECT_H_

[CVE-2023-40093_1.diff] cpdf_number.cpp #4
-bool CPDF_Number::IsNumber() const { - return true; -} - -CPDF_Number* CPDF_Number::AsNumber() { - return this; -} - -const CPDF_Number* CPDF_Number::AsNumber() const { +CPDF_Number* CPDF_Number::AsMutableNumber() {
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/parser/cpdf_number.cpp
29
30
31
32
33
34
35
36
37
38
} float CPDF_Number::GetNumber() const { return m_bInteger ? static_cast<float>(m_Integer) : m_Float; } int CPDF_Number::GetInteger() const { return m_bInteger ? m_Integer : static_cast<int>(m_Float); }
+ show +
39
40
41
42
43
44
45
46
47
bool CPDF_Number::IsNumber() const { return true; } CPDF_Number* CPDF_Number::AsNumber() { return this; } const CPDF_Number* CPDF_Number::AsNumber() const {
+ show +
48
49
50
51
52
53
54
55
56
57
return this; } void CPDF_Number::SetString(const ByteString& str) { m_bInteger = FX_atonum(str.AsStringView(), &m_Integer); } ByteString CPDF_Number::GetString() const { return m_bInteger ? ByteString::FormatInteger(m_Integer) : ByteString::FormatFloat(m_Float);

[CVE-2023-40093_1.diff] cpdf_boolean.cpp #3
-bool CPDF_Boolean::IsBoolean() const { - return true; -} - -CPDF_Boolean* CPDF_Boolean::AsBoolean() { - return this; -} - -const CPDF_Boolean* CPDF_Boolean::AsBoolean() const { +CPDF_Boolean* CPDF_Boolean::AsMutableBoolean() {
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/parser/cpdf_boolean.cpp
27
28
29
30
31
32
33
34
35
36
} int CPDF_Boolean::GetInteger() const { return m_bValue; } void CPDF_Boolean::SetString(const ByteString& str) { m_bValue = (str == "true"); }
+ show +
37
38
39
40
41
42
43
44
45
bool CPDF_Boolean::IsBoolean() const { return true; } CPDF_Boolean* CPDF_Boolean::AsBoolean() { return this; } const CPDF_Boolean* CPDF_Boolean::AsBoolean() const {
+ show +
46
47
48
49
50
51
52
return this; } bool CPDF_Boolean::WriteTo(IFX_ArchiveStream* archive) const { return archive->WriteString(" ") && archive->WriteString(GetString().AsStringView()); }

[CVE-2023-40093_1.diff] cpdf_hint_tables.cpp #5
- CPDF_LinearizedHeader* pLinearized) - : m_pValidator(pValidator), - m_pLinearized(pLinearized), - m_nFirstPageSharedObjs(0), - m_szFirstPageObjOffset(0) { - ASSERT(m_pLinearized); + const CPDF_LinearizedHeader* pLinearized) + : m_pValidator(pValidator), m_pLinearized(pLinearized) { + DCHECK(m_pLinearized); -CPDF_HintTables::~CPDF_HintTables() {} +CPDF_HintTables::~CPDF_HintTables() = default;
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/parser/cpdf_hint_tables.cpp
30
31
32
33
34
35
36
37
38
39
// Sanity check values from the page table header. The note in the PDF 1.7 // reference for Table F.3 says the valid range is only 0 through 32. Though 0 // is not useful either. bool IsValidPageOffsetHintTableBitCount(uint32_t bits) { return bits > 0 && bits <= 32; } } // namespace CPDF_HintTables::CPDF_HintTables(CPDF_ReadValidator* pValidator,
+ show +
40
41
42
43
44
45
46
47
48
CPDF_LinearizedHeader* pLinearized) : m_pValidator(pValidator), m_pLinearized(pLinearized), m_nFirstPageSharedObjs(0), m_szFirstPageObjOffset(0) { ASSERT(m_pLinearized); } CPDF_HintTables::~CPDF_HintTables() {}
+ show +
49
50
51
52
53
54
55
56
57
58
uint32_t CPDF_HintTables::GetItemLength( uint32_t index, const std::vector<FX_FILESIZE>& szArray) const { if (szArray.size() < 2 || index > szArray.size() - 2 || szArray[index] > szArray[index + 1]) { return 0; } return szArray[index + 1] - szArray[index]; }

[CVE-2023-40093_1.diff] cpdf_string.cpp #4
-bool CPDF_String::IsString() const { - return true; -} - -CPDF_String* CPDF_String::AsString() { - return this; -} - -const CPDF_String* CPDF_String::AsString() const { +CPDF_String* CPDF_String::AsMutableString() {
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/parser/cpdf_string.cpp
42
43
44
45
46
47
48
49
50
51
} ByteString CPDF_String::GetString() const { return m_String; } void CPDF_String::SetString(const ByteString& str) { m_String = str; }
+ show +
52
53
54
55
56
57
58
59
60
bool CPDF_String::IsString() const { return true; } CPDF_String* CPDF_String::AsString() { return this; } const CPDF_String* CPDF_String::AsString() const {
+ show +
61
62
63
64
65
66
67
68
69
70
return this; } WideString CPDF_String::GetUnicodeText() const { return PDF_DecodeText(m_String); } bool CPDF_String::WriteTo(IFX_ArchiveStream* archive) const { return archive->WriteString( PDF_EncodeString(GetString(), IsHex()).AsStringView());

[CVE-2023-40093_1.diff] cpdf_array.cpp #4
-bool CPDF_Array::IsArray() const { - return true; -} - -CPDF_Array* CPDF_Array::AsArray() { - return this; -} - -const CPDF_Array* CPDF_Array::AsArray() const { +CPDF_Array* CPDF_Array::AsMutableArray() {
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/parser/cpdf_array.cpp
28
29
30
31
32
33
34
35
36
37
for (auto& it : m_Objects) { if (it && it->GetObjNum() == kInvalidObjNum) it.release(); } } CPDF_Object::Type CPDF_Array::GetType() const { return ARRAY; }
+ show +
38
39
40
41
42
43
44
45
46
bool CPDF_Array::IsArray() const { return true; } CPDF_Array* CPDF_Array::AsArray() { return this; } const CPDF_Array* CPDF_Array::AsArray() const {
+ show +
47
48
49
50
51
52
53
54
55
56
return this; } std::unique_ptr<CPDF_Object> CPDF_Array::Clone() const { return CloneObjectNonCyclic(false); } std::unique_ptr<CPDF_Object> CPDF_Array::CloneNonCyclic( bool bDirect, std::set<const CPDF_Object*>* pVisited) const {

[CVE-2023-40093_1.diff] cpdf_array.cpp #6
- rect.left = GetNumberAt(0); - rect.bottom = GetNumberAt(1); - rect.right = GetNumberAt(2); - rect.top = GetNumberAt(3); + rect.left = GetFloatAt(0); + rect.bottom = GetFloatAt(1); + rect.right = GetFloatAt(2); + rect.top = GetFloatAt(3);
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/parser/cpdf_array.cpp
64
65
66
67
68
69
70
71
72
73
} } return std::move(pCopy); } CFX_FloatRect CPDF_Array::GetRect() { CFX_FloatRect rect; if (!IsArray() || m_Objects.size() != 4) return rect;
+ show +
74
75
76
77
rect.left = GetNumberAt(0); rect.bottom = GetNumberAt(1); rect.right = GetNumberAt(2); rect.top = GetNumberAt(3);
+ show +
78
79
80
81
82
83
84
85
86
87
return rect; } CFX_Matrix CPDF_Array::GetMatrix() { CFX_Matrix matrix; if (!IsArray() || m_Objects.size() != 6) return CFX_Matrix(); return CFX_Matrix(GetNumberAt(0), GetNumberAt(1), GetNumberAt(2), GetNumberAt(3), GetNumberAt(4), GetNumberAt(5));

[CVE-2023-40093_1.diff] cpdf_name.cpp #4
-bool CPDF_Name::IsName() const { - return true; -} - -CPDF_Name* CPDF_Name::AsName() { - return this; -} - -const CPDF_Name* CPDF_Name::AsName() const { +CPDF_Name* CPDF_Name::AsMutableName() {
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/parser/cpdf_name.cpp
27
28
29
30
31
32
33
34
35
36
} ByteString CPDF_Name::GetString() const { return m_Name; } void CPDF_Name::SetString(const ByteString& str) { m_Name = str; }
+ show +
37
38
39
40
41
42
43
44
45
bool CPDF_Name::IsName() const { return true; } CPDF_Name* CPDF_Name::AsName() { return this; } const CPDF_Name* CPDF_Name::AsName() const {
+ show +
46
47
48
49
50
51
52
53
54
55
return this; } WideString CPDF_Name::GetUnicodeText() const { return PDF_DecodeText(m_Name); } bool CPDF_Name::WriteTo(IFX_ArchiveStream* archive) const { return archive->WriteString("/") && archive->WriteString(PDF_NameEncode(GetString()).AsStringView());

[CVE-2023-40093_1.diff] cpdf_object_walker.h #6
- explicit CPDF_NonConstObjectWalker(CPDF_Object* root) - : CPDF_ObjectWalker(root) {} - - CPDF_Object* GetNext() { - return const_cast<CPDF_Object*>(CPDF_ObjectWalker::GetNext()); - } + explicit CPDF_NonConstObjectWalker(RetainPtr<CPDF_Object> root); + RetainPtr<CPDF_Object> GetNext();
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfapi/parser/cpdf_object_walker.h
51
52
53
54
55
56
57
58
59
60
const CPDF_Object* parent_object_; ByteString dict_key_; size_t current_depth_; std::stack<std::unique_ptr<SubobjectIterator>> stack_; }; class CPDF_NonConstObjectWalker : public CPDF_ObjectWalker { public:
+ show +
61
62
63
64
65
explicit CPDF_NonConstObjectWalker(CPDF_Object* root) : CPDF_ObjectWalker(root) {} CPDF_Object* GetNext() { return const_cast<CPDF_Object*>(CPDF_ObjectWalker::GetNext());
+ show +
66
67
68
69
} }; #endif // CORE_FPDFAPI_PARSER_CPDF_OBJECT_WALKER_H_

[CVE-2023-40093_1.diff] retain_ptr.h #4
- RetainPtr& operator=(const RetainPtr& that) { - if (*this != that) - Reset(that.Get()); - return *this; - } - - // Move-assign a RetainPtr. After assignment, |that| will be NULL. - RetainPtr& operator=(RetainPtr&& that) { - m_pObj.reset(that.Leak()); - return *this; - } - - // Assigment from raw pointers is intentially not provided to make - // reference count churn more visible where possible. -
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxcrt/retain_ptr.h
50
51
52
53
54
55
56
57
58
59
m_pObj.reset(obj); } T* Get() const { return m_pObj.get(); } void Swap(RetainPtr& that) { m_pObj.swap(that.m_pObj); } // Useful for passing notion of object ownership across a C API. T* Leak() { return m_pObj.release(); } void Unleak(T* ptr) { m_pObj.reset(ptr); }
+ show +
60
61
62
63
64
65
66
67
68
RetainPtr& operator=(const RetainPtr& that) { if (*this != that) Reset(that.Get()); return *this; } RetainPtr& operator=(RetainPtr&& that) { m_pObj.reset(that.Leak()); return *this;
+ show +
69
70
71
72
73
74
75
76
77
78
} bool operator==(const RetainPtr& that) const { return Get() == that.Get(); } bool operator!=(const RetainPtr& that) const { return !(*this == that); } bool operator<(const RetainPtr& that) const { return std::less<T*>()(Get(), that.Get()); } explicit operator bool() const { return !!m_pObj; }

[CVE-2023-40093_1.diff] bytestring.cpp #6
-ByteString::ByteString(const std::ostringstream& outStream) { - std::string str = outStream.str(); - if (str.length() > 0) - m_pData.Reset(StringData::Create(str.c_str(), str.length())); +ByteString::ByteString(const fxcrt::ostringstream& outStream) { + auto str = outStream.str(); + if (!str.empty()) + m_pData.Reset(StringData::Create(str.c_str(), str.size())); -ByteString::~ByteString() {} +ByteString::~ByteString() = default; + +void ByteString::clear() { + if (m_pData && m_pData->CanOperateInPlace(0)) { + m_pData->m_nDataLength = 0; + return; + } + m_pData.Reset(); +}
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxcrt/bytestring.cpp
205
206
207
208
209
210
211
212
213
214
m_pData.Reset(StringData::Create(nNewLen)); size_t nOffset = 0; for (const auto& item : list) { m_pData->CopyContentsAt(nOffset, item.unterminated_c_str(), item.GetLength()); nOffset += item.GetLength(); } }
+ show +
215
216
217
218
219
220
221
ByteString::ByteString(const std::ostringstream& outStream) { std::string str = outStream.str(); if (str.length() > 0) m_pData.Reset(StringData::Create(str.c_str(), str.length())); } ByteString::~ByteString() {}
+ show +
222
223
224
225
226
227
228
229
230
231
const ByteString& ByteString::operator=(const char* pStr) { if (!pStr || !pStr[0]) clear(); else AssignCopy(pStr, strlen(pStr)); return *this; }

[CVE-2023-40093_1.diff] fx_memory_unittest.cpp #2
-const size_t kMaxByteAlloc = std::numeric_limits<size_t>::max(); -const size_t kMaxIntAlloc = kMaxByteAlloc / sizeof(int); -const size_t kOverflowIntAlloc = kMaxIntAlloc + 100; -const size_t kWidth = 640; -const size_t kOverflowIntAlloc2D = kMaxIntAlloc / kWidth + 10; +constexpr size_t kMaxByteAlloc = std::numeric_limits<size_t>::max(); +constexpr size_t kMaxIntAlloc = kMaxByteAlloc / sizeof(int); +constexpr size_t kOverflowIntAlloc = kMaxIntAlloc + 100; +constexpr size_t kWidth = 640; +constexpr size_t kOverflowIntAlloc2D = kMaxIntAlloc / kWidth + 10; +constexpr size_t kCloseToMaxIntAlloc = kMaxIntAlloc - 100; +constexpr size_t kCloseToMaxByteAlloc = kMaxByteAlloc - 100;
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxcrt/fx_memory_unittest.cpp
3
4
5
6
7
8
9
10
11
12
// found in the LICENSE file. #include "core/fxcrt/fx_memory.h" #include <limits> #include "testing/gtest/include/gtest/gtest.h" namespace {
+ show +
13
14
15
16
17
const size_t kMaxByteAlloc = std::numeric_limits<size_t>::max(); const size_t kMaxIntAlloc = kMaxByteAlloc / sizeof(int); const size_t kOverflowIntAlloc = kMaxIntAlloc + 100; const size_t kWidth = 640; const size_t kOverflowIntAlloc2D = kMaxIntAlloc / kWidth + 10;
+ show +
18
19
20
21
22
23
24
25
26
27
} // namespace // TODO(tsepez): re-enable OOM tests if we can find a way to // prevent it from hosing the bots. TEST(fxcrt, DISABLED_FX_AllocOOM) { EXPECT_DEATH_IF_SUPPORTED((void)FX_Alloc(int, kMaxIntAlloc), ""); int* ptr = FX_Alloc(int, 1); EXPECT_TRUE(ptr);

[CVE-2023-40093_1.diff] byteorder_unittest.cpp #1
-// Copyright 2019 PDFium Authors. All rights reserved. +// Copyright 2019 The PDFium Authors +#include "core/fxcrt/fx_system.h" -// Original code to use as a reference implementation. - -#define FXWORD_GET_LSBFIRST(p) \ - (static_cast<uint16_t>((static_cast<uint16_t>(p[1]) << 8) | \ - (static_cast<uint16_t>(p[0])))) -#define FXWORD_GET_MSBFIRST(p) \ - (static_cast<uint16_t>((static_cast<uint16_t>(p[0]) << 8) | \ - (static_cast<uint16_t>(p[1])))) -#define FXDWORD_GET_LSBFIRST(p) \ - ((static_cast<uint32_t>(p[3]) << 24) | (static_cast<uint32_t>(p[2]) << 16) | \ - (static_cast<uint32_t>(p[1]) << 8) | (static_cast<uint32_t>(p[0]))) -#define FXDWORD_GET_MSBFIRST(p) \ - ((static_cast<uint32_t>(p[0]) << 24) | (static_cast<uint32_t>(p[1]) << 16) | \ - (static_cast<uint32_t>(p[2]) << 8) | (static_cast<uint32_t>(p[3]))) -
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxcrt/fx_system.h
200
201
202
203
204
205
206
207
208
209
char* FXSYS_strlwr(char* str); char* FXSYS_strupr(char* str); int FXSYS_stricmp(const char*, const char*); int FXSYS_wcsicmp(const wchar_t* str1, const wchar_t* str2); wchar_t* FXSYS_wcslwr(wchar_t* str); wchar_t* FXSYS_wcsupr(wchar_t* str); #define FXSYS_pow(a, b) (float)pow(a, b) #define FXSYS_wcsftime wcsftime #endif // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_
+ show +
210
211
212
213
214
215
216
217
218
219
220
221
#define FXWORD_GET_LSBFIRST(p) \ (static_cast<uint16_t>((static_cast<uint16_t>(p[1]) << 8) | \ (static_cast<uint16_t>(p[0])))) #define FXWORD_GET_MSBFIRST(p) \ (static_cast<uint16_t>((static_cast<uint16_t>(p[0]) << 8) | \ (static_cast<uint16_t>(p[1])))) #define FXDWORD_GET_LSBFIRST(p) \ ((static_cast<uint32_t>(p[3]) << 24) | (static_cast<uint32_t>(p[2]) << 16) | \ (static_cast<uint32_t>(p[1]) << 8) | (static_cast<uint32_t>(p[0]))) #define FXDWORD_GET_MSBFIRST(p) \ ((static_cast<uint32_t>(p[0]) << 24) | (static_cast<uint32_t>(p[1]) << 16) | \ (static_cast<uint32_t>(p[2]) << 8) | (static_cast<uint32_t>(p[3])))
+ show +
222
223
224
225
226
227
228
229
230
231
int32_t FXSYS_atoi(const char* str); uint32_t FXSYS_atoui(const char* str); int32_t FXSYS_wtoi(const wchar_t* str); int64_t FXSYS_atoi64(const char* str); const char* FXSYS_i64toa(int64_t value, char* str, int radix); int FXSYS_round(float f); #define FXSYS_sqrt2(a, b) (float)sqrt((a) * (a) + (b) * (b)) #ifdef __cplusplus } // extern C #endif // __cplusplus

[CVE-2023-40093_1.diff] retain_ptr_unittest.cpp #4
+TEST(RetainPtr, CopyConversionCtor) { + PseudoRetainable obj; + { + RetainPtr<PseudoRetainable> ptr1(&obj); + { + RetainPtr<const PseudoRetainable> ptr2(ptr1); + EXPECT_EQ(2, obj.retain_count()); + EXPECT_EQ(0, obj.release_count()); + } + EXPECT_EQ(2, obj.retain_count()); + EXPECT_EQ(1, obj.release_count()); + } + EXPECT_EQ(2, obj.retain_count()); + EXPECT_EQ(2, obj.release_count()); +} + +TEST(RetainPtr, MoveConversionCtor) { + PseudoRetainable obj; + { + RetainPtr<PseudoRetainable> ptr1(&obj); + { + RetainPtr<const PseudoRetainable> ptr2(std::move(ptr1)); + EXPECT_FALSE(ptr1.Get()); + EXPECT_EQ(&obj, ptr2.Get()); + EXPECT_EQ(1, obj.retain_count()); + EXPECT_EQ(0, obj.release_count()); + } + EXPECT_EQ(1, obj.retain_count()); + EXPECT_EQ(1, obj.release_count()); + } + EXPECT_EQ(1, obj.retain_count()); + EXPECT_EQ(1, obj.release_count()); +} + +TEST(RetainPtr, NullptrAssign) { + PseudoRetainable obj; + RetainPtr<PseudoRetainable> ptr(&obj); + ptr = nullptr; + EXPECT_FALSE(ptr); +} + +TEST(RetainPtr, RawAssign) { + PseudoRetainable obj; + RetainPtr<PseudoRetainable> ptr; + ptr = pdfium::WrapRetain(&obj); + EXPECT_EQ(&obj, ptr); +} + +TEST(RetainPtr, CopyAssign) { + PseudoRetainable obj; + { + RetainPtr<PseudoRetainable> ptr(&obj); + { + RetainPtr<PseudoRetainable> ptr2; + ptr2 = ptr; + EXPECT_EQ(2, obj.retain_count()); + EXPECT_EQ(0, obj.release_count()); + } + { + // Test assignment from wrapped underlying type. + RetainPtr<PseudoRetainable> ptr2; + ptr2 = pdfium::WrapRetain(ptr.Get()); + EXPECT_EQ(3, obj.retain_count()); + EXPECT_EQ(1, obj.release_count()); + } + EXPECT_EQ(3, obj.retain_count()); + EXPECT_EQ(2, obj.release_count()); + } + EXPECT_EQ(3, obj.retain_count()); + EXPECT_EQ(3, obj.release_count()); +} + +TEST(RetainPtr, MoveAssign) { + PseudoRetainable obj; + { + RetainPtr<PseudoRetainable> ptr1(&obj); + { + RetainPtr<PseudoRetainable> ptr2; + EXPECT_EQ(&obj, ptr1.Get()); + EXPECT_FALSE(ptr2.Get()); + ptr2 = std::move(ptr1); + EXPECT_FALSE(ptr1.Get()); + EXPECT_EQ(&obj, ptr2.Get()); + EXPECT_EQ(1, obj.retain_count()); + EXPECT_EQ(0, obj.release_count()); + } + EXPECT_EQ(1, obj.retain_count()); + EXPECT_EQ(1, obj.release_count()); + } + EXPECT_EQ(1, obj.retain_count()); + EXPECT_EQ(1, obj.release_count()); +} + +TEST(RetainPtr, CopyConvertAssign) { + PseudoRetainable obj; + { + RetainPtr<PseudoRetainable> ptr(&obj); + { + RetainPtr<const PseudoRetainable> ptr2; + ptr2 = ptr; + EXPECT_EQ(2, obj.retain_count()); + EXPECT_EQ(0, obj.release_count()); + } + { + // Test assignment from wrapped underlying type. + RetainPtr<const PseudoRetainable> ptr2; + ptr2 = pdfium::WrapRetain(ptr.Get()); + EXPECT_EQ(3, obj.retain_count()); + EXPECT_EQ(1, obj.release_count()); + } + EXPECT_EQ(3, obj.retain_count()); + EXPECT_EQ(2, obj.release_count()); + } + EXPECT_EQ(3, obj.retain_count()); + EXPECT_EQ(3, obj.release_count()); +} + +TEST(RetainPtr, MoveConvertAssign) { + PseudoRetainable obj; + { + RetainPtr<PseudoRetainable> ptr1(&obj); + { + RetainPtr<const PseudoRetainable> ptr2; + ptr2 = std::move(ptr1); + EXPECT_FALSE(ptr1); + EXPECT_EQ(&obj, ptr2.Get()); + EXPECT_EQ(1, obj.retain_count()); + EXPECT_EQ(0, obj.release_count()); + } + EXPECT_EQ(1, obj.retain_count()); + EXPECT_EQ(1, obj.release_count()); + } + EXPECT_EQ(1, obj.retain_count()); + EXPECT_EQ(1, obj.release_count()); +} + +TEST(RetainPtr, AmbiguousExpression) { + class A : public Retainable {}; + class B : public A {}; + + // Test passes if it compiles without error. + RetainPtr<A> var = (0) ? pdfium::MakeRetain<A>() : pdfium::MakeRetain<B>(); + EXPECT_TRUE(var); +} + -TEST(RetainPtr, Assign) { - PseudoRetainable obj; - { - RetainPtr<PseudoRetainable> ptr(&obj); - { - RetainPtr<PseudoRetainable> ptr2; - ptr2 = ptr; - EXPECT_EQ(2, obj.retain_count()); - EXPECT_EQ(0, obj.release_count()); - } - EXPECT_EQ(2, obj.retain_count()); - EXPECT_EQ(1, obj.release_count()); - } - EXPECT_EQ(2, obj.retain_count()); - EXPECT_EQ(2, obj.release_count()); -} - -TEST(RetainPtr, MoveAssign) { - PseudoRetainable obj; - { - RetainPtr<PseudoRetainable> ptr1(&obj); - { - RetainPtr<PseudoRetainable> ptr2; - EXPECT_EQ(&obj, ptr1.Get()); - EXPECT_EQ(nullptr, ptr2.Get()); - ptr2 = std::move(ptr1); - EXPECT_EQ(nullptr, ptr1.Get()); - EXPECT_EQ(&obj, ptr2.Get()); - EXPECT_EQ(1, obj.retain_count()); - EXPECT_EQ(0, obj.release_count()); - } - EXPECT_EQ(1, obj.retain_count()); - EXPECT_EQ(1, obj.release_count()); - } - EXPECT_EQ(1, obj.retain_count()); - EXPECT_EQ(1, obj.release_count()); -} -
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxcrt/retain_ptr_unittest.cpp
164
165
166
167
168
169
170
171
172
173
EXPECT_EQ(1, obj1.retain_count()); EXPECT_EQ(0, obj1.release_count()); } EXPECT_EQ(1, obj1.retain_count()); EXPECT_EQ(1, obj1.release_count()); } EXPECT_EQ(1, obj1.retain_count()); EXPECT_EQ(1, obj1.release_count()); }
+ show +
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
TEST(RetainPtr, Assign) { PseudoRetainable obj; { RetainPtr<PseudoRetainable> ptr(&obj); { RetainPtr<PseudoRetainable> ptr2; ptr2 = ptr; EXPECT_EQ(2, obj.retain_count()); EXPECT_EQ(0, obj.release_count()); } EXPECT_EQ(2, obj.retain_count()); EXPECT_EQ(1, obj.release_count()); } EXPECT_EQ(2, obj.retain_count()); EXPECT_EQ(2, obj.release_count()); } TEST(RetainPtr, MoveAssign) { PseudoRetainable obj; { RetainPtr<PseudoRetainable> ptr1(&obj); { RetainPtr<PseudoRetainable> ptr2; EXPECT_EQ(&obj, ptr1.Get()); EXPECT_EQ(nullptr, ptr2.Get()); ptr2 = std::move(ptr1); EXPECT_EQ(nullptr, ptr1.Get()); EXPECT_EQ(&obj, ptr2.Get()); EXPECT_EQ(1, obj.retain_count()); EXPECT_EQ(0, obj.release_count()); } EXPECT_EQ(1, obj.retain_count()); EXPECT_EQ(1, obj.release_count()); } EXPECT_EQ(1, obj.retain_count()); EXPECT_EQ(1, obj.release_count());
+ show +
210
211
212
213
214
215
216
217
218
219
} TEST(RetainPtr, Equals) { PseudoRetainable obj1; PseudoRetainable obj2; RetainPtr<PseudoRetainable> null_ptr1; RetainPtr<PseudoRetainable> obj1_ptr1(&obj1); RetainPtr<PseudoRetainable> obj2_ptr1(&obj2); { RetainPtr<PseudoRetainable> null_ptr2;

[CVE-2023-40093_1.diff] fx_coordinates.h #4
+using CFX_Point16 = CFX_PTemplate<int16_t>; - float Length() const { return sqrt(x * x + y * y); } - void Normalize() { - float fLen = Length(); - if (fLen < 0.0001f) - return; - - x /= fLen; - y /= fLen; - } - void Translate(BaseType dx, BaseType dy) { - x += dx; - y += dy; - } - void Scale(BaseType sx, BaseType sy) { - x *= sx; - y *= sy; - } - void Rotate(float fRadian) { - float cosValue = cos(fRadian); - float sinValue = sin(fRadian); - x = x * cosValue - y * sinValue; - y = x * sinValue + y * cosValue; - } + float Length() const; + void Normalize();
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxcrt/fx_coordinates.h
140
141
142
143
144
145
146
147
148
149
CFX_VTemplate() : CFX_PTemplate<BaseType>() {} CFX_VTemplate(BaseType new_x, BaseType new_y) : CFX_PTemplate<BaseType>(new_x, new_y) {} CFX_VTemplate(const CFX_VTemplate& other) : CFX_PTemplate<BaseType>(other) {} CFX_VTemplate(const CFX_PTemplate<BaseType>& point1, const CFX_PTemplate<BaseType>& point2) : CFX_PTemplate<BaseType>(point2.x - point1.x, point2.y - point1.y) {}
+ show +
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
float Length() const { return sqrt(x * x + y * y); } void Normalize() { float fLen = Length(); if (fLen < 0.0001f) return; x /= fLen; y /= fLen; } void Translate(BaseType dx, BaseType dy) { x += dx; y += dy; } void Scale(BaseType sx, BaseType sy) { x *= sx; y *= sy; } void Rotate(float fRadian) { float cosValue = cos(fRadian); float sinValue = sin(fRadian); x = x * cosValue - y * sinValue; y = x * sinValue + y * cosValue;
+ show +
172
173
174
175
176
177
178
179
180
181
} }; using CFX_Vector = CFX_VTemplate<int32_t>; using CFX_VectorF = CFX_VTemplate<float>; // Rectangles. // TODO(tsepez): Consolidate all these different rectangle classes. // LTRB rectangles (y-axis runs downwards). struct FX_RECT {

[CVE-2023-40093_1.diff] fx_coordinates.h #5
- bool Valid() const { - pdfium::base::CheckedNumeric<int> w = right; - pdfium::base::CheckedNumeric<int> h = bottom; - w -= left; - h -= top; - return w.IsValid() && h.IsValid(); - } + bool Valid() const; + FX_RECT SwappedClipBox(int width, int height, bool bFlipX, bool bFlipY) const;
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxcrt/fx_coordinates.h
179
180
181
182
183
184
185
186
187
188
// LTRB rectangles (y-axis runs downwards). struct FX_RECT { FX_RECT() : left(0), top(0), right(0), bottom(0) {} FX_RECT(int l, int t, int r, int b) : left(l), top(t), right(r), bottom(b) {} int Width() const { return right - left; } int Height() const { return bottom - top; } bool IsEmpty() const { return right <= left || bottom <= top; }
+ show +
189
190
191
192
193
194
bool Valid() const { pdfium::base::CheckedNumeric<int> w = right; pdfium::base::CheckedNumeric<int> h = bottom; w -= left; h -= top; return w.IsValid() && h.IsValid();
+ show +
195
196
197
198
199
200
201
202
203
204
} void Normalize(); void Intersect(const FX_RECT& src); void Intersect(int l, int t, int r, int b) { Intersect(FX_RECT(l, t, r, b)); } void Offset(int dx, int dy) { left += dx; right += dx;

[CVE-2023-40093_1.diff] fx_coordinates.h #7
- void InitRect(const CFX_PointF& point) { - left = point.x; - right = point.x; - bottom = point.y; - top = point.y; - }
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxcrt/fx_coordinates.h
256
257
258
259
260
261
262
263
264
265
// Returned rect has bounds rounded up/down such that the original is // contained in it. FX_RECT GetOuterRect() const; // Returned rect has bounds rounded up/down such that the dimensions are // rounded up and the sum of the error in the bounds is minimized. FX_RECT GetClosestRect() const; CFX_FloatRect GetCenterSquare() const;
+ show +
266
267
268
269
270
void InitRect(const CFX_PointF& point) { left = point.x; right = point.x; bottom = point.y; top = point.y;
+ show +
271
272
273
274
275
276
277
278
279
280
} void UpdateRect(const CFX_PointF& point); float Width() const { return right - left; } float Height() const { return top - bottom; } void Inflate(float x, float y) { Normalize(); left -= x; right += x;

[CVE-2023-40093_1.diff] unowned_ptr.h #4
+ void Reset(T* obj = nullptr) { + ProbeForLowSeverityLifetimeIssue(); + m_pObj = obj; + } + -template <typename T, typename U> -inline bool operator==(const U* lhs, const UnownedPtr<T>& rhs) { - return rhs == lhs; -} - -template <typename T, typename U> -inline bool operator!=(const U* lhs, const UnownedPtr<T>& rhs) { - return rhs != lhs; -} - +namespace pdfium { + +// Type-deducing wrapper to make an UnownedPtr from an ordinary pointer, +// since equivalent constructor is explicit. +template <typename T> +UnownedPtr<T> WrapUnowned(T* that) { + return UnownedPtr<T>(that); +} + +} // namespace pdfium +
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxcrt/unowned_ptr.h
97
98
99
100
101
102
103
104
105
106
inline void ProbeForLowSeverityLifetimeIssue() { #if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) if (m_pObj) reinterpret_cast<const volatile uint8_t*>(m_pObj)[0]; #endif } T* m_pObj = nullptr; };
+ show +
107
108
109
110
111
112
113
114
template <typename T, typename U> inline bool operator==(const U* lhs, const UnownedPtr<T>& rhs) { return rhs == lhs; } template <typename T, typename U> inline bool operator!=(const U* lhs, const UnownedPtr<T>& rhs) { return rhs != lhs;
+ show +
115
116
117
118
119
120
121
} } // namespace fxcrt using fxcrt::UnownedPtr; #endif // CORE_FXCRT_UNOWNED_PTR_H_

[CVE-2023-40093_1.diff] cpdf_dest_unittest.cpp #2
- array->AddNew<CPDF_Number>(0); // Page Index. - array->AddNew<CPDF_Name>("XYZ"); - array->AddNew<CPDF_Number>(4); // X + array->AppendNew<CPDF_Number>(0); // Page Index. + array->AppendNew<CPDF_Name>("XYZ"); + array->AppendNew<CPDF_Number>(4); // X - auto dest = pdfium::MakeUnique<CPDF_Dest>(); - EXPECT_FALSE(dest->GetXYZ(&hasX, &hasY, &hasZoom, &x, &y, &zoom)); + CPDF_Dest dest(nullptr); + EXPECT_FALSE(dest.GetXYZ(&hasX, &hasY, &hasZoom, &x, &y, &zoom)); - auto dest = pdfium::MakeUnique<CPDF_Dest>(array.Get()); - EXPECT_FALSE(dest->GetXYZ(&hasX, &hasY, &hasZoom, &x, &y, &zoom)); + CPDF_Dest dest(array); + EXPECT_FALSE(dest.GetXYZ(&hasX, &hasY, &hasZoom, &x, &y, &zoom)); - array->AddNew<CPDF_Number>(5); // Y - array->AddNew<CPDF_Number>(6); // Zoom. + array->AppendNew<CPDF_Number>(5); // Y + array->AppendNew<CPDF_Number>(6); // Zoom. - auto dest = pdfium::MakeUnique<CPDF_Dest>(array.Get()); - EXPECT_TRUE(dest->GetXYZ(&hasX, &hasY, &hasZoom, &x, &y, &zoom)); + CPDF_Dest dest(array); + EXPECT_TRUE(dest.GetXYZ(&hasX, &hasY, &hasZoom, &x, &y, &zoom));
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfdoc/cpdf_dest_unittest.cpp
14
15
16
17
18
19
20
21
22
23
TEST(cpdf_dest, GetXYZ) { bool hasX; bool hasY; bool hasZoom; float x; float y; float zoom; // |array| must outlive |dest|. auto array = pdfium::MakeUnique<CPDF_Array>();
+ show +
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
array->AddNew<CPDF_Number>(0); // Page Index. array->AddNew<CPDF_Name>("XYZ"); array->AddNew<CPDF_Number>(4); // X { auto dest = pdfium::MakeUnique<CPDF_Dest>(); EXPECT_FALSE(dest->GetXYZ(&hasX, &hasY, &hasZoom, &x, &y, &zoom)); } { // Not enough entries. auto dest = pdfium::MakeUnique<CPDF_Dest>(array.get()); EXPECT_FALSE(dest->GetXYZ(&hasX, &hasY, &hasZoom, &x, &y, &zoom)); } array->AddNew<CPDF_Number>(5); // Y array->AddNew<CPDF_Number>(6); // Zoom. { auto dest = pdfium::MakeUnique<CPDF_Dest>(array.get()); EXPECT_TRUE(dest->GetXYZ(&hasX, &hasY, &hasZoom, &x, &y, &zoom));
+ show +
41
42
43
44
45
46
47
48
49
50
EXPECT_TRUE(hasX); EXPECT_TRUE(hasY); EXPECT_TRUE(hasZoom); EXPECT_EQ(4, x); EXPECT_EQ(5, y); EXPECT_EQ(6, zoom); } // Set zoom to 0. array->SetNewAt<CPDF_Number>(4, 0); {

[CVE-2023-40093_1.diff] cpdf_annotlist.cpp #7
+bool CPDF_AnnotList::Contains(const CPDF_Annot* pAnnot) const { + auto it = std::find_if(m_AnnotList.begin(), m_AnnotList.end(), + [pAnnot](const std::unique_ptr<CPDF_Annot>& annot) { + return annot.get() == pAnnot; + }); + return it != m_AnnotList.end(); +} + - const CFX_Matrix* pMatrix, - bool bWidgetPass, - CPDF_RenderOptions* pOptions, - FX_RECT* clip_rect) { + const CFX_Matrix& mtMatrix, + bool bWidgetPass) {
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fpdfdoc/cpdf_annotlist.cpp
156
157
158
159
160
161
162
163
164
165
m_AnnotList.push_back(std::move(pPopupAnnot)); } } CPDF_AnnotList::~CPDF_AnnotList() {} void CPDF_AnnotList::DisplayPass(CPDF_Page* pPage, CFX_RenderDevice* pDevice, CPDF_RenderContext* pContext, bool bPrinting,
+ show +
166
167
168
169
const CFX_Matrix* pMatrix, bool bWidgetPass, CPDF_RenderOptions* pOptions, FX_RECT* clip_rect) {
+ show +
170
171
172
173
174
175
176
177
178
179
for (const auto& pAnnot : m_AnnotList) { bool bWidget = pAnnot->GetSubtype() == CPDF_Annot::Subtype::WIDGET; if ((bWidgetPass && !bWidget) || (!bWidgetPass && bWidget)) continue; uint32_t annot_flags = pAnnot->GetFlags(); if (annot_flags & ANNOTFLAG_HIDDEN) continue; if (bPrinting && (annot_flags & ANNOTFLAG_PRINT) == 0)

[CVE-2023-40093_1.diff] cfx_renderdevice.cpp #15
-#if defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_ -void CFX_RenderDevice::Flush(bool release) { - if (release) - m_pDeviceDriver.reset(); - else - m_pDeviceDriver->Flush(); -} -#endif - + DCHECK(pDriver); + DCHECK(!m_pDeviceDriver);
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxge/cfx_renderdevice.cpp
374
375
376
377
378
379
380
381
382
383
m_RenderCaps(0), m_DeviceClass(0) {} CFX_RenderDevice::~CFX_RenderDevice() { RestoreState(false); #if defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_ Flush(true); #endif }
+ show +
384
385
386
387
388
389
390
391
#if defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_ void CFX_RenderDevice::Flush(bool release) { if (release) m_pDeviceDriver.reset(); else m_pDeviceDriver->Flush(); } #endif
+ show +
392
393
394
395
396
397
398
399
400
401
void CFX_RenderDevice::SetDeviceDriver( std::unique_ptr<IFX_RenderDeviceDriver> pDriver) { m_pDeviceDriver = std::move(pDriver); InitDeviceInfo(); } void CFX_RenderDevice::InitDeviceInfo() { m_Width = m_pDeviceDriver->GetDeviceCaps(FXDC_PIXEL_WIDTH); m_Height = m_pDeviceDriver->GetDeviceCaps(FXDC_PIXEL_HEIGHT);

[CVE-2023-40093_1.diff] cfpf_skiafont.cpp #4
- rtBBox.left = FPF_EM_ADJUST(x_ppem, cbox.xMin); - rtBBox.right = FPF_EM_ADJUST(x_ppem, cbox.xMax); - rtBBox.top = FPF_EM_ADJUST(y_ppem, cbox.yMax); - rtBBox.bottom = FPF_EM_ADJUST(y_ppem, cbox.yMin); + rtBBox.left = static_cast<int32_t>(FPF_EM_ADJUST(x_ppem, cbox.xMin)); + rtBBox.right = static_cast<int32_t>(FPF_EM_ADJUST(x_ppem, cbox.xMax)); + rtBBox.top = static_cast<int32_t>(FPF_EM_ADJUST(y_ppem, cbox.yMax)); + rtBBox.bottom = static_cast<int32_t>(FPF_EM_ADJUST(y_ppem, cbox.yMin));
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxge/android/cfpf_skiafont.cpp
100
101
102
103
104
105
106
107
108
109
} FXFT_Glyph glyph; if (FXFT_Get_Glyph(m_Face->glyph, &glyph)) { FXFT_Set_Pixel_Sizes(m_Face, 0, 64); return false; } FXFT_BBox cbox; FXFT_Glyph_Get_CBox(glyph, FXFT_GLYPH_BBOX_PIXELS, &cbox); int32_t x_ppem = m_Face->size->metrics.x_ppem; int32_t y_ppem = m_Face->size->metrics.y_ppem;
+ show +
110
111
112
113
rtBBox.left = FPF_EM_ADJUST(x_ppem, cbox.xMin); rtBBox.right = FPF_EM_ADJUST(x_ppem, cbox.xMax); rtBBox.top = FPF_EM_ADJUST(y_ppem, cbox.yMax); rtBBox.bottom = FPF_EM_ADJUST(y_ppem, cbox.yMin);
+ show +
114
115
116
117
118
119
120
121
122
123
rtBBox.top = std::min(rtBBox.top, GetAscent()); rtBBox.bottom = std::max(rtBBox.bottom, GetDescent()); FXFT_Done_Glyph(glyph); return FXFT_Set_Pixel_Sizes(m_Face, 0, 64) == 0; } if (FXFT_Load_Glyph( m_Face, iGlyphIndex, FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH)) { return false; }

[CVE-2023-40093_1.diff] fx_agg_driver.cpp #4
+namespace pdfium { -void RgbByteOrderSetPixel(const RetainPtr<CFX_DIBitmap>& pBitmap, - int x, - int y, - uint32_t argb) { - if (x < 0 || x >= pBitmap->GetWidth() || y < 0 || y >= pBitmap->GetHeight()) - return; - - uint8_t* pos = pBitmap->GetBuffer() + y * pBitmap->GetPitch() + - x * pBitmap->GetBPP() / 8; - if (pBitmap->GetFormat() == FXDIB_Argb) { - FXARGB_SETRGBORDERDIB(pos, argb); - return; - } - - int alpha = FXARGB_A(argb); - pos[0] = (FXARGB_R(argb) * alpha + pos[0] * (255 - alpha)) / 255; - pos[1] = (FXARGB_G(argb) * alpha + pos[1] * (255 - alpha)) / 255; - pos[2] = (FXARGB_B(argb) * alpha + pos[2] * (255 - alpha)) / 255; -} -
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxge/agg/fx_agg_driver.cpp
28
29
30
31
32
33
34
35
36
37
namespace { const float kMaxPos = 32000.0f; CFX_PointF HardClip(const CFX_PointF& pos) { return CFX_PointF(pdfium::clamp(pos.x, -kMaxPos, kMaxPos), pdfium::clamp(pos.y, -kMaxPos, kMaxPos)); }
+ show +
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
void RgbByteOrderSetPixel(const RetainPtr<CFX_DIBitmap>& pBitmap, int x, int y, uint32_t argb) { if (x < 0 || x >= pBitmap->GetWidth() || y < 0 || y >= pBitmap->GetHeight()) return; uint8_t* pos = pBitmap->GetBuffer() + y * pBitmap->GetPitch() + x * pBitmap->GetBPP() / 8; if (pBitmap->GetFormat() == FXDIB_Argb) { FXARGB_SETRGBORDERDIB(pos, argb); return; } int alpha = FXARGB_A(argb); pos[0] = (FXARGB_R(argb) * alpha + pos[0] * (255 - alpha)) / 255; pos[1] = (FXARGB_G(argb) * alpha + pos[1] * (255 - alpha)) / 255; pos[2] = (FXARGB_B(argb) * alpha + pos[2] * (255 - alpha)) / 255;
+ show +
56
57
58
59
60
61
62
63
64
65
} void RgbByteOrderCompositeRect(const RetainPtr<CFX_DIBitmap>& pBitmap, int left, int top, int width, int height, FX_ARGB argb) { int src_alpha = FXARGB_A(argb); if (src_alpha == 0)

[CVE-2023-40093_1.diff] fx_agg_driver.cpp #20
- uint8_t* clip_scan, - uint8_t* dest_extra_alpha_scan) { - ASSERT(!m_bRgbByteOrder); - ASSERT(!m_pDevice->IsCmykImage()); + uint8_t* clip_scan) { + DCHECK(!m_bRgbByteOrder);
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxge/agg/fx_agg_driver.cpp
583
584
585
586
587
588
589
590
591
592
span_left); } void CFX_Renderer::CompositeSpan1bpp(uint8_t* dest_scan, int Bpp, int span_left, int span_len, uint8_t* cover_scan, int clip_left, int clip_right,
+ show +
593
594
595
596
uint8_t* clip_scan, uint8_t* dest_extra_alpha_scan) { ASSERT(!m_bRgbByteOrder); ASSERT(!m_pDevice->IsCmykImage());
+ show +
597
598
599
600
601
602
603
604
605
606
int col_start = GetColStart(span_left, clip_left); int col_end = GetColEnd(span_left, span_len, clip_right); dest_scan += col_start / 8; CompositeSpan1bppHelper(dest_scan, col_start, col_end, cover_scan, clip_scan, span_left); } void CFX_Renderer::CompositeSpanGray(uint8_t* dest_scan, int Bpp, int span_left,

[CVE-2023-40093_1.diff] fx_agg_driver.cpp #24
- if (Bpp == 3 && dest_extra_alpha_scan) { - for (int col = col_start; col < col_end; col++) { - int src_alpha = m_bFullCover ? GetSrcAlpha(clip_scan, col) - : GetSourceAlpha(cover_scan, clip_scan, col); - if (src_alpha) { - if (src_alpha == 255) { - *dest_scan++ = static_cast<uint8_t>(m_Blue); - *dest_scan++ = static_cast<uint8_t>(m_Green); - *dest_scan++ = static_cast<uint8_t>(m_Red); - *dest_extra_alpha_scan++ = static_cast<uint8_t>(m_Alpha); - continue; - } - uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alpha - - (*dest_extra_alpha_scan) * src_alpha / 255; - *dest_extra_alpha_scan++ = dest_alpha; - int alpha_ratio = src_alpha * 255 / dest_alpha; - *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, alpha_ratio); - dest_scan++; - *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Green, alpha_ratio); - dest_scan++; - *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red, alpha_ratio); - dest_scan++; - continue; - } - dest_extra_alpha_scan++; - dest_scan += Bpp; - } - return; - }
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxge/agg/fx_agg_driver.cpp
750
751
752
753
754
755
756
757
758
759
dest_scan++; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, src_alpha); dest_scan += Bpp - 2; continue; } } dest_scan += Bpp; } return; }
+ show +
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
if (Bpp == 3 && dest_extra_alpha_scan) { for (int col = col_start; col < col_end; col++) { int src_alpha = m_bFullCover ? GetSrcAlpha(clip_scan, col) : GetSourceAlpha(cover_scan, clip_scan, col); if (src_alpha) { if (src_alpha == 255) { *dest_scan++ = static_cast<uint8_t>(m_Blue); *dest_scan++ = static_cast<uint8_t>(m_Green); *dest_scan++ = static_cast<uint8_t>(m_Red); *dest_extra_alpha_scan++ = static_cast<uint8_t>(m_Alpha); continue; } uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alpha - (*dest_extra_alpha_scan) * src_alpha / 255; *dest_extra_alpha_scan++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, alpha_ratio); dest_scan++; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Green, alpha_ratio); dest_scan++; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red, alpha_ratio); dest_scan++; continue; } dest_extra_alpha_scan++; dest_scan += Bpp; } return;
+ show +
788
789
790
791
792
793
794
795
796
797
} for (int col = col_start; col < col_end; col++) { int src_alpha = m_bFullCover ? GetSrcAlpha(clip_scan, col) : GetSourceAlpha(cover_scan, clip_scan, col); if (src_alpha) { if (src_alpha == 255) { if (Bpp == 4) { *(uint32_t*)dest_scan = m_Color; } else if (Bpp == 3) { *dest_scan++ = m_Blue;

[CVE-2023-40093_1.diff] fx_skia_device.cpp #4
- path.dump(&stream, false, false); - std::unique_ptr<char, FxFreeDeleter> storage; - storage.reset(FX_Alloc(char, stream.bytesWritten())); - stream.copyTo(storage.get()); - printf("%.*s", (int)stream.bytesWritten(), storage.get()); + path.dump(&stream, false); + DataVector<char> storage(stream.bytesWritten()); + stream.copyTo(storage.data()); + printf("%.*s", static_cast<int>(storage.size()), storage.data());
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxge/skia/fx_skia_device.cpp
173
174
175
176
177
178
179
180
181
182
} } #endif // SHOW_SKIA_PATH void DebugShowSkiaPath(const SkPath& path) { #if SHOW_SKIA_PATH #if SHOW_SKIA_PATH_SHORTHAND printf(" **\n"); #else SkDynamicMemoryWStream stream;
+ show +
183
184
185
186
187
path.dump(&stream, false, false); std::unique_ptr<char, FxFreeDeleter> storage; storage.reset(FX_Alloc(char, stream.bytesWritten())); stream.copyTo(storage.get()); printf("%.*s", (int)stream.bytesWritten(), storage.get());
+ show +
188
189
190
191
192
193
194
195
196
197
#endif // SHOW_SKIA_PATH_SHORTHAND #endif // SHOW_SKIA_PATH } void DebugShowCanvasClip(CFX_SkiaDeviceDriver* driver, const SkCanvas* canvas) { #if SHOW_SKIA_PATH SkMatrix matrix = canvas->getTotalMatrix(); SkScalar m[9]; matrix.get9(m); printf("matrix (%g,%g,%g) (%g,%g,%g) (%g,%g,%g)\n", m[0], m[1], m[2], m[3],

[CVE-2023-40093_1.diff] fx_skia_device.cpp #13
-#endif // _SKIA_SUPPORT_ - -#ifdef _SKIA_SUPPORT_PATHS_ - case FXDC_PIXEL_WIDTH: - return m_pBitmap->GetWidth(); - case FXDC_PIXEL_HEIGHT: - return m_pBitmap->GetHeight(); - case FXDC_BITS_PIXEL: - return m_pBitmap->GetBPP(); - case FXDC_HORZ_SIZE: - case FXDC_VERT_SIZE: - return 0; - case FXDC_RENDER_CAPS: { - int flags = FXRC_GET_BITS | FXRC_ALPHA_PATH | FXRC_ALPHA_IMAGE | - FXRC_BLEND_MODE | FXRC_SOFT_CLIP | FXRC_SHADING; - if (m_pBitmap->HasAlpha()) { - flags |= FXRC_ALPHA_OUTPUT; - } else if (m_pBitmap->IsAlphaMask()) { - if (m_pBitmap->GetBPP() == 1) { - flags |= FXRC_BITMASK_OUTPUT; - } else { - flags |= FXRC_BYTEMASK_OUTPUT; - } - } - if (m_pBitmap->IsCmykImage()) { - flags |= FXRC_CMYK_OUTPUT; - } - return flags; - } -#endif // _SKIA_SUPPORT_PATHS_ -
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxge/skia/fx_skia_device.cpp
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
return m_pCanvas->imageInfo().height(); case FXDC_BITS_PIXEL: return 32; case FXDC_HORZ_SIZE: case FXDC_VERT_SIZE: return 0; case FXDC_RENDER_CAPS: return FXRC_GET_BITS | FXRC_ALPHA_PATH | FXRC_ALPHA_IMAGE | FXRC_BLEND_MODE | FXRC_SOFT_CLIP | FXRC_ALPHA_OUTPUT | FXRC_FILLSTROKE_PATH | FXRC_SHADING;
+ show +
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
#endif // _SKIA_SUPPORT_ #ifdef _SKIA_SUPPORT_PATHS_ case FXDC_PIXEL_WIDTH: return m_pBitmap->GetWidth(); case FXDC_PIXEL_HEIGHT: return m_pBitmap->GetHeight(); case FXDC_BITS_PIXEL: return m_pBitmap->GetBPP(); case FXDC_HORZ_SIZE: case FXDC_VERT_SIZE: return 0; case FXDC_RENDER_CAPS: { int flags = FXRC_GET_BITS | FXRC_ALPHA_PATH | FXRC_ALPHA_IMAGE | FXRC_BLEND_MODE | FXRC_SOFT_CLIP | FXRC_SHADING; if (m_pBitmap->HasAlpha()) { flags |= FXRC_ALPHA_OUTPUT; } else if (m_pBitmap->IsAlphaMask()) { if (m_pBitmap->GetBPP() == 1) { flags |= FXRC_BITMASK_OUTPUT; } else { flags |= FXRC_BYTEMASK_OUTPUT; } } if (m_pBitmap->IsCmykImage()) { flags |= FXRC_CMYK_OUTPUT; } return flags; } #endif // _SKIA_SUPPORT_PATHS_
+ show +
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
} return 0; } void CFX_SkiaDeviceDriver::SaveState() { m_pCache->DebugCheckClip(); if (!m_pCache->ClipSave()) m_pCanvas->save(); #ifdef _SKIA_SUPPORT_PATHS_

[CVE-2023-40093_1.diff] cfx_imagetransformer.h #2
- struct BicubicData { - int res_x; - int res_y; - int src_col_l; - int src_row_l; - int src_col_r; - int src_row_r; - int pos_pixel[8]; - int u_w[4]; - int v_w[4]; - }; - - struct DownSampleData { - int src_col; - int src_row; - }; -
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxge/dib/cfx_imagetransformer.h
36
37
38
39
40
41
42
43
44
45
int res_x; int res_y; int src_col_l; int src_row_l; int src_col_r; int src_row_r; int row_offset_l; int row_offset_r; };
+ show +
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
struct BicubicData { int res_x; int res_y; int src_col_l; int src_row_l; int src_col_r; int src_row_r; int pos_pixel[8]; int u_w[4]; int v_w[4]; }; struct DownSampleData { int src_col; int src_row; };
+ show +
62
63
64
65
66
67
68
69
70
71
struct CalcData { const CFX_DIBitmap* bitmap; const CFX_Matrix& matrix; const uint8_t* buf; uint32_t pitch; }; void CalcMask(const CalcData& cdata); void CalcAlpha(const CalcData& cdata);

[CVE-2023-40093_1.diff] cfx_dibitmap.cpp #15
- } else { - if (GetFormat() == FXDIB_Argb) { - if (pSrcClone->GetBPP() == 1) - return false; + return true; + } - for (int row = 0; row < m_Height; row++) { - uint8_t* dest_scan = m_pBuffer.Get() + m_Pitch * row + 3; - uint8_t* src_scan = - pSrcClone->m_pBuffer.Get() + pSrcClone->m_Pitch * row; - for (int col = 0; col < m_Width; col++) { - *dest_scan = (*dest_scan) * src_scan[col] / 255; - dest_scan += 4; - } - } - } else { - m_pAlphaMask->MultiplyAlpha(pSrcClone); + DCHECK_EQ(GetFormat(), FXDIB_Format::kArgb); + if (pSrcClone->GetBPP() == 1) + return false; + + for (int row = 0; row < m_Height; row++) { + uint8_t* dest_scan = m_pBuffer.Get() + m_Pitch * row + 3; + uint8_t* src_scan = pSrcClone->m_pBuffer.Get() + pSrcClone->m_Pitch * row; + for (int col = 0; col < m_Width; col++) { + *dest_scan = (*dest_scan) * src_scan[col] / 255; + dest_scan += 4;
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxge/dib/cfx_dibitmap.cpp
435
436
437
438
439
440
441
442
443
444
if (!((1 << (7 - col % 8)) & src_scan[col / 8])) dest_scan[col] = 0; } } else { for (int col = 0; col < m_Width; col++) { *dest_scan = (*dest_scan) * src_scan[col] / 255; dest_scan++; } } }
+ show +
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
} else { if (GetFormat() == FXDIB_Argb) { if (pSrcClone->GetBPP() == 1) return false; for (int row = 0; row < m_Height; row++) { uint8_t* dest_scan = m_pBuffer.Get() + m_Pitch * row + 3; uint8_t* src_scan = pSrcClone->m_pBuffer.Get() + pSrcClone->m_Pitch * row; for (int col = 0; col < m_Width; col++) { *dest_scan = (*dest_scan) * src_scan[col] / 255; dest_scan += 4; } } } else { m_pAlphaMask->MultiplyAlpha(pSrcClone);
+ show +
461
462
463
464
465
466
467
468
469
470
} } return true; } bool CFX_DIBitmap::MultiplyAlpha(int alpha) { if (!m_pBuffer) return false; switch (GetFormat()) {

[CVE-2023-40093_1.diff] cfx_imagetransformer.cpp #4
- void Transform(int x, int y, int* x1, int* y1) const { - std::pair<float, float> val = TransformInternal(x, y); - *x1 = pdfium::base::saturated_cast<int>(val.first / kBase); - *y1 = pdfium::base::saturated_cast<int>(val.second / kBase); + void Transform(int x, int y, int* x1, int* y1, int* res_x, int* res_y) const { + CFX_PointF val = TransformInternal(CFX_PointF(x, y)); + *x1 = pdfium::base::saturated_cast<int>(val.x / kBase); + *y1 = pdfium::base::saturated_cast<int>(val.y / kBase); + *res_x = static_cast<int>(val.x) % kBase; + *res_y = static_cast<int>(val.y) % kBase; + if (*res_x < 0 && *res_x > -kBase) + *res_x = kBase + *res_x; + if (*res_y < 0 && *res_y > -kBase) + *res_y = kBase + *res_y; - protected: - std::pair<float, float> TransformInternal(float x, float y) const { - return std::make_pair(a * x + c * y + e + kBase / 2, - b * x + d * y + f + kBase / 2); + private: + CFX_PointF TransformInternal(CFX_PointF pt) const { + return CFX_PointF(a * pt.x + c * pt.y + e + kBase / 2, + b * pt.x + d * pt.y + f + kBase / 2);
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxge/dib/cfx_imagetransformer.cpp
158
159
160
161
162
163
164
165
166
167
class CPDF_FixedMatrix { public: explicit CPDF_FixedMatrix(const CFX_Matrix& src) : a(FXSYS_round(src.a * kBase)), b(FXSYS_round(src.b * kBase)), c(FXSYS_round(src.c * kBase)), d(FXSYS_round(src.d * kBase)), e(FXSYS_round(src.e * kBase)), f(FXSYS_round(src.f * kBase)) {}
+ show +
168
169
170
171
172
173
174
175
176
177
void Transform(int x, int y, int* x1, int* y1) const { std::pair<float, float> val = TransformInternal(x, y); *x1 = pdfium::base::saturated_cast<int>(val.first / kBase); *y1 = pdfium::base::saturated_cast<int>(val.second / kBase); } protected: std::pair<float, float> TransformInternal(float x, float y) const { return std::make_pair(a * x + c * y + e + kBase / 2, b * x + d * y + f + kBase / 2);
+ show +
178
179
180
181
182
183
184
185
186
187
} const int a; const int b; const int c; const int d; const int e; const int f; };

[CVE-2023-40093_1.diff] cfx_scanlinecompositor.cpp #33
-void CompositeRow_Rgb2Argb_NoBlend_NoClip_RgbByteOrder(uint8_t* dest_scan, - const uint8_t* src_scan, - int width, - int src_Bpp) { +void CompositeRow_Rgb2Argb_NoBlend_NoClip_RgbByteOrder( + pdfium::span<uint8_t> dest_span, + pdfium::span<const uint8_t> src_span, + int width, + int src_Bpp) { + uint8_t* dest_scan = dest_span.data(); + const uint8_t* src_scan = src_span.data();
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxge/dib/cfx_scanlinecompositor.cpp
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
? blended_colors[color] : Blend(blend_type, back_color, *src_scan); dest_scan[index] = FXDIB_ALPHA_MERGE(back_color, blended, src_alpha); src_scan++; } dest_scan += dest_Bpp; src_scan++; } }
+ show +
2145
2146
2147
2148
void CompositeRow_Rgb2Argb_NoBlend_NoClip_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int src_Bpp) {
+ show +
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
for (int col = 0; col < width; col++) { if (src_Bpp == 4) { FXARGB_SETRGBORDERDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan)); } else { FXARGB_SETRGBORDERDIB( dest_scan, FXARGB_MAKE(0xff, src_scan[2], src_scan[1], src_scan[0])); } dest_scan += 4; src_scan += src_Bpp; }

[CVE-2023-40093_1.diff] cfx_scanlinecompositor.cpp #35
-void CompositeRow_Argb2Rgb_NoBlend_RgbByteOrder(uint8_t* dest_scan, - const uint8_t* src_scan, - int width, - int dest_Bpp, - const uint8_t* clip_scan) { +void CompositeRow_Argb2Rgb_NoBlend_RgbByteOrder( + pdfium::span<uint8_t> dest_span, + pdfium::span<const uint8_t> src_span, + int width, + int dest_Bpp, + pdfium::span<const uint8_t> clip_span) { + uint8_t* dest_scan = dest_span.data(); + const uint8_t* src_scan = src_span.data(); + const uint8_t* clip_scan = clip_span.data();
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxge/dib/cfx_scanlinecompositor.cpp
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
? blended_colors[color] : Blend(blend_type, back_color, src_color); dest_scan[index] = blended; src_scan++; } dest_scan += dest_Bpp; src_scan += src_gap; } }
+ show +
2193
2194
2195
2196
2197
void CompositeRow_Argb2Rgb_NoBlend_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int dest_Bpp, const uint8_t* clip_scan) {
+ show +
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
for (int col = 0; col < width; col++) { uint8_t src_alpha; if (clip_scan) { src_alpha = src_scan[3] * (*clip_scan++) / 255; } else { src_alpha = src_scan[3]; } if (src_alpha == 255) { dest_scan[2] = *src_scan++; dest_scan[1] = *src_scan++;

[CVE-2023-40093_1.diff] cfx_scanlinecompositor.cpp #38
- dest_scan[2] = *src_scan++; - dest_scan[1] = *src_scan++; - dest_scan[0] = *src_scan++; - src_scan += src_gap; + ReverseCopy3Bytes(dest_scan, src_scan); + src_scan += src_Bpp;
/media/esteban/ACOS/ResurrectionX/external/pdfium/core/fxge/dib/cfx_scanlinecompositor.cpp
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
int blend_type, int src_Bpp, const uint8_t* clip_scan) { int blended_colors[3]; bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int src_gap = src_Bpp - 3; for (int col = 0; col < width; col++) { int src_alpha = *clip_scan++; uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) {
+ show +
2256
2257
2258
2259
dest_scan[2] = *src_scan++; dest_scan[1] = *src_scan++; dest_scan[0] = *src_scan++; src_scan += src_gap;
+ show +
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
dest_scan += 4; continue; } if (src_alpha == 0) { dest_scan += 4; src_scan += src_Bpp; continue; } uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; dest_scan[3] = dest_alpha;

[CVE-2023-40093_1.diff] fpdf_text_embeddertest.cpp #3
- EXPECT_NEAR(41.071, left, 0.001); - EXPECT_NEAR(46.243, right, 0.001); - EXPECT_NEAR(49.844, bottom, 0.001); - EXPECT_NEAR(55.520, top, 0.001); + EXPECT_NEAR(41.120, left, 0.001); + EXPECT_NEAR(46.208, right, 0.001); + EXPECT_NEAR(49.892, bottom, 0.001); + EXPECT_NEAR(55.652, top, 0.001);
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/fpdftext_embeddertest.cpp
97
98
99
100
101
102
103
104
105
106
EXPECT_DOUBLE_EQ(0.0, right); EXPECT_DOUBLE_EQ(0.0, bottom); EXPECT_DOUBLE_EQ(0.0, top); EXPECT_FALSE(FPDFText_GetCharBox(textpage, 55, &left, &right, &bottom, &top)); EXPECT_DOUBLE_EQ(0.0, left); EXPECT_DOUBLE_EQ(0.0, right); EXPECT_DOUBLE_EQ(0.0, bottom); EXPECT_DOUBLE_EQ(0.0, top); EXPECT_TRUE(FPDFText_GetCharBox(textpage, 4, &left, &right, &bottom, &top));
+ show +
107
108
109
110
EXPECT_NEAR(41.071, left, 0.001); EXPECT_NEAR(46.243, right, 0.001); EXPECT_NEAR(49.844, bottom, 0.001); EXPECT_NEAR(55.520, top, 0.001);
+ show +
111
112
113
114
115
116
117
118
119
120
double x = 0.0; double y = 0.0; EXPECT_TRUE(FPDFText_GetCharOrigin(textpage, 4, &x, &y)); EXPECT_NEAR(40.664, x, 0.001); EXPECT_NEAR(50.000, y, 0.001); EXPECT_EQ(4, FPDFText_GetCharIndexAtPos(textpage, 42.0, 50.0, 1.0, 1.0)); EXPECT_EQ(-1, FPDFText_GetCharIndexAtPos(textpage, 0.0, 0.0, 1.0, 1.0)); EXPECT_EQ(-1, FPDFText_GetCharIndexAtPos(textpage, 199.0, 199.0, 1.0, 1.0));

[CVE-2023-40093_1.diff] fpdf_text_embeddertest.cpp #4
- EXPECT_NEAR(20.847, left, 0.001); - EXPECT_NEAR(135.167, right, 0.001); - EXPECT_NEAR(96.655, bottom, 0.001); - EXPECT_NEAR(116.000, top, 0.001); + EXPECT_NEAR(20.800, left, 0.001); + EXPECT_NEAR(135.040, right, 0.001); + EXPECT_NEAR(96.688, bottom, 0.001); + EXPECT_NEAR(111.600, top, 0.001);
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/fpdftext_embeddertest.cpp
125
126
127
128
129
130
131
132
133
134
EXPECT_EQ(-1, FPDFText_GetCharIndexAtPos(textpage, -1.0, 50.0, 1.0, 1.0)); // Count does not include the terminating NUL in the string literal. EXPECT_EQ(2, FPDFText_CountRects(textpage, 0, sizeof(expected) - 1)); left = 0.0; right = 0.0; bottom = 0.0; top = 0.0; EXPECT_TRUE(FPDFText_GetRect(textpage, 1, &left, &top, &right, &bottom));
+ show +
135
136
137
138
EXPECT_NEAR(20.847, left, 0.001); EXPECT_NEAR(135.167, right, 0.001); EXPECT_NEAR(96.655, bottom, 0.001); EXPECT_NEAR(116.000, top, 0.001);
+ show +
139
140
141
142
143
144
145
146
147
148
// Test out of range indicies set outputs to (0.0, 0.0, 0.0, 0.0). left = -1.0; right = -1.0; bottom = -1.0; top = -1.0; EXPECT_FALSE(FPDFText_GetRect(textpage, -1, &left, &top, &right, &bottom)); EXPECT_EQ(0.0, left); EXPECT_EQ(0.0, right); EXPECT_EQ(0.0, bottom);

[CVE-2023-40093_1.diff] fpdf_text_embeddertest.cpp #8
- EXPECT_NEAR(50.791, left, 0.001); - EXPECT_NEAR(187.963, right, 0.001); - EXPECT_NEAR(97.624, bottom, 0.001); - EXPECT_NEAR(108.736, top, 0.001); + EXPECT_NEAR(50.828, left, 0.001); + EXPECT_NEAR(187.904, right, 0.001); + EXPECT_NEAR(97.516, bottom, 0.001); + EXPECT_NEAR(108.700, top, 0.001);
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/fpdftext_embeddertest.cpp
375
376
377
378
379
380
381
382
383
384
EXPECT_EQ(0, FPDFLink_CountRects(pagelink, -1)); EXPECT_EQ(0, FPDFLink_CountRects(pagelink, 2)); EXPECT_EQ(0, FPDFLink_CountRects(pagelink, 10000)); // Check boundary of valid link index with valid rect index. double left = 0.0; double right = 0.0; double top = 0.0; double bottom = 0.0; EXPECT_TRUE(FPDFLink_GetRect(pagelink, 0, 0, &left, &top, &right, &bottom));
+ show +
385
386
387
388
EXPECT_NEAR(50.791, left, 0.001); EXPECT_NEAR(187.963, right, 0.001); EXPECT_NEAR(97.624, bottom, 0.001); EXPECT_NEAR(108.736, top, 0.001);
+ show +
389
390
391
392
393
394
395
396
397
398
// Check that valid link with invalid rect index leaves parameters unchanged. left = -1.0; right = -1.0; top = -1.0; bottom = -1.0; EXPECT_FALSE(FPDFLink_GetRect(pagelink, 0, 1, &left, &top, &right, &bottom)); EXPECT_EQ(-1.0, left); EXPECT_EQ(-1.0, right); EXPECT_EQ(-1.0, bottom);

[CVE-2023-40093_1.diff] fpdf_dataavail.cpp #2
+#include "core/fxcrt/unowned_ptr.h" -#include "third_party/base/ptr_util.h" +#include "third_party/base/numerics/safe_conversions.h" -static_assert(CPDF_DataAvail::DataError == PDF_DATA_ERROR, - "CPDF_DataAvail::DataError value mismatch"); -static_assert(CPDF_DataAvail::DataNotAvailable == PDF_DATA_NOTAVAIL, - "CPDF_DataAvail::DataNotAvailable value mismatch"); -static_assert(CPDF_DataAvail::DataAvailable == PDF_DATA_AVAIL, - "CPDF_DataAvail::DataAvailable value mismatch"); +static_assert(CPDF_DataAvail::kDataError == PDF_DATA_ERROR, + "CPDF_DataAvail::kDataError value mismatch"); +static_assert(CPDF_DataAvail::kDataNotAvailable == PDF_DATA_NOTAVAIL, + "CPDF_DataAvail::kDataNotAvailable value mismatch"); +static_assert(CPDF_DataAvail::kDataAvailable == PDF_DATA_AVAIL, + "CPDF_DataAvail::kDataAvailable value mismatch"); -static_assert(CPDF_DataAvail::LinearizationUnknown == PDF_LINEARIZATION_UNKNOWN, - "CPDF_DataAvail::LinearizationUnknown value mismatch"); -static_assert(CPDF_DataAvail::NotLinearized == PDF_NOT_LINEARIZED, - "CPDF_DataAvail::NotLinearized value mismatch"); -static_assert(CPDF_DataAvail::Linearized == PDF_LINEARIZED, - "CPDF_DataAvail::Linearized value mismatch"); +static_assert(CPDF_DataAvail::kLinearizationUnknown == + PDF_LINEARIZATION_UNKNOWN, + "CPDF_DataAvail::kLinearizationUnknown value mismatch"); +static_assert(CPDF_DataAvail::kNotLinearized == PDF_NOT_LINEARIZED, + "CPDF_DataAvail::kNotLinearized value mismatch"); +static_assert(CPDF_DataAvail::kLinearized == PDF_LINEARIZED, + "CPDF_DataAvail::kLinearized value mismatch"); -static_assert(CPDF_DataAvail::FormError == PDF_FORM_ERROR, - "CPDF_DataAvail::FormError value mismatch"); -static_assert(CPDF_DataAvail::FormNotAvailable == PDF_FORM_NOTAVAIL, - "CPDF_DataAvail::FormNotAvailable value mismatch"); -static_assert(CPDF_DataAvail::FormAvailable == PDF_FORM_AVAIL, - "CPDF_DataAvail::FormAvailable value mismatch"); -static_assert(CPDF_DataAvail::FormNotExist == PDF_FORM_NOTEXIST, - "CPDF_DataAvail::FormNotExist value mismatch"); +static_assert(CPDF_DataAvail::kFormError == PDF_FORM_ERROR, + "CPDF_DataAvail::kFormError value mismatch"); +static_assert(CPDF_DataAvail::kFormNotAvailable == PDF_FORM_NOTAVAIL, + "CPDF_DataAvail::kFormNotAvailable value mismatch"); +static_assert(CPDF_DataAvail::kFormAvailable == PDF_FORM_AVAIL, + "CPDF_DataAvail::kFormAvailable value mismatch"); +static_assert(CPDF_DataAvail::kFormNotExist == PDF_FORM_NOTEXIST, + "CPDF_DataAvail::kFormNotExist value mismatch");
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/fpdf_dataavail.cpp
8
9
10
11
12
13
14
15
16
17
#include <memory> #include <utility> #include "core/fpdfapi/parser/cpdf_data_avail.h" #include "core/fpdfapi/parser/cpdf_document.h" #include "core/fxcrt/fx_stream.h" #include "core/fxcrt/retain_ptr.h" #include "fpdfsdk/fsdk_define.h" #include "public/fpdf_formfill.h"
+ show +
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "third_party/base/ptr_util.h" // These checks are here because core/ and public/ cannot depend on each other. static_assert(CPDF_DataAvail::DataError == PDF_DATA_ERROR, "CPDF_DataAvail::DataError value mismatch"); static_assert(CPDF_DataAvail::DataNotAvailable == PDF_DATA_NOTAVAIL, "CPDF_DataAvail::DataNotAvailable value mismatch"); static_assert(CPDF_DataAvail::DataAvailable == PDF_DATA_AVAIL, "CPDF_DataAvail::DataAvailable value mismatch"); static_assert(CPDF_DataAvail::LinearizationUnknown == PDF_LINEARIZATION_UNKNOWN, "CPDF_DataAvail::LinearizationUnknown value mismatch"); static_assert(CPDF_DataAvail::NotLinearized == PDF_NOT_LINEARIZED, "CPDF_DataAvail::NotLinearized value mismatch"); static_assert(CPDF_DataAvail::Linearized == PDF_LINEARIZED, "CPDF_DataAvail::Linearized value mismatch"); static_assert(CPDF_DataAvail::FormError == PDF_FORM_ERROR, "CPDF_DataAvail::FormError value mismatch"); static_assert(CPDF_DataAvail::FormNotAvailable == PDF_FORM_NOTAVAIL, "CPDF_DataAvail::FormNotAvailable value mismatch"); static_assert(CPDF_DataAvail::FormAvailable == PDF_FORM_AVAIL, "CPDF_DataAvail::FormAvailable value mismatch"); static_assert(CPDF_DataAvail::FormNotExist == PDF_FORM_NOTEXIST, "CPDF_DataAvail::FormNotExist value mismatch");
+ show +
43
44
45
46
47
48
49
50
51
52
namespace { class FPDF_FileAvailContext : public CPDF_DataAvail::FileAvail { public: FPDF_FileAvailContext() : m_pfileAvail(nullptr) {} ~FPDF_FileAvailContext() override {} void Set(FX_FILEAVAIL* pfileAvail) { m_pfileAvail = pfileAvail; }

[CVE-2023-40093_1.diff] fpdf_editimg.cpp #7
- pImgObj->set_matrix(CFX_Matrix(static_cast<float>(a), static_cast<float>(b), - static_cast<float>(c), static_cast<float>(d), - static_cast<float>(e), static_cast<float>(f))); - pImgObj->CalcBoundingBox(); + pImgObj->SetImageMatrix(CFX_Matrix( + static_cast<float>(a), static_cast<float>(b), static_cast<float>(c), + static_cast<float>(d), static_cast<float>(e), static_cast<float>(f)));
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/fpdfeditimg.cpp
104
105
106
107
108
109
110
111
112
113
double a, double b, double c, double d, double e, double f) { if (!image_object) return false; CPDF_ImageObject* pImgObj = static_cast<CPDF_ImageObject*>(image_object);
+ show +
114
115
116
117
pImgObj->set_matrix(CFX_Matrix(static_cast<float>(a), static_cast<float>(b), static_cast<float>(c), static_cast<float>(d), static_cast<float>(e), static_cast<float>(f))); pImgObj->CalcBoundingBox();
+ show +
118
119
120
121
122
123
124
125
126
127
pImgObj->SetDirty(true); return true; } FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFImageObj_SetBitmap(FPDF_PAGE* pages, int nCount, FPDF_PAGEOBJECT image_object, FPDF_BITMAP bitmap) { if (!image_object || !bitmap || !pages)

[CVE-2023-40093_1.diff] fpdf_editimg.cpp #8
- RetainPtr<CFX_DIBitmap> pBitmap; - if (pSource->GetBPP() == 1) - pBitmap = pSource->CloneConvert(FXDIB_8bppRgb); - else - pBitmap = pSource->Clone(nullptr); + RetainPtr<CFX_DIBitmap> pBitmap = + pSource->GetBPP() == 1 ? pSource->ConvertTo(FXDIB_Format::k8bppRgb) + : pSource->Realize(); +FPDF_EXPORT FPDF_BITMAP FPDF_CALLCONV +FPDFImageObj_GetRenderedBitmap(FPDF_DOCUMENT document, + FPDF_PAGE page, + FPDF_PAGEOBJECT image_object) { + CPDF_Document* doc = CPDFDocumentFromFPDFDocument(document); + if (!doc) + return nullptr; + + CPDF_Page* optional_page = CPDFPageFromFPDFPage(page); + if (optional_page && optional_page->GetDocument() != doc) + return nullptr; + + CPDF_ImageObject* image = CPDFImageObjectFromFPDFPageObject(image_object); + if (!image) + return nullptr; + + // Create |result_bitmap|. + const CFX_Matrix& image_matrix = image->matrix(); + int output_width = image_matrix.a; + int output_height = image_matrix.d; + auto result_bitmap = pdfium::MakeRetain<CFX_DIBitmap>(); + if (!result_bitmap->Create(output_width, output_height, FXDIB_Format::kArgb)) + return nullptr; + + // Set up all the rendering code. + RetainPtr<CPDF_Dictionary> page_resources = + optional_page ? optional_page->GetMutablePageResources() : nullptr; + CPDF_RenderContext context(doc, std::move(page_resources), + /*pPageCache=*/nullptr); + CFX_DefaultRenderDevice device; + device.Attach(result_bitmap); + CPDF_RenderStatus status(&context, &device); + CPDF_ImageRenderer renderer(&status); + + // Need to first flip the image, as expected by |renderer|. + CFX_Matrix render_matrix(1, 0, 0, -1, 0, output_height); + + // Then take |image_matrix|'s offset into account. + render_matrix.Translate(-image_matrix.e, image_matrix.f); + + // Do the actual rendering. + bool should_continue = renderer.Start(image, render_matrix, + /*bStdCS=*/false, BlendMode::kNormal); + while (should_continue) + should_continue = renderer.Continue(/*pPause=*/nullptr); + + if (!renderer.GetResult()) + return nullptr; + +#if defined(_SKIA_SUPPORT_) + if (CFX_DefaultRenderDevice::SkiaIsDefaultRenderer()) + result_bitmap->UnPreMultiply(); +#endif + + // Caller takes ownership. + return FPDFBitmapFromCFXDIBitmap(result_bitmap.Leak()); +} +
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/fpdfeditimg.cpp
147
148
149
150
151
152
153
154
155
156
return nullptr; RetainPtr<CPDF_Image> pImg = pObj->AsImage()->GetImage(); if (!pImg) return nullptr; RetainPtr<CFX_DIBSource> pSource = pImg->LoadDIBSource(); if (!pSource) return nullptr;
+ show +
157
158
159
160
161
162
163
164
165
RetainPtr<CFX_DIBitmap> pBitmap; // If the source image has a representation of 1 bit per pixel, then convert // it to a grayscale bitmap having 1 byte per pixel, since bitmaps have no // concept of bits. Otherwise, convert the source image to a bitmap directly, // retaining its color representation. if (pSource->GetBPP() == 1) pBitmap = pSource->CloneConvert(FXDIB_8bppRgb); else pBitmap = pSource->Clone(nullptr);
+ show +
166
167
168
169
170
171
172
173
174
175
return pBitmap.Leak(); } FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFImageObj_GetImageDataDecoded(FPDF_PAGEOBJECT image_object, void* buffer, unsigned long buflen) { CPDF_PageObject* pObj = CPDFPageObjectFromFPDFPageObject(image_object); if (!pObj || !pObj->IsImage())

[CVE-2023-40093_1.diff] fpdf_editimg.cpp #12
- CPDF_Object* pFilter = - pObj->AsImage()->GetImage()->GetDict()->GetDirectObjectFor("Filter"); - ByteString bsFilter; - if (pFilter->IsName()) - bsFilter = pFilter->AsName()->GetString(); - else - bsFilter = pFilter->AsArray()->GetStringAt(index); + RetainPtr<const CPDF_Dictionary> pDict = + pObj->AsImage()->GetImage()->GetDict(); + RetainPtr<const CPDF_Object> pFilter = pDict->GetDirectObjectFor("Filter"); + ByteString bsFilter = pFilter->IsName() + ? pFilter->AsName()->GetString() + : pFilter->AsArray()->GetByteStringAt(index); - unsigned long len = bsFilter.GetLength() + 1; - if (buffer && len <= buflen) - memcpy(buffer, bsFilter.c_str(), len); - return len; + return NulTerminateMaybeCopyAndReturnLength(bsFilter, buffer, buflen);
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/fpdfeditimg.cpp
234
235
236
237
238
239
240
241
242
243
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFImageObj_GetImageFilter(FPDF_PAGEOBJECT image_object, int index, void* buffer, unsigned long buflen) { if (index < 0 || index >= FPDFImageObj_GetImageFilterCount(image_object)) return 0; CPDF_PageObject* pObj = CPDFPageObjectFromFPDFPageObject(image_object);
+ show +
244
245
246
247
248
249
250
251
252
253
254
255
CPDF_Object* pFilter = pObj->AsImage()->GetImage()->GetDict()->GetDirectObjectFor("Filter"); ByteString bsFilter; if (pFilter->IsName()) bsFilter = pFilter->AsName()->GetString(); else bsFilter = pFilter->AsArray()->GetStringAt(index); unsigned long len = bsFilter.GetLength() + 1; if (buffer && len <= buflen) memcpy(buffer, bsFilter.c_str(), len); return len;
+ show +
256
257
258
259
260
261
262
263
264
265
} FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFImageObj_GetImageMetadata(FPDF_PAGEOBJECT image_object, FPDF_PAGE page, FPDF_IMAGEOBJ_METADATA* metadata) { CPDF_PageObject* pObj = CPDFPageObjectFromFPDFPageObject(image_object); if (!pObj || !pObj->IsImage() || !metadata) return false;

[CVE-2023-40093_1.diff] fpdf_save_embeddertest.cpp #4
- EXPECT_THAT(GetString(), testing::StartsWith("%PDF-1.6\r\n")); - EXPECT_THAT(GetString(), testing::HasSubstr("/Root ")); - EXPECT_THAT(GetString(), testing::HasSubstr("/Info ")); - EXPECT_EQ(8219u, GetString().length()); + EXPECT_THAT(GetString(), StartsWith("%PDF-1.6\r\n")); + EXPECT_THAT(GetString(), HasSubstr("/Root ")); + EXPECT_THAT(GetString(), HasSubstr("/Info ")); + EXPECT_THAT(GetString(), HasSubstr("/Size 37")); + EXPECT_THAT(GetString(), HasSubstr("35 0 obj")); + EXPECT_THAT(GetString(), HasSubstr("36 0 obj")); + EXPECT_THAT(GetString(), Not(HasSubstr("37 0 obj"))); + EXPECT_THAT(GetString(), Not(HasSubstr("38 0 obj"))); + EXPECT_EQ(7908u, GetString().size());
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/fpdfsave_embeddertest.cpp
68
69
70
71
72
73
74
75
76
77
FPDF_PAGE page = LoadPage(i); FPDF_BITMAP bitmap = RenderPage(page); EXPECT_EQ(612, FPDFBitmap_GetWidth(bitmap)); EXPECT_EQ(792, FPDFBitmap_GetHeight(bitmap)); original_md5[i] = HashBitmap(bitmap); FPDFBitmap_Destroy(bitmap); UnloadPage(page); } EXPECT_TRUE(FPDF_SaveAsCopy(document(), this, 0));
+ show +
78
79
80
81
EXPECT_THAT(GetString(), testing::StartsWith("%PDF-1.6\r\n")); EXPECT_THAT(GetString(), testing::HasSubstr("/Root ")); EXPECT_THAT(GetString(), testing::HasSubstr("/Info ")); EXPECT_EQ(8219u, GetString().length());
+ show +
82
83
84
85
86
87
88
89
90
91
// Make sure new document renders the same as the old one. EXPECT_TRUE(OpenSavedDocument()); for (int i = 0; i < kPageCount; ++i) { FPDF_PAGE page = LoadSavedPage(i); FPDF_BITMAP bitmap = RenderSavedPage(page); EXPECT_EQ(original_md5[i], HashBitmap(bitmap)); FPDFBitmap_Destroy(bitmap); CloseSavedPage(page); }

[CVE-2023-40093_1.diff] cpdfsdk_annot.cpp #4
-CPDF_Annot::Subtype CPDFSDK_Annot::GetAnnotSubtype() const { - return CPDF_Annot::Subtype::UNKNOWN; -} - -bool CPDFSDK_Annot::IsSignatureWidget() const { - return false; -} - -void CPDFSDK_Annot::SetRect(const CFX_FloatRect& rect) {} - -CFX_FloatRect CPDFSDK_Annot::GetRect() const { - return CFX_FloatRect(); -} -
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/cpdfsdk_annot.cpp
52
53
54
55
56
57
58
59
60
61
} int CPDFSDK_Annot::GetLayoutOrder() const { return 5; } CPDF_Annot* CPDFSDK_Annot::GetPDFAnnot() const { return nullptr; }
+ show +
62
63
64
65
66
67
68
69
70
71
72
73
CPDF_Annot::Subtype CPDFSDK_Annot::GetAnnotSubtype() const { return CPDF_Annot::Subtype::UNKNOWN; } bool CPDFSDK_Annot::IsSignatureWidget() const { return false; } void CPDFSDK_Annot::SetRect(const CFX_FloatRect& rect) {} CFX_FloatRect CPDFSDK_Annot::GetRect() const { return CFX_FloatRect();
+ show +
74
75
76
77
78
79
80
81
82
83
} UnderlyingPageType* CPDFSDK_Annot::GetUnderlyingPage() { #ifdef PDF_ENABLE_XFA return GetPDFXFAPage(); #else // PDF_ENABLE_XFA return GetPDFPage(); #endif // PDF_ENABLE_XFA }

[CVE-2023-40093_1.diff] fpdf_formfill.cpp #11
- CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); - if (!pPageView) - return false; - return pPageView->OnLButtonDown(CFX_PointF(page_x, page_y), modifier); + CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); + return pPageView && + pPageView->OnLButtonDown( + Mask<FWL_EVENTFLAG>::FromUnderlyingUnchecked(modifier), + CFX_PointF(page_x, page_y));
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/fpdfformfill.cpp
356
357
358
359
360
361
362
363
364
365
if (!pPageView) return false; return pPageView->OnFocus(CFX_PointF(page_x, page_y), modifier); } FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y) {
+ show +
366
367
368
369
CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); if (!pPageView) return false; return pPageView->OnLButtonDown(CFX_PointF(page_x, page_y), modifier);
+ show +
370
371
372
373
374
375
376
377
378
379
} FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y) { CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); if (!pPageView) return false;

[CVE-2023-40093_1.diff] fpdf_formfill.cpp #12
- CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); - if (!pPageView) - return false; - return pPageView->OnLButtonUp(CFX_PointF(page_x, page_y), modifier); + CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); + return pPageView && + pPageView->OnLButtonUp( + Mask<FWL_EVENTFLAG>::FromUnderlyingUnchecked(modifier), + CFX_PointF(page_x, page_y));
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/fpdfformfill.cpp
367
368
369
370
371
372
373
374
375
376
if (!pPageView) return false; return pPageView->OnLButtonDown(CFX_PointF(page_x, page_y), modifier); } FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y) {
+ show +
377
378
379
380
CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); if (!pPageView) return false; return pPageView->OnLButtonUp(CFX_PointF(page_x, page_y), modifier);
+ show +
381
382
383
384
385
386
387
388
389
390
} #ifdef PDF_ENABLE_XFA FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnRButtonDown(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y) { CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); if (!pPageView)

[CVE-2023-40093_1.diff] fpdf_formfill.cpp #14
- CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); - if (!pPageView) - return false; - return pPageView->OnRButtonDown(CFX_PointF(page_x, page_y), modifier); + CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); + return pPageView && + pPageView->OnRButtonDown( + Mask<FWL_EVENTFLAG>::FromUnderlyingUnchecked(modifier), + CFX_PointF(page_x, page_y));
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/fpdfformfill.cpp
379
380
381
382
383
384
385
386
387
388
return false; return pPageView->OnLButtonUp(CFX_PointF(page_x, page_y), modifier); } #ifdef PDF_ENABLE_XFA FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnRButtonDown(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y) {
+ show +
389
390
391
392
CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); if (!pPageView) return false; return pPageView->OnRButtonDown(CFX_PointF(page_x, page_y), modifier);
+ show +
393
394
395
396
397
398
399
400
401
402
} FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnRButtonUp(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y) { CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); if (!pPageView) return false;

[CVE-2023-40093_1.diff] fpdf_formfill.cpp #15
- CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); - if (!pPageView) - return false; - return pPageView->OnRButtonUp(CFX_PointF(page_x, page_y), modifier); + CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); + return pPageView && + pPageView->OnRButtonUp( + Mask<FWL_EVENTFLAG>::FromUnderlyingUnchecked(modifier), + CFX_PointF(page_x, page_y));
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/fpdfformfill.cpp
390
391
392
393
394
395
396
397
398
399
if (!pPageView) return false; return pPageView->OnRButtonDown(CFX_PointF(page_x, page_y), modifier); } FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnRButtonUp(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y) {
+ show +
400
401
402
403
CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); if (!pPageView) return false; return pPageView->OnRButtonUp(CFX_PointF(page_x, page_y), modifier);
+ show +
404
405
406
407
408
409
410
411
412
413
} #endif // PDF_ENABLE_XFA FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnKeyDown(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int nKeyCode, int modifier) { CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); if (!pPageView) return false;

[CVE-2023-40093_1.diff] cpdfsdk_widget.h #4
- bool IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode); - void DrawAppearance(CFX_RenderDevice* pDevice, - const CFX_Matrix& mtUser2Device, - CPDF_Annot::AppearanceMode mode, - const CPDF_RenderOptions* pOptions) override; - + bool IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode) const; + bool IsPushHighlighted() const;
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/cpdfsdk_widget.h
126
127
128
129
130
131
132
133
134
135
void DrawShadow(CFX_RenderDevice* pDevice, CPDFSDK_PageView* pPageView); void SetAppModified(); void ClearAppModified(); bool IsAppModified() const; uint32_t GetAppearanceAge() const { return m_nAppearanceAge; } uint32_t GetValueAge() const { return m_nValueAge; }
+ show +
136
137
138
139
140
bool IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode); void DrawAppearance(CFX_RenderDevice* pDevice, const CFX_Matrix& mtUser2Device, CPDF_Annot::AppearanceMode mode, const CPDF_RenderOptions* pOptions) override;
+ show +
141
142
143
144
145
146
147
148
149
150
CFX_Matrix GetMatrix() const; CFX_FloatRect GetClientRect() const; CFX_FloatRect GetRotatedRect() const; CFX_Color GetTextPWLColor() const; CFX_Color GetBorderPWLColor() const; CFX_Color GetFillPWLColor() const; private: UnownedPtr<CPDFSDK_InterForm> const m_pInterForm;

[CVE-2023-40093_1.diff] cpdfsdk_baannot.cpp #3
- CPDF_Annot::AppearanceMode mode, - const CPDF_RenderOptions* pOptions) { - m_pAnnot->DrawAppearance(m_pPageView->GetPDFPage(), pDevice, mtUser2Device, - mode, pOptions); + CPDF_Annot::AppearanceMode mode) { + m_pAnnot->DrawAppearance(GetPageView()->GetPDFPage(), pDevice, mtUser2Device, + mode);
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/cpdfsdk_baannot.cpp
55
56
57
58
59
60
61
62
63
64
CFX_FloatRect CPDFSDK_BAAnnot::GetRect() const { return m_pAnnot->GetRect(); } CPDF_Annot::Subtype CPDFSDK_BAAnnot::GetAnnotSubtype() const { return m_pAnnot->GetSubtype(); } void CPDFSDK_BAAnnot::DrawAppearance(CFX_RenderDevice* pDevice, const CFX_Matrix& mtUser2Device,
+ show +
65
66
67
68
CPDF_Annot::AppearanceMode mode, const CPDF_RenderOptions* pOptions) { m_pAnnot->DrawAppearance(m_pPageView->GetPDFPage(), pDevice, mtUser2Device, mode, pOptions);
+ show +
69
70
71
72
73
74
75
76
77
78
} bool CPDFSDK_BAAnnot::IsAppearanceValid() { return !!m_pAnnot->GetAnnotDict()->GetDictFor("AP"); } bool CPDFSDK_BAAnnot::IsAppearanceValid(CPDF_Annot::AppearanceMode mode) { CPDF_Dictionary* pAP = m_pAnnot->GetAnnotDict()->GetDictFor("AP"); if (!pAP) return false;

[CVE-2023-40093_1.diff] cpwl_wnd.h #5
-// Cursor style. These must match the values in public/fpdf_formfill.h -#define FXCT_ARROW 0 -#define FXCT_NESW 1 -#define FXCT_NWSE 2 -#define FXCT_VBEAM 3 -#define FXCT_HBEAM 4 -#define FXCT_HAND 5 -
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/cfx_systemhandler.h
29
30
31
32
33
34
35
36
37
38
uint16_t wMonth; uint16_t wDayOfWeek; uint16_t wDay; uint16_t wHour; uint16_t wMinute; uint16_t wSecond; uint16_t wMilliseconds; }; // Cursor style. These must match the values in public/fpdf_formfill.h
+ show +
39
40
41
42
43
44
#define FXCT_ARROW 0 #define FXCT_NESW 1 #define FXCT_NWSE 2 #define FXCT_VBEAM 3 #define FXCT_HBEAM 4 #define FXCT_HAND 5
+ show +
45
46
47
48
49
50
51
52
53
54
class CFFL_FormFiller; class CPDF_Document; class CPDF_Font; class CPDFSDK_FormFillEnvironment; class CPDFSDK_Widget; class CFX_SystemHandler { public: explicit CFX_SystemHandler(CPDFSDK_FormFillEnvironment* pFormFillEnv);
/media/esteban/ACOS/ResurrectionX/external/pdfium/public/fpdf_formfill.h
303
304
305
306
307
308
309
310
311
312
/* Version 2. */ void* m_isolate; /* Unused in v3, retain for compatibility. */ unsigned int m_v8EmbedderSlot; /* Unused in v3, retain for compatibility. */ /* Version 3. */ /* Version 3 moves m_Isolate and m_v8EmbedderSlot to FPDF_LIBRARY_CONFIG. */ } IPDF_JSPLATFORM; // Flags for Cursor type
+ show +
313
314
315
316
317
318
#define FXCT_ARROW 0 #define FXCT_NESW 1 #define FXCT_NWSE 2 #define FXCT_VBEAM 3 #define FXCT_HBEAM 4 #define FXCT_HAND 5
+ show +
319
320
321
322
323
324
325
326
327
328
/** * Function signature for the callback function passed to the FFI_SetTimer * method. * Parameters: * idEvent - Identifier of the timer. * Return value: * None. **/ typedef void (*TimerCallback)(int idEvent);

[CVE-2023-40093_1.diff] fpdf_dataavail_embeddertest.cpp #4
- avail_ = FPDFAvail_Create(loader.file_avail(), loader.file_access()); - ASSERT_EQ(PDF_DATA_AVAIL, FPDFAvail_IsDocAvail(avail_, loader.hints())); - document_ = FPDFAvail_GetDocument(avail_, nullptr); - ASSERT_TRUE(document_); + CreateAvail(loader.file_avail(), loader.file_access()); + ASSERT_EQ(PDF_DATA_AVAIL, FPDFAvail_IsDocAvail(avail(), loader.hints())); + SetDocumentFromAvail(); + ASSERT_TRUE(document());
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/fpdf_dataavail_embeddertest.cpp
164
165
166
167
168
169
170
171
172
173
TEST_F(FPDFDataAvailEmbeddertest, TrailerAsHexstring) { // Document must load without crashing but is too malformed to be available. EXPECT_FALSE(OpenDocument("trailer_as_hexstring.pdf")); MockDownloadHints hints; EXPECT_FALSE(FPDFAvail_IsDocAvail(avail_, &hints)); } TEST_F(FPDFDataAvailEmbeddertest, LoadUsingHintTables) { TestAsyncLoader loader("feature_linearized_loading.pdf");
+ show +
174
175
176
177
avail_ = FPDFAvail_Create(loader.file_avail(), loader.file_access()); ASSERT_EQ(PDF_DATA_AVAIL, FPDFAvail_IsDocAvail(avail_, loader.hints())); document_ = FPDFAvail_GetDocument(avail_, nullptr); ASSERT_TRUE(document_);
+ show +
178
179
180
181
182
183
184
185
186
187
ASSERT_EQ(PDF_DATA_AVAIL, FPDFAvail_IsPageAvail(avail_, 1, loader.hints())); // No new data available, to prevent load "Pages" node. loader.set_is_new_data_available(false); FPDF_PAGE page = FPDF_LoadPage(document(), 1); EXPECT_TRUE(page); FPDF_ClosePage(page); } TEST_F(FPDFDataAvailEmbeddertest, CheckFormAvailIfLinearized) {
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/fpdf_dataavail_embeddertest.cpp
179
180
181
182
183
184
185
186
187
188
// No new data available, to prevent load "Pages" node. loader.set_is_new_data_available(false); FPDF_PAGE page = FPDF_LoadPage(document(), 1); EXPECT_TRUE(page); FPDF_ClosePage(page); } TEST_F(FPDFDataAvailEmbeddertest, CheckFormAvailIfLinearized) { TestAsyncLoader loader("feature_linearized_loading.pdf");
+ show +
189
190
191
192
avail_ = FPDFAvail_Create(loader.file_avail(), loader.file_access()); ASSERT_EQ(PDF_DATA_AVAIL, FPDFAvail_IsDocAvail(avail_, loader.hints())); document_ = FPDFAvail_GetDocument(avail_, nullptr); ASSERT_TRUE(document_);
+ show +
193
194
195
196
197
198
199
200
201
202
// Prevent access to non requested data to coerce the parser to send new // request for non available (non requested before) data. loader.set_is_new_data_available(false); loader.ClearRequestedSegments(); int status = PDF_FORM_NOTAVAIL; while (status == PDF_FORM_NOTAVAIL) { loader.FlushRequestedData(); status = FPDFAvail_IsFormAvail(avail_, loader.hints());
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/fpdf_dataavail_embeddertest.cpp
200
201
202
203
204
205
206
207
208
209
while (status == PDF_FORM_NOTAVAIL) { loader.FlushRequestedData(); status = FPDFAvail_IsFormAvail(avail_, loader.hints()); } EXPECT_NE(PDF_FORM_ERROR, status); } TEST_F(FPDFDataAvailEmbeddertest, DoNotLoadMainCrossRefForFirstPageIfLinearized) { TestAsyncLoader loader("feature_linearized_loading.pdf");
+ show +
210
211
212
213
avail_ = FPDFAvail_Create(loader.file_avail(), loader.file_access()); ASSERT_EQ(PDF_DATA_AVAIL, FPDFAvail_IsDocAvail(avail_, loader.hints())); document_ = FPDFAvail_GetDocument(avail_, nullptr); ASSERT_TRUE(document_);
+ show +
214
215
216
217
218
219
220
221
222
223
const int first_page_num = FPDFAvail_GetFirstPageNum(document_); // The main cross ref table should not be processed. // (It is always at file end) EXPECT_GT(loader.file_access()->m_FileLen, loader.max_already_available_bound()); // Prevent access to non requested data to coerce the parser to send new // request for non available (non requested before) data. loader.set_is_new_data_available(false);
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/fpdf_dataavail_embeddertest.cpp
239
240
241
242
243
244
245
246
247
248
// Prevent loading data, while page loading. loader.set_is_new_data_available(false); FPDF_PAGE page = FPDF_LoadPage(document(), first_page_num); EXPECT_TRUE(page); FPDF_ClosePage(page); } TEST_F(FPDFDataAvailEmbeddertest, LoadSecondPageIfLinearizedWithHints) { TestAsyncLoader loader("feature_linearized_loading.pdf");
+ show +
249
250
251
252
avail_ = FPDFAvail_Create(loader.file_avail(), loader.file_access()); ASSERT_EQ(PDF_DATA_AVAIL, FPDFAvail_IsDocAvail(avail_, loader.hints())); document_ = FPDFAvail_GetDocument(avail_, nullptr); ASSERT_TRUE(document_);
+ show +
253
254
255
256
257
258
259
260
261
262
static constexpr uint32_t kSecondPageNum = 1; // Prevent access to non requested data to coerce the parser to send new // request for non available (non requested before) data. loader.set_is_new_data_available(false); loader.ClearRequestedSegments(); int status = PDF_DATA_NOTAVAIL; while (status == PDF_DATA_NOTAVAIL) {

[CVE-2023-40093_1.diff] fpdf_dataavail_embeddertest.cpp #6
- avail_ = FPDFAvail_Create(loader.file_avail(), loader.file_access()); - ASSERT_EQ(PDF_DATA_AVAIL, FPDFAvail_IsDocAvail(avail_, loader.hints())); - document_ = FPDFAvail_GetDocument(avail_, nullptr); - ASSERT_TRUE(document_); - const int first_page_num = FPDFAvail_GetFirstPageNum(document_); + CreateAvail(loader.file_avail(), loader.file_access()); + ASSERT_EQ(PDF_DATA_AVAIL, FPDFAvail_IsDocAvail(avail(), loader.hints())); + SetDocumentFromAvail(); + ASSERT_TRUE(document()); + const int first_page_num = FPDFAvail_GetFirstPageNum(document());
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/fpdf_dataavail_embeddertest.cpp
200
201
202
203
204
205
206
207
208
209
while (status == PDF_FORM_NOTAVAIL) { loader.FlushRequestedData(); status = FPDFAvail_IsFormAvail(avail_, loader.hints()); } EXPECT_NE(PDF_FORM_ERROR, status); } TEST_F(FPDFDataAvailEmbeddertest, DoNotLoadMainCrossRefForFirstPageIfLinearized) { TestAsyncLoader loader("feature_linearized_loading.pdf");
+ show +
210
211
212
213
214
avail_ = FPDFAvail_Create(loader.file_avail(), loader.file_access()); ASSERT_EQ(PDF_DATA_AVAIL, FPDFAvail_IsDocAvail(avail_, loader.hints())); document_ = FPDFAvail_GetDocument(avail_, nullptr); ASSERT_TRUE(document_); const int first_page_num = FPDFAvail_GetFirstPageNum(document_);
+ show +
215
216
217
218
219
220
221
222
223
224
// The main cross ref table should not be processed. // (It is always at file end) EXPECT_GT(loader.file_access()->m_FileLen, loader.max_already_available_bound()); // Prevent access to non requested data to coerce the parser to send new // request for non available (non requested before) data. loader.set_is_new_data_available(false); FPDFAvail_IsPageAvail(avail_, first_page_num, loader.hints());

[CVE-2023-40093_1.diff] fpdf_dataavail_embeddertest.cpp #9
- avail_ = FPDFAvail_Create(loader.file_avail(), loader.file_access()); - ASSERT_EQ(PDF_DATA_AVAIL, FPDFAvail_IsDocAvail(avail_, loader.hints())); - document_ = FPDFAvail_GetDocument(avail_, nullptr); - ASSERT_TRUE(document_); + CreateAvail(loader.file_avail(), loader.file_access()); + ASSERT_EQ(PDF_DATA_AVAIL, FPDFAvail_IsDocAvail(avail(), loader.hints())); + SetDocumentFromAvail(); + ASSERT_TRUE(document());
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/fpdf_dataavail_embeddertest.cpp
164
165
166
167
168
169
170
171
172
173
TEST_F(FPDFDataAvailEmbeddertest, TrailerAsHexstring) { // Document must load without crashing but is too malformed to be available. EXPECT_FALSE(OpenDocument("trailer_as_hexstring.pdf")); MockDownloadHints hints; EXPECT_FALSE(FPDFAvail_IsDocAvail(avail_, &hints)); } TEST_F(FPDFDataAvailEmbeddertest, LoadUsingHintTables) { TestAsyncLoader loader("feature_linearized_loading.pdf");
+ show +
174
175
176
177
avail_ = FPDFAvail_Create(loader.file_avail(), loader.file_access()); ASSERT_EQ(PDF_DATA_AVAIL, FPDFAvail_IsDocAvail(avail_, loader.hints())); document_ = FPDFAvail_GetDocument(avail_, nullptr); ASSERT_TRUE(document_);
+ show +
178
179
180
181
182
183
184
185
186
187
ASSERT_EQ(PDF_DATA_AVAIL, FPDFAvail_IsPageAvail(avail_, 1, loader.hints())); // No new data available, to prevent load "Pages" node. loader.set_is_new_data_available(false); FPDF_PAGE page = FPDF_LoadPage(document(), 1); EXPECT_TRUE(page); FPDF_ClosePage(page); } TEST_F(FPDFDataAvailEmbeddertest, CheckFormAvailIfLinearized) {
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/fpdf_dataavail_embeddertest.cpp
179
180
181
182
183
184
185
186
187
188
// No new data available, to prevent load "Pages" node. loader.set_is_new_data_available(false); FPDF_PAGE page = FPDF_LoadPage(document(), 1); EXPECT_TRUE(page); FPDF_ClosePage(page); } TEST_F(FPDFDataAvailEmbeddertest, CheckFormAvailIfLinearized) { TestAsyncLoader loader("feature_linearized_loading.pdf");
+ show +
189
190
191
192
avail_ = FPDFAvail_Create(loader.file_avail(), loader.file_access()); ASSERT_EQ(PDF_DATA_AVAIL, FPDFAvail_IsDocAvail(avail_, loader.hints())); document_ = FPDFAvail_GetDocument(avail_, nullptr); ASSERT_TRUE(document_);
+ show +
193
194
195
196
197
198
199
200
201
202
// Prevent access to non requested data to coerce the parser to send new // request for non available (non requested before) data. loader.set_is_new_data_available(false); loader.ClearRequestedSegments(); int status = PDF_FORM_NOTAVAIL; while (status == PDF_FORM_NOTAVAIL) { loader.FlushRequestedData(); status = FPDFAvail_IsFormAvail(avail_, loader.hints());
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/fpdf_dataavail_embeddertest.cpp
200
201
202
203
204
205
206
207
208
209
while (status == PDF_FORM_NOTAVAIL) { loader.FlushRequestedData(); status = FPDFAvail_IsFormAvail(avail_, loader.hints()); } EXPECT_NE(PDF_FORM_ERROR, status); } TEST_F(FPDFDataAvailEmbeddertest, DoNotLoadMainCrossRefForFirstPageIfLinearized) { TestAsyncLoader loader("feature_linearized_loading.pdf");
+ show +
210
211
212
213
avail_ = FPDFAvail_Create(loader.file_avail(), loader.file_access()); ASSERT_EQ(PDF_DATA_AVAIL, FPDFAvail_IsDocAvail(avail_, loader.hints())); document_ = FPDFAvail_GetDocument(avail_, nullptr); ASSERT_TRUE(document_);
+ show +
214
215
216
217
218
219
220
221
222
223
const int first_page_num = FPDFAvail_GetFirstPageNum(document_); // The main cross ref table should not be processed. // (It is always at file end) EXPECT_GT(loader.file_access()->m_FileLen, loader.max_already_available_bound()); // Prevent access to non requested data to coerce the parser to send new // request for non available (non requested before) data. loader.set_is_new_data_available(false);
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/fpdf_dataavail_embeddertest.cpp
239
240
241
242
243
244
245
246
247
248
// Prevent loading data, while page loading. loader.set_is_new_data_available(false); FPDF_PAGE page = FPDF_LoadPage(document(), first_page_num); EXPECT_TRUE(page); FPDF_ClosePage(page); } TEST_F(FPDFDataAvailEmbeddertest, LoadSecondPageIfLinearizedWithHints) { TestAsyncLoader loader("feature_linearized_loading.pdf");
+ show +
249
250
251
252
avail_ = FPDFAvail_Create(loader.file_avail(), loader.file_access()); ASSERT_EQ(PDF_DATA_AVAIL, FPDFAvail_IsDocAvail(avail_, loader.hints())); document_ = FPDFAvail_GetDocument(avail_, nullptr); ASSERT_TRUE(document_);
+ show +
253
254
255
256
257
258
259
260
261
262
static constexpr uint32_t kSecondPageNum = 1; // Prevent access to non requested data to coerce the parser to send new // request for non available (non requested before) data. loader.set_is_new_data_available(false); loader.ClearRequestedSegments(); int status = PDF_DATA_NOTAVAIL; while (status == PDF_DATA_NOTAVAIL) {

[CVE-2023-40093_1.diff] cpdfxfa_docenvironment.cpp #17
- dwOptions & XFA_PRINTOPT_ShowDialog, nStartPage, nEndPage, - dwOptions & XFA_PRINTOPT_CanCancel, dwOptions & XFA_PRINTOPT_ShrinkPage, - dwOptions & XFA_PRINTOPT_AsImage, dwOptions & XFA_PRINTOPT_ReverseOrder, - dwOptions & XFA_PRINTOPT_PrintAnnot); + !!(dwOptions & XFA_PrintOpt::kShowDialog), nStartPage, nEndPage, + !!(dwOptions & XFA_PrintOpt::kCanCancel), + !!(dwOptions & XFA_PrintOpt::kShrinkPage), + !!(dwOptions & XFA_PrintOpt::kAsImage), + !!(dwOptions & XFA_PrintOpt::kReverseOrder), + !!(dwOptions & XFA_PrintOpt::kPrintAnnot)); -FX_ARGB CPDFXFA_DocEnvironment::GetHighlightColor(CXFA_FFDoc* hDoc) { +FX_ARGB CPDFXFA_DocEnvironment::GetHighlightColor( + const CXFA_FFDoc* hDoc) const {
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
576
577
578
579
580
581
582
583
584
585
CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pContext->GetFormFillEnv(); if (!pFormFillEnv || !pFormFillEnv->GetFormFillInfo() || !pFormFillEnv->GetFormFillInfo()->m_pJsPlatform || !pFormFillEnv->GetFormFillInfo()->m_pJsPlatform->Doc_print) { return; } pFormFillEnv->GetFormFillInfo()->m_pJsPlatform->Doc_print( pFormFillEnv->GetFormFillInfo()->m_pJsPlatform,
+ show +
586
587
588
589
590
591
592
dwOptions & XFA_PRINTOPT_ShowDialog, nStartPage, nEndPage, dwOptions & XFA_PRINTOPT_CanCancel, dwOptions & XFA_PRINTOPT_ShrinkPage, dwOptions & XFA_PRINTOPT_AsImage, dwOptions & XFA_PRINTOPT_ReverseOrder, dwOptions & XFA_PRINTOPT_PrintAnnot); } FX_ARGB CPDFXFA_DocEnvironment::GetHighlightColor(CXFA_FFDoc* hDoc) {
+ show +
593
594
595
596
597
598
599
600
601
602
if (hDoc != m_pContext->GetXFADoc() || !m_pContext->GetFormFillEnv()) return 0; CPDFSDK_InterForm* pInterForm = m_pContext->GetFormFillEnv()->GetInterForm(); if (!pInterForm) return 0; return ArgbEncode(pInterForm->GetHighlightAlpha(), pInterForm->GetHighlightColor(FormFieldType::kXFA)); }

[CVE-2023-40093_1.diff] cpdfxfa_docenvironment.cpp #22
-bool CPDFXFA_DocEnvironment::NotifySubmit(bool bPrevOrPost) { - if (bPrevOrPost) - return OnBeforeNotifySubmit(); - - OnAfterNotifySubmit(); - return true; -} -
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
594
595
596
597
598
599
600
601
602
603
return 0; CPDFSDK_InterForm* pInterForm = m_pContext->GetFormFillEnv()->GetInterForm(); if (!pInterForm) return 0; return ArgbEncode(pInterForm->GetHighlightAlpha(), pInterForm->GetHighlightColor(FormFieldType::kXFA)); }
+ show +
604
605
606
607
608
609
bool CPDFXFA_DocEnvironment::NotifySubmit(bool bPrevOrPost) { if (bPrevOrPost) return OnBeforeNotifySubmit(); OnAfterNotifySubmit(); return true;
+ show +
610
611
612
613
614
615
616
617
618
619
} bool CPDFXFA_DocEnvironment::OnBeforeNotifySubmit() { if (!m_pContext->ContainsXFAForm()) return true; CXFA_FFDocView* docView = m_pContext->GetXFADocView(); if (!docView) return true;

[CVE-2023-40093_1.diff] cpwl_wnd.cpp #20
- case BorderStyle::BEVELED: - return CFX_Color(CFX_Color::kGray, 1); - case BorderStyle::INSET: - return CFX_Color(CFX_Color::kGray, 0.5f); + case BorderStyle::kBeveled: + return CFX_Color(CFX_Color::Type::kGray, 1); + case BorderStyle::kInset: + return CFX_Color(CFX_Color::Type::kGray, 0.5f);
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/pwl/cpwl_wnd.cpp
690
691
692
693
694
695
696
697
698
699
CPWL_Wnd::ProviderIface* CPWL_Wnd::GetProvider() const { return m_CreationParams.pProvider.Get(); } IPVT_FontMap* CPWL_Wnd::GetFontMap() const { return m_CreationParams.pFontMap; } CFX_Color CPWL_Wnd::GetBorderLeftTopColor(BorderStyle nBorderStyle) const { switch (nBorderStyle) {
+ show +
700
701
702
703
case BorderStyle::BEVELED: return CFX_Color(CFX_Color::kGray, 1); case BorderStyle::INSET: return CFX_Color(CFX_Color::kGray, 0.5f);
+ show +
704
705
706
707
708
709
710
711
712
713
default: return CFX_Color(); } } CFX_Color CPWL_Wnd::GetBorderRightBottomColor(BorderStyle nBorderStyle) const { switch (nBorderStyle) { case BorderStyle::BEVELED: return GetBackgroundColor() / 2.0f; case BorderStyle::INSET:

[CVE-2023-40093_1.diff] cpwl_combo_box.cpp #5
+void CPWL_ComboBox::ReplaceAndKeepSelection(const WideString& text) { + if (m_pEdit) + m_pEdit->ReplaceAndKeepSelection(text); +} + +bool CPWL_ComboBox::SelectAllText() { + return m_pEdit && m_pEdit->SelectAllText(); +} + -void CPWL_ComboBox::GetEditSelection(int32_t& nStartChar, - int32_t& nEndChar) const { - nStartChar = -1; - nEndChar = -1; - - if (m_pEdit) - m_pEdit->GetSelection(nStartChar, nEndChar); -} -
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/pwl/cpwl_combo_box.cpp
223
224
225
226
227
228
229
230
231
232
m_pEdit->SetText(m_pList->GetText()); m_nSelectItem = nItemIndex; } void CPWL_ComboBox::SetEditSelection(int32_t nStartChar, int32_t nEndChar) { if (m_pEdit) m_pEdit->SetSelection(nStartChar, nEndChar); }
+ show +
233
234
235
236
237
238
239
void CPWL_ComboBox::GetEditSelection(int32_t& nStartChar, int32_t& nEndChar) const { nStartChar = -1; nEndChar = -1; if (m_pEdit) m_pEdit->GetSelection(nStartChar, nEndChar);
+ show +
240
241
242
243
244
245
246
247
248
249
} void CPWL_ComboBox::ClearSelection() { if (m_pEdit) m_pEdit->ClearSelection(); } void CPWL_ComboBox::CreateChildWnd(const CreateParams& cp) { CreateEdit(cp); CreateButton(cp);

[CVE-2023-40093_1.diff] cpdfsdk_appstream.cpp #34
- CFX_Color crBackground; - CFX_Color crBorder; - int iColorType; - float fc[4]; - pControl->GetOriginalBackgroundColor(iColorType, fc); - if (iColorType > 0) - crBackground = CFX_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); - - pControl->GetOriginalBorderColor(iColorType, fc); - if (iColorType > 0) - crBorder = CFX_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); + CFX_Color crBackground = pControl->GetOriginalBackgroundColor(); + CFX_Color crBorder = pControl->GetOriginalBorderColor();
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/pwl/cpwl_appstream.cpp
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
nLayout = ButtonStyle::kIconRightLabelLeft; break; case TEXTPOS_OVERLAID: nLayout = ButtonStyle::kLabelOverIcon; break; default: nLayout = ButtonStyle::kLabel; break; }
+ show +
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
CFX_Color crBackground; CFX_Color crBorder; int iColorType; float fc[4]; pControl->GetOriginalBackgroundColor(iColorType, fc); if (iColorType > 0) crBackground = CFX_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); pControl->GetOriginalBorderColor(iColorType, fc); if (iColorType > 0) crBorder = CFX_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
+ show +
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
float fBorderWidth = static_cast<float>(widget_->GetBorderWidth()); CPWL_Dash dsBorder(3, 0, 0); CFX_Color crLeftTop; CFX_Color crRightBottom; BorderStyle nBorderStyle = widget_->GetBorderStyle(); switch (nBorderStyle) { case BorderStyle::DASH: dsBorder = CPWL_Dash(3, 3, 0);

[CVE-2023-40093_1.diff] cpwl_scroll_bar.cpp #11
- switch (m_sbType) { - case SBT_HSCROLL: - pos = pos - m_OriginInfo.fContentMin; - break; - case SBT_VSCROLL: - pos = m_OriginInfo.fContentMax - pos; - break; - } + pos = m_OriginInfo.fContentMax - pos;
/media/esteban/ACOS/ResurrectionX/external/pdfium/fpdfsdk/pwl/cpwl_scroll_bar.cpp
517
518
519
520
521
522
523
524
525
526
return; m_OriginInfo = info; float fMax = std::max(0.0f, info.fContentMax - info.fContentMin - info.fPlateWidth); SetScrollRange(0, fMax, info.fPlateWidth); SetScrollStep(info.fBigStep, info.fSmallStep); } void CPWL_ScrollBar::SetScrollPosition(float pos) {
+ show +
527
528
529
530
531
532
533
switch (m_sbType) { case SBT_HSCROLL: pos = pos - m_OriginInfo.fContentMin; break; case SBT_VSCROLL: pos = m_OriginInfo.fContentMax - pos; break;
+ show +
534
535
536
537
538
539
540
541
542
543
} SetScrollPos(pos); } void CPWL_ScrollBar::NotifyLButtonDown(CPWL_Wnd* child, const CFX_PointF& pos) { if (child == m_pMinButton) OnMinButtonLBDown(pos); else if (child == m_pMaxButton) OnMaxButtonLBDown(pos); else if (child == m_pPosButton)

[CVE-2023-40093_1.diff] BC_DefaultPlacement.cpp #4
- if (!hasBit(m_numcols - 1, m_numrows - 1)) { - setBit(m_numcols - 1, m_numrows - 1, true); - setBit(m_numcols - 2, m_numrows - 2, true); + if (!HasBit(m_numcols - 1, m_numrows - 1)) { + SetBit(m_numcols - 1, m_numrows - 1, true); + SetBit(m_numcols - 2, m_numrows - 2, true); -void CBC_DefaultPlacement::module(int32_t row, - int32_t col, - int32_t pos, - int32_t bit) { + +void CBC_DefaultPlacement::SetModule(int32_t row, + int32_t col, + int32_t pos, + int32_t bit) {
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/datamatrix/BC_DefaultPlacement.cpp
83
84
85
86
87
88
89
90
91
92
do { if ((row >= 0) && (col < m_numcols) && !hasBit(col, row)) { utah(row, col, pos++); } row += 2; col -= 2; } while ((row < m_numrows) && (col >= 0)); row += 3; col++; } while ((row < m_numrows) || (col < m_numcols));
+ show +
93
94
95
96
97
98
99
100
101
if (!hasBit(m_numcols - 1, m_numrows - 1)) { setBit(m_numcols - 1, m_numrows - 1, true); setBit(m_numcols - 2, m_numrows - 2, true); } } void CBC_DefaultPlacement::module(int32_t row, int32_t col, int32_t pos, int32_t bit) {
+ show +
102
103
104
105
106
107
108
109
110
111
if (row < 0) { row += m_numrows; col += 4 - ((m_numrows + 4) % 8); } if (col < 0) { col += m_numcols; row += 4 - ((m_numcols + 4) % 8); } int32_t v = m_codewords[pos]; v &= 1 << (8 - bit);

[CVE-2023-40093_1.diff] BC_QRCoderMode.h #2
- static CBC_QRCoderMode* sKANJI; - static CBC_QRCoderMode* sECI; - static CBC_QRCoderMode* sGBK; - static CBC_QRCoderMode* sTERMINATOR; - static CBC_QRCoderMode* sFNC1_FIRST_POSITION; - static CBC_QRCoderMode* sFNC1_SECOND_POSITION; - static CBC_QRCoderMode* sSTRUCTURED_APPEND;
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/qrcode/BC_QRCoderMode.h
22
23
24
25
26
27
28
29
30
31
static CBC_QRCoderMode* ForBits(int32_t bits, int32_t& e); static void Destroy(); int32_t GetCharacterCountBits(int32_t number, int32_t& e) const; int32_t GetBits() const; ByteString GetName() const; static CBC_QRCoderMode* sBYTE; static CBC_QRCoderMode* sNUMERIC; static CBC_QRCoderMode* sALPHANUMERIC;
+ show +
32
33
34
35
36
37
38
static CBC_QRCoderMode* sKANJI; static CBC_QRCoderMode* sECI; static CBC_QRCoderMode* sGBK; static CBC_QRCoderMode* sTERMINATOR; static CBC_QRCoderMode* sFNC1_FIRST_POSITION; static CBC_QRCoderMode* sFNC1_SECOND_POSITION; static CBC_QRCoderMode* sSTRUCTURED_APPEND;
+ show +
39
40
41
42
43
44
45
46
47
48
private: CBC_QRCoderMode(); CBC_QRCoderMode(std::vector<int32_t> charCountBits, int32_t bits, ByteString name); std::vector<int32_t> m_characterCountBitsForVersions; const int32_t m_bits; const ByteString m_name;

[CVE-2023-40093_1.diff] BC_QRCoderVersion.cpp #3
- m_ecBlocksArray[0] = pdfium::MakeUnique<CBC_QRCoderECBlocks>(data[0]); - m_ecBlocksArray[1] = pdfium::MakeUnique<CBC_QRCoderECBlocks>(data[1]); - m_ecBlocksArray[2] = pdfium::MakeUnique<CBC_QRCoderECBlocks>(data[2]); - m_ecBlocksArray[3] = pdfium::MakeUnique<CBC_QRCoderECBlocks>(data[3]); + m_ecBlocksArray[0] = std::make_unique<CBC_QRCoderECBlocks>(data[0]); + m_ecBlocksArray[1] = std::make_unique<CBC_QRCoderECBlocks>(data[1]); + m_ecBlocksArray[2] = std::make_unique<CBC_QRCoderECBlocks>(data[2]); + m_ecBlocksArray[3] = std::make_unique<CBC_QRCoderECBlocks>(data[3]);
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/qrcode/BC_QRCoderVersion.cpp
34
35
36
37
38
39
40
41
42
43
namespace { std::vector<std::unique_ptr<CBC_QRCoderVersion>>* g_VERSION = nullptr; } // namespace CBC_QRCoderVersion::CBC_QRCoderVersion(int32_t versionNumber, const CBC_QRCoderECBlockData data[4]) : m_versionNumber(versionNumber) {
+ show +
44
45
46
47
m_ecBlocksArray[0] = pdfium::MakeUnique<CBC_QRCoderECBlocks>(data[0]); m_ecBlocksArray[1] = pdfium::MakeUnique<CBC_QRCoderECBlocks>(data[1]); m_ecBlocksArray[2] = pdfium::MakeUnique<CBC_QRCoderECBlocks>(data[2]); m_ecBlocksArray[3] = pdfium::MakeUnique<CBC_QRCoderECBlocks>(data[3]);
+ show +
48
49
50
51
52
53
54
55
56
57
m_totalCodeWords = m_ecBlocksArray[0]->GetTotalDataCodeWords(); } CBC_QRCoderVersion::~CBC_QRCoderVersion() { } // static void CBC_QRCoderVersion::Initialize() { g_VERSION = new std::vector<std::unique_ptr<CBC_QRCoderVersion>>(); }

[CVE-2023-40093_1.diff] BC_QRCoderMode.cpp #2
+#include "third_party/base/check.h" -CBC_QRCoderMode* CBC_QRCoderMode::sKANJI = nullptr; -CBC_QRCoderMode* CBC_QRCoderMode::sECI = nullptr; -CBC_QRCoderMode* CBC_QRCoderMode::sGBK = nullptr; -CBC_QRCoderMode* CBC_QRCoderMode::sTERMINATOR = nullptr; -CBC_QRCoderMode* CBC_QRCoderMode::sFNC1_FIRST_POSITION = nullptr; -CBC_QRCoderMode* CBC_QRCoderMode::sFNC1_SECOND_POSITION = nullptr; -CBC_QRCoderMode* CBC_QRCoderMode::sSTRUCTURED_APPEND = nullptr;
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/qrcode/BC_QRCoderMode.cpp
22
23
24
25
26
27
28
29
30
31
#include "fxbarcode/qrcode/BC_QRCoderMode.h" #include <utility> #include "fxbarcode/utils.h" CBC_QRCoderMode* CBC_QRCoderMode::sBYTE = nullptr; CBC_QRCoderMode* CBC_QRCoderMode::sNUMERIC = nullptr; CBC_QRCoderMode* CBC_QRCoderMode::sALPHANUMERIC = nullptr;
+ show +
32
33
34
35
36
37
38
CBC_QRCoderMode* CBC_QRCoderMode::sKANJI = nullptr; CBC_QRCoderMode* CBC_QRCoderMode::sECI = nullptr; CBC_QRCoderMode* CBC_QRCoderMode::sGBK = nullptr; CBC_QRCoderMode* CBC_QRCoderMode::sTERMINATOR = nullptr; CBC_QRCoderMode* CBC_QRCoderMode::sFNC1_FIRST_POSITION = nullptr; CBC_QRCoderMode* CBC_QRCoderMode::sFNC1_SECOND_POSITION = nullptr; CBC_QRCoderMode* CBC_QRCoderMode::sSTRUCTURED_APPEND = nullptr;
+ show +
39
40
41
42
43
44
45
46
47
48
CBC_QRCoderMode::CBC_QRCoderMode(std::vector<int32_t> charCountBits, int32_t bits, ByteString name) : m_characterCountBitsForVersions(std::move(charCountBits)), m_bits(bits), m_name(name) {} CBC_QRCoderMode::~CBC_QRCoderMode() {}

[CVE-2023-40093_1.diff] BC_QRCoderMaskUtil.cpp #4
- int32_t width = matrix->GetWidth(); - int32_t height = matrix->GetHeight(); - for (int32_t y = 0; y < height - 1; y++) { - for (int32_t x = 0; x < width - 1; x++) { + size_t width = matrix->GetWidth(); + size_t height = matrix->GetHeight(); + for (size_t y = 0; y + 1 < height; y++) { + for (size_t x = 0; x + 1 < width; x++) {
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp
31
32
33
34
35
36
37
38
39
40
int32_t CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule1( CBC_CommonByteMatrix* matrix) { return ApplyMaskPenaltyRule1Internal(matrix, true) + ApplyMaskPenaltyRule1Internal(matrix, false); } int32_t CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule2( CBC_CommonByteMatrix* matrix) { int32_t penalty = 0; uint8_t* array = matrix->GetArray();
+ show +
41
42
43
44
int32_t width = matrix->GetWidth(); int32_t height = matrix->GetHeight(); for (int32_t y = 0; y < height - 1; y++) { for (int32_t x = 0; x < width - 1; x++) {
+ show +
45
46
47
48
49
50
51
52
53
54
int32_t value = array[y * width + x]; if (value == array[y * width + x + 1] && value == array[(y + 1) * width + x] && value == array[(y + 1) * width + x + 1]) { penalty++; } } } return 3 * penalty; }

[CVE-2023-40093_1.diff] BC_OnedEAN13Writer_unittest.cpp #2
- int32_t width; - int32_t height; - uint8_t* encoded; - const char* expected; - encoded = writer.Encode("", BCFORMAT_EAN_13, width, height); - EXPECT_EQ(nullptr, encoded); - FX_Free(encoded); + EXPECT_TRUE(writer.Encode("").empty()); + EXPECT_TRUE(writer.Encode("123").empty()); + EXPECT_TRUE(writer.Encode("123456789012").empty()); + EXPECT_TRUE(writer.Encode("12345678901234").empty()); - encoded = writer.Encode("123", BCFORMAT_EAN_13, width, height); - EXPECT_EQ(nullptr, encoded); - FX_Free(encoded); - - encoded = writer.Encode("123456789012", BCFORMAT_EAN_13, width, height); - EXPECT_EQ(nullptr, encoded); - FX_Free(encoded); - - encoded = writer.Encode("12345678901234", BCFORMAT_EAN_13, width, height); - EXPECT_EQ(nullptr, encoded); - FX_Free(encoded); - - encoded = writer.Encode("1234567890128", BCFORMAT_EAN_13, width, height); - EXPECT_NE(nullptr, encoded); - EXPECT_EQ(1, height); - EXPECT_EQ(95, width); - - expected = + static const char kExpected1[] =
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/oned/BC_OnedEAN13Writer_unittest.cpp
2
3
4
5
6
7
8
9
10
11
// Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "fxbarcode/oned/BC_OnedEAN13Writer.h" #include "testing/gtest/include/gtest/gtest.h" namespace { TEST(OnedEAN13WriterTest, Encode) { CBC_OnedEAN13Writer writer;
+ show +
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
int32_t width; int32_t height; uint8_t* encoded; const char* expected; // EAN-13 barcodes encode 13-digit numbers into 95 modules in a unidimensional // disposition. encoded = writer.Encode("", BCFORMAT_EAN_13, width, height); EXPECT_EQ(nullptr, encoded); FX_Free(encoded); encoded = writer.Encode("123", BCFORMAT_EAN_13, width, height); EXPECT_EQ(nullptr, encoded); FX_Free(encoded); encoded = writer.Encode("123456789012", BCFORMAT_EAN_13, width, height); EXPECT_EQ(nullptr, encoded); FX_Free(encoded); encoded = writer.Encode("12345678901234", BCFORMAT_EAN_13, width, height); EXPECT_EQ(nullptr, encoded); FX_Free(encoded); encoded = writer.Encode("1234567890128", BCFORMAT_EAN_13, width, height); EXPECT_NE(nullptr, encoded); EXPECT_EQ(1, height); EXPECT_EQ(95, width); expected =
+ show +
41
42
43
44
45
46
47
48
49
50
"# #" // Start // 1 implicit by LLGLGG in next 6 digits " # ##" // 2 L " #### #" // 3 L " ### #" // 4 G " ## #" // 5 L " # #" // 6 G " # #" // 7 G " # # " // Middle "# # " // 8 R

[CVE-2023-40093_1.diff] BC_OnedEAN13Writer_unittest.cpp #3
- for (int i = 0; i < 95; i++) { - EXPECT_EQ(expected[i] != ' ', !!encoded[i]) << i; - } - FX_Free(encoded); + DataVector<uint8_t> encoded = writer.Encode("1234567890128"); + for (size_t i = 0; i < strlen(kExpected1); i++) + EXPECT_EQ(kExpected1[i] != ' ', !!encoded[i]) << i; - encoded = writer.Encode("7776665554440", BCFORMAT_EAN_13, width, height); - EXPECT_NE(nullptr, encoded); - EXPECT_EQ(1, height); - EXPECT_EQ(95, width); - - expected = + static const char kExpected2[] =
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/oned/BC_OnedEAN13Writer_unittest.cpp
47
48
49
50
51
52
53
54
55
56
" # #" // 6 G " # #" // 7 G " # # " // Middle "# # " // 8 R "### # " // 9 R "### # " // 0 R "## ## " // 1 R "## ## " // 2 R "# # " // 8 R "# #"; // End
+ show +
57
58
59
60
61
62
63
64
65
66
67
for (int i = 0; i < 95; i++) { EXPECT_EQ(expected[i] != ' ', !!encoded[i]) << i; } FX_Free(encoded); encoded = writer.Encode("7776665554440", BCFORMAT_EAN_13, width, height); EXPECT_NE(nullptr, encoded); EXPECT_EQ(1, height); EXPECT_EQ(95, width); expected =
+ show +
68
69
70
71
72
73
74
75
76
77
"# #" // Start // 7 implicit by LGLGLG in next 6 digits " ### ##" // 7 L " # #" // 7 G " # ####" // 6 L " # #" // 6 G " # ####" // 6 L " ### #" // 5 G " # # " // Middle "# ### " // 5 R

[CVE-2023-40093_1.diff] BC_OnedCode39Writer_unittest.cpp #2
- int32_t width; - int32_t height; - uint8_t* encoded; - const char* expected; - - encoded = writer.Encode("PDFIUM", BCFORMAT_CODE_39, width, height); - expected = + static const char kExpected1[] =
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/oned/BC_OnedCode39Writer_unittest.cpp
27
28
29
30
31
32
33
34
35
36
CBC_OnedCode39Writer writer; EXPECT_FALSE(writer.SetWideNarrowRatio(0)); EXPECT_FALSE(writer.SetWideNarrowRatio(1)); EXPECT_TRUE(writer.SetWideNarrowRatio(2)); EXPECT_TRUE(writer.SetWideNarrowRatio(3)); EXPECT_FALSE(writer.SetWideNarrowRatio(4)); EXPECT_FALSE(writer.SetWideNarrowRatio(100)); writer.SetWideNarrowRatio(3);
+ show +
37
38
39
40
41
42
43
int32_t width; int32_t height; uint8_t* encoded; const char* expected; encoded = writer.Encode("PDFIUM", BCFORMAT_CODE_39, width, height); expected =
+ show +
44
45
46
47
48
49
50
51
52
53
"# # ### ### # " // * Start "# ### ### # # " // P "# # ### # ### " // D "# ### ### # # " // F "# ### # ### # " // I "### # # # ### " // U "### ### # # # " // M "# # ### ### #"; // * End FX_Free(encoded);

[CVE-2023-40093_1.diff] BC_OnedCode39Writer_unittest.cpp #5
- for (size_t i = 0; i < strlen(expected); i++) - EXPECT_EQ(expected[i] != ' ', !!encoded[i]) << i; - FX_Free(encoded); + encoded = writer.Encode("PDFIUM"); + ASSERT_EQ(strlen(kExpected3), encoded.size()); + for (size_t i = 0; i < strlen(kExpected3); i++) + EXPECT_EQ(kExpected3[i] != ' ', !!encoded[i]) << i; - encoded = writer.Encode("A -$%./+Z", BCFORMAT_CODE_39, width, height); - EXPECT_EQ(1, height); - EXPECT_EQ((9 + DELIMITER_CHARS) * MODULES_PER_CHAR - 1, width); - expected = + static const char kExpected4[] =
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/oned/BC_OnedCode39Writer_unittest.cpp
103
104
105
106
107
108
109
110
111
112
EXPECT_EQ((6 + DELIMITER_CHARS) * MODULES_PER_CHAR - 1, width); expected = "# # ### ### # " // * Start "# ### ### # # " // P "# # ### # ### " // D "# ### ### # # " // F "# ### # ### # " // I "### # # # ### " // U "### ### # # # " // M "# # ### ### #"; // * End
+ show +
113
114
115
116
117
118
119
120
121
for (size_t i = 0; i < strlen(expected); i++) { EXPECT_EQ(expected[i] != ' ', !!encoded[i]) << i; } FX_Free(encoded); encoded = writer.Encode("A -$%./+Z", BCFORMAT_CODE_39, width, height); EXPECT_EQ(1, height); EXPECT_EQ((9 + DELIMITER_CHARS) * MODULES_PER_CHAR - 1, width); expected =
+ show +
122
123
124
125
126
127
128
129
130
131
"# # ### ### # " // * Start "### # # # ### " // A "# ### # ### # " // Space "# # # ### ### " // - "# # # # # " // $ "# # # # # " // % "### # # ### # " // . "# # # # # " // / "# # # # # " // + "# ### ### # # " // Z

[CVE-2023-40093_1.diff] BC_OnedEAN13Writer.h #3
- uint8_t* EncodeWithHint(const ByteString& contents, - BCFORMAT format, - int32_t& outWidth, - int32_t& outHeight, - int32_t hints) override; - uint8_t* EncodeImpl(const ByteString& contents, int32_t& outLength) override; + DataVector<uint8_t> Encode(const ByteString& contents) override;
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/oned/BC_OnedUPCAWriter.h
17
18
19
20
21
22
23
24
25
26
class CFX_DIBitmap; class CFX_Matrix; class CFX_RenderDevice; class CBC_OnedUPCAWriter : public CBC_OneDimWriter { public: CBC_OnedUPCAWriter(); ~CBC_OnedUPCAWriter() override; // CBC_OneDimWriter
+ show +
27
28
29
30
31
32
uint8_t* EncodeWithHint(const ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, int32_t hints) override; uint8_t* EncodeImpl(const ByteString& contents, int32_t& outLength) override;
+ show +
33
34
35
36
37
38
39
40
41
42
bool CheckContentValidity(const WideStringView& contents) override; WideString FilterContents(const WideStringView& contents) override; void Init(); int32_t CalcChecksum(const ByteString& contents); protected: bool ShowChars(const WideStringView& contents, CFX_RenderDevice* device, const CFX_Matrix* matrix,
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/oned/BC_OnedEAN13Writer.h
13
14
15
16
17
18
19
20
21
22
class CFX_DIBitmap; class CFX_RenderDevice; class CBC_OnedEAN13Writer : public CBC_OneDimWriter { public: CBC_OnedEAN13Writer(); ~CBC_OnedEAN13Writer() override; // CBC_OneDimWriter
+ show +
23
24
25
26
27
28
uint8_t* EncodeWithHint(const ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, int32_t hints) override; uint8_t* EncodeImpl(const ByteString& contents, int32_t& outLength) override;
+ show +
29
30
31
32
33
34
35
36
37
38
bool CheckContentValidity(const WideStringView& contents) override; WideString FilterContents(const WideStringView& contents) override; int32_t CalcChecksum(const ByteString& contents); protected: bool ShowChars(const WideStringView& contents, CFX_RenderDevice* device, const CFX_Matrix* matrix, int32_t barWidth,
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/oned/BC_OnedCode128Writer.h
18
19
20
21
22
23
24
25
26
27
explicit CBC_OnedCode128Writer(BC_TYPE type); ~CBC_OnedCode128Writer() override; // Exposed for testing. static int32_t Encode128B(const ByteString& contents, std::vector<int32_t>* patterns); static int32_t Encode128C(const ByteString& contents, std::vector<int32_t>* patterns); // CBC_OneDimWriter
+ show +
28
29
30
31
32
33
uint8_t* EncodeWithHint(const ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, int32_t hints) override; uint8_t* EncodeImpl(const ByteString& contents, int32_t& outLength) override;
+ show +
34
35
36
37
38
39
40
41
42
43
bool CheckContentValidity(const WideStringView& contents) override; WideString FilterContents(const WideStringView& contents) override; bool SetTextLocation(BC_TEXT_LOC location); BC_TYPE GetType() const { return m_codeFormat; } private: const BC_TYPE m_codeFormat; };
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/oned/BC_OnedCode39Writer.h
9
10
11
12
13
14
15
16
17
18
#include "fxbarcode/BC_Library.h" #include "fxbarcode/oned/BC_OneDimWriter.h" class CBC_OnedCode39Writer : public CBC_OneDimWriter { public: CBC_OnedCode39Writer(); ~CBC_OnedCode39Writer() override; // CBC_OneDimWriter
+ show +
19
20
21
22
23
24
uint8_t* EncodeWithHint(const ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, int32_t hints) override; uint8_t* EncodeImpl(const ByteString& contents, int32_t& outLength) override;
+ show +
25
26
27
28
29
30
31
32
33
34
bool RenderResult(const WideStringView& contents, uint8_t* code, int32_t codeLength) override; bool CheckContentValidity(const WideStringView& contents) override; WideString FilterContents(const WideStringView& contents) override; WideString RenderTextContents(const WideStringView& contents) override; virtual bool SetTextLocation(BC_TEXT_LOC loction); virtual bool SetWideNarrowRatio(int8_t ratio);
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/oned/BC_OnedEAN8Writer.h
14
15
16
17
18
19
20
21
22
23
class CFX_DIBitmap; class CFX_RenderDevice; class CBC_OnedEAN8Writer : public CBC_OneDimWriter { public: CBC_OnedEAN8Writer(); ~CBC_OnedEAN8Writer() override; // CBC_OneDimWriter
+ show +
24
25
26
27
28
29
uint8_t* EncodeWithHint(const ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, int32_t hints) override; uint8_t* EncodeImpl(const ByteString& contents, int32_t& outLength) override;
+ show +
30
31
32
33
34
35
36
37
38
39
bool CheckContentValidity(const WideStringView& contents) override; WideString FilterContents(const WideStringView& contents) override; void SetDataLength(int32_t length) override; bool SetTextLocation(BC_TEXT_LOC location); int32_t CalcChecksum(const ByteString& contents); protected: bool ShowChars(const WideStringView& contents, CFX_RenderDevice* device,

[CVE-2023-40093_1.diff] BC_OnedUPCAWriter.h #3
- uint8_t* EncodeWithHint(const ByteString& contents, - BCFORMAT format, - int32_t& outWidth, - int32_t& outHeight, - int32_t hints) override; - uint8_t* EncodeImpl(const ByteString& contents, int32_t& outLength) override; + DataVector<uint8_t> Encode(const ByteString& contents) override;
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/oned/BC_OnedUPCAWriter.h
17
18
19
20
21
22
23
24
25
26
class CFX_DIBitmap; class CFX_Matrix; class CFX_RenderDevice; class CBC_OnedUPCAWriter : public CBC_OneDimWriter { public: CBC_OnedUPCAWriter(); ~CBC_OnedUPCAWriter() override; // CBC_OneDimWriter
+ show +
27
28
29
30
31
32
uint8_t* EncodeWithHint(const ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, int32_t hints) override; uint8_t* EncodeImpl(const ByteString& contents, int32_t& outLength) override;
+ show +
33
34
35
36
37
38
39
40
41
42
bool CheckContentValidity(const WideStringView& contents) override; WideString FilterContents(const WideStringView& contents) override; void Init(); int32_t CalcChecksum(const ByteString& contents); protected: bool ShowChars(const WideStringView& contents, CFX_RenderDevice* device, const CFX_Matrix* matrix,
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/oned/BC_OnedEAN13Writer.h
13
14
15
16
17
18
19
20
21
22
class CFX_DIBitmap; class CFX_RenderDevice; class CBC_OnedEAN13Writer : public CBC_OneDimWriter { public: CBC_OnedEAN13Writer(); ~CBC_OnedEAN13Writer() override; // CBC_OneDimWriter
+ show +
23
24
25
26
27
28
uint8_t* EncodeWithHint(const ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, int32_t hints) override; uint8_t* EncodeImpl(const ByteString& contents, int32_t& outLength) override;
+ show +
29
30
31
32
33
34
35
36
37
38
bool CheckContentValidity(const WideStringView& contents) override; WideString FilterContents(const WideStringView& contents) override; int32_t CalcChecksum(const ByteString& contents); protected: bool ShowChars(const WideStringView& contents, CFX_RenderDevice* device, const CFX_Matrix* matrix, int32_t barWidth,
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/oned/BC_OnedCode128Writer.h
18
19
20
21
22
23
24
25
26
27
explicit CBC_OnedCode128Writer(BC_TYPE type); ~CBC_OnedCode128Writer() override; // Exposed for testing. static int32_t Encode128B(const ByteString& contents, std::vector<int32_t>* patterns); static int32_t Encode128C(const ByteString& contents, std::vector<int32_t>* patterns); // CBC_OneDimWriter
+ show +
28
29
30
31
32
33
uint8_t* EncodeWithHint(const ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, int32_t hints) override; uint8_t* EncodeImpl(const ByteString& contents, int32_t& outLength) override;
+ show +
34
35
36
37
38
39
40
41
42
43
bool CheckContentValidity(const WideStringView& contents) override; WideString FilterContents(const WideStringView& contents) override; bool SetTextLocation(BC_TEXT_LOC location); BC_TYPE GetType() const { return m_codeFormat; } private: const BC_TYPE m_codeFormat; };
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/oned/BC_OnedCode39Writer.h
9
10
11
12
13
14
15
16
17
18
#include "fxbarcode/BC_Library.h" #include "fxbarcode/oned/BC_OneDimWriter.h" class CBC_OnedCode39Writer : public CBC_OneDimWriter { public: CBC_OnedCode39Writer(); ~CBC_OnedCode39Writer() override; // CBC_OneDimWriter
+ show +
19
20
21
22
23
24
uint8_t* EncodeWithHint(const ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, int32_t hints) override; uint8_t* EncodeImpl(const ByteString& contents, int32_t& outLength) override;
+ show +
25
26
27
28
29
30
31
32
33
34
bool RenderResult(const WideStringView& contents, uint8_t* code, int32_t codeLength) override; bool CheckContentValidity(const WideStringView& contents) override; WideString FilterContents(const WideStringView& contents) override; WideString RenderTextContents(const WideStringView& contents) override; virtual bool SetTextLocation(BC_TEXT_LOC loction); virtual bool SetWideNarrowRatio(int8_t ratio);
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/oned/BC_OnedEAN8Writer.h
14
15
16
17
18
19
20
21
22
23
class CFX_DIBitmap; class CFX_RenderDevice; class CBC_OnedEAN8Writer : public CBC_OneDimWriter { public: CBC_OnedEAN8Writer(); ~CBC_OnedEAN8Writer() override; // CBC_OneDimWriter
+ show +
24
25
26
27
28
29
uint8_t* EncodeWithHint(const ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, int32_t hints) override; uint8_t* EncodeImpl(const ByteString& contents, int32_t& outLength) override;
+ show +
30
31
32
33
34
35
36
37
38
39
bool CheckContentValidity(const WideStringView& contents) override; WideString FilterContents(const WideStringView& contents) override; void SetDataLength(int32_t length) override; bool SetTextLocation(BC_TEXT_LOC location); int32_t CalcChecksum(const ByteString& contents); protected: bool ShowChars(const WideStringView& contents, CFX_RenderDevice* device,

[CVE-2023-40093_1.diff] BC_OnedEAN8Writer_unittest.cpp #2
- int32_t width; - int32_t height; - uint8_t* encoded; - const char* expected; - encoded = writer.Encode("", BCFORMAT_EAN_8, width, height); - EXPECT_EQ(nullptr, encoded); - FX_Free(encoded); + EXPECT_TRUE(writer.Encode("").empty()); + EXPECT_TRUE(writer.Encode("123").empty()); + EXPECT_TRUE(writer.Encode("1234567").empty()); + EXPECT_TRUE(writer.Encode("123456789").empty()); - encoded = writer.Encode("123", BCFORMAT_EAN_8, width, height); - EXPECT_EQ(nullptr, encoded); - FX_Free(encoded); - - encoded = writer.Encode("1234567", BCFORMAT_EAN_8, width, height); - EXPECT_EQ(nullptr, encoded); - FX_Free(encoded); - - encoded = writer.Encode("123456789", BCFORMAT_EAN_8, width, height); - EXPECT_EQ(nullptr, encoded); - FX_Free(encoded); - - encoded = writer.Encode("12345670", BCFORMAT_EAN_8, width, height); - EXPECT_NE(nullptr, encoded); - EXPECT_EQ(1, height); - EXPECT_EQ(67, width); - - expected = + static const char kExpected1[] =
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/oned/BC_OnedEAN8Writer_unittest.cpp
2
3
4
5
6
7
8
9
10
11
// Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "fxbarcode/oned/BC_OnedEAN8Writer.h" #include "testing/gtest/include/gtest/gtest.h" namespace { TEST(OnedEAN8WriterTest, Encode) { CBC_OnedEAN8Writer writer;
+ show +
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
int32_t width; int32_t height; uint8_t* encoded; const char* expected; // EAN-8 barcodes encode 8-digit numbers into 67 modules in a unidimensional // disposition. encoded = writer.Encode("", BCFORMAT_EAN_8, width, height); EXPECT_EQ(nullptr, encoded); FX_Free(encoded); encoded = writer.Encode("123", BCFORMAT_EAN_8, width, height); EXPECT_EQ(nullptr, encoded); FX_Free(encoded); encoded = writer.Encode("1234567", BCFORMAT_EAN_8, width, height); EXPECT_EQ(nullptr, encoded); FX_Free(encoded); encoded = writer.Encode("123456789", BCFORMAT_EAN_8, width, height); EXPECT_EQ(nullptr, encoded); FX_Free(encoded); encoded = writer.Encode("12345670", BCFORMAT_EAN_8, width, height); EXPECT_NE(nullptr, encoded); EXPECT_EQ(1, height); EXPECT_EQ(67, width); expected =
+ show +
41
42
43
44
45
46
47
48
49
50
"# #" // Start " ## #" // 1 L " # ##" // 2 L " #### #" // 3 L " # ##" // 4 L " # # " // Middle "# ### " // 5 R "# # " // 6 R "# # " // 7 R "### # " // 0 R

[CVE-2023-40093_1.diff] BC_OnedEAN8Writer_unittest.cpp #3
- for (int i = 0; i < 67; i++) { - EXPECT_EQ(expected[i] != ' ', !!encoded[i]) << i; - } - FX_Free(encoded); + DataVector<uint8_t> encoded = writer.Encode("12345670"); + ASSERT_EQ(strlen(kExpected1), encoded.size()); + for (size_t i = 0; i < strlen(kExpected1); i++) + EXPECT_EQ(kExpected1[i] != ' ', !!encoded[i]) << i; - encoded = writer.Encode("99441104", BCFORMAT_EAN_8, width, height); - EXPECT_NE(nullptr, encoded); - EXPECT_EQ(1, height); - EXPECT_EQ(67, width); - - expected = + static const char kExpected2[] =
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/oned/BC_OnedEAN8Writer_unittest.cpp
42
43
44
45
46
47
48
49
50
51
" ## #" // 1 L " # ##" // 2 L " #### #" // 3 L " # ##" // 4 L " # # " // Middle "# ### " // 5 R "# # " // 6 R "# # " // 7 R "### # " // 0 R "# #"; // End
+ show +
52
53
54
55
56
57
58
59
60
61
62
for (int i = 0; i < 67; i++) { EXPECT_EQ(expected[i] != ' ', !!encoded[i]) << i; } FX_Free(encoded); encoded = writer.Encode("99441104", BCFORMAT_EAN_8, width, height); EXPECT_NE(nullptr, encoded); EXPECT_EQ(1, height); EXPECT_EQ(67, width); expected =
+ show +
63
64
65
66
67
68
69
70
71
72
"# #" // Start " # ##" // 9 L " # ##" // 9 L " # ##" // 4 L " # ##" // 4 L " # # " // Middle "## ## " // 1 R "## ## " // 1 R "### # " // 0 R "# ### " // 4 R

[CVE-2023-40093_1.diff] BC_OnedCodaBarWriter_unittest.cpp #2
- for (size_t i = 0; i < strlen(expected); i++) { - EXPECT_EQ(expected[i] != ' ', !!encoded[i]) << i; - } - FX_Free(encoded); + encoded = writer.Encode("-$./:+"); + ASSERT_EQ(strlen(kExpected3), encoded.size()); + for (size_t i = 0; i < strlen(kExpected3); i++) + EXPECT_EQ(kExpected3[i] != ' ', !!encoded[i]) << i; - encoded = writer.Encode("456.987987987/001", BCFORMAT_CODABAR, width, height); - EXPECT_EQ(1, height); - EXPECT_EQ(kModulesForDelimiters + 15 * kModulesPerNumber + - 2 * kModulesPerPunctuation, - width); - expected = + static const char kExpected4[] =
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/oned/BC_OnedCodaBarWriter_unittest.cpp
53
54
55
56
57
58
59
60
61
62
width); expected = "# ## # # " // A Start "# # ## # " // - "# ## # # " // $ "## ## ## # " // . "## ## # ## " // / "## # ## ## " // : "# ## ## ## " // + "# # # ##"; // B End
+ show +
63
64
65
66
67
68
69
70
71
72
73
for (size_t i = 0; i < strlen(expected); i++) { EXPECT_EQ(expected[i] != ' ', !!encoded[i]) << i; } FX_Free(encoded); encoded = writer.Encode("456.987987987/001", BCFORMAT_CODABAR, width, height); EXPECT_EQ(1, height); EXPECT_EQ(kModulesForDelimiters + 15 * kModulesPerNumber + 2 * kModulesPerPunctuation, width); expected =
+ show +
74
75
76
77
78
79
80
81
82
83
"# ## # # " // A Start "# ## # # " // 4 "## # # # " // 5 "# # # ## " // 6 "## ## ## # " // . "## # # # " // 9 "# ## # # " // 8 "# # ## # " // 7 "## # # # " // 9 "# ## # # " // 8

[CVE-2023-40093_1.diff] BC_OnedUPCAWriter_unittest.cpp #3
- EXPECT_NE(nullptr, encoded); - EXPECT_EQ(1, height); - EXPECT_EQ(static_cast<int32_t>(strlen(expected)), width); - for (size_t i = 0; i < strlen(expected); i++) { - EXPECT_EQ(expected[i] != ' ', !!encoded[i]) << i; - } - FX_Free(encoded); + DataVector<uint8_t> encoded = writer.Encode("123456789012"); + ASSERT_EQ(strlen(kExpected1), encoded.size()); + for (size_t i = 0; i < strlen(kExpected1); i++) + EXPECT_EQ(kExpected1[i] != ' ', !!encoded[i]) << i; - encoded = writer.Encode("777666555440", BCFORMAT_UPC_A, width, height); - expected = + encoded = writer.Encode("777666555440"); + static const char kExpected2[] =
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/oned/BC_OnedUPCAWriter_unittest.cpp
44
45
46
47
48
49
50
51
52
53
" ## #" // 5 L " # ####" // 6 L " # # " // Middle "# # " // 7 R "# # " // 8 R "### # " // 9 R "### # " // 0 R "## ## " // 1 R "## ## " // 2 R "# #"; // End
+ show +
54
55
56
57
58
59
60
61
62
63
EXPECT_NE(nullptr, encoded); EXPECT_EQ(1, height); EXPECT_EQ(static_cast<int32_t>(strlen(expected)), width); for (size_t i = 0; i < strlen(expected); i++) { EXPECT_EQ(expected[i] != ' ', !!encoded[i]) << i; } FX_Free(encoded); encoded = writer.Encode("777666555440", BCFORMAT_UPC_A, width, height); expected =
+ show +
64
65
66
67
68
69
70
71
72
73
"# #" // Start " ### ##" // 7 L " ### ##" // 7 L " ### ##" // 7 L " # ####" // 6 L " # ####" // 6 L " # ####" // 6 L " # # " // Middle "# ### " // 5 R "# ### " // 5 R

[CVE-2023-40093_1.diff] BC_OnedUPCAWriter_unittest.cpp #4
- EXPECT_NE(nullptr, encoded); - EXPECT_EQ(1, height); - EXPECT_EQ(static_cast<int32_t>(strlen(expected)), width); - for (size_t i = 0; i < strlen(expected); i++) { - EXPECT_EQ(expected[i] != ' ', !!encoded[i]) << i; - } - FX_Free(encoded); + ASSERT_EQ(strlen(kExpected2), encoded.size()); + for (size_t i = 0; i < strlen(kExpected2); i++) + EXPECT_EQ(kExpected2[i] != ' ', !!encoded[i]) << i;
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/oned/BC_OnedUPCAWriter_unittest.cpp
44
45
46
47
48
49
50
51
52
53
" ## #" // 5 L " # ####" // 6 L " # # " // Middle "# # " // 7 R "# # " // 8 R "### # " // 9 R "### # " // 0 R "## ## " // 1 R "## ## " // 2 R "# #"; // End
+ show +
54
55
56
57
58
59
60
EXPECT_NE(nullptr, encoded); EXPECT_EQ(1, height); EXPECT_EQ(static_cast<int32_t>(strlen(expected)), width); for (size_t i = 0; i < strlen(expected); i++) { EXPECT_EQ(expected[i] != ' ', !!encoded[i]) << i; } FX_Free(encoded);
+ show +
61
62
63
64
65
66
67
68
69
70
encoded = writer.Encode("777666555440", BCFORMAT_UPC_A, width, height); expected = "# #" // Start " ### ##" // 7 L " ### ##" // 7 L " ### ##" // 7 L " # ####" // 6 L " # ####" // 6 L " # ####" // 6 L
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxbarcode/oned/BC_OnedUPCAWriter_unittest.cpp
69
70
71
72
73
74
75
76
77
78
" # ####" // 6 L " # ####" // 6 L " # # " // Middle "# ### " // 5 R "# ### " // 5 R "# ### " // 5 R "# ### " // 4 R "# ### " // 4 R "### # " // 0 R "# #"; // End
+ show +
79
80
81
82
83
84
85
EXPECT_NE(nullptr, encoded); EXPECT_EQ(1, height); EXPECT_EQ(static_cast<int32_t>(strlen(expected)), width); for (size_t i = 0; i < strlen(expected); i++) { EXPECT_EQ(expected[i] != ' ', !!encoded[i]) << i; } FX_Free(encoded);
+ show +
86
87
88
89
90
91
92
93
94
95
} TEST(OnedUPCAWriterTest, Checksum) { CBC_OnedUPCAWriter writer; EXPECT_EQ(0, writer.CalcChecksum("")); EXPECT_EQ(6, writer.CalcChecksum("123")); EXPECT_EQ(2, writer.CalcChecksum("12345678901")); EXPECT_EQ(0, writer.CalcChecksum("77766655544")); }

[CVE-2023-40093_1.diff] pdfium_test_write_helper.cc #14
-std::string WriteSkp(const char* pdf_name, - int num, - SkPictureRecorder* recorder) { - char filename[256]; - int chars_formatted = - snprintf(filename, sizeof(filename), "%s.%d.skp", pdf_name, num); - - if (chars_formatted < 0 || - static_cast<size_t>(chars_formatted) >= sizeof(filename)) { - fprintf(stderr, "Filename %s is too long\n", filename); - return ""; +std::string WriteSkp(const char* pdf_name, int num, const SkPicture& picture) { + std::string filename = GeneratePageOutputFilename(pdf_name, num, "skp"); + if (filename.empty()) { + return filename; - - sk_sp<SkPicture> picture(recorder->finishRecordingAsPicture()); - SkFILEWStream wStream(filename); - picture->serialize(&wStream); - return std::string(filename); + SkFILEWStream wStream(filename.c_str()); + picture.serialize(&wStream); + return filename;
/media/esteban/ACOS/ResurrectionX/external/pdfium/samples/pdfium_test.cc
587
588
589
590
591
592
593
594
595
596
fprintf(stderr, "Failed to write to %s\n", filename); break; } } fclose(fp); DeleteEnhMetaFile(emf); } #endif // _WIN32 #ifdef PDF_ENABLE_SKIA
+ show +
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
std::string WriteSkp(const char* pdf_name, int num, SkPictureRecorder* recorder) { char filename[256]; int chars_formatted = snprintf(filename, sizeof(filename), "%s.%d.skp", pdf_name, num); if (chars_formatted < 0 || static_cast<size_t>(chars_formatted) >= sizeof(filename)) { fprintf(stderr, "Filename %s is too long\n", filename); return ""; } sk_sp<SkPicture> picture(recorder->finishRecordingAsPicture()); SkFILEWStream wStream(filename); picture->serialize(&wStream); return std::string(filename);
+ show +
614
615
616
617
618
619
620
621
622
623
} #endif // These example JS platform callback handlers are entirely optional, // and exist here to show the flow of information from a document back // to the embedder. int ExampleAppAlert(IPDF_JSPLATFORM*, FPDF_WIDESTRING msg, FPDF_WIDESTRING title, int type,

[CVE-2023-40093_1.diff] fpdf_doc.h #3
+// Go to a destination in an embedded file. +#define PDFACTION_EMBEDDEDGOTO 5 -typedef struct _FS_QUADPOINTSF { - FS_FLOAT x1; - FS_FLOAT y1; - FS_FLOAT x2; - FS_FLOAT y2; - FS_FLOAT x3; - FS_FLOAT y3; - FS_FLOAT x4; - FS_FLOAT y4; -} FS_QUADPOINTSF; +// The file identifier entry type. See section 14.4 "File Identifiers" of the +// ISO 32000-1:2008 spec. +typedef enum { + FILEIDTYPE_PERMANENT = 0, + FILEIDTYPE_CHANGING = 1 +} FPDF_FILEIDTYPE;
/media/esteban/ACOS/ResurrectionX/external/pdfium/public/fpdf_doc.h
29
30
31
32
33
34
35
36
37
38
#define PDFDEST_VIEW_UNKNOWN_MODE 0 #define PDFDEST_VIEW_XYZ 1 #define PDFDEST_VIEW_FIT 2 #define PDFDEST_VIEW_FITH 3 #define PDFDEST_VIEW_FITV 4 #define PDFDEST_VIEW_FITR 5 #define PDFDEST_VIEW_FITB 6 #define PDFDEST_VIEW_FITBH 7 #define PDFDEST_VIEW_FITBV 8
+ show +
39
40
41
42
43
44
45
46
47
48
typedef struct _FS_QUADPOINTSF { FS_FLOAT x1; FS_FLOAT y1; FS_FLOAT x2; FS_FLOAT y2; FS_FLOAT x3; FS_FLOAT y3; FS_FLOAT x4; FS_FLOAT y4; } FS_QUADPOINTSF;
+ show +
49
50
51
52
53
54
55
56
57
58
// Get the first child of |bookmark|, or the first top-level bookmark item. // // document - handle to the document. // bookmark - handle to the current bookmark. Pass NULL for the first top // level item. // // Returns a handle to the first child of |bookmark| or the first top-level // bookmark item. NULL if no child or top-level bookmark found. FPDF_EXPORT FPDF_BOOKMARK FPDF_CALLCONV

[CVE-2023-40093_1.diff] fpdfview.h #9
+ + // Version 3 - Experimental. + + // Pointer to the V8::Platform to use. + void* m_pPlatform; + + // Version 4 - Experimental. + + // Explicit specification of core renderer to use. |m_RendererType| must be + // a valid value for |FPDF_LIBRARY_CONFIG| versions of this level or higher, + // or else the initialization will fail with an immediate crash. + // Note that use of a specified |FPDF_RENDERER_TYPE| value for which the + // corresponding render library is not included in the build will similarly + // fail with an immediate crash. + FPDF_RENDERER_TYPE m_RendererType; + -#if defined(PDFIUM_PRINT_TEXT_WITH_GDI) -// Pointer to a helper function to make |font| with |text| of |text_length| -// accessible when printing text with GDI. This is useful in sandboxed -// environments where PDFium's access to GDI may be restricted. -typedef void (*PDFiumEnsureTypefaceCharactersAccessible)(const LOGFONT* font, - const wchar_t* text, - size_t text_length); - -// Function: FPDF_SetTypefaceAccessibleFunc -// Set the function pointer that makes GDI fonts available in sandboxed -// environments. Experimental API. -// Parameters: -// func - A function pointer. See description above. -// Return value: -// None. -FPDF_EXPORT void FPDF_CALLCONV -FPDF_SetTypefaceAccessibleFunc(PDFiumEnsureTypefaceCharactersAccessible func); - -// Function: FPDF_SetPrintTextWithGDI -// Set whether to use GDI to draw fonts when printing on Windows. -// Experimental API. -// Parameters: -// use_gdi - Set to true to enable printing text with GDI. -// Return value: -// None. -FPDF_EXPORT void FPDF_CALLCONV FPDF_SetPrintTextWithGDI(FPDF_BOOL use_gdi); -#endif // PDFIUM_PRINT_TEXT_WITH_GDI - +// Experimental API. -// Experimental API.
/media/esteban/ACOS/ResurrectionX/external/pdfium/public/fpdfview.h
232
233
234
235
236
237
238
239
240
241
// Parameters: // policy - The specified policy for setting, for example: // FPDF_POLICY_MACHINETIME_ACCESS. // enable - True to enable, false to disable the policy. // Return value: // None. FPDF_EXPORT void FPDF_CALLCONV FPDF_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable); #if defined(_WIN32)
+ show +
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
#if defined(PDFIUM_PRINT_TEXT_WITH_GDI) // Pointer to a helper function to make |font| with |text| of |text_length| // accessible when printing text with GDI. This is useful in sandboxed // environments where PDFium's access to GDI may be restricted. typedef void (*PDFiumEnsureTypefaceCharactersAccessible)(const LOGFONT* font, const wchar_t* text, size_t text_length); // Function: FPDF_SetTypefaceAccessibleFunc // Set the function pointer that makes GDI fonts available in sandboxed // environments. Experimental API. // Parameters: // func - A function pointer. See description above. // Return value: // None. FPDF_EXPORT void FPDF_CALLCONV FPDF_SetTypefaceAccessibleFunc(PDFiumEnsureTypefaceCharactersAccessible func); // Function: FPDF_SetPrintTextWithGDI // Set whether to use GDI to draw fonts when printing on Windows. // Experimental API. // Parameters: // use_gdi - Set to true to enable printing text with GDI. // Return value: // None. FPDF_EXPORT void FPDF_CALLCONV FPDF_SetPrintTextWithGDI(FPDF_BOOL use_gdi); #endif // PDFIUM_PRINT_TEXT_WITH_GDI
+ show +
269
270
271
272
273
274
275
276
277
278
// Function: FPDF_SetPrintPostscriptLevel // Set postscript printing level when printing on Windows. // Experimental API. // Parameters: // postscript_level- 0 to disable postscript printing, // 2 to print with postscript level 2, // 3 to print with postscript level 3. // All other values are invalid. // Return value:

[CVE-2023-40093_1.diff] BUILD.gn #4
- defines = [] - - if (is_component_build) { - defines += [ "SKIA_IMPLEMENTATION=1" ] - } + # Turn on SK_API to export Skia's public API + defines = [ + "IS_SKIA_IMPL=1", + "SKIA_IMPLEMENTATION=1", + ]
/media/esteban/ACOS/ResurrectionX/external/pdfium/skia/BUILD.gn
96
97
98
99
100
101
102
103
104
105
"//third_party/skia/src/utils", "//third_party/skia/src/lazy", ] if (is_mac || is_ios) { include_dirs += [ "//third_party/skia/include/utils/mac" ] } if (is_mac) { include_dirs += [ "//third_party/skia/include/utils/ios" ] }
+ show +
106
107
108
109
110
defines = [] if (is_component_build) { defines += [ "SKIA_IMPLEMENTATION=1" ] }
+ show +
111
112
113
114
115
116
117
118
119
120
if (current_cpu == "arm") { if (arm_use_neon) { defines += [ "SK_ARM_HAS_NEON" ] } else if (arm_optionally_use_neon) { defines += [ "SK_ARM_HAS_OPTIONAL_NEON" ] } } # Settings for text blitting, chosen to approximate the system browser.

[CVE-2023-40093_1.diff] BUILD.gn #10
- libs = [ "ImageIO.framework" ] - set_sources_assignment_filter([]) - sources += [ - "//third_party/skia/src/ports/SkFontHost_mac.cpp", - "//third_party/skia/src/utils/mac/SkCreateCGImageRef.cpp", - "//third_party/skia/src/utils/mac/SkStream_mac.cpp", - ] - set_sources_assignment_filter(sources_assignment_filter) + frameworks += [ "ImageIO.framework" ]
/media/esteban/ACOS/ResurrectionX/external/pdfium/skia/BUILD.gn
344
345
346
347
348
349
350
351
352
353
} else { sources += [ "//third_party/skia/src/pdf/SkDocument_PDF_None.cpp" ] } if (is_android && !is_debug) { configs -= [ "//build/config/compiler:default_optimization" ] configs += [ "//build/config/compiler:optimize_max" ] } if (is_ios) {
+ show +
354
355
356
357
358
359
360
361
libs = [ "ImageIO.framework" ] set_sources_assignment_filter([]) sources += [ "//third_party/skia/src/ports/SkFontHost_mac.cpp", "//third_party/skia/src/utils/mac/SkCreateCGImageRef.cpp", "//third_party/skia/src/utils/mac/SkStream_mac.cpp", ] set_sources_assignment_filter(sources_assignment_filter)
+ show +
362
363
364
365
366
367
368
369
370
371
# To disable warning "CGContextSelectFont' is deprecated" cflags = [ "-Wno-deprecated-declarations" ] } } # Separated out so it can be compiled with different flags for SSE. if (current_cpu == "x86" || current_cpu == "x64") { source_set("skia_opts_sse3") { sources = skia_opts.ssse3_sources

[CVE-2023-40093_1.diff] fake_file_access.cpp #2
- file_access_wrapper_(pdfium::MakeUnique<FileAccessWrapper>(this)), - file_avail_(pdfium::MakeUnique<FileAvailImpl>(this)), - download_hints_(pdfium::MakeUnique<DownloadHintsImpl>(this)) { - ASSERT(file_access_); + file_access_wrapper_(std::make_unique<FileAccessWrapper>(this)), + file_avail_(std::make_unique<FileAvailImpl>(this)), + download_hints_(std::make_unique<DownloadHintsImpl>(this)) { + DCHECK(file_access_); -FakeFileAccess::~FakeFileAccess() {} +FakeFileAccess::~FakeFileAccess() = default;
/media/esteban/ACOS/ResurrectionX/external/pdfium/testing/fake_file_access.cpp
69
70
71
72
73
74
75
76
77
78
} private: fxcrt::UnownedPtr<FakeFileAccess> simulator_; }; } // namespace FakeFileAccess::FakeFileAccess(FPDF_FILEACCESS* file_access) : file_access_(file_access),
+ show +
79
80
81
82
83
84
85
file_access_wrapper_(pdfium::MakeUnique<FileAccessWrapper>(this)), file_avail_(pdfium::MakeUnique<FileAvailImpl>(this)), download_hints_(pdfium::MakeUnique<DownloadHintsImpl>(this)) { ASSERT(file_access_); } FakeFileAccess::~FakeFileAccess() {}
+ show +
86
87
88
89
90
91
92
93
94
95
FPDF_BOOL FakeFileAccess::IsDataAvail(size_t offset, size_t size) const { return available_data_.Contains(RangeSet::Range(offset, offset + size)); } void FakeFileAccess::AddSegment(size_t offset, size_t size) { requested_data_.Union(RangeSet::Range(offset, offset + size)); } unsigned long FakeFileAccess::GetFileSize() {

[CVE-2023-40093_1.diff] test.gni #3
+ import("//build/config/android/internal_rules.gni") - "//build/config/android:hide_all_but_jni_onload", - ] - configs += [ - "//build/config:executable_config", + configs += [ "//build/config:executable_config" ]
/media/esteban/ACOS/ResurrectionX/external/pdfium/testing/test.gni
46
47
48
49
50
51
52
53
54
55
data_deps = [] forward_variables_from(invoker, "*", _wrapper_script_vars + [ "extra_dist_files" ]) testonly = true # Thanks to the set_defaults() for test(), configs are initialized with # the default shared_library configs rather than executable configs. configs -= [ "//build/config:shared_library_config",
+ show +
56
57
58
59
"//build/config/android:hide_all_but_jni_onload", ] configs += [ "//build/config:executable_config",
+ show +
60
61
62
63
64
65
66
67
68
69
"//build/config/android:hide_all_but_jni", ] # Don't output to the root or else conflict with the group() below. output_name = rebase_path(_exec_output, root_out_dir) if (is_component_build || is_asan) { data_deps += [ "//build/android:cpplib_stripped" ] } }

[CVE-2023-40093_1.diff] cfxjse_formcalc_context.cpp #50
- int32_t iNums = - (int32_t)((log10((float)(nPayment / nPrincipalAmount)) - - log10((float)(nPayment / nPrincipalAmount - nRateOfMonth))) / - log10((float)(1 + nRateOfMonth))); - int32_t iEnd = std::min((int32_t)(nFirstMonth + nNumberOfMonths - 1), iNums); + int32_t iNums = static_cast<int32_t>( + (log10((float)(nPayment / nPrincipalAmount)) - + log10((float)(nPayment / nPrincipalAmount - nRateOfMonth))) / + log10((float)(1 + nRateOfMonth))); + int32_t iEnd = + std::min(static_cast<int32_t>(nFirstMonth + nNumberOfMonths - 1), iNums);
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxjs/cfxjse_formcalc_context.cpp
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
float nPayment = ValueToFloat(pThis, argThree.get()); float nFirstMonth = ValueToFloat(pThis, argFour.get()); float nNumberOfMonths = ValueToFloat(pThis, argFive.get()); if ((nPrincipalAmount <= 0) || (nRate <= 0) || (nPayment <= 0) || (nFirstMonth < 0) || (nNumberOfMonths < 0)) { pContext->ThrowArgumentMismatchException(); return; } float nRateOfMonth = nRate / 12;
+ show +
2382
2383
2384
2385
2386
int32_t iNums = (int32_t)((log10((float)(nPayment / nPrincipalAmount)) - log10((float)(nPayment / nPrincipalAmount - nRateOfMonth))) / log10((float)(1 + nRateOfMonth))); int32_t iEnd = std::min((int32_t)(nFirstMonth + nNumberOfMonths - 1), iNums);
+ show +
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
if (nPayment < nPrincipalAmount * nRateOfMonth) { args.GetReturnValue()->SetFloat(0); return; } int32_t i = 0; for (i = 0; i < nFirstMonth - 1; ++i) nPrincipalAmount -= nPayment - nPrincipalAmount * nRateOfMonth;
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxjs/cfxjse_formcalc_context.cpp
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
float nPayment = ValueToFloat(pThis, argThree.get()); float nFirstMonth = ValueToFloat(pThis, argFour.get()); float nNumberOfMonths = ValueToFloat(pThis, argFive.get()); if ((nPrincipalAmount <= 0) || (nRate <= 0) || (nPayment <= 0) || (nFirstMonth < 0) || (nNumberOfMonths < 0)) { pContext->ThrowArgumentMismatchException(); return; } float nRateOfMonth = nRate / 12;
+ show +
2517
2518
2519
2520
2521
int32_t iNums = (int32_t)((log10((float)(nPayment / nPrincipalAmount)) - log10((float)(nPayment / nPrincipalAmount - nRateOfMonth))) / log10((float)(1 + nRateOfMonth))); int32_t iEnd = std::min((int32_t)(nFirstMonth + nNumberOfMonths - 1), iNums);
+ show +
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
if (nPayment < nPrincipalAmount * nRateOfMonth) { pContext->ThrowArgumentMismatchException(); return; } int32_t i = 0; for (i = 0; i < nFirstMonth - 1; ++i) nPrincipalAmount -= nPayment - nPrincipalAmount * nRateOfMonth; float nTemp = 0;

[CVE-2023-40093_1.diff] cjs_field.cpp #6
- const ByteString& string) { - ASSERT(pFormFillEnv); + const ByteString& bsString) { + DCHECK(pFormFillEnv); - BorderStyle nBorderStyle = BorderStyle::SOLID; - if (string == "solid") - nBorderStyle = BorderStyle::SOLID; - else if (string == "beveled") - nBorderStyle = BorderStyle::BEVELED; - else if (string == "dashed") - nBorderStyle = BorderStyle::DASH; - else if (string == "inset") - nBorderStyle = BorderStyle::INSET; - else if (string == "underline") - nBorderStyle = BorderStyle::UNDERLINE; + BorderStyle nBorderStyle = BorderStyle::kSolid; + if (bsString == "solid") + nBorderStyle = BorderStyle::kSolid; + else if (bsString == "beveled") + nBorderStyle = BorderStyle::kBeveled; + else if (bsString == "dashed") + nBorderStyle = BorderStyle::kDash; + else if (bsString == "inset") + nBorderStyle = BorderStyle::kInset; + else if (bsString == "underline") + nBorderStyle = BorderStyle::kUnderline;
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxjs/cjs_field.cpp
454
455
456
457
458
459
460
461
462
463
} else { Field::SetBorderStyle(m_pFormFillEnv.Get(), m_FieldName, m_nFormControlIndex, byte_str); } return CJS_Return(true); } void Field::SetBorderStyle(CPDFSDK_FormFillEnvironment* pFormFillEnv, const WideString& swFieldName, int nControlIndex,
+ show +
464
465
466
467
468
469
470
471
472
473
474
475
476
477
const ByteString& string) { ASSERT(pFormFillEnv); BorderStyle nBorderStyle = BorderStyle::SOLID; if (string == "solid") nBorderStyle = BorderStyle::SOLID; else if (string == "beveled") nBorderStyle = BorderStyle::BEVELED; else if (string == "dashed") nBorderStyle = BorderStyle::DASH; else if (string == "inset") nBorderStyle = BorderStyle::INSET; else if (string == "underline") nBorderStyle = BorderStyle::UNDERLINE;
+ show +
478
479
480
481
482
483
484
485
486
487
else return; std::vector<CPDF_FormField*> FieldArray = GetFormFields(pFormFillEnv, swFieldName); for (CPDF_FormField* pFormField : FieldArray) { if (nControlIndex < 0) { bool bSet = false; for (int i = 0, sz = pFormField->CountControls(); i < sz; ++i) { if (CPDFSDK_Widget* pWidget =

[CVE-2023-40093_1.diff] cfx_globaldata.h #4
- - void LoadFileBuffer(const wchar_t* sFilePath, - uint8_t*& pBuffer, - int32_t& nLength); - void WriteFileBuffer(const wchar_t* sFilePath, - const char* pBuffer, - int32_t nLength); -
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxjs/cjs_globaldata.h
52
53
54
55
56
57
58
59
60
61
CJS_GlobalData(); ~CJS_GlobalData(); void LoadGlobalPersistentVariables(); void SaveGlobalPersisitentVariables(); CJS_GlobalData_Element* GetGlobalVariable(const ByteString& sPropname); iterator FindGlobalVariable(const ByteString& sPropname); const_iterator FindGlobalVariable(const ByteString& sPropname) const;
+ show +
62
63
64
65
66
67
void LoadFileBuffer(const wchar_t* sFilePath, uint8_t*& pBuffer, int32_t& nLength); void WriteFileBuffer(const wchar_t* sFilePath, const char* pBuffer, int32_t nLength);
+ show +
68
69
70
71
72
73
74
75
76
77
void MakeByteString(const ByteString& name, CJS_KeyValue* pData, CFX_BinaryBuf& sData); size_t m_RefCount; std::vector<std::unique_ptr<CJS_GlobalData_Element>> m_arrayGlobalData; WideString m_sFilePath; }; #endif // FXJS_CJS_GLOBALDATA_H_

[CVE-2023-40093_1.diff] cjx_tree.h #5
+ protected: + explicit CJX_Tree(CXFA_Object* obj); + - void ResolveNodeList(CFXJSE_Value* pValue, - WideString wsExpression, - uint32_t dwFlag, - CXFA_Node* refNode); + v8::Local<v8::Value> ResolveNodeList(v8::Isolate* pIsolate, + WideString wsExpression, + Mask<XFA_ResolveFlag> dwFlag, + CXFA_Node* refNode);
/media/esteban/ACOS/ResurrectionX/external/pdfium/fxjs/xfa/cjx_tree.h
24
25
26
27
28
29
30
31
32
33
JS_PROP(all); JS_PROP(classAll); JS_PROP(classIndex); JS_PROP(index); JS_PROP(name); JS_PROP(nodes); JS_PROP(parent); JS_PROP(somExpression); private:
+ show +
34
35
36
37
void ResolveNodeList(CFXJSE_Value* pValue, WideString wsExpression, uint32_t dwFlag, CXFA_Node* refNode);
+ show +
38
39
40
41
42
static const CJX_MethodSpec MethodSpecs[]; }; #endif // FXJS_XFA_CJX_TREE_H_

[CVE-2023-40093_1.diff] cxfa_texttabstopscontext.h #2
- int32_t m_iTabIndex; - bool m_bTabstops; - float m_fTabWidth; - float m_fLeft; + int32_t m_iTabIndex = -1; + bool m_bHasTabstops = false; + float m_fTabWidth = 0.0f; + float m_fLeft = 0.0f;
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fxfa/cxfa_texttabstopscontext.h
22
23
24
25
26
27
28
29
30
31
class CXFA_TextTabstopsContext { public: CXFA_TextTabstopsContext(); ~CXFA_TextTabstopsContext(); void Append(uint32_t dwAlign, float fTabstops); void RemoveAll(); void Reset();
+ show +
32
33
34
35
int32_t m_iTabIndex; bool m_bTabstops; float m_fTabWidth; float m_fLeft;
+ show +
36
37
38
39
std::vector<XFA_TABSTOPS> m_tabstops; }; #endif // XFA_FXFA_CXFA_TEXTTABSTOPSCONTEXT_H_

[CVE-2023-40093_1.diff] cxfa_ffwidget.cpp #16
-bool CXFA_FFWidget::Undo() { - return false; -} - -bool CXFA_FFWidget::Redo() { - return false; -} -
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fxfa/cxfa_ffwidget.cpp
441
442
443
444
445
446
447
448
449
450
} bool CXFA_FFWidget::CanUndo() { return false; } bool CXFA_FFWidget::CanRedo() { return false; }
+ show +
451
452
453
454
455
456
bool CXFA_FFWidget::Undo() { return false; } bool CXFA_FFWidget::Redo() { return false;
+ show +
457
458
459
460
461
462
463
464
465
466
} bool CXFA_FFWidget::CanCopy() { return false; } bool CXFA_FFWidget::CanCut() { return false; }

[CVE-2023-40093_1.diff] cxfa_ffwidget.cpp #17
-Optional<WideString> CXFA_FFWidget::Copy() { - return {}; +bool CXFA_FFWidget::Undo() { + return false; -Optional<WideString> CXFA_FFWidget::Cut() { - return {}; +bool CXFA_FFWidget::Redo() { + return false; +} + +absl::optional<WideString> CXFA_FFWidget::Copy() { + return absl::nullopt; +} + +absl::optional<WideString> CXFA_FFWidget::Cut() { + return absl::nullopt;
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fxfa/cxfa_ffwidget.cpp
473
474
475
476
477
478
479
480
481
482
} bool CXFA_FFWidget::CanDelete() { return CanCut(); } bool CXFA_FFWidget::CanDeSelect() { return CanCopy(); }
+ show +
483
484
485
486
487
488
Optional<WideString> CXFA_FFWidget::Copy() { return {}; } Optional<WideString> CXFA_FFWidget::Cut() { return {};
+ show +
489
490
491
492
493
494
495
496
497
498
} bool CXFA_FFWidget::Paste(const WideString& wsPaste) { return false; } void CXFA_FFWidget::SelectAll() {} void CXFA_FFWidget::Delete() {}

[CVE-2023-40093_1.diff] fxfa.h #3
-#define XFA_PRINTOPT_ShowDialog 0x00000001 -#define XFA_PRINTOPT_CanCancel 0x00000002 -#define XFA_PRINTOPT_ShrinkPage 0x00000004 -#define XFA_PRINTOPT_AsImage 0x00000008 -#define XFA_PRINTOPT_ReverseOrder 0x00000010 -#define XFA_PRINTOPT_PrintAnnot 0x00000020 - -#define XFA_PAGEVIEWEVENT_PostAdded 1 -#define XFA_PAGEVIEWEVENT_PostRemoved 3 -#define XFA_PAGEVIEWEVENT_StopLayout 4 +enum class XFA_PrintOpt : uint8_t { + kShowDialog = 1 << 0, + kCanCancel = 1 << 1, + kShrinkPage = 1 << 2, + kAsImage = 1 << 3, + kReverseOrder = 1 << 4, + kPrintAnnot = 1 << 5, +};
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fxfa/fxfa.h
39
40
41
42
43
44
45
46
47
48
kXFAFull = 2, kXFAForeground = 3, }; #define XFA_PARSESTATUS_StatusErr -3 #define XFA_PARSESTATUS_StreamErr -2 #define XFA_PARSESTATUS_SyntaxErr -1 #define XFA_PARSESTATUS_Ready 0 #define XFA_PARSESTATUS_Done 100
+ show +
49
50
51
52
53
54
55
56
57
#define XFA_PRINTOPT_ShowDialog 0x00000001 #define XFA_PRINTOPT_CanCancel 0x00000002 #define XFA_PRINTOPT_ShrinkPage 0x00000004 #define XFA_PRINTOPT_AsImage 0x00000008 #define XFA_PRINTOPT_ReverseOrder 0x00000010 #define XFA_PRINTOPT_PrintAnnot 0x00000020 #define XFA_PAGEVIEWEVENT_PostAdded 1 #define XFA_PAGEVIEWEVENT_PostRemoved 3 #define XFA_PAGEVIEWEVENT_StopLayout 4
+ show +
58
59
60
61
62
63
64
65
66
67
#define XFA_EVENTERROR_Success 1 #define XFA_EVENTERROR_Error -1 #define XFA_EVENTERROR_NotExist 0 #define XFA_EVENTERROR_Disabled 2 #define XFA_TRAVERSEWAY_Tranvalse 0x0001 #define XFA_TRAVERSEWAY_Form 0x0002 enum XFA_WidgetStatus {

[CVE-2023-40093_1.diff] cxfa_ffdatetimeedit.h #2
-enum XFA_DATETIMETYPE { - XFA_DATETIMETYPE_Date = 0, - XFA_DATETIMETYPE_Time, - XFA_DATETIMETYPE_DateAndTime -}; -
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fxfa/cxfa_ffdatetimeedit.h
3
4
5
6
7
8
9
10
11
12
// found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef XFA_FXFA_CXFA_FFDATETIMEEDIT_H_ #define XFA_FXFA_CXFA_FFDATETIMEEDIT_H_ #include "core/fxcrt/fx_coordinates.h" #include "xfa/fxfa/cxfa_fftextedit.h"
+ show +
13
14
15
16
17
enum XFA_DATETIMETYPE { XFA_DATETIMETYPE_Date = 0, XFA_DATETIMETYPE_Time, XFA_DATETIMETYPE_DateAndTime };
+ show +
18
19
20
21
22
23
24
25
26
27
class CFWL_Event; class CFWL_Widget; class CXFA_FFDateTimeEdit : public CXFA_FFTextEdit { public: explicit CXFA_FFDateTimeEdit(CXFA_Node* pNode); ~CXFA_FFDateTimeEdit() override; // CXFA_FFTextEdit

[CVE-2023-40093_1.diff] fxfa_basic.h #3
-enum XFA_XDPPACKET { - XFA_XDPPACKET_UNKNOWN = 0, - XFA_XDPPACKET_Config = 1 << static_cast<uint8_t>(XFA_PacketType::Config), - XFA_XDPPACKET_Template = 1 << static_cast<uint8_t>(XFA_PacketType::Template), - XFA_XDPPACKET_Datasets = 1 << static_cast<uint8_t>(XFA_PacketType::Datasets), - XFA_XDPPACKET_Form = 1 << static_cast<uint8_t>(XFA_PacketType::Form), - XFA_XDPPACKET_LocaleSet = 1 - << static_cast<uint8_t>(XFA_PacketType::LocaleSet), - XFA_XDPPACKET_ConnectionSet = - 1 << static_cast<uint8_t>(XFA_PacketType::ConnectionSet), - XFA_XDPPACKET_SourceSet = 1 - << static_cast<uint8_t>(XFA_PacketType::SourceSet), - XFA_XDPPACKET_Xdc = 1 << static_cast<uint8_t>(XFA_PacketType::Xdc), - XFA_XDPPACKET_Pdf = 1 << static_cast<uint8_t>(XFA_PacketType::Pdf), - XFA_XDPPACKET_Xfdf = 1 << static_cast<uint8_t>(XFA_PacketType::Xfdf), - XFA_XDPPACKET_Xmpmeta = 1 << static_cast<uint8_t>(XFA_PacketType::Xmpmeta), - XFA_XDPPACKET_Signature = 1 - << static_cast<uint8_t>(XFA_PacketType::Signature), - XFA_XDPPACKET_Stylesheet = - 1 << static_cast<uint8_t>(XFA_PacketType::Stylesheet), - XFA_XDPPACKET_USER = 1 << static_cast<uint8_t>(XFA_PacketType::User), - XFA_XDPPACKET_XDP = 1 << static_cast<uint8_t>(XFA_PacketType::Xdp) -}; - -enum XFA_XDPPACKET_FLAGS { - XFA_XDPPACKET_FLAGS_COMPLETEMATCH = 1, - XFA_XDPPACKET_FLAGS_PREFIXMATCH = 2, - XFA_XDPPACKET_FLAGS_NOMATCH = 4, - XFA_XDPPACKET_FLAGS_SUPPORTONE = 8, - XFA_XDPPACKET_FLAGS_SUPPORTMANY = 16, +enum class XFA_XDPPACKET { + kUNKNOWN = 0, +#undef PCKT____ +#define PCKT____(a, b, c, d, e, f) \ + k##c = 1 << static_cast<uint8_t>(XFA_PacketType::c), +#include "xfa/fxfa/parser/packets.inc" +#undef PCKT____
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fxfa/fxfa_basic.h
56
57
58
59
60
61
62
63
64
65
Config, LocaleSet, Stylesheet, Template, Signature, Datasets, Form, ConnectionSet, };
+ show +
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
enum XFA_XDPPACKET { XFA_XDPPACKET_UNKNOWN = 0, XFA_XDPPACKET_Config = 1 << static_cast<uint8_t>(XFA_PacketType::Config), XFA_XDPPACKET_Template = 1 << static_cast<uint8_t>(XFA_PacketType::Template), XFA_XDPPACKET_Datasets = 1 << static_cast<uint8_t>(XFA_PacketType::Datasets), XFA_XDPPACKET_Form = 1 << static_cast<uint8_t>(XFA_PacketType::Form), XFA_XDPPACKET_LocaleSet = 1 << static_cast<uint8_t>(XFA_PacketType::LocaleSet), XFA_XDPPACKET_ConnectionSet = 1 << static_cast<uint8_t>(XFA_PacketType::ConnectionSet), XFA_XDPPACKET_SourceSet = 1 << static_cast<uint8_t>(XFA_PacketType::SourceSet), XFA_XDPPACKET_Xdc = 1 << static_cast<uint8_t>(XFA_PacketType::Xdc), XFA_XDPPACKET_Pdf = 1 << static_cast<uint8_t>(XFA_PacketType::Pdf), XFA_XDPPACKET_Xfdf = 1 << static_cast<uint8_t>(XFA_PacketType::Xfdf), XFA_XDPPACKET_Xmpmeta = 1 << static_cast<uint8_t>(XFA_PacketType::Xmpmeta), XFA_XDPPACKET_Signature = 1 << static_cast<uint8_t>(XFA_PacketType::Signature), XFA_XDPPACKET_Stylesheet = 1 << static_cast<uint8_t>(XFA_PacketType::Stylesheet), XFA_XDPPACKET_USER = 1 << static_cast<uint8_t>(XFA_PacketType::User), XFA_XDPPACKET_XDP = 1 << static_cast<uint8_t>(XFA_PacketType::Xdp) }; enum XFA_XDPPACKET_FLAGS { XFA_XDPPACKET_FLAGS_COMPLETEMATCH = 1, XFA_XDPPACKET_FLAGS_PREFIXMATCH = 2, XFA_XDPPACKET_FLAGS_NOMATCH = 4, XFA_XDPPACKET_FLAGS_SUPPORTONE = 8, XFA_XDPPACKET_FLAGS_SUPPORTMANY = 16,
+ show +
96
97
98
99
100
101
102
103
104
105
}; enum class XFA_AttributeEnum : uint32_t { Asterisk, Slash, Backslash, On, Tb, Up, MetaData,

[CVE-2023-40093_1.diff] cxfa_box.cpp #3
+#include <math.h> + +#include "third_party/base/notreached.h" +#include "third_party/base/numerics/safe_conversions.h" +#include "xfa/fgas/graphics/cfgas_gegraphics.h" +#include "xfa/fgas/graphics/cfgas_gepath.h" +#include "xfa/fgas/graphics/cfgas_gepattern.h" +#include "xfa/fgas/graphics/cfgas_geshading.h" -#include "xfa/fxgraphics/cxfa_gepath.h" -#include "xfa/fxgraphics/cxfa_gepattern.h" -#include "xfa/fxgraphics/cxfa_geshading.h" -#include "xfa/fxgraphics/cxfa_graphics.h"
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fxfa/parser/cxfa_box.cpp
10
11
12
13
14
15
16
17
18
19
#include <utility> #include "fxjs/xfa/cjx_object.h" #include "xfa/fxfa/parser/cxfa_corner.h" #include "xfa/fxfa/parser/cxfa_edge.h" #include "xfa/fxfa/parser/cxfa_fill.h" #include "xfa/fxfa/parser/cxfa_margin.h" #include "xfa/fxfa/parser/cxfa_measurement.h" #include "xfa/fxfa/parser/cxfa_node.h" #include "xfa/fxfa/parser/cxfa_rectangle.h"
+ show +
20
21
22
23
#include "xfa/fxgraphics/cxfa_gepath.h" #include "xfa/fxgraphics/cxfa_gepattern.h" #include "xfa/fxgraphics/cxfa_geshading.h" #include "xfa/fxgraphics/cxfa_graphics.h"
+ show +
24
25
26
27
28
29
30
31
32
33
namespace { std::pair<XFA_AttributeEnum, CXFA_Stroke*> Style3D( const std::vector<CXFA_Stroke*>& strokes) { if (strokes.empty()) return {XFA_AttributeEnum::Unknown, nullptr}; CXFA_Stroke* stroke = strokes[0]; for (size_t i = 1; i < strokes.size(); i++) {

[CVE-2023-40093_1.diff] cxfa_margin.h #3
- Optional<float> TryLeftInset() const; - Optional<float> TryTopInset() const; - Optional<float> TryRightInset() const; - Optional<float> TryBottomInset() const; + absl::optional<float> TryLeftInset() const; + absl::optional<float> TryTopInset() const; + absl::optional<float> TryRightInset() const; + absl::optional<float> TryBottomInset() const; + + private: + CXFA_Margin(CXFA_Document* doc, XFA_PacketType packet);
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fxfa/parser/cxfa_margin.h
12
13
14
15
16
17
18
19
20
21
class CXFA_Margin : public CXFA_Node { public: CXFA_Margin(CXFA_Document* doc, XFA_PacketType packet); ~CXFA_Margin() override; float GetLeftInset() const; float GetTopInset() const; float GetRightInset() const; float GetBottomInset() const;
+ show +
22
23
24
25
Optional<float> TryLeftInset() const; Optional<float> TryTopInset() const; Optional<float> TryRightInset() const; Optional<float> TryBottomInset() const;
+ show +
26
27
28
}; #endif // XFA_FXFA_PARSER_CXFA_MARGIN_H_

[CVE-2023-40093_1.diff] cxfa_localemgr.cpp #3
-#define FX_LANG_zh_HK 0x0c04 -#define FX_LANG_zh_CN 0x0804 -#define FX_LANG_zh_TW 0x0404 -#define FX_LANG_nl_NL 0x0413 -#define FX_LANG_en_GB 0x0809 -#define FX_LANG_en_US 0x0409 -#define FX_LANG_fr_FR 0x040c -#define FX_LANG_de_DE 0x0407 -#define FX_LANG_it_IT 0x0410 -#define FX_LANG_ja_JP 0x0411 -#define FX_LANG_ko_KR 0x0412 -#define FX_LANG_pt_BR 0x0416 -#define FX_LANG_ru_RU 0x0419 -#define FX_LANG_es_LA 0x080a -#define FX_LANG_es_ES 0x0c0a -
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fxfa/parser/cxfa_localemgr.cpp
19
20
21
22
23
24
25
26
27
28
#include "third_party/base/ptr_util.h" #include "xfa/fxfa/parser/cxfa_acrobat.h" #include "xfa/fxfa/parser/cxfa_common.h" #include "xfa/fxfa/parser/cxfa_locale.h" #include "xfa/fxfa/parser/cxfa_node.h" #include "xfa/fxfa/parser/cxfa_nodelocale.h" #include "xfa/fxfa/parser/cxfa_present.h" #include "xfa/fxfa/parser/cxfa_xmllocale.h" #include "xfa/fxfa/parser/xfa_utils.h"
+ show +
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#define FX_LANG_zh_HK 0x0c04 #define FX_LANG_zh_CN 0x0804 #define FX_LANG_zh_TW 0x0404 #define FX_LANG_nl_NL 0x0413 #define FX_LANG_en_GB 0x0809 #define FX_LANG_en_US 0x0409 #define FX_LANG_fr_FR 0x040c #define FX_LANG_de_DE 0x0407 #define FX_LANG_it_IT 0x0410 #define FX_LANG_ja_JP 0x0411 #define FX_LANG_ko_KR 0x0412 #define FX_LANG_pt_BR 0x0416 #define FX_LANG_ru_RU 0x0419 #define FX_LANG_es_LA 0x080a #define FX_LANG_es_ES 0x0c0a
+ show +
44
45
46
47
48
49
50
51
52
53
// These arrays are the hex encoded XML strings which define the locale. // <locale name="en_US" desc="English(America)"> // <calendarSymbols name="gregorian"> // <monthNames> // <month>January</month> // <month>February</month> // ... const uint8_t g_enUS_Locale[] = { 0x78, 0x9C, 0x95, 0x56, 0xD1, 0x6E, 0x9B, 0x30, 0x14, 0x7D, 0x9F, 0xB4,

[CVE-2023-40093_1.diff] cxfa_nodeiteratortemplate_unittest.cpp #5
- root_ = pdfium::MakeUnique<Node>(nullptr); - child1_ = pdfium::MakeUnique<Node>(root_.get()); - child2_ = pdfium::MakeUnique<Node>(root_.get()); - child3_ = pdfium::MakeUnique<Node>(child2_.get()); - child4_ = pdfium::MakeUnique<Node>(child3_.get()); - child5_ = pdfium::MakeUnique<Node>(child4_.get()); - child6_ = pdfium::MakeUnique<Node>(child3_.get()); - child7_ = pdfium::MakeUnique<Node>(child2_.get()); - child8_ = pdfium::MakeUnique<Node>(child7_.get()); - child9_ = pdfium::MakeUnique<Node>(child2_.get()); + root_ = std::make_unique<Node>(nullptr); + child1_ = std::make_unique<Node>(root_.get()); + child2_ = std::make_unique<Node>(root_.get()); + child3_ = std::make_unique<Node>(child2_.get()); + child4_ = std::make_unique<Node>(child3_.get()); + child5_ = std::make_unique<Node>(child4_.get()); + child6_ = std::make_unique<Node>(child3_.get()); + child7_ = std::make_unique<Node>(child2_.get()); + child8_ = std::make_unique<Node>(child7_.get()); + child9_ = std::make_unique<Node>(child2_.get());
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fxfa/parser/cxfa_nodeiteratortemplate_unittest.cpp
51
52
53
54
55
56
57
58
59
60
// | // child1--child2 // | // child3------------child7--child9 // | | // child4--child6 child8 // | // child5 // void SetUp() override {
+ show +
61
62
63
64
65
66
67
68
69
70
root_ = pdfium::MakeUnique<Node>(nullptr); child1_ = pdfium::MakeUnique<Node>(root_.get()); child2_ = pdfium::MakeUnique<Node>(root_.get()); child3_ = pdfium::MakeUnique<Node>(child2_.get()); child4_ = pdfium::MakeUnique<Node>(child3_.get()); child5_ = pdfium::MakeUnique<Node>(child4_.get()); child6_ = pdfium::MakeUnique<Node>(child3_.get()); child7_ = pdfium::MakeUnique<Node>(child2_.get()); child8_ = pdfium::MakeUnique<Node>(child7_.get()); child9_ = pdfium::MakeUnique<Node>(child2_.get());
+ show +
71
72
73
74
75
76
77
78
79
80
} Node* root() const { return root_.get(); } Node* child1() const { return child1_.get(); } Node* child2() const { return child2_.get(); } Node* child3() const { return child3_.get(); } Node* child4() const { return child4_.get(); } Node* child5() const { return child5_.get(); } Node* child6() const { return child6_.get(); } Node* child7() const { return child7_.get(); }

[CVE-2023-40093_1.diff] cxfa_nodeiteratortemplate_unittest.cpp #6
- EXPECT_EQ(nullptr, iter.GetRoot()); - EXPECT_EQ(nullptr, iter.GetCurrent()); - EXPECT_EQ(nullptr, iter.MoveToNext()); - EXPECT_EQ(nullptr, iter.MoveToPrev()); - EXPECT_EQ(nullptr, iter.SkipChildrenAndMoveToNext()); + EXPECT_FALSE(iter.GetRoot()); + EXPECT_FALSE(iter.GetCurrent()); + EXPECT_FALSE(iter.MoveToNext()); + EXPECT_FALSE(iter.MoveToPrev()); + EXPECT_FALSE(iter.SkipChildrenAndMoveToNext());
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fxfa/parser/cxfa_nodeiteratortemplate_unittest.cpp
89
90
91
92
93
94
95
96
97
98
std::unique_ptr<Node> child4_; std::unique_ptr<Node> child5_; std::unique_ptr<Node> child6_; std::unique_ptr<Node> child7_; std::unique_ptr<Node> child8_; std::unique_ptr<Node> child9_; }; TEST_F(CXFA_NodeIteratorTemplateTest, Empty) { Iterator iter(nullptr);
+ show +
99
100
101
102
103
EXPECT_EQ(nullptr, iter.GetRoot()); EXPECT_EQ(nullptr, iter.GetCurrent()); EXPECT_EQ(nullptr, iter.MoveToNext()); EXPECT_EQ(nullptr, iter.MoveToPrev()); EXPECT_EQ(nullptr, iter.SkipChildrenAndMoveToNext());
+ show +
104
105
106
107
108
109
110
111
112
113
} TEST_F(CXFA_NodeIteratorTemplateTest, Root) { Iterator iter(root()); EXPECT_EQ(root(), iter.GetRoot()); EXPECT_EQ(root(), iter.GetCurrent()); } TEST_F(CXFA_NodeIteratorTemplateTest, Current) { Iterator iter(root());

[CVE-2023-40093_1.diff] cxfa_nodeiteratortemplate_unittest.cpp #10
- EXPECT_EQ(nullptr, iter.MoveToNext()); - EXPECT_EQ(nullptr, iter.GetCurrent()); + EXPECT_FALSE(iter.MoveToNext()); + EXPECT_FALSE(iter.GetCurrent()); - EXPECT_EQ(nullptr, iter.MoveToNext()); - EXPECT_EQ(nullptr, iter.GetCurrent()); + EXPECT_FALSE(iter.MoveToNext()); + EXPECT_FALSE(iter.GetCurrent());
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fxfa/parser/cxfa_nodeiteratortemplate_unittest.cpp
190
191
192
193
194
195
196
197
198
199
EXPECT_EQ(child7(), iter.MoveToNext()); EXPECT_EQ(child7(), iter.GetCurrent()); EXPECT_EQ(child8(), iter.MoveToNext()); EXPECT_EQ(child8(), iter.GetCurrent()); EXPECT_EQ(child9(), iter.MoveToNext()); EXPECT_EQ(child9(), iter.GetCurrent());
+ show +
200
201
202
203
204
EXPECT_EQ(nullptr, iter.MoveToNext()); EXPECT_EQ(nullptr, iter.GetCurrent()); EXPECT_EQ(nullptr, iter.MoveToNext()); EXPECT_EQ(nullptr, iter.GetCurrent());
+ show +
205
206
207
208
209
210
211
212
213
214
} TEST_F(CXFA_NodeIteratorTemplateTest, SkipChildrenAndMoveToNext) { Iterator iter(root()); iter.SetCurrent(child3()); EXPECT_EQ(child7(), iter.SkipChildrenAndMoveToNext()); EXPECT_EQ(child9(), iter.SkipChildrenAndMoveToNext()); EXPECT_EQ(nullptr, iter.SkipChildrenAndMoveToNext()); }

[CVE-2023-40093_1.diff] cxfa_document.cpp #24
- pDataNode->JSObject()->SetAttributeValue(wsValue, wsValue, false, - false); - pFormNode->JSObject()->SetCData(XFA_Attribute::Value, wsContent, - false, false); + pDataNode->JSObject()->SetAttributeValue(wsValue, wsValue); + pFormNode->JSObject()->SetCData(XFA_Attribute::Value, wsContent);
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
218
219
220
221
222
223
224
225
226
227
if (!pItems) continue; CXFA_Node* pText = pItems->GetFirstChild(); if (!pText) continue; WideString wsContent = pText->JSObject()->GetContent(false); if (wsContent == wsValue) { pChecked = pChild;
+ show +
228
229
230
231
pDataNode->JSObject()->SetAttributeValue(wsValue, wsValue, false, false); pFormNode->JSObject()->SetCData(XFA_Attribute::Value, wsContent, false, false);
+ show +
232
233
234
235
236
237
238
239
240
241
break; } } if (!pChecked) break; pChild = pFormNode->GetFirstChild(); for (; pChild; pChild = pChild->GetNextSibling()) { if (pChild == pChecked) continue;

[CVE-2023-40093_1.diff] xfa_utils.cpp #18
- int32_t iVTType = XFA_VT_NULL; - switch (pValueChild->GetElementType()) { - case XFA_Element::Decimal: - iVTType = XFA_VT_DECIMAL; - break; - case XFA_Element::Float: - iVTType = XFA_VT_FLOAT; - break; - case XFA_Element::Date: - iVTType = XFA_VT_DATE; - break; - case XFA_Element::Time: - iVTType = XFA_VT_TIME; - break; - case XFA_Element::DateTime: - iVTType = XFA_VT_DATETIME; - break; - case XFA_Element::Boolean: - iVTType = XFA_VT_BOOLEAN; - break; - case XFA_Element::Integer: - iVTType = XFA_VT_INTEGER; - break; - case XFA_Element::Text: - iVTType = XFA_VT_TEXT; - break; - default: - iVTType = XFA_VT_NULL; - break; - } - return CXFA_LocaleValue(iVTType, pNode->GetRawValue(), + return CXFA_LocaleValue(XFA_GetLocaleValueType(pValueChild->GetElementType()), + pNode->GetRawValue(), +CXFA_LocaleValue::ValueType XFA_GetLocaleValueType(XFA_Element element) { + switch (element) { + case XFA_Element::Decimal: + return CXFA_LocaleValue::ValueType::kDecimal; + case XFA_Element::Float: + return CXFA_LocaleValue::ValueType::kFloat; + case XFA_Element::Date: + return CXFA_LocaleValue::ValueType::kDate; + case XFA_Element::Time: + return CXFA_LocaleValue::ValueType::kTime; + case XFA_Element::DateTime: + return CXFA_LocaleValue::ValueType::kDateTime; + case XFA_Element::Boolean: + return CXFA_LocaleValue::ValueType::kBoolean; + case XFA_Element::Integer: + return CXFA_LocaleValue::ValueType::kInteger; + case XFA_Element::Text: + return CXFA_LocaleValue::ValueType::kText; + default: + return CXFA_LocaleValue::ValueType::kNull; + } +} +
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fxfa/parser/xfa_utils.cpp
419
420
421
422
423
424
425
426
427
428
CXFA_LocaleValue XFA_GetLocaleValue(CXFA_Node* pNode) { CXFA_Value* pNodeValue = pNode->GetChild<CXFA_Value>(0, XFA_Element::Value, false); if (!pNodeValue) return CXFA_LocaleValue(); CXFA_Node* pValueChild = pNodeValue->GetFirstChild(); if (!pValueChild) return CXFA_LocaleValue();
+ show +
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
int32_t iVTType = XFA_VT_NULL; switch (pValueChild->GetElementType()) { case XFA_Element::Decimal: iVTType = XFA_VT_DECIMAL; break; case XFA_Element::Float: iVTType = XFA_VT_FLOAT; break; case XFA_Element::Date: iVTType = XFA_VT_DATE; break; case XFA_Element::Time: iVTType = XFA_VT_TIME; break; case XFA_Element::DateTime: iVTType = XFA_VT_DATETIME; break; case XFA_Element::Boolean: iVTType = XFA_VT_BOOLEAN; break; case XFA_Element::Integer: iVTType = XFA_VT_INTEGER; break; case XFA_Element::Text: iVTType = XFA_VT_TEXT; break; default: iVTType = XFA_VT_NULL; break; } return CXFA_LocaleValue(iVTType, pNode->GetRawValue(),
+ show +
460
461
462
463
464
465
466
467
468
469
pNode->GetDocument()->GetLocalMgr()); } bool XFA_FDEExtension_ResolveNamespaceQualifier(CFX_XMLElement* pNode, const WideString& wsQualifier, WideString* wsNamespaceURI) { if (!pNode) return false; CFX_XMLNode* pFakeRoot = pNode->GetNodeItem(CFX_XMLNode::Root);

[CVE-2023-40093_1.diff] cxfa_fill.cpp #3
- {XFA_Element::Pattern, 1, XFA_PROPERTYFLAG_OneOf}, - {XFA_Element::Solid, 1, - XFA_PROPERTYFLAG_OneOf | XFA_PROPERTYFLAG_DefaultOneOf}, - {XFA_Element::Stipple, 1, XFA_PROPERTYFLAG_OneOf}, - {XFA_Element::Color, 1, 0}, - {XFA_Element::Linear, 1, XFA_PROPERTYFLAG_OneOf}, - {XFA_Element::Extras, 1, 0}, - {XFA_Element::Radial, 1, XFA_PROPERTYFLAG_OneOf}, + {XFA_Element::Pattern, 1, {XFA_PropertyFlag::kOneOf}}, + {XFA_Element::Solid, + 1, + {XFA_PropertyFlag::kOneOf, XFA_PropertyFlag::kDefaultOneOf}}, + {XFA_Element::Stipple, 1, {XFA_PropertyFlag::kOneOf}}, + {XFA_Element::Color, 1, {}}, + {XFA_Element::Linear, 1, {XFA_PropertyFlag::kOneOf}}, + {XFA_Element::Extras, 1, {}}, + {XFA_Element::Radial, 1, {XFA_PropertyFlag::kOneOf}},
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fxfa/parser/cxfa_fill.cpp
11
12
13
14
15
16
17
18
19
20
#include "xfa/fxfa/parser/cxfa_color.h" #include "xfa/fxfa/parser/cxfa_linear.h" #include "xfa/fxfa/parser/cxfa_node.h" #include "xfa/fxfa/parser/cxfa_pattern.h" #include "xfa/fxfa/parser/cxfa_radial.h" #include "xfa/fxfa/parser/cxfa_stipple.h" namespace { const CXFA_Node::PropertyData kPropertyData[] = {
+ show +
21
22
23
24
25
26
27
28
{XFA_Element::Pattern, 1, XFA_PROPERTYFLAG_OneOf}, {XFA_Element::Solid, 1, XFA_PROPERTYFLAG_OneOf | XFA_PROPERTYFLAG_DefaultOneOf}, {XFA_Element::Stipple, 1, XFA_PROPERTYFLAG_OneOf}, {XFA_Element::Color, 1, 0}, {XFA_Element::Linear, 1, XFA_PROPERTYFLAG_OneOf}, {XFA_Element::Extras, 1, 0}, {XFA_Element::Radial, 1, XFA_PROPERTYFLAG_OneOf},
+ show +
29
30
31
32
33
34
35
36
37
38
{XFA_Element::Unknown, 0, 0}}; const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Presence, XFA_AttributeType::Enum, (void*)XFA_AttributeEnum::Visible}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"fill";

[CVE-2023-40093_1.diff] cxfa_fill.cpp #5
-FX_ARGB CXFA_Fill::GetColor(bool bText) { - CXFA_Color* pColor = GetChild<CXFA_Color>(0, XFA_Element::Color, false); - if (!pColor) - return bText ? 0xFF000000 : 0xFFFFFFFF; - return pColor->GetValueOrDefault(bText ? 0xFF000000 : 0xFFFFFFFF); +FX_ARGB CXFA_Fill::GetFillColor() const { + const auto* pColor = GetChild<CXFA_Color>(0, XFA_Element::Color, false); + return pColor ? pColor->GetValueOrDefault(0xFFFFFFFF) : 0xFFFFFFFF; +} + +FX_ARGB CXFA_Fill::GetTextColor() const { + const auto* pColor = GetChild<CXFA_Color>(0, XFA_Element::Color, false); + return pColor ? pColor->GetValueOrDefault(0xFF000000) : 0xFF000000;
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fxfa/parser/cxfa_fill.cpp
61
62
63
64
65
66
67
68
69
70
void CXFA_Fill::SetColor(FX_ARGB color) { CXFA_Color* pColor = JSObject()->GetOrCreateProperty<CXFA_Color>(0, XFA_Element::Color); if (!pColor) return; pColor->SetValue(color); }
+ show +
71
72
73
74
75
FX_ARGB CXFA_Fill::GetColor(bool bText) { CXFA_Color* pColor = GetChild<CXFA_Color>(0, XFA_Element::Color, false); if (!pColor) return bText ? 0xFF000000 : 0xFFFFFFFF; return pColor->GetValueOrDefault(bText ? 0xFF000000 : 0xFFFFFFFF);
+ show +
76
77
78
79
80
81
82
83
84
85
} XFA_Element CXFA_Fill::GetType() const { CXFA_Node* pChild = GetFirstChild(); while (pChild) { XFA_Element eType = pChild->GetElementType(); if (eType != XFA_Element::Color && eType != XFA_Element::Extras) return eType; pChild = pChild->GetNextSibling();

[CVE-2023-40093_1.diff] cfwl_combobox.cpp #2
-#include <algorithm> -#include <memory> -#include <utility> - -#include "third_party/base/ptr_util.h" +#include "v8/include/cppgc/visitor.h"
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fwl/cfwl_monthcalendar.cpp
1
2
3
4
5
6
7
8
// Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "xfa/fwl/cfwl_monthcalendar.h"
+ show +
9
10
11
12
13
#include <algorithm> #include <memory> #include <utility> #include "third_party/base/ptr_util.h"
+ show +
14
15
16
17
18
19
20
21
22
23
#include "third_party/base/stl_util.h" #include "xfa/fde/cfde_textout.h" #include "xfa/fwl/cfwl_datetimepicker.h" #include "xfa/fwl/cfwl_formproxy.h" #include "xfa/fwl/cfwl_messagemouse.h" #include "xfa/fwl/cfwl_notedriver.h" #include "xfa/fwl/cfwl_themebackground.h" #include "xfa/fwl/cfwl_themetext.h" #include "xfa/fwl/ifwl_themeprovider.h"
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fwl/cfwl_listbox.cpp
1
2
3
4
5
6
7
8
// Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "xfa/fwl/cfwl_listbox.h"
+ show +
9
10
11
12
13
#include <algorithm> #include <memory> #include <utility> #include "third_party/base/ptr_util.h"
+ show +
14
15
16
17
18
19
20
21
22
23
#include "third_party/base/stl_util.h" #include "xfa/fde/cfde_textout.h" #include "xfa/fwl/cfwl_app.h" #include "xfa/fwl/cfwl_messagekey.h" #include "xfa/fwl/cfwl_messagemouse.h" #include "xfa/fwl/cfwl_messagemousewheel.h" #include "xfa/fwl/cfwl_themebackground.h" #include "xfa/fwl/cfwl_themepart.h" #include "xfa/fwl/cfwl_themetext.h" #include "xfa/fwl/ifwl_themeprovider.h"
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fwl/cfwl_combobox.cpp
1
2
3
4
5
6
7
8
// Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "xfa/fwl/cfwl_combobox.h"
+ show +
9
10
11
12
13
#include <algorithm> #include <memory> #include <utility> #include "third_party/base/ptr_util.h"
+ show +
14
15
16
17
18
19
20
21
22
23
#include "xfa/fde/cfde_texteditengine.h" #include "xfa/fde/cfde_textout.h" #include "xfa/fwl/cfwl_app.h" #include "xfa/fwl/cfwl_event.h" #include "xfa/fwl/cfwl_eventselectchanged.h" #include "xfa/fwl/cfwl_eventtextchanged.h" #include "xfa/fwl/cfwl_formproxy.h" #include "xfa/fwl/cfwl_listbox.h" #include "xfa/fwl/cfwl_messagekey.h" #include "xfa/fwl/cfwl_messagekillfocus.h"
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fwl/cfwl_scrollbar.cpp
1
2
3
4
5
6
7
8
// Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "xfa/fwl/cfwl_scrollbar.h"
+ show +
9
10
11
12
13
#include <algorithm> #include <memory> #include <utility> #include "third_party/base/ptr_util.h"
+ show +
14
15
16
17
18
19
20
21
22
23
#include "third_party/base/stl_util.h" #include "xfa/fwl/cfwl_messagemouse.h" #include "xfa/fwl/cfwl_messagemousewheel.h" #include "xfa/fwl/cfwl_notedriver.h" #include "xfa/fwl/cfwl_themebackground.h" #include "xfa/fwl/cfwl_themepart.h" #include "xfa/fwl/cfwl_timerinfo.h" #include "xfa/fwl/ifwl_themeprovider.h" #define FWL_SCROLLBAR_Elapse 500

[CVE-2023-40093_1.diff] fwl_widgetdef.h #2
-#define FWL_WGTSTYLE_OverLapper 0 -#define FWL_WGTSTYLE_Popup (1L << 0) -#define FWL_WGTSTYLE_Child (2L << 0) -#define FWL_WGTSTYLE_WindowTypeMask (3L << 0) -#define FWL_WGTSTYLE_Border (1L << 2) -#define FWL_WGTSTYLE_VScroll (1L << 11) -#define FWL_WGTSTYLE_Group (1L << 22) -#define FWL_WGTSTYLE_NoBackground (1L << 28) +#include <stdint.h> -#define FWL_WGTSTATE_Disabled (1L << 2) -#define FWL_WGTSTATE_Focused (1L << 4) -#define FWL_WGTSTATE_Invisible (1L << 5) -#define FWL_WGTSTATE_MAX (6) - -// Same as enum FWL_VKEYCODE in public/fpdf_fwlevent.h, but duplicated to keep -// xfa/fwl standalone. +// Same as enum FWL_VKEYCODE in public/fpdf_fwlevent.h, but duplicated here +// to keep xfa/fwl standalone.
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fwl/fwl_widgetdef.h
1
2
3
4
5
6
7
8
9
// Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef XFA_FWL_FWL_WIDGETDEF_H_ #define XFA_FWL_FWL_WIDGETDEF_H_
+ show +
10
11
12
13
14
15
16
17
18
19
20
21
22
#define FWL_WGTSTYLE_OverLapper 0 #define FWL_WGTSTYLE_Popup (1L << 0) #define FWL_WGTSTYLE_Child (2L << 0) #define FWL_WGTSTYLE_WindowTypeMask (3L << 0) #define FWL_WGTSTYLE_Border (1L << 2) #define FWL_WGTSTYLE_VScroll (1L << 11) #define FWL_WGTSTYLE_Group (1L << 22) #define FWL_WGTSTYLE_NoBackground (1L << 28) #define FWL_WGTSTATE_Disabled (1L << 2) #define FWL_WGTSTATE_Focused (1L << 4) #define FWL_WGTSTATE_Invisible (1L << 5) #define FWL_WGTSTATE_MAX (6)
+ show +
23
24
25
26
27
28
29
30
31
32
#define FWL_VKEY_LButton 0x01 #define FWL_VKEY_RButton 0x02 #define FWL_VKEY_MButton 0x04 #define FWL_VKEY_Back 0x08 #define FWL_VKEY_Tab 0x09 #define FWL_VKEY_NewLine 0x0A #define FWL_VKEY_Clear 0x0C #define FWL_VKEY_Return 0x0D #define FWL_VKEY_Shift 0x10

[CVE-2023-40093_1.diff] cfwl_scrollbar.h #4
- bool IsVertical() const { - return !!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_SCB_Vert); - } - void DrawTrack(CXFA_Graphics* pGraphics, - IFWL_ThemeProvider* pTheme, - bool bLower, - const CFX_Matrix* pMatrix); - void DrawArrowBtn(CXFA_Graphics* pGraphics, - IFWL_ThemeProvider* pTheme, - bool bMinBtn, - const CFX_Matrix* pMatrix); - void DrawThumb(CXFA_Graphics* pGraphics, - IFWL_ThemeProvider* pTheme, - const CFX_Matrix* pMatrix); + CFWL_ScrollBar(CFWL_App* app, + const Properties& properties, + CFWL_Widget* pOuter); + + bool IsVertical() const { return !!(GetStyleExts() & FWL_STYLEEXT_SCB_Vert); } + void DrawUpperTrack(CFGAS_GEGraphics* pGraphics, const CFX_Matrix& mtMatrix); + void DrawLowerTrack(CFGAS_GEGraphics* pGraphics, const CFX_Matrix& mtMatrix); + void DrawMaxArrowBtn(CFGAS_GEGraphics* pGraphics, const CFX_Matrix& mtMatrix); + void DrawMinArrowBtn(CFGAS_GEGraphics* pGraphics, const CFX_Matrix& mtMatrix); + void DrawThumb(CFGAS_GEGraphics* pGraphics, const CFX_Matrix& mtMatrix);
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fwl/cfwl_scrollbar.h
56
57
58
59
60
61
62
63
64
65
private: class Timer : public CFWL_Timer { public: explicit Timer(CFWL_ScrollBar* pToolTip); ~Timer() override {} void Run(CFWL_TimerInfo* pTimerInfo) override; }; friend class CFWL_ScrollBar::Timer;
+ show +
66
67
68
69
70
71
72
73
74
75
76
77
78
79
bool IsVertical() const { return !!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_SCB_Vert); } void DrawTrack(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, bool bLower, const CFX_Matrix* pMatrix); void DrawArrowBtn(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, bool bMinBtn, const CFX_Matrix* pMatrix); void DrawThumb(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix);
+ show +
80
81
82
83
84
85
86
87
88
89
void Layout(); void CalcButtonLen(); CFX_RectF CalcMinButtonRect(); CFX_RectF CalcMaxButtonRect(); CFX_RectF CalcThumbButtonRect(const CFX_RectF& rtThumbRect); CFX_RectF CalcMinTrackRect(const CFX_RectF& rtMinRect); CFX_RectF CalcMaxTrackRect(const CFX_RectF& rtMaxRect); float GetTrackPointPos(const CFX_PointF& point); bool SendEvent();

[CVE-2023-40093_1.diff] cfwl_messagesetfocus.cpp #2
-#include <memory> - -#include "third_party/base/ptr_util.h" - -CFWL_MessageSetFocus::CFWL_MessageSetFocus(CFWL_Widget* pSrcTarget, - CFWL_Widget* pDstTarget) - : CFWL_Message(CFWL_Message::Type::SetFocus, pSrcTarget, pDstTarget) {} +CFWL_MessageSetFocus::CFWL_MessageSetFocus(CFWL_Widget* pDstTarget) + : CFWL_Message(CFWL_Message::Type::kSetFocus, pDstTarget) {} -
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fwl/cfwl_messagesetfocus.cpp
1
2
3
4
5
6
7
8
// Copyright 2016 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "xfa/fwl/cfwl_messagesetfocus.h"
+ show +
9
10
11
12
13
14
15
#include <memory> #include "third_party/base/ptr_util.h" CFWL_MessageSetFocus::CFWL_MessageSetFocus(CFWL_Widget* pSrcTarget, CFWL_Widget* pDstTarget) : CFWL_Message(CFWL_Message::Type::SetFocus, pSrcTarget, pDstTarget) {}
+ show +
16
17
18
19
20
21
CFWL_MessageSetFocus::~CFWL_MessageSetFocus() {} std::unique_ptr<CFWL_Message> CFWL_MessageSetFocus::Clone() { return pdfium::MakeUnique<CFWL_MessageSetFocus>(*this); }

[CVE-2023-40093_1.diff] cfwl_messagekillfocus.cpp #2
-#include <memory> - -#include "third_party/base/ptr_util.h" - -CFWL_MessageKillFocus::CFWL_MessageKillFocus(CFWL_Widget* pSrcTarget) - : CFWL_MessageKillFocus(pSrcTarget, nullptr) {} - -CFWL_MessageKillFocus::CFWL_MessageKillFocus(CFWL_Widget* pSrcTarget, - CFWL_Widget* pDstTarget) - : CFWL_Message(CFWL_Message::Type::KillFocus, pSrcTarget, pDstTarget) {} +CFWL_MessageKillFocus::CFWL_MessageKillFocus(CFWL_Widget* pDstTarget) + : CFWL_Message(CFWL_Message::Type::kKillFocus, pDstTarget) {}
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fwl/cfwl_messagekillfocus.cpp
1
2
3
4
5
6
7
8
// Copyright 2016 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "xfa/fwl/cfwl_messagekillfocus.h"
+ show +
9
10
11
12
13
14
15
16
17
18
#include <memory> #include "third_party/base/ptr_util.h" CFWL_MessageKillFocus::CFWL_MessageKillFocus(CFWL_Widget* pSrcTarget) : CFWL_MessageKillFocus(pSrcTarget, nullptr) {} CFWL_MessageKillFocus::CFWL_MessageKillFocus(CFWL_Widget* pSrcTarget, CFWL_Widget* pDstTarget) : CFWL_Message(CFWL_Message::Type::KillFocus, pSrcTarget, pDstTarget) {}
+ show +
19
20
21
22
23
24
CFWL_MessageKillFocus::~CFWL_MessageKillFocus() {} std::unique_ptr<CFWL_Message> CFWL_MessageKillFocus::Clone() { return pdfium::MakeUnique<CFWL_MessageKillFocus>(*this); }

[CVE-2023-40093_1.diff] cfwl_edit.cpp #16
- IFWL_ThemeProvider* theme = GetAvailableTheme(); - CFWL_ThemePart part; - part.m_pWidget = this; - - if (!theme) { - m_fFontSize = FWLTHEME_CAPACITY_FontSize; - return; - } + IFWL_ThemeProvider* theme = GetThemeProvider(); + CFWL_ThemePart part(CFWL_ThemePart::Part::kNone, this);
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fwl/cfwl_edit.cpp
616
617
618
619
620
621
622
623
624
625
m_EdtEngine.LimitVerticalScroll( (m_pProperties->m_dwStyles & FWL_WGTSTYLE_VScroll) == 0 && (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_AutoVScroll) == 0); } else { m_EdtEngine.EnableMultiLine(false); m_EdtEngine.EnableLineWrap(false); m_EdtEngine.LimitVerticalScroll(false); } m_EdtEngine.LimitHorizontalScroll(!auto_hscroll);
+ show +
626
627
628
629
630
631
632
IFWL_ThemeProvider* theme = GetAvailableTheme(); CFWL_ThemePart part; part.m_pWidget = this; if (!theme) { m_fFontSize = FWLTHEME_CAPACITY_FontSize; return;
+ show +
633
634
635
636
637
638
639
640
641
642
} m_fFontSize = theme->GetFontSize(&part); RetainPtr<CFGAS_GEFont> pFont = theme->GetFont(&part); if (!pFont) return; m_EdtEngine.SetFont(pFont); m_EdtEngine.SetFontColor(theme->GetTextColor(&part)); m_EdtEngine.SetFontSize(m_fFontSize);

[CVE-2023-40093_1.diff] cfwl_scrollbar.cpp #7
- return CFX_RectF(m_rtClient.left, m_rtMaxBtn.bottom(), m_rtClient.width, - 0); + return CFX_RectF(m_ClientRect.left, m_MaxBtnRect.bottom(), + m_ClientRect.width, 0); - return CFX_RectF(m_rtMaxBtn.right(), m_rtClient.top, 0, m_rtClient.height); + return CFX_RectF(m_MaxBtnRect.right(), m_ClientRect.top, 0, + m_ClientRect.height); - CFX_RectF rtClient = m_rtClient; + CFX_RectF rtClient = m_ClientRect;
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fwl/cfwl_scrollbar.cpp
196
197
198
199
200
201
202
203
204
205
if (m_bMinSize) { rect.left = rtThumb.left; rect.top = rtThumb.top; return rect; } float fRange = m_fRangeMax - m_fRangeMin; if (fRange < 0) { if (IsVertical()) {
+ show +
206
207
208
209
210
211
212
return CFX_RectF(m_rtClient.left, m_rtMaxBtn.bottom(), m_rtClient.width, 0); } return CFX_RectF(m_rtMaxBtn.right(), m_rtClient.top, 0, m_rtClient.height); } CFX_RectF rtClient = m_rtClient;
+ show +
213
214
215
216
217
218
219
220
221
222
float fLength = IsVertical() ? rtClient.height : rtClient.width; float fSize = m_fButtonLen; fLength -= fSize * 2.0f; if (fLength < fSize) fLength = 0.0f; float fThumbSize = fLength * fLength / (fRange + fLength); fThumbSize = std::max(fThumbSize, kMinThumbSize); float fDiff = std::max(fLength - fThumbSize, 0.0f);

[CVE-2023-40093_1.diff] cfwl_scrollbar.cpp #9
- float iy = (m_rtThumb.top + m_rtThumb.bottom()) / 2; - return CFX_RectF(m_rtClient.left, iy, m_rtClient.width, - m_rtClient.bottom() - iy); + float iy = (m_ThumbRect.top + m_ThumbRect.bottom()) / 2; + return CFX_RectF(m_ClientRect.left, iy, m_ClientRect.width, + m_ClientRect.bottom() - iy); - float ix = (m_rtThumb.left + m_rtThumb.right()) / 2; - return CFX_RectF(ix, m_rtClient.top, m_rtClient.height - ix, - m_rtClient.height); + float ix = (m_ThumbRect.left + m_ThumbRect.right()) / 2; + return CFX_RectF(ix, m_ClientRect.top, m_ClientRect.height - ix, + m_ClientRect.height);
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fwl/cfwl_scrollbar.cpp
257
258
259
260
261
262
263
264
265
266
rect.height = m_rtClient.height; } return rect; } CFX_RectF CFWL_ScrollBar::CalcMaxTrackRect(const CFX_RectF& rtMaxRect) { if (m_bMinSize) return CFX_RectF(rtMaxRect.TopLeft(), 0, 0); if (IsVertical()) {
+ show +
267
268
269
270
271
272
273
274
float iy = (m_rtThumb.top + m_rtThumb.bottom()) / 2; return CFX_RectF(m_rtClient.left, iy, m_rtClient.width, m_rtClient.bottom() - iy); } float ix = (m_rtThumb.left + m_rtThumb.right()) / 2; return CFX_RectF(ix, m_rtClient.top, m_rtClient.height - ix, m_rtClient.height);
+ show +
275
276
277
278
279
280
281
282
283
284
} float CFWL_ScrollBar::GetTrackPointPos(const CFX_PointF& point) { CFX_PointF diff = point - m_cpTrackPoint; float fRange = m_fRangeMax - m_fRangeMin; float fPos; if (IsVertical()) { fPos = fRange * diff.y / (m_rtMaxBtn.top - m_rtMinBtn.bottom() - m_rtThumb.height);

[CVE-2023-40093_1.diff] cfwl_widgetmgr.cpp #3
- pItem = pItem->pChild; - while (pItem && pItem->pNext) - pItem = pItem->pNext; - return pItem ? pItem->pWidget : nullptr; -} - -CFWL_Widget* CFWL_WidgetMgr::GetSystemFormWidget(CFWL_Widget* pWidget) const { - Item* pItem = GetWidgetMgrItem(pWidget); - while (pItem) { - if (IsAbleNative(pItem->pWidget)) - return pItem->pWidget; - pItem = pItem->pParent; - } - return nullptr; -} - -void CFWL_WidgetMgr::AppendWidget(CFWL_Widget* pWidget) { - Item* pItem = GetWidgetMgrItem(pWidget); - if (!pItem) - return; - if (!pItem->pParent) - return; - - Item* pChild = pItem->pParent->pChild; - int32_t i = 0; - while (pChild) { - if (pChild == pItem) { - if (pChild->pPrevious) - pChild->pPrevious->pNext = pChild->pNext; - if (pChild->pNext) - pChild->pNext->pPrevious = pChild->pPrevious; - if (pItem->pParent->pChild == pItem) - pItem->pParent->pChild = pItem->pNext; - - pItem->pNext = nullptr; - pItem->pPrevious = nullptr; - break; - } - if (!pChild->pNext) - break; - - pChild = pChild->pNext; - ++i; - } - - pChild = pItem->pParent->pChild; - if (pChild) { - while (pChild->pNext) - pChild = pChild->pNext; - - pChild->pNext = pItem; - pItem->pPrevious = pChild; - } else { - pItem->pParent->pChild = pItem; - pItem->pPrevious = nullptr; - } - pItem->pNext = nullptr; + Item* pChild = pItem->GetLastChild(); + return pChild ? pChild->pWidget : nullptr;
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fwl/cfwl_widgetmgr.cpp
74
75
76
77
78
79
80
81
82
83
CFWL_Widget* CFWL_WidgetMgr::GetFirstChildWidget(CFWL_Widget* pWidget) const { Item* pItem = GetWidgetMgrItem(pWidget); return pItem && pItem->pChild ? pItem->pChild->pWidget : nullptr; } CFWL_Widget* CFWL_WidgetMgr::GetLastChildWidget(CFWL_Widget* pWidget) const { Item* pItem = GetWidgetMgrItem(pWidget); if (!pItem) return nullptr;
+ show +
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
pItem = pItem->pChild; while (pItem && pItem->pNext) pItem = pItem->pNext; return pItem ? pItem->pWidget : nullptr; } CFWL_Widget* CFWL_WidgetMgr::GetSystemFormWidget(CFWL_Widget* pWidget) const { Item* pItem = GetWidgetMgrItem(pWidget); while (pItem) { if (IsAbleNative(pItem->pWidget)) return pItem->pWidget; pItem = pItem->pParent; } return nullptr; } void CFWL_WidgetMgr::AppendWidget(CFWL_Widget* pWidget) { Item* pItem = GetWidgetMgrItem(pWidget); if (!pItem) return; if (!pItem->pParent) return; Item* pChild = pItem->pParent->pChild; int32_t i = 0; while (pChild) { if (pChild == pItem) { if (pChild->pPrevious) pChild->pPrevious->pNext = pChild->pNext; if (pChild->pNext) pChild->pNext->pPrevious = pChild->pPrevious; if (pItem->pParent->pChild == pItem) pItem->pParent->pChild = pItem->pNext; pItem->pNext = nullptr; pItem->pPrevious = nullptr; break; } if (!pChild->pNext) break; pChild = pChild->pNext; ++i; } pChild = pItem->pParent->pChild; if (pChild) { while (pChild->pNext) pChild = pChild->pNext; pChild->pNext = pItem; pItem->pPrevious = pChild; } else { pItem->pParent->pChild = pItem; pItem->pPrevious = nullptr; } pItem->pNext = nullptr;
+ show +
141
142
143
144
145
146
147
148
149
150
} void CFWL_WidgetMgr::RepaintWidget(CFWL_Widget* pWidget, const CFX_RectF& rect) { if (!m_pAdapter) return; CFWL_Widget* pNative = pWidget; CFX_RectF transformedRect = rect; if (IsFormDisabled()) {

[CVE-2023-40093_1.diff] cfwl_pushbuttontp.h #3
- void SetTopLineColor(uint32_t* pData); - void SetLeftLineColor(uint32_t* pData); - void SetRightLineColor(uint32_t* pData); - void SetBottomLineColor(uint32_t* pData); - void SetBackgroudColor(uint32_t* pData); - void SetCaptionColor(uint32_t* pData); - void SetCornerColor(uint32_t* pData); - int32_t GetColorID(uint32_t dwStates) const; + CFWL_PushButtonTP(); + + int32_t GetColorID(Mask<CFWL_PartState> dwStates) const;
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fwl/theme/cfwl_pushbuttontp.h
20
21
22
23
24
25
26
27
28
29
void DrawBackground(CFWL_ThemeBackground* pParams) override; protected: struct PBThemeData { FX_ARGB clrBorder[5]; FX_ARGB clrStart[5]; FX_ARGB clrEnd[5]; FX_ARGB clrFill[5]; };
+ show +
30
31
32
33
34
35
36
37
38
void SetTopLineColor(uint32_t* pData); void SetLeftLineColor(uint32_t* pData); void SetRightLineColor(uint32_t* pData); void SetBottomLineColor(uint32_t* pData); void SetBackgroudColor(uint32_t* pData); void SetCaptionColor(uint32_t* pData); void SetCornerColor(uint32_t* pData); int32_t GetColorID(uint32_t dwStates) const;
+ show +
39
40
41
42
43
44
45
46
std::unique_ptr<PBThemeData> m_pThemeData; private: void SetThemeData(); }; #endif // XFA_FWL_THEME_CFWL_PUSHBUTTONTP_H_

[CVE-2023-40093_1.diff] cfgas_fontmgr.cpp #11
- return x ? x->wBitField : 999; + return x ? x->wBitField : FGAS_FONTUSB::kNoBitField; -inline uint8_t GetUInt8(const uint8_t* p) { - return p[0]; -} - -inline uint16_t GetUInt16(const uint8_t* p) { - return static_cast<uint16_t>(p[0] << 8 | p[1]); +uint16_t ReadUInt16FromSpanAtOffset(pdfium::span<const uint8_t> data, + size_t offset) { + const uint8_t* p = &data[offset]; + return FXSYS_UINT16_GET_MSBFIRST(p);
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fgas/font/cfgas_fontmgr.cpp
334
335
336
337
338
339
340
341
342
343
uint16_t FX_GetCodePageBit(uint16_t wCodePage) { for (size_t i = 0; i < FX_ArraySize(g_CodePages); ++i) { if (g_CodePages[i] == wCodePage) return static_cast<uint16_t>(i); } return static_cast<uint16_t>(-1); } uint16_t FX_GetUnicodeBit(wchar_t wcUnicode) { const FGAS_FONTUSB* x = FGAS_GetUnicodeBitField(wcUnicode);
+ show +
344
345
346
347
348
349
350
351
352
return x ? x->wBitField : 999; } inline uint8_t GetUInt8(const uint8_t* p) { return p[0]; } inline uint16_t GetUInt16(const uint8_t* p) { return static_cast<uint16_t>(p[0] << 8 | p[1]);
+ show +
353
354
355
356
357
358
359
360
361
362
} struct FX_BIT2CHARSET { uint16_t wBit; uint16_t wCharset; }; const FX_BIT2CHARSET g_FX_Bit2Charset[4][16] = { {{1 << 0, FX_CHARSET_ANSI}, {1 << 1, FX_CHARSET_MSWin_EasternEuropean},

[CVE-2023-40093_1.diff] cfgas_fontmgr.cpp #14
- USB[0] = pOS2->ulUnicodeRange1; - USB[1] = pOS2->ulUnicodeRange2; - USB[2] = pOS2->ulUnicodeRange3; - USB[3] = pOS2->ulUnicodeRange4; - CSB[0] = pOS2->ulCodePageRange1; - CSB[1] = pOS2->ulCodePageRange2; + USB[0] = static_cast<uint32_t>(pOS2->ulUnicodeRange1); + USB[1] = static_cast<uint32_t>(pOS2->ulUnicodeRange2); + USB[2] = static_cast<uint32_t>(pOS2->ulUnicodeRange3); + USB[3] = static_cast<uint32_t>(pOS2->ulUnicodeRange4); + CSB[0] = static_cast<uint32_t>(pOS2->ulCodePageRange1); + CSB[1] = static_cast<uint32_t>(pOS2->ulCodePageRange2);
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fgas/font/cfgas_fontmgr.cpp
924
925
926
927
928
929
930
931
932
933
TT_OS2* pOS2 = (TT_OS2*)FT_Get_Sfnt_Table(pFace, ft_sfnt_os2); if (!pOS2) { USB[0] = 0; USB[1] = 0; USB[2] = 0; USB[3] = 0; CSB[0] = 0; CSB[1] = 0; return; }
+ show +
934
935
936
937
938
939
USB[0] = pOS2->ulUnicodeRange1; USB[1] = pOS2->ulUnicodeRange2; USB[2] = pOS2->ulUnicodeRange3; USB[3] = pOS2->ulUnicodeRange4; CSB[0] = pOS2->ulCodePageRange1; CSB[1] = pOS2->ulCodePageRange2;
+ show +
940
941
942
943
944
945
946
947
948
949
} int32_t CFGAS_FontMgr::IsPartName(const WideString& Name1, const WideString& Name2) { if (Name1.Contains(Name2.c_str())) return 1; return 0; } #endif // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_

[CVE-2023-40093_1.diff] cfgas_stringformatter.cpp #15
- FX_TIMEZONE tz = pLocale->GetTimeZone(); - if (tz.tzHour != 0 || tz.tzMinute != 0) { - wsResult += tz.tzHour < 0 ? L"-" : L"+"; - wsResult += - WideString::Format(L"%02d:%02d", abs(tz.tzHour), tz.tzMinute); + int tz_minutes = pLocale->GetTimeZoneInMinutes(); + if (tz_minutes != 0) { + wsResult += tz_minutes < 0 ? L"-" : L"+"; + int abs_tz_minutes = abs(tz_minutes); + wsResult += WideString::Format(L"%02d:%02d", abs_tz_minutes / 60, + abs_tz_minutes % 60);
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fgas/crt/cfgas_formatstring.cpp
674
675
676
677
678
679
680
681
682
683
} else if (symbol == L"S" || symbol == L"SS") { wsResult += NumToString(symbol.GetLength(), second); } else if (symbol == L"FFF") { wsResult += NumToString(3, millisecond); } else if (symbol == L"A") { wsResult += pLocale->GetMeridiemName(!bPM); } else if (symbol == L"Z" || symbol == L"z") { if (symbol == L"Z") wsResult += L"GMT";
+ show +
684
685
686
687
688
FX_TIMEZONE tz = pLocale->GetTimeZone(); if (tz.tzHour != 0 || tz.tzMinute != 0) { wsResult += tz.tzHour < 0 ? L"-" : L"+"; wsResult += WideString::Format(L"%02d:%02d", abs(tz.tzHour), tz.tzMinute);
+ show +
689
690
691
692
693
694
695
696
697
698
} } } return wsResult; } WideString FormatDateTimeInternal(const CFX_DateTime& dt, const WideString& wsDatePattern, const WideString& wsTimePattern, bool bDateFirst,

[CVE-2023-40093_1.diff] cfgas_stringformatter.cpp #19
- uint32_t dwHash = FX_HashCode_GetW(wsCategory.AsStringView(), false); - if (dwHash == FX_LOCALECATEGORY_DateTimeHash) - return FX_LOCALECATEGORY_DateTime; - if (dwHash == FX_LOCALECATEGORY_TextHash) - return FX_LOCALECATEGORY_Text; - if (dwHash == FX_LOCALECATEGORY_NumHash) - return FX_LOCALECATEGORY_Num; - if (dwHash == FX_LOCALECATEGORY_ZeroHash) - return FX_LOCALECATEGORY_Zero; - if (dwHash == FX_LOCALECATEGORY_NullHash) - return FX_LOCALECATEGORY_Null; - if (dwHash == FX_LOCALECATEGORY_DateHash) { - if (eCategory == FX_LOCALECATEGORY_Time) - return FX_LOCALECATEGORY_DateTime; - eCategory = FX_LOCALECATEGORY_Date; - } else if (dwHash == FX_LOCALECATEGORY_TimeHash) { - if (eCategory == FX_LOCALECATEGORY_Date) - return FX_LOCALECATEGORY_DateTime; - eCategory = FX_LOCALECATEGORY_Time; + if (wsCategory == kDateTimeStr) + return Category::kDateTime; + if (wsCategory == kTextStr) + return Category::kText; + if (wsCategory == kNumStr) + return Category::kNum; + if (wsCategory == kZeroStr) + return Category::kZero; + if (wsCategory == kNullStr) + return Category::kNull; + if (wsCategory == kDateStr) { + if (eCategory == Category::kTime) + return Category::kDateTime; + eCategory = Category::kDate; + } else if (wsCategory == kTimeStr) { + if (eCategory == Category::kDate) + return Category::kDateTime; + eCategory = Category::kTime;
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fgas/crt/cfgas_formatstring.cpp
878
879
880
881
882
883
884
885
886
887
if (pStr[ccf] == '.' || pStr[ccf] == '(') break; if (pStr[ccf] == '{') { bBraceOpen = true; break; } wsCategory += pStr[ccf]; ccf++; }
+ show +
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
uint32_t dwHash = FX_HashCode_GetW(wsCategory.AsStringView(), false); if (dwHash == FX_LOCALECATEGORY_DateTimeHash) return FX_LOCALECATEGORY_DateTime; if (dwHash == FX_LOCALECATEGORY_TextHash) return FX_LOCALECATEGORY_Text; if (dwHash == FX_LOCALECATEGORY_NumHash) return FX_LOCALECATEGORY_Num; if (dwHash == FX_LOCALECATEGORY_ZeroHash) return FX_LOCALECATEGORY_Zero; if (dwHash == FX_LOCALECATEGORY_NullHash) return FX_LOCALECATEGORY_Null; if (dwHash == FX_LOCALECATEGORY_DateHash) { if (eCategory == FX_LOCALECATEGORY_Time) return FX_LOCALECATEGORY_DateTime; eCategory = FX_LOCALECATEGORY_Date; } else if (dwHash == FX_LOCALECATEGORY_TimeHash) { if (eCategory == FX_LOCALECATEGORY_Date) return FX_LOCALECATEGORY_DateTime; eCategory = FX_LOCALECATEGORY_Time;
+ show +
907
908
909
910
911
912
913
914
915
916
} } else if (pStr[ccf] == '}') { bBraceOpen = false; } ccf++; } return eCategory; } WideString CFGAS_FormatString::GetTextFormat(const WideString& wsPattern,

[CVE-2023-40093_1.diff] cfde_texteditengine.cpp #6
-CFDE_TextEditEngine::CFDE_TextEditEngine() - : font_color_(0xff000000), - font_size_(10.0f), - line_spacing_(10.0f), - text_length_(0), - gap_position_(0), - gap_size_(kGapSize), - available_width_(kPageWidthMax), - character_limit_(std::numeric_limits<size_t>::max()), - visible_line_count_(1), - next_operation_index_to_undo_(kMaxEditOperations - 1), - next_operation_index_to_insert_(0), - max_edit_operations_(kMaxEditOperations), - character_alignment_(CFX_TxtLineAlignment_Left), - has_character_limit_(false), - is_comb_text_(false), - is_dirty_(false), - validation_enabled_(false), - is_multiline_(false), - is_linewrap_enabled_(false), - limit_horizontal_area_(false), - limit_vertical_area_(false), - password_mode_(false), - password_alias_(L'*'), - has_selection_(false), - selection_({0, 0}) { +CFDE_TextEditEngine::CFDE_TextEditEngine() {
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fde/cfde_texteditengine.cpp
125
126
127
128
129
130
131
132
133
134
return 0; } bool BreakFlagsChanged(int flags, WordBreakProperty previous) { return (flags != 1 || previous != WordBreakProperty::kALetter) && (flags != 2 || previous != WordBreakProperty::kNumeric); } } // namespace
+ show +
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
CFDE_TextEditEngine::CFDE_TextEditEngine() : font_color_(0xff000000), font_size_(10.0f), line_spacing_(10.0f), text_length_(0), gap_position_(0), gap_size_(kGapSize), available_width_(kPageWidthMax), character_limit_(std::numeric_limits<size_t>::max()), visible_line_count_(1), next_operation_index_to_undo_(kMaxEditOperations - 1), next_operation_index_to_insert_(0), max_edit_operations_(kMaxEditOperations), character_alignment_(CFX_TxtLineAlignment_Left), has_character_limit_(false), is_comb_text_(false), is_dirty_(false), validation_enabled_(false), is_multiline_(false), is_linewrap_enabled_(false), limit_horizontal_area_(false), limit_vertical_area_(false), password_mode_(false), password_alias_(L'*'), has_selection_(false), selection_({0, 0}) {
+ show +
161
162
163
164
165
166
167
168
169
170
content_.resize(gap_size_); operation_buffer_.resize(max_edit_operations_); text_break_.SetFontSize(font_size_); text_break_.SetLineBreakTolerance(2.0f); text_break_.SetTabWidth(36); } CFDE_TextEditEngine::~CFDE_TextEditEngine() {}

[CVE-2023-40093_1.diff] cfde_texteditengine.cpp #12
-size_t CFDE_TextEditEngine::GetIndexBefore(size_t pos) { - int32_t bidi_level; - CFX_RectF rect; - // Possible |Layout| triggered by |GetCharacterInfo|. - std::tie(bidi_level, rect) = GetCharacterInfo(pos); - return FX_IsOdd(bidi_level) ? GetIndexRight(pos) : GetIndexLeft(pos); -} -
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fde/cfde_texteditengine.cpp
388
389
390
391
392
393
394
395
396
397
} void CFDE_TextEditEngine::ClearOperationRecords() { for (auto& record : operation_buffer_) record.reset(); next_operation_index_to_undo_ = max_edit_operations_ - 1; next_operation_index_to_insert_ = 0; }
+ show +
398
399
400
401
402
403
size_t CFDE_TextEditEngine::GetIndexBefore(size_t pos) { int32_t bidi_level; CFX_RectF rect; // Possible |Layout| triggered by |GetCharacterInfo|. std::tie(bidi_level, rect) = GetCharacterInfo(pos); return FX_IsOdd(bidi_level) ? GetIndexRight(pos) : GetIndexLeft(pos);
+ show +
404
405
406
407
408
409
410
411
412
413
} size_t CFDE_TextEditEngine::GetIndexLeft(size_t pos) const { if (pos == 0) return 0; --pos; wchar_t ch = GetChar(pos); while (pos != 0) { // We want to be on the location just before the \r or \n

[CVE-2023-40093_1.diff] cfde_texteditengine.cpp #27
- if (static_cast<size_t>(nIndex) >= engine_->GetLength()) - current_position_ = engine_->GetLength(); - else - current_position_ = nIndex; + nIndex = std::min(nIndex, engine_->GetLength()); + current_position_ = pdfium::base::checked_cast<int32_t>(nIndex);
/media/esteban/ACOS/ResurrectionX/external/pdfium/xfa/fde/cfde_texteditengine.cpp
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
--current_position_; else ++current_position_; } wchar_t CFDE_TextEditEngine::Iterator::GetChar() const { return engine_->GetChar(current_position_); } void CFDE_TextEditEngine::Iterator::SetAt(size_t nIndex) {
+ show +
1151
1152
1153
1154
if (static_cast<size_t>(nIndex) >= engine_->GetLength()) current_position_ = engine_->GetLength(); else current_position_ = nIndex;
+ show +
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
} bool CFDE_TextEditEngine::Iterator::IsEOF(bool bPrev) const { return bPrev ? current_position_ == -1 : current_position_ > -1 && static_cast<size_t>(current_position_) == engine_->GetLength(); } size_t CFDE_TextEditEngine::Iterator::FindNextBreakPos(bool bPrev) {

[CVE-2023-40093_1.diff] BUILD.gn #2
- config("fx_freetype_warnings") { - visibility = [ ":*" ] - if (is_clang) { - # open_face_PS_from_sfnt_stream() and open_face_from_buffer() in - # ftbase.h are unused. - # - # ttgload.c casts from unsigned int to unsigned long to void*. - cflags = [ - "-Wno-unused-function", - "-Wno-int-to-void-pointer-cast", - ] - } - } -
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/BUILD.gn
36
37
38
39
40
41
42
43
44
45
"bigint/BigIntegerUtils.hh", "bigint/BigUnsigned.cc", "bigint/BigUnsigned.hh", "bigint/BigUnsignedInABase.cc", "bigint/BigUnsignedInABase.hh", "bigint/NumberlikeArray.hh", ] } if (pdf_bundle_freetype) {
+ show +
46
47
48
49
50
51
52
53
54
55
56
57
58
config("fx_freetype_warnings") { visibility = [ ":*" ] if (is_clang) { # open_face_PS_from_sfnt_stream() and open_face_from_buffer() in # ftbase.h are unused. # # ttgload.c casts from unsigned int to unsigned long to void*. cflags = [ "-Wno-unused-function", "-Wno-int-to-void-pointer-cast", ] } }
+ show +
59
60
61
62
63
64
65
66
67
68
config("freetype_public_includes_config") { # The relative freetype/include path points to PDFium's custom config. # The absolute path points to whatever copy of FreeType is in # //third_party/freetype. include_dirs = [ "freetype/include", "//third_party/freetype/src/include", ] defines = [

[CVE-2023-40093_1.diff] BUILD.gn #9
- "libopenjpeg20/bio.c", - "libopenjpeg20/cio.c", - "libopenjpeg20/dwt.c", - "libopenjpeg20/event.c", - "libopenjpeg20/function_list.c", - "libopenjpeg20/image.c", - "libopenjpeg20/invert.c", - "libopenjpeg20/j2k.c", - "libopenjpeg20/jp2.c", - "libopenjpeg20/mct.c", - "libopenjpeg20/mqc.c", - "libopenjpeg20/openjpeg.c", - "libopenjpeg20/opj_clock.c", - "libopenjpeg20/pi.c", - "libopenjpeg20/sparse_array.c", - "libopenjpeg20/sparse_array.h", - "libopenjpeg20/t1.c", - "libopenjpeg20/t2.c", - "libopenjpeg20/tcd.c", - "libopenjpeg20/tgt.c", - "libopenjpeg20/thread.c", + "libopenjpeg/bio.c", + "libopenjpeg/cio.c", + "libopenjpeg/dwt.c", + "libopenjpeg/event.c", + "libopenjpeg/function_list.c", + "libopenjpeg/ht_dec.c", + "libopenjpeg/image.c", + "libopenjpeg/invert.c", + "libopenjpeg/j2k.c", + "libopenjpeg/jp2.c", + "libopenjpeg/mct.c", + "libopenjpeg/mqc.c", + "libopenjpeg/openjpeg.c", + + # NOTE: libopenjpeg/opj_clock.c is not used. + "libopenjpeg/opj_malloc.cc", + "libopenjpeg/opj_malloc.h", + "libopenjpeg/pi.c", + "libopenjpeg/sparse_array.c", + "libopenjpeg/sparse_array.h", + "libopenjpeg/t1.c", + "libopenjpeg/t1_ht_luts.h", + "libopenjpeg/t2.c", + "libopenjpeg/tcd.c", + "libopenjpeg/tgt.c", + "libopenjpeg/thread.c", + deps = [ "../core/fxcrt" ]
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/BUILD.gn
370
371
372
373
374
375
376
377
378
379
static_library("fx_libopenjpeg") { configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code", ":pdfium_third_party_config", # Must be after no_chromium_code for warning flags to be ordered correctly. ":fx_libopenjpeg_warnings", ] sources = [
+ show +
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
"libopenjpeg20/bio.c", "libopenjpeg20/cio.c", "libopenjpeg20/dwt.c", "libopenjpeg20/event.c", "libopenjpeg20/function_list.c", "libopenjpeg20/image.c", "libopenjpeg20/invert.c", "libopenjpeg20/j2k.c", "libopenjpeg20/jp2.c", "libopenjpeg20/mct.c", "libopenjpeg20/mqc.c", "libopenjpeg20/openjpeg.c", "libopenjpeg20/opj_clock.c", "libopenjpeg20/pi.c", "libopenjpeg20/sparse_array.c", "libopenjpeg20/sparse_array.h", "libopenjpeg20/t1.c", "libopenjpeg20/t2.c", "libopenjpeg20/tcd.c", "libopenjpeg20/tgt.c", "libopenjpeg20/thread.c",
+ show +
401
402
403
404
405
406
407
408
409
410
] } config("system_libpng_config") { libs = [ "png" ] defines = [ "USE_SYSTEM_LIBPNG" ] } group("png") { if (use_system_libpng) {

[CVE-2023-40093_1.diff] BUILD.gn #12
- configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ - "//build/config/compiler:no_chromium_code", - ":pdfium_third_party_config", - ] + configs += [ + "../:pdfium_strict_config", + "../:pdfium_noshorten_config", + ] -
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/BUILD.gn
16
17
18
19
20
21
22
23
24
25
if (pdf_bundle_freetype) { deps += [ ":fx_freetype" ] } } config("pdfium_third_party_config") { configs = [ "..:pdfium_common_config" ] } static_library("bigint") {
+ show +
26
27
28
29
30
configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code", ":pdfium_third_party_config", ]
+ show +
31
32
33
34
35
36
37
38
39
40
sources = [ "bigint/BigInteger.cc", "bigint/BigInteger.hh", "bigint/BigIntegerLibrary.hh", "bigint/BigIntegerUtils.cc", "bigint/BigIntegerUtils.hh", "bigint/BigUnsigned.cc", "bigint/BigUnsigned.hh", "bigint/BigUnsignedInABase.cc", "bigint/BigUnsignedInABase.hh",
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/BUILD.gn
410
411
412
413
414
415
416
417
418
419
if (use_system_libpng) { public_configs = [ ":system_libpng_config" ] } else { public_deps = [ ":fx_lpng", ] } } jumbo_static_library("fx_lpng") {
+ show +
420
421
422
423
424
configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code", ":pdfium_third_party_config", ]
+ show +
425
426
427
428
429
430
431
432
433
434
sources = [ "libpng16/png.c", "libpng16/png.h", "libpng16/pngconf.h", "libpng16/pngdebug.h", "libpng16/pngerror.c", "libpng16/pngget.c", "libpng16/pnginfo.h", "libpng16/pnglibconf.h", "libpng16/pngmem.c",
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/BUILD.gn
472
473
474
475
476
477
478
479
480
481
} if (is_win) { # Unary minus applied to unsigned type. cflags += [ "/wd4146" ] } } if (pdf_enable_xfa) { static_library("fx_tiff") {
+ show +
482
483
484
485
486
configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code", ":pdfium_third_party_config", ]
+ show +
487
488
489
490
491
492
493
494
495
496
if (is_win) { # Need to undefine the macro since it is redefined in # tif_ojpeg.c and tif_jpeg.c. configs -= [ "//build/config/win:lean_and_mean" ] } deps = [ ":zlib", "//third_party:jpeg", ] sources = [
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/BUILD.gn
529
530
531
532
533
534
535
536
537
538
"libtiff/tif_warning.c", "libtiff/tif_write.c", "libtiff/tif_zip.c", "libtiff/tiffiop.h", "libtiff/tiffvers.h", ] } } jumbo_source_set("pdfium_base") {
+ show +
539
540
541
542
543
configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code", ":pdfium_third_party_config", ]
+ show +
544
545
546
547
548
549
550
551
552
553
sources = [ "base/allocator/partition_allocator/address_space_randomization.cc", "base/allocator/partition_allocator/address_space_randomization.h", "base/allocator/partition_allocator/oom.h", "base/allocator/partition_allocator/page_allocator.cc", "base/allocator/partition_allocator/page_allocator.h", "base/allocator/partition_allocator/partition_alloc.cc", "base/allocator/partition_allocator/partition_alloc.h", "base/allocator/partition_allocator/spin_lock.cc", "base/allocator/partition_allocator/spin_lock.h",

[CVE-2023-40093_1.diff] BUILD.gn #13
- configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ - "//build/config/compiler:no_chromium_code", - ":pdfium_third_party_config", - ] + configs += [ + "../:pdfium_strict_config", + "../:pdfium_noshorten_config", + ]
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/BUILD.gn
16
17
18
19
20
21
22
23
24
25
if (pdf_bundle_freetype) { deps += [ ":fx_freetype" ] } } config("pdfium_third_party_config") { configs = [ "..:pdfium_common_config" ] } static_library("bigint") {
+ show +
26
27
28
29
30
configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code", ":pdfium_third_party_config", ]
+ show +
31
32
33
34
35
36
37
38
39
40
sources = [ "bigint/BigInteger.cc", "bigint/BigInteger.hh", "bigint/BigIntegerLibrary.hh", "bigint/BigIntegerUtils.cc", "bigint/BigIntegerUtils.hh", "bigint/BigUnsigned.cc", "bigint/BigUnsigned.hh", "bigint/BigUnsignedInABase.cc", "bigint/BigUnsignedInABase.hh",
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/BUILD.gn
410
411
412
413
414
415
416
417
418
419
if (use_system_libpng) { public_configs = [ ":system_libpng_config" ] } else { public_deps = [ ":fx_lpng", ] } } jumbo_static_library("fx_lpng") {
+ show +
420
421
422
423
424
configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code", ":pdfium_third_party_config", ]
+ show +
425
426
427
428
429
430
431
432
433
434
sources = [ "libpng16/png.c", "libpng16/png.h", "libpng16/pngconf.h", "libpng16/pngdebug.h", "libpng16/pngerror.c", "libpng16/pngget.c", "libpng16/pnginfo.h", "libpng16/pnglibconf.h", "libpng16/pngmem.c",
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/BUILD.gn
472
473
474
475
476
477
478
479
480
481
} if (is_win) { # Unary minus applied to unsigned type. cflags += [ "/wd4146" ] } } if (pdf_enable_xfa) { static_library("fx_tiff") {
+ show +
482
483
484
485
486
configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code", ":pdfium_third_party_config", ]
+ show +
487
488
489
490
491
492
493
494
495
496
if (is_win) { # Need to undefine the macro since it is redefined in # tif_ojpeg.c and tif_jpeg.c. configs -= [ "//build/config/win:lean_and_mean" ] } deps = [ ":zlib", "//third_party:jpeg", ] sources = [
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/BUILD.gn
529
530
531
532
533
534
535
536
537
538
"libtiff/tif_warning.c", "libtiff/tif_write.c", "libtiff/tif_zip.c", "libtiff/tiffiop.h", "libtiff/tiffvers.h", ] } } jumbo_source_set("pdfium_base") {
+ show +
539
540
541
542
543
configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code", ":pdfium_third_party_config", ]
+ show +
544
545
546
547
548
549
550
551
552
553
sources = [ "base/allocator/partition_allocator/address_space_randomization.cc", "base/allocator/partition_allocator/address_space_randomization.h", "base/allocator/partition_allocator/oom.h", "base/allocator/partition_allocator/page_allocator.cc", "base/allocator/partition_allocator/page_allocator.h", "base/allocator/partition_allocator/partition_alloc.cc", "base/allocator/partition_allocator/partition_alloc.h", "base/allocator/partition_allocator/spin_lock.cc", "base/allocator/partition_allocator/spin_lock.h",

[CVE-2023-40093_1.diff] tif_strip.c #4
-uint32 -TIFFDefaultStripSize(TIFF* tif, uint32 request) +uint32_t TIFFDefaultStripSize(TIFF *tif, uint32_t request) - return (*tif->tif_defstripsize)(tif, request); + return (*tif->tif_defstripsize)(tif, request); -uint32 -_TIFFDefaultStripSize(TIFF* tif, uint32 s) +uint32_t _TIFFDefaultStripSize(TIFF *tif, uint32_t s) - if ((int32) s < 1) { - /* - * If RowsPerStrip is unspecified, try to break the - * image up into strips that are approximately - * STRIP_SIZE_DEFAULT bytes long. - */ - uint64 scanlinesize; - uint64 rows; - scanlinesize=TIFFScanlineSize64(tif); - if (scanlinesize==0) - scanlinesize=1; - rows=(uint64)STRIP_SIZE_DEFAULT/scanlinesize; - if (rows==0) - rows=1; - else if (rows>0xFFFFFFFF) - rows=0xFFFFFFFF; - s=(uint32)rows; - } - return (s); + if ((int32_t)s < 1) + { + /* + * If RowsPerStrip is unspecified, try to break the + * image up into strips that are approximately + * STRIP_SIZE_DEFAULT bytes long. + */ + uint64_t scanlinesize; + uint64_t rows; + scanlinesize = TIFFScanlineSize64(tif); + if (scanlinesize == 0) + scanlinesize = 1; + rows = (uint64_t)STRIP_SIZE_DEFAULT / scanlinesize; + if (rows == 0) + rows = 1; + else if (rows > 0xFFFFFFFF) + rows = 0xFFFFFFFF; + s = (uint32_t)rows; + } + return (s);
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/libtiff/tif_strip.c
223
224
225
226
227
228
229
230
231
232
} return(n); } /* * Compute a default strip size based on the image * characteristics and a requested value. If the * request is <1 then we choose a strip size according * to certain heuristics. */
+ show +
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
uint32 TIFFDefaultStripSize(TIFF* tif, uint32 request) { return (*tif->tif_defstripsize)(tif, request); } uint32 _TIFFDefaultStripSize(TIFF* tif, uint32 s) { if ((int32) s < 1) { /* * If RowsPerStrip is unspecified, try to break the * image up into strips that are approximately * STRIP_SIZE_DEFAULT bytes long. */ uint64 scanlinesize; uint64 rows; scanlinesize=TIFFScanlineSize64(tif); if (scanlinesize==0) scanlinesize=1; rows=(uint64)STRIP_SIZE_DEFAULT/scanlinesize; if (rows==0) rows=1; else if (rows>0xFFFFFFFF) rows=0xFFFFFFFF; s=(uint32)rows; } return (s);
+ show +
261
262
263
264
265
266
267
268
269
270
} /* * Return the number of bytes to read/write in a call to * one of the scanline-oriented i/o routines. Note that * this number may be 1/samples-per-pixel if data is * stored as separate planes. * The ScanlineSize in case of YCbCrSubsampling is defined as the * strip size divided by the strip height, i.e. the size of a pack of vertical * subsampling lines divided by vertical subsampling. It should thus make

[CVE-2023-40093_1.diff] tif_fax3.h #6
-#define SYNC_EOL(eoflab) do { \ - if (EOLcnt == 0) { \ - for (;;) { \ - NeedBits16(11,eoflab); \ - if (GetBits(11) == 0) \ - break; \ - ClrBits(1); \ - } \ - } \ - for (;;) { \ - NeedBits8(8,eoflab); \ - if (GetBits(8)) \ - break; \ - ClrBits(8); \ - } \ - while (GetBits(1) == 0) \ - ClrBits(1); \ - ClrBits(1); /* EOL bit */ \ - EOLcnt = 0; /* reset EOL counter/flag */ \ -} while (0) +#define SYNC_EOL(eoflab) \ + do \ + { \ + if (EOLcnt == 0) \ + { \ + for (;;) \ + { \ + NeedBits16(11, eoflab); \ + if (GetBits(11) == 0) \ + break; \ + ClrBits(1); \ + } \ + } \ + for (;;) \ + { \ + NeedBits8(8, eoflab); \ + if (GetBits(8)) \ + break; \ + ClrBits(8); \ + } \ + while (GetBits(1) == 0) \ + ClrBits(1); \ + ClrBits(1); /* EOL bit */ \ + EOLcnt = 0; /* reset EOL counter/flag */ \ + } while (0) -#define CLEANUP_RUNS() do { \ - if (RunLength) \ - SETVALUE(0); \ - if (a0 != lastx) { \ - badlength(a0, lastx); \ - while (a0 > lastx && pa > thisrun) \ - a0 -= *--pa; \ - if (a0 < lastx) { \ - if (a0 < 0) \ - a0 = 0; \ - if ((pa-thisrun)&1) \ - SETVALUE(0); \ - SETVALUE(lastx - a0); \ - } else if (a0 > lastx) { \ - SETVALUE(lastx); \ - SETVALUE(0); \ - } \ - } \ -} while (0) +#define CLEANUP_RUNS() \ + do \ + { \ + if (RunLength) \ + SETVALUE(0); \ + if (a0 != lastx) \ + { \ + badlength(a0, lastx); \ + while (a0 > lastx && pa > thisrun) \ + a0 -= *--pa; \ + if (a0 < lastx) \ + { \ + if (a0 < 0) \ + a0 = 0; \ + if ((pa - thisrun) & 1) \ + SETVALUE(0); \ + SETVALUE(lastx - a0); \ + } \ + else if (a0 > lastx) \ + { \ + SETVALUE(lastx); \ + SETVALUE(0); \ + } \ + } \ + } while (0)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/libtiff/tif_fax3.h
251
252
253
254
255
256
257
258
259
260
/* * Synchronize input decoding at the start of each * row by scanning for an EOL (if appropriate) and * skipping any trash data that might be present * after a decoding error. Note that the decoding * done elsewhere that recognizes an EOL only consumes * 11 consecutive zero bits. This means that if EOLcnt * is non-zero then we still need to scan for the final flag * bit that is part of the EOL code. */
+ show +
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
#define SYNC_EOL(eoflab) do { \ if (EOLcnt == 0) { \ for (;;) { \ NeedBits16(11,eoflab); \ if (GetBits(11) == 0) \ break; \ ClrBits(1); \ } \ } \ for (;;) { \ NeedBits8(8,eoflab); \ if (GetBits(8)) \ break; \ ClrBits(8); \ } \ while (GetBits(1) == 0) \ ClrBits(1); \ ClrBits(1); /* EOL bit */ \ EOLcnt = 0; /* reset EOL counter/flag */ \ } while (0) /* * Cleanup the array of runs after decoding a row. * We adjust final runs to insure the user buffer is not * overwritten and/or undecoded area is white filled. */ #define CLEANUP_RUNS() do { \ if (RunLength) \ SETVALUE(0); \ if (a0 != lastx) { \ badlength(a0, lastx); \ while (a0 > lastx && pa > thisrun) \ a0 -= *--pa; \ if (a0 < lastx) { \ if (a0 < 0) \ a0 = 0; \ if ((pa-thisrun)&1) \ SETVALUE(0); \ SETVALUE(lastx - a0); \ } else if (a0 > lastx) { \ SETVALUE(lastx); \ SETVALUE(0); \ } \ } \ } while (0)
+ show +
306
307
308
309
310
311
312
313
314
315
/* * Decode a line of 1D-encoded data. * * The line expanders are written as macros so that they can be reused * but still have direct access to the local variables of the "calling" * function. * * Note that unlike the original version we have to explicitly test for * a0 >= lastx after each black/white run is decoded. This is because

[CVE-2023-40093_1.diff] tif_jpeg.c #4
-# ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ - typedef unsigned char boolean; -# endif -# define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ +#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ +typedef unsigned char boolean; +#endif +#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/libtiff/tif_ojpeg.c
201
202
203
204
205
206
207
208
209
210
not defined. Unfortunately, the MinGW and Borland compilers include a typedef for INT32, which causes a conflict. MSVC does not include a conflicting typedef given the headers which are included. */ #if defined(__BORLANDC__) || defined(__MINGW32__) # define XMD_H 1 #endif /* Define "boolean" as unsigned char, not int, per Windows custom. */ #if defined(__WIN32__) && !defined(__MINGW32__)
+ show +
211
212
213
214
# ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ typedef unsigned char boolean; # endif # define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
+ show +
215
216
217
218
219
220
221
222
223
224
#endif #if defined(USE_SYSTEM_LIBJPEG) #include <jerror.h> #include <jpeglib.h> #elif defined(USE_LIBJPEG_TURBO) #include "third_party/libjpeg_turbo/jerror.h" #include "third_party/libjpeg_turbo/jpeglib.h" #else #include "third_party/libjpeg/jerror.h"
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/libtiff/tif_jpeg.c
72
73
74
75
76
77
78
79
80
81
"JPEGLib: JPEG parameter struct mismatch: library thinks size is 432, caller expects 464" For such users we wil fix the problem here. See install.doc file from the JPEG library distribution for details. */ /* Define "boolean" as unsigned char, not int, per Windows custom. */ #if defined(__WIN32__) && !defined(__MINGW32__)
+ show +
82
83
84
85
# ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ typedef unsigned char boolean; # endif # define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
+ show +
86
87
88
89
90
91
92
93
94
95
#endif #if defined(USE_SYSTEM_LIBJPEG) #include <jerror.h> #include <jpeglib.h> #elif defined(USE_LIBJPEG_TURBO) #include "third_party/libjpeg_turbo/jerror.h" #include "third_party/libjpeg_turbo/jpeglib.h" #else #include "third_party/libjpeg/jerror.h"
/media/esteban/ACOS/ResurrectionX/external/libjpeg-turbo/jconfig.txt
72
73
74
75
76
77
78
79
80
81
* and pseudo-ANSI compilers get confused. To keep one of these bozos happy, * define INCOMPLETE_TYPES_BROKEN. This is not recommended unless you * actually get "missing structure definition" warnings or errors while * compiling the JPEG code. */ #undef INCOMPLETE_TYPES_BROKEN /* Define "boolean" as unsigned char, not int, on Windows systems. */ #ifdef _WIN32
+ show +
82
83
84
85
#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ typedef unsigned char boolean; #endif #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
+ show +
86
87
88
89
90
91
92
93
94
95
#endif /* * The following options affect code selection within the JPEG library, * but they don't need to be visible to applications using the library. * To minimize application namespace pollution, the symbols won't be * defined unless JPEG_INTERNALS has been defined. */
/media/esteban/ACOS/ResurrectionX/external/libjpeg-turbo/win/jconfig.h.in
14
15
16
17
18
19
20
21
22
23
#undef NEED_SYS_TYPES_H #undef NEED_BSD_STRINGS #define HAVE_UNSIGNED_CHAR #define HAVE_UNSIGNED_SHORT #undef INCOMPLETE_TYPES_BROKEN #undef RIGHT_SHIFT_IS_UNSIGNED #undef __CHAR_UNSIGNED__ /* Define "boolean" as unsigned char, not int, per Windows custom */
+ show +
24
25
26
27
#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ typedef unsigned char boolean; #endif #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
+ show +
28
29
30
31
32
33
34
/* Define "INT32" as int, not long, per Windows custom */ #if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */ typedef short INT16; typedef signed int INT32; #endif #define XMD_H /* prevent jmorecfg.h from redefining it */

[CVE-2023-40093_1.diff] tif_packbits.c #2
-static int -PackBitsPreEncode(TIFF* tif, uint16 s) +static int PackBitsPreEncode(TIFF *tif, uint16_t s) - (void) s; + (void)s; - tif->tif_data = (uint8*)_TIFFmalloc(sizeof(tmsize_t)); - if (tif->tif_data == NULL) - return (0); - /* - * Calculate the scanline/tile-width size in bytes. - */ - if (isTiled(tif)) - *(tmsize_t*)tif->tif_data = TIFFTileRowSize(tif); - else - *(tmsize_t*)tif->tif_data = TIFFScanlineSize(tif); - return (1); + tif->tif_data = (uint8_t *)_TIFFmallocExt(tif, sizeof(tmsize_t)); + if (tif->tif_data == NULL) + return (0); + /* + * Calculate the scanline/tile-width size in bytes. + */ + if (isTiled(tif)) + *(tmsize_t *)tif->tif_data = TIFFTileRowSize(tif); + else + *(tmsize_t *)tif->tif_data = TIFFScanlineSize(tif); + return (1); -static int -PackBitsPostEncode(TIFF* tif) +static int PackBitsPostEncode(TIFF *tif) - if (tif->tif_data) - _TIFFfree(tif->tif_data); - return (1); + if (tif->tif_data) + _TIFFfreeExt(tif, tif->tif_data); + return (1); -static int -PackBitsEncode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s) +static int PackBitsEncode(TIFF *tif, uint8_t *buf, tmsize_t cc, uint16_t s) - unsigned char* bp = (unsigned char*) buf; - uint8* op; - uint8* ep; - uint8* lastliteral; - long n, slop; - int b; - enum { BASE, LITERAL, RUN, LITERAL_RUN } state; + unsigned char *bp = (unsigned char *)buf; + uint8_t *op; + uint8_t *ep; + uint8_t *lastliteral; + long n, slop; + int b; + enum + { + BASE, + LITERAL, + RUN, + LITERAL_RUN + } state; - (void) s; - op = tif->tif_rawcp; - ep = tif->tif_rawdata + tif->tif_rawdatasize; - state = BASE; - lastliteral = 0; - while (cc > 0) { - /* - * Find the longest string of identical bytes. - */ - b = *bp++; - cc--; - n = 1; - for (; cc > 0 && b == *bp; cc--, bp++) - n++; - again: - if (op + 2 >= ep) { /* insure space for new data */ - /* - * Be careful about writing the last - * literal. Must write up to that point - * and then copy the remainder to the - * front of the buffer. - */ - if (state == LITERAL || state == LITERAL_RUN) { - slop = (long)(op - lastliteral); - tif->tif_rawcc += (tmsize_t)(lastliteral - tif->tif_rawcp); - if (!TIFFFlushData1(tif)) - return (0); - op = tif->tif_rawcp; - while (slop-- > 0) - *op++ = *lastliteral++; - lastliteral = tif->tif_rawcp; - } else { - tif->tif_rawcc += (tmsize_t)(op - tif->tif_rawcp); - if (!TIFFFlushData1(tif)) - return (0); - op = tif->tif_rawcp; - } - } - switch (state) { - case BASE: /* initial state, set run/literal */ - if (n > 1) { - state = RUN; - if (n > 128) { - *op++ = (uint8) -127; - *op++ = (uint8) b; - n -= 128; - goto again; - } - *op++ = (uint8)(-(n-1)); - *op++ = (uint8) b; - } else { - lastliteral = op; - *op++ = 0; - *op++ = (uint8) b; - state = LITERAL; - } - break; - case LITERAL: /* last object was literal string */ - if (n > 1) { - state = LITERAL_RUN; - if (n > 128) { - *op++ = (uint8) -127; - *op++ = (uint8) b; - n -= 128; - goto again; - } - *op++ = (uint8)(-(n-1)); /* encode run */ - *op++ = (uint8) b; - } else { /* extend literal */ - if (++(*lastliteral) == 127) - state = BASE; - *op++ = (uint8) b; - } - break; - case RUN: /* last object was run */ - if (n > 1) { - if (n > 128) { - *op++ = (uint8) -127; - *op++ = (uint8) b; - n -= 128; - goto again; - } - *op++ = (uint8)(-(n-1)); - *op++ = (uint8) b; - } else { - lastliteral = op; - *op++ = 0; - *op++ = (uint8) b; - state = LITERAL; - } - break; - case LITERAL_RUN: /* literal followed by a run */ - /* - * Check to see if previous run should - * be converted to a literal, in which - * case we convert literal-run-literal - * to a single literal. - */ - if (n == 1 && op[-2] == (uint8) -1 && - *lastliteral < 126) { - state = (((*lastliteral) += 2) == 127 ? - BASE : LITERAL); - op[-2] = op[-1]; /* replicate */ - } else - state = RUN; - goto again; - } - } - tif->tif_rawcc += (tmsize_t)(op - tif->tif_rawcp); - tif->tif_rawcp = op; - return (1); + (void)s; + op = tif->tif_rawcp; + ep = tif->tif_rawdata + tif->tif_rawdatasize; + state = BASE; + lastliteral = 0; + while (cc > 0) + { + /* + * Find the longest string of identical bytes. + */ + b = *bp++; + cc--; + n = 1; + for (; cc > 0 && b == *bp; cc--, bp++) + n++; + again: + if (op + 2 >= ep) + { /* insure space for new data */ + /* + * Be careful about writing the last + * literal. Must write up to that point + * and then copy the remainder to the + * front of the buffer. + */ + if (state == LITERAL || state == LITERAL_RUN) + { + slop = (long)(op - lastliteral); + tif->tif_rawcc += (tmsize_t)(lastliteral - tif->tif_rawcp); + if (!TIFFFlushData1(tif)) + return (0); + op = tif->tif_rawcp; + while (slop-- > 0) + *op++ = *lastliteral++; + lastliteral = tif->tif_rawcp; + } + else + { + tif->tif_rawcc += (tmsize_t)(op - tif->tif_rawcp); + if (!TIFFFlushData1(tif)) + return (0); + op = tif->tif_rawcp; + } + } + switch (state) + { + case BASE: /* initial state, set run/literal */ + if (n > 1) + { + state = RUN; + if (n > 128) + { + *op++ = (uint8_t)-127; + *op++ = (uint8_t)b; + n -= 128; + goto again; + } + *op++ = (uint8_t)(-(n - 1)); + *op++ = (uint8_t)b; + } + else + { + lastliteral = op; + *op++ = 0; + *op++ = (uint8_t)b; + state = LITERAL; + } + break; + case LITERAL: /* last object was literal string */ + if (n > 1) + { + state = LITERAL_RUN; + if (n > 128) + { + *op++ = (uint8_t)-127; + *op++ = (uint8_t)b; + n -= 128; + goto again; + } + *op++ = (uint8_t)(-(n - 1)); /* encode run */ + *op++ = (uint8_t)b; + } + else + { /* extend literal */ + if (++(*lastliteral) == 127) + state = BASE; + *op++ = (uint8_t)b; + } + break; + case RUN: /* last object was run */ + if (n > 1) + { + if (n > 128) + { + *op++ = (uint8_t)-127; + *op++ = (uint8_t)b; + n -= 128; + goto again; + } + *op++ = (uint8_t)(-(n - 1)); + *op++ = (uint8_t)b; + } + else + { + lastliteral = op; + *op++ = 0; + *op++ = (uint8_t)b; + state = LITERAL; + } + break; + case LITERAL_RUN: /* literal followed by a run */ + /* + * Check to see if previous run should + * be converted to a literal, in which + * case we convert literal-run-literal + * to a single literal. + */ + if (n == 1 && op[-2] == (uint8_t)-1 && *lastliteral < 126) + { + state = (((*lastliteral) += 2) == 127 ? BASE : LITERAL); + op[-2] = op[-1]; /* replicate */ + } + else + state = RUN; + goto again; + } + } + tif->tif_rawcc += (tmsize_t)(op - tif->tif_rawcp); + tif->tif_rawcp = op; + return (1);
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/libtiff/tif_packbits.c
26
27
28
29
30
31
32
33
34
35
#include "tiffiop.h" #ifdef PACKBITS_SUPPORT /* * TIFF Library. * * PackBits Compression Algorithm Support */ #include <stdio.h>
+ show +
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
static int PackBitsPreEncode(TIFF* tif, uint16 s) { (void) s; tif->tif_data = (uint8*)_TIFFmalloc(sizeof(tmsize_t)); if (tif->tif_data == NULL) return (0); /* * Calculate the scanline/tile-width size in bytes. */ if (isTiled(tif)) *(tmsize_t*)tif->tif_data = TIFFTileRowSize(tif); else *(tmsize_t*)tif->tif_data = TIFFScanlineSize(tif); return (1); } static int PackBitsPostEncode(TIFF* tif) { if (tif->tif_data) _TIFFfree(tif->tif_data); return (1); } /* * Encode a run of pixels. */ static int PackBitsEncode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s) { unsigned char* bp = (unsigned char*) buf; uint8* op; uint8* ep; uint8* lastliteral; long n, slop; int b; enum { BASE, LITERAL, RUN, LITERAL_RUN } state; (void) s; op = tif->tif_rawcp; ep = tif->tif_rawdata + tif->tif_rawdatasize; state = BASE; lastliteral = 0; while (cc > 0) { /* * Find the longest string of identical bytes. */ b = *bp++; cc--; n = 1; for (; cc > 0 && b == *bp; cc--, bp++) n++; again: if (op + 2 >= ep) { /* insure space for new data */ /* * Be careful about writing the last * literal. Must write up to that point * and then copy the remainder to the * front of the buffer. */ if (state == LITERAL || state == LITERAL_RUN) { slop = (long)(op - lastliteral); tif->tif_rawcc += (tmsize_t)(lastliteral - tif->tif_rawcp); if (!TIFFFlushData1(tif)) return (0); op = tif->tif_rawcp; while (slop-- > 0) *op++ = *lastliteral++; lastliteral = tif->tif_rawcp; } else { tif->tif_rawcc += (tmsize_t)(op - tif->tif_rawcp); if (!TIFFFlushData1(tif)) return (0); op = tif->tif_rawcp; } } switch (state) { case BASE: /* initial state, set run/literal */ if (n > 1) { state = RUN; if (n > 128) { *op++ = (uint8) -127; *op++ = (uint8) b; n -= 128; goto again; } *op++ = (uint8)(-(n-1)); *op++ = (uint8) b; } else { lastliteral = op; *op++ = 0; *op++ = (uint8) b; state = LITERAL; } break; case LITERAL: /* last object was literal string */ if (n > 1) { state = LITERAL_RUN; if (n > 128) { *op++ = (uint8) -127; *op++ = (uint8) b; n -= 128; goto again; } *op++ = (uint8)(-(n-1)); /* encode run */ *op++ = (uint8) b; } else { /* extend literal */ if (++(*lastliteral) == 127) state = BASE; *op++ = (uint8) b; } break; case RUN: /* last object was run */ if (n > 1) { if (n > 128) { *op++ = (uint8) -127; *op++ = (uint8) b; n -= 128; goto again; } *op++ = (uint8)(-(n-1)); *op++ = (uint8) b; } else { lastliteral = op; *op++ = 0; *op++ = (uint8) b; state = LITERAL; } break; case LITERAL_RUN: /* literal followed by a run */ /* * Check to see if previous run should * be converted to a literal, in which * case we convert literal-run-literal * to a single literal. */ if (n == 1 && op[-2] == (uint8) -1 && *lastliteral < 126) { state = (((*lastliteral) += 2) == 127 ? BASE : LITERAL); op[-2] = op[-1]; /* replicate */ } else state = RUN; goto again; } } tif->tif_rawcc += (tmsize_t)(op - tif->tif_rawcp); tif->tif_rawcp = op; return (1);
+ show +
187
188
189
190
191
192
193
194
195
196
} /* * Encode a rectangular chunk of pixels. We break it up * into row-sized pieces to insure that encoded runs do * not span rows. Otherwise, there can be problems with * the decoder if data is read, for example, by scanlines * when it was encoded by strips. */ static int

[CVE-2023-40093_1.diff] tif_fax3.c #4
-#define DECLARE_STATE(tif, sp, mod) \ - static const char module[] = mod; \ - Fax3CodecState* sp = DecoderState(tif); \ - int a0; /* reference element */ \ - int lastx = sp->b.rowpixels; /* last element in row */ \ - uint32 BitAcc; /* bit accumulator */ \ - int BitsAvail; /* # valid bits in BitAcc */ \ - int RunLength; /* length of current run */ \ - unsigned char* cp; /* next byte of input data */ \ - unsigned char* ep; /* end of input data */ \ - uint32* pa; /* place to stuff next run */ \ - uint32* thisrun; /* current row's run array */ \ - int EOLcnt; /* # EOL codes recognized */ \ - const unsigned char* bitmap = sp->bitmap; /* input data bit reverser */ \ - const TIFFFaxTabEnt* TabEnt -#define DECLARE_STATE_2D(tif, sp, mod) \ - DECLARE_STATE(tif, sp, mod); \ - int b1; /* next change on prev line */ \ - uint32* pb /* next run in reference line */\ -/* - * Load any state that may be changed during decoding. - */ -#define CACHE_STATE(tif, sp) do { \ - BitAcc = sp->data; \ - BitsAvail = sp->bit; \ - EOLcnt = sp->EOLcnt; \ - cp = (unsigned char*) tif->tif_rawcp; \ - ep = cp + tif->tif_rawcc; \ -} while (0) +#define DECLARE_STATE(tif, sp, mod) \ + static const char module[] = mod; \ + Fax3CodecState *sp = DecoderState(tif); \ + int a0; /* reference element */ \ + int lastx = sp->b.rowpixels; /* last element in row */ \ + uint32_t BitAcc; /* bit accumulator */ \ + int BitsAvail; /* # valid bits in BitAcc */ \ + int RunLength; /* length of current run */ \ + unsigned char *cp; /* next byte of input data */ \ + unsigned char *ep; /* end of input data */ \ + uint32_t *pa; /* place to stuff next run */ \ + uint32_t *thisrun; /* current row's run array */ \ + int EOLcnt; /* # EOL codes recognized */ \ + const unsigned char *bitmap = sp->bitmap; /* input data bit reverser */ \ + const TIFFFaxTabEnt *TabEnt +#define DECLARE_STATE_2D(tif, sp, mod) \ + DECLARE_STATE(tif, sp, mod); \ + int b1; /* next change on prev line */ \ + uint32_t \ + *pb /* next run in reference line */ /* \ + * Load any state that may be \ + * changed during decoding. \ + */ +#define CACHE_STATE(tif, sp) \ + do \ + { \ + BitAcc = sp->data; \ + BitsAvail = sp->bit; \ + EOLcnt = sp->EOLcnt; \ + cp = (unsigned char *)tif->tif_rawcp; \ + ep = cp + tif->tif_rawcc; \ + } while (0) -#define UNCACHE_STATE(tif, sp) do { \ - sp->bit = BitsAvail; \ - sp->data = BitAcc; \ - sp->EOLcnt = EOLcnt; \ - tif->tif_rawcc -= (tmsize_t)((uint8*) cp - tif->tif_rawcp); \ - tif->tif_rawcp = (uint8*) cp; \ -} while (0) +#define UNCACHE_STATE(tif, sp) \ + do \ + { \ + sp->bit = BitsAvail; \ + sp->data = BitAcc; \ + sp->EOLcnt = EOLcnt; \ + tif->tif_rawcc -= (tmsize_t)((uint8_t *)cp - tif->tif_rawcp); \ + tif->tif_rawcp = (uint8_t *)cp; \ + } while (0) -static int -Fax3PreDecode(TIFF* tif, uint16 s) +static int Fax3PreDecode(TIFF *tif, uint16_t s) - Fax3CodecState* sp = DecoderState(tif); + Fax3CodecState *sp = DecoderState(tif); - (void) s; - assert(sp != NULL); - sp->bit = 0; /* force initial read */ - sp->data = 0; - sp->EOLcnt = 0; /* force initial scan for EOL */ - /* - * Decoder assumes lsb-to-msb bit order. Note that we select - * this here rather than in Fax3SetupState so that viewers can - * hold the image open, fiddle with the FillOrder tag value, - * and then re-decode the image. Otherwise they'd need to close - * and open the image to get the state reset. - */ - sp->bitmap = - TIFFGetBitRevTable(tif->tif_dir.td_fillorder != FILLORDER_LSB2MSB); - if (sp->refruns) { /* init reference line to white */ - sp->refruns[0] = (uint32) sp->b.rowpixels; - sp->refruns[1] = 0; - } - sp->line = 0; - return (1); + (void)s; + assert(sp != NULL); + sp->bit = 0; /* force initial read */ + sp->data = 0; + sp->EOLcnt = 0; /* force initial scan for EOL */ + /* + * Decoder assumes lsb-to-msb bit order. Note that we select + * this here rather than in Fax3SetupState so that viewers can + * hold the image open, fiddle with the FillOrder tag value, + * and then re-decode the image. Otherwise they'd need to close + * and open the image to get the state reset. + */ + sp->bitmap = + TIFFGetBitRevTable(tif->tif_dir.td_fillorder != FILLORDER_LSB2MSB); + sp->curruns = sp->runs; + if (sp->refruns) + { /* init reference line to white */ + sp->refruns = sp->runs + sp->nruns; + sp->refruns[0] = (uint32_t)sp->b.rowpixels; + sp->refruns[1] = 0; + } + sp->line = 0; + return (1);
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/libtiff/tif_fax3.c
93
94
95
96
97
98
99
100
101
102
#define isAligned(p,t) ((((size_t)(p)) & (sizeof (t)-1)) == 0) /* * Group 3 and Group 4 Decoding. */ /* * These macros glue the TIFF library state to * the state expected by Frank's decoder. */
+ show +
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#define DECLARE_STATE(tif, sp, mod) \ static const char module[] = mod; \ Fax3CodecState* sp = DecoderState(tif); \ int a0; /* reference element */ \ int lastx = sp->b.rowpixels; /* last element in row */ \ uint32 BitAcc; /* bit accumulator */ \ int BitsAvail; /* # valid bits in BitAcc */ \ int RunLength; /* length of current run */ \ unsigned char* cp; /* next byte of input data */ \ unsigned char* ep; /* end of input data */ \ uint32* pa; /* place to stuff next run */ \ uint32* thisrun; /* current row's run array */ \ int EOLcnt; /* # EOL codes recognized */ \ const unsigned char* bitmap = sp->bitmap; /* input data bit reverser */ \ const TIFFFaxTabEnt* TabEnt #define DECLARE_STATE_2D(tif, sp, mod) \ DECLARE_STATE(tif, sp, mod); \ int b1; /* next change on prev line */ \ uint32* pb /* next run in reference line */\ /* * Load any state that may be changed during decoding. */ #define CACHE_STATE(tif, sp) do { \ BitAcc = sp->data; \ BitsAvail = sp->bit; \ EOLcnt = sp->EOLcnt; \ cp = (unsigned char*) tif->tif_rawcp; \ ep = cp + tif->tif_rawcc; \ } while (0) /* * Save state possibly changed during decoding. */ #define UNCACHE_STATE(tif, sp) do { \ sp->bit = BitsAvail; \ sp->data = BitAcc; \ sp->EOLcnt = EOLcnt; \ tif->tif_rawcc -= (tmsize_t)((uint8*) cp - tif->tif_rawcp); \ tif->tif_rawcp = (uint8*) cp; \ } while (0) /* * Setup state for decoding a strip. */ static int Fax3PreDecode(TIFF* tif, uint16 s) { Fax3CodecState* sp = DecoderState(tif); (void) s; assert(sp != NULL); sp->bit = 0; /* force initial read */ sp->data = 0; sp->EOLcnt = 0; /* force initial scan for EOL */ /* * Decoder assumes lsb-to-msb bit order. Note that we select * this here rather than in Fax3SetupState so that viewers can * hold the image open, fiddle with the FillOrder tag value, * and then re-decode the image. Otherwise they'd need to close * and open the image to get the state reset. */ sp->bitmap = TIFFGetBitRevTable(tif->tif_dir.td_fillorder != FILLORDER_LSB2MSB); if (sp->refruns) { /* init reference line to white */ sp->refruns[0] = (uint32) sp->b.rowpixels; sp->refruns[1] = 0; } sp->line = 0; return (1);
+ show +
171
172
173
174
175
176
177
178
179
180
} /* * Routine for handling various errors/conditions. * Note how they are "glued into the decoder" by * overriding the definitions used by the decoder. */ static void Fax3Unexpected(const char* module, TIFF* tif, uint32 line, uint32 a0)

[CVE-2023-40093_1.diff] tif_getimage.c #5
-int -TIFFReadRGBAImage(TIFF* tif, - uint32 rwidth, uint32 rheight, uint32* raster, int stop) +int TIFFReadRGBAImage(TIFF *tif, uint32_t rwidth, uint32_t rheight, + uint32_t *raster, int stop) - return TIFFReadRGBAImageOriented(tif, rwidth, rheight, raster, - ORIENTATION_BOTLEFT, stop); + return TIFFReadRGBAImageOriented(tif, rwidth, rheight, raster, + ORIENTATION_BOTLEFT, stop); -static int -setorientation(TIFFRGBAImage* img) +static int setorientation(TIFFRGBAImage *img) - switch (img->orientation) { - case ORIENTATION_TOPLEFT: - case ORIENTATION_LEFTTOP: - if (img->req_orientation == ORIENTATION_TOPRIGHT || - img->req_orientation == ORIENTATION_RIGHTTOP) - return FLIP_HORIZONTALLY; - else if (img->req_orientation == ORIENTATION_BOTRIGHT || - img->req_orientation == ORIENTATION_RIGHTBOT) - return FLIP_HORIZONTALLY | FLIP_VERTICALLY; - else if (img->req_orientation == ORIENTATION_BOTLEFT || - img->req_orientation == ORIENTATION_LEFTBOT) - return FLIP_VERTICALLY; - else - return 0; - case ORIENTATION_TOPRIGHT: - case ORIENTATION_RIGHTTOP: - if (img->req_orientation == ORIENTATION_TOPLEFT || - img->req_orientation == ORIENTATION_LEFTTOP) - return FLIP_HORIZONTALLY; - else if (img->req_orientation == ORIENTATION_BOTRIGHT || - img->req_orientation == ORIENTATION_RIGHTBOT) - return FLIP_VERTICALLY; - else if (img->req_orientation == ORIENTATION_BOTLEFT || - img->req_orientation == ORIENTATION_LEFTBOT) - return FLIP_HORIZONTALLY | FLIP_VERTICALLY; - else - return 0; - case ORIENTATION_BOTRIGHT: - case ORIENTATION_RIGHTBOT: - if (img->req_orientation == ORIENTATION_TOPLEFT || - img->req_orientation == ORIENTATION_LEFTTOP) - return FLIP_HORIZONTALLY | FLIP_VERTICALLY; - else if (img->req_orientation == ORIENTATION_TOPRIGHT || - img->req_orientation == ORIENTATION_RIGHTTOP) - return FLIP_VERTICALLY; - else if (img->req_orientation == ORIENTATION_BOTLEFT || - img->req_orientation == ORIENTATION_LEFTBOT) - return FLIP_HORIZONTALLY; - else - return 0; - case ORIENTATION_BOTLEFT: - case ORIENTATION_LEFTBOT: - if (img->req_orientation == ORIENTATION_TOPLEFT || - img->req_orientation == ORIENTATION_LEFTTOP) - return FLIP_VERTICALLY; - else if (img->req_orientation == ORIENTATION_TOPRIGHT || - img->req_orientation == ORIENTATION_RIGHTTOP) - return FLIP_HORIZONTALLY | FLIP_VERTICALLY; - else if (img->req_orientation == ORIENTATION_BOTRIGHT || - img->req_orientation == ORIENTATION_RIGHTBOT) - return FLIP_HORIZONTALLY; - else - return 0; - default: /* NOTREACHED */ - return 0; - } + switch (img->orientation) + { + case ORIENTATION_TOPLEFT: + case ORIENTATION_LEFTTOP: + if (img->req_orientation == ORIENTATION_TOPRIGHT || + img->req_orientation == ORIENTATION_RIGHTTOP) + return FLIP_HORIZONTALLY; + else if (img->req_orientation == ORIENTATION_BOTRIGHT || + img->req_orientation == ORIENTATION_RIGHTBOT) + return FLIP_HORIZONTALLY | FLIP_VERTICALLY; + else if (img->req_orientation == ORIENTATION_BOTLEFT || + img->req_orientation == ORIENTATION_LEFTBOT) + return FLIP_VERTICALLY; + else + return 0; + case ORIENTATION_TOPRIGHT: + case ORIENTATION_RIGHTTOP: + if (img->req_orientation == ORIENTATION_TOPLEFT || + img->req_orientation == ORIENTATION_LEFTTOP) + return FLIP_HORIZONTALLY; + else if (img->req_orientation == ORIENTATION_BOTRIGHT || + img->req_orientation == ORIENTATION_RIGHTBOT) + return FLIP_VERTICALLY; + else if (img->req_orientation == ORIENTATION_BOTLEFT || + img->req_orientation == ORIENTATION_LEFTBOT) + return FLIP_HORIZONTALLY | FLIP_VERTICALLY; + else + return 0; + case ORIENTATION_BOTRIGHT: + case ORIENTATION_RIGHTBOT: + if (img->req_orientation == ORIENTATION_TOPLEFT || + img->req_orientation == ORIENTATION_LEFTTOP) + return FLIP_HORIZONTALLY | FLIP_VERTICALLY; + else if (img->req_orientation == ORIENTATION_TOPRIGHT || + img->req_orientation == ORIENTATION_RIGHTTOP) + return FLIP_VERTICALLY; + else if (img->req_orientation == ORIENTATION_BOTLEFT || + img->req_orientation == ORIENTATION_LEFTBOT) + return FLIP_HORIZONTALLY; + else + return 0; + case ORIENTATION_BOTLEFT: + case ORIENTATION_LEFTBOT: + if (img->req_orientation == ORIENTATION_TOPLEFT || + img->req_orientation == ORIENTATION_LEFTTOP) + return FLIP_VERTICALLY; + else if (img->req_orientation == ORIENTATION_TOPRIGHT || + img->req_orientation == ORIENTATION_RIGHTTOP) + return FLIP_HORIZONTALLY | FLIP_VERTICALLY; + else if (img->req_orientation == ORIENTATION_BOTRIGHT || + img->req_orientation == ORIENTATION_RIGHTBOT) + return FLIP_HORIZONTALLY; + else + return 0; + default: /* NOTREACHED */ + return 0; + }
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/libtiff/tif_getimage.c
537
538
539
540
541
542
543
544
545
546
TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "%s", emsg); ok = 0; } return (ok); } /* * Read the specified image into an ABGR-format raster. Use bottom left * origin for raster by default. */
+ show +
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
int TIFFReadRGBAImage(TIFF* tif, uint32 rwidth, uint32 rheight, uint32* raster, int stop) { return TIFFReadRGBAImageOriented(tif, rwidth, rheight, raster, ORIENTATION_BOTLEFT, stop); } static int setorientation(TIFFRGBAImage* img) { switch (img->orientation) { case ORIENTATION_TOPLEFT: case ORIENTATION_LEFTTOP: if (img->req_orientation == ORIENTATION_TOPRIGHT || img->req_orientation == ORIENTATION_RIGHTTOP) return FLIP_HORIZONTALLY; else if (img->req_orientation == ORIENTATION_BOTRIGHT || img->req_orientation == ORIENTATION_RIGHTBOT) return FLIP_HORIZONTALLY | FLIP_VERTICALLY; else if (img->req_orientation == ORIENTATION_BOTLEFT || img->req_orientation == ORIENTATION_LEFTBOT) return FLIP_VERTICALLY; else return 0; case ORIENTATION_TOPRIGHT: case ORIENTATION_RIGHTTOP: if (img->req_orientation == ORIENTATION_TOPLEFT || img->req_orientation == ORIENTATION_LEFTTOP) return FLIP_HORIZONTALLY; else if (img->req_orientation == ORIENTATION_BOTRIGHT || img->req_orientation == ORIENTATION_RIGHTBOT) return FLIP_VERTICALLY; else if (img->req_orientation == ORIENTATION_BOTLEFT || img->req_orientation == ORIENTATION_LEFTBOT) return FLIP_HORIZONTALLY | FLIP_VERTICALLY; else return 0; case ORIENTATION_BOTRIGHT: case ORIENTATION_RIGHTBOT: if (img->req_orientation == ORIENTATION_TOPLEFT || img->req_orientation == ORIENTATION_LEFTTOP) return FLIP_HORIZONTALLY | FLIP_VERTICALLY; else if (img->req_orientation == ORIENTATION_TOPRIGHT || img->req_orientation == ORIENTATION_RIGHTTOP) return FLIP_VERTICALLY; else if (img->req_orientation == ORIENTATION_BOTLEFT || img->req_orientation == ORIENTATION_LEFTBOT) return FLIP_HORIZONTALLY; else return 0; case ORIENTATION_BOTLEFT: case ORIENTATION_LEFTBOT: if (img->req_orientation == ORIENTATION_TOPLEFT || img->req_orientation == ORIENTATION_LEFTTOP) return FLIP_VERTICALLY; else if (img->req_orientation == ORIENTATION_TOPRIGHT || img->req_orientation == ORIENTATION_RIGHTTOP) return FLIP_HORIZONTALLY | FLIP_VERTICALLY; else if (img->req_orientation == ORIENTATION_BOTRIGHT || img->req_orientation == ORIENTATION_RIGHTBOT) return FLIP_HORIZONTALLY; else return 0; default: /* NOTREACHED */ return 0;
+ show +
613
614
615
616
617
618
619
620
621
622
} } /* * Get an tile-organized image that has * PlanarConfiguration contiguous if SamplesPerPixel > 1 * or * SamplesPerPixel == 1 */ static int

[CVE-2023-40093_1.diff] tif_getimage.c #48
-static int -PickContigCase(TIFFRGBAImage* img) +static int PickContigCase(TIFFRGBAImage *img) - img->get = TIFFIsTiled(img->tif) ? gtTileContig : gtStripContig; - img->put.contig = NULL; - switch (img->photometric) { - case PHOTOMETRIC_RGB: - switch (img->bitspersample) { - case 8: - if (img->alpha == EXTRASAMPLE_ASSOCALPHA && - img->samplesperpixel >= 4) - img->put.contig = putRGBAAcontig8bittile; - else if (img->alpha == EXTRASAMPLE_UNASSALPHA && - img->samplesperpixel >= 4) - { - if (BuildMapUaToAa(img)) - img->put.contig = putRGBUAcontig8bittile; - } - else if( img->samplesperpixel >= 3 ) - img->put.contig = putRGBcontig8bittile; - break; - case 16: - if (img->alpha == EXTRASAMPLE_ASSOCALPHA && - img->samplesperpixel >=4 ) - { - if (BuildMapBitdepth16To8(img)) - img->put.contig = putRGBAAcontig16bittile; - } - else if (img->alpha == EXTRASAMPLE_UNASSALPHA && - img->samplesperpixel >=4 ) - { - if (BuildMapBitdepth16To8(img) && - BuildMapUaToAa(img)) - img->put.contig = putRGBUAcontig16bittile; - } - else if( img->samplesperpixel >=3 ) - { - if (BuildMapBitdepth16To8(img)) - img->put.contig = putRGBcontig16bittile; - } - break; - } - break; - case PHOTOMETRIC_SEPARATED: - if (img->samplesperpixel >=4 && buildMap(img)) { - if (img->bitspersample == 8) { - if (!img->Map) - img->put.contig = putRGBcontig8bitCMYKtile; - else - img->put.contig = putRGBcontig8bitCMYKMaptile; - } - } - break; - case PHOTOMETRIC_PALETTE: - if (buildMap(img)) { - switch (img->bitspersample) { - case 8: - img->put.contig = put8bitcmaptile; - break; - case 4: - img->put.contig = put4bitcmaptile; - break; - case 2: - img->put.contig = put2bitcmaptile; - break; - case 1: - img->put.contig = put1bitcmaptile; - break; - } - } - break; - case PHOTOMETRIC_MINISWHITE: - case PHOTOMETRIC_MINISBLACK: - if (buildMap(img)) { - switch (img->bitspersample) { - case 16: - img->put.contig = put16bitbwtile; - break; - case 8: - if (img->alpha && img->samplesperpixel == 2) - img->put.contig = putagreytile; - else - img->put.contig = putgreytile; - break; - case 4: - img->put.contig = put4bitbwtile; - break; - case 2: - img->put.contig = put2bitbwtile; - break; - case 1: - img->put.contig = put1bitbwtile; - break; - } - } - break; - case PHOTOMETRIC_YCBCR: - if ((img->bitspersample==8) && (img->samplesperpixel==3)) - { - if (initYCbCrConversion(img)!=0) - { - /* - * The 6.0 spec says that subsampling must be - * one of 1, 2, or 4, and that vertical subsampling - * must always be <= horizontal subsampling; so - * there are only a few possibilities and we just - * enumerate the cases. - * Joris: added support for the [1,2] case, nonetheless, to accommodate - * some OJPEG files - */ - uint16 SubsamplingHor; - uint16 SubsamplingVer; - TIFFGetFieldDefaulted(img->tif, TIFFTAG_YCBCRSUBSAMPLING, &SubsamplingHor, &SubsamplingVer); - switch ((SubsamplingHor<<4)|SubsamplingVer) { - case 0x44: - img->put.contig = putcontig8bitYCbCr44tile; - break; - case 0x42: - img->put.contig = putcontig8bitYCbCr42tile; - break; - case 0x41: - img->put.contig = putcontig8bitYCbCr41tile; - break; - case 0x22: - img->put.contig = putcontig8bitYCbCr22tile; - break; - case 0x21: - img->put.contig = putcontig8bitYCbCr21tile; - break; - case 0x12: - img->put.contig = putcontig8bitYCbCr12tile; - break; - case 0x11: - img->put.contig = putcontig8bitYCbCr11tile; - break; - } - } - } - break; - case PHOTOMETRIC_CIELAB: - if (img->samplesperpixel == 3 && buildMap(img)) { - if (img->bitspersample == 8) - img->put.contig = initCIELabConversion(img); - break; - } - } - return ((img->get!=NULL) && (img->put.contig!=NULL)); + img->get = TIFFIsTiled(img->tif) ? gtTileContig : gtStripContig; + img->put.contig = NULL; + switch (img->photometric) + { + case PHOTOMETRIC_RGB: + switch (img->bitspersample) + { + case 8: + if (img->alpha == EXTRASAMPLE_ASSOCALPHA && + img->samplesperpixel >= 4) + img->put.contig = putRGBAAcontig8bittile; + else if (img->alpha == EXTRASAMPLE_UNASSALPHA && + img->samplesperpixel >= 4) + { + if (BuildMapUaToAa(img)) + img->put.contig = putRGBUAcontig8bittile; + } + else if (img->samplesperpixel >= 3) + img->put.contig = putRGBcontig8bittile; + break; + case 16: + if (img->alpha == EXTRASAMPLE_ASSOCALPHA && + img->samplesperpixel >= 4) + { + if (BuildMapBitdepth16To8(img)) + img->put.contig = putRGBAAcontig16bittile; + } + else if (img->alpha == EXTRASAMPLE_UNASSALPHA && + img->samplesperpixel >= 4) + { + if (BuildMapBitdepth16To8(img) && BuildMapUaToAa(img)) + img->put.contig = putRGBUAcontig16bittile; + } + else if (img->samplesperpixel >= 3) + { + if (BuildMapBitdepth16To8(img)) + img->put.contig = putRGBcontig16bittile; + } + break; + } + break; + case PHOTOMETRIC_SEPARATED: + if (img->samplesperpixel >= 4 && buildMap(img)) + { + if (img->bitspersample == 8) + { + if (!img->Map) + img->put.contig = putRGBcontig8bitCMYKtile; + else + img->put.contig = putRGBcontig8bitCMYKMaptile; + } + } + break; + case PHOTOMETRIC_PALETTE: + if (buildMap(img)) + { + switch (img->bitspersample) + { + case 8: + img->put.contig = put8bitcmaptile; + break; + case 4: + img->put.contig = put4bitcmaptile; + break; + case 2: + img->put.contig = put2bitcmaptile; + break; + case 1: + img->put.contig = put1bitcmaptile; + break; + } + } + break; + case PHOTOMETRIC_MINISWHITE: + case PHOTOMETRIC_MINISBLACK: + if (buildMap(img)) + { + switch (img->bitspersample) + { + case 16: + img->put.contig = put16bitbwtile; + break; + case 8: + if (img->alpha && img->samplesperpixel == 2) + img->put.contig = putagreytile; + else + img->put.contig = putgreytile; + break; + case 4: + img->put.contig = put4bitbwtile; + break; + case 2: + img->put.contig = put2bitbwtile; + break; + case 1: + img->put.contig = put1bitbwtile; + break; + } + } + break; + case PHOTOMETRIC_YCBCR: + if ((img->bitspersample == 8) && (img->samplesperpixel == 3)) + { + if (initYCbCrConversion(img) != 0) + { + /* + * The 6.0 spec says that subsampling must be + * one of 1, 2, or 4, and that vertical subsampling + * must always be <= horizontal subsampling; so + * there are only a few possibilities and we just + * enumerate the cases. + * Joris: added support for the [1,2] case, nonetheless, to + * accommodate some OJPEG files + */ + uint16_t SubsamplingHor; + uint16_t SubsamplingVer; + TIFFGetFieldDefaulted(img->tif, TIFFTAG_YCBCRSUBSAMPLING, + &SubsamplingHor, &SubsamplingVer); + switch ((SubsamplingHor << 4) | SubsamplingVer) + { + case 0x44: + img->put.contig = putcontig8bitYCbCr44tile; + break; + case 0x42: + img->put.contig = putcontig8bitYCbCr42tile; + break; + case 0x41: + img->put.contig = putcontig8bitYCbCr41tile; + break; + case 0x22: + img->put.contig = putcontig8bitYCbCr22tile; + break; + case 0x21: + img->put.contig = putcontig8bitYCbCr21tile; + break; + case 0x12: + img->put.contig = putcontig8bitYCbCr12tile; + break; + case 0x11: + img->put.contig = putcontig8bitYCbCr11tile; + break; + } + } + } + break; + case PHOTOMETRIC_CIELAB: + if (img->samplesperpixel == 3 && buildMap(img)) + { + if (img->bitspersample == 8 || img->bitspersample == 16) + img->put.contig = initCIELabConversion(img); + break; + } + } + return ((img->get != NULL) && (img->put.contig != NULL));
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/libtiff/tif_getimage.c
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
if (img->bitspersample <= 8 && !makecmap(img)) return (0); break; } return (1); } /* * Select the appropriate conversion routine for packed data. */
+ show +
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
static int PickContigCase(TIFFRGBAImage* img) { img->get = TIFFIsTiled(img->tif) ? gtTileContig : gtStripContig; img->put.contig = NULL; switch (img->photometric) { case PHOTOMETRIC_RGB: switch (img->bitspersample) { case 8: if (img->alpha == EXTRASAMPLE_ASSOCALPHA && img->samplesperpixel >= 4) img->put.contig = putRGBAAcontig8bittile; else if (img->alpha == EXTRASAMPLE_UNASSALPHA && img->samplesperpixel >= 4) { if (BuildMapUaToAa(img)) img->put.contig = putRGBUAcontig8bittile; } else if( img->samplesperpixel >= 3 ) img->put.contig = putRGBcontig8bittile; break; case 16: if (img->alpha == EXTRASAMPLE_ASSOCALPHA && img->samplesperpixel >=4 ) { if (BuildMapBitdepth16To8(img)) img->put.contig = putRGBAAcontig16bittile; } else if (img->alpha == EXTRASAMPLE_UNASSALPHA && img->samplesperpixel >=4 ) { if (BuildMapBitdepth16To8(img) && BuildMapUaToAa(img)) img->put.contig = putRGBUAcontig16bittile; } else if( img->samplesperpixel >=3 ) { if (BuildMapBitdepth16To8(img)) img->put.contig = putRGBcontig16bittile; } break; } break; case PHOTOMETRIC_SEPARATED: if (img->samplesperpixel >=4 && buildMap(img)) { if (img->bitspersample == 8) { if (!img->Map) img->put.contig = putRGBcontig8bitCMYKtile; else img->put.contig = putRGBcontig8bitCMYKMaptile; } } break; case PHOTOMETRIC_PALETTE: if (buildMap(img)) { switch (img->bitspersample) { case 8: img->put.contig = put8bitcmaptile; break; case 4: img->put.contig = put4bitcmaptile; break; case 2: img->put.contig = put2bitcmaptile; break; case 1: img->put.contig = put1bitcmaptile; break; } } break; case PHOTOMETRIC_MINISWHITE: case PHOTOMETRIC_MINISBLACK: if (buildMap(img)) { switch (img->bitspersample) { case 16: img->put.contig = put16bitbwtile; break; case 8: if (img->alpha && img->samplesperpixel == 2) img->put.contig = putagreytile; else img->put.contig = putgreytile; break; case 4: img->put.contig = put4bitbwtile; break; case 2: img->put.contig = put2bitbwtile; break; case 1: img->put.contig = put1bitbwtile; break; } } break; case PHOTOMETRIC_YCBCR: if ((img->bitspersample==8) && (img->samplesperpixel==3)) { if (initYCbCrConversion(img)!=0) { /* * The 6.0 spec says that subsampling must be * one of 1, 2, or 4, and that vertical subsampling * must always be <= horizontal subsampling; so * there are only a few possibilities and we just * enumerate the cases. * Joris: added support for the [1,2] case, nonetheless, to accommodate * some OJPEG files */ uint16 SubsamplingHor; uint16 SubsamplingVer; TIFFGetFieldDefaulted(img->tif, TIFFTAG_YCBCRSUBSAMPLING, &SubsamplingHor, &SubsamplingVer); switch ((SubsamplingHor<<4)|SubsamplingVer) { case 0x44: img->put.contig = putcontig8bitYCbCr44tile; break; case 0x42: img->put.contig = putcontig8bitYCbCr42tile; break; case 0x41: img->put.contig = putcontig8bitYCbCr41tile; break; case 0x22: img->put.contig = putcontig8bitYCbCr22tile; break; case 0x21: img->put.contig = putcontig8bitYCbCr21tile; break; case 0x12: img->put.contig = putcontig8bitYCbCr12tile; break; case 0x11: img->put.contig = putcontig8bitYCbCr11tile; break; } } } break; case PHOTOMETRIC_CIELAB: if (img->samplesperpixel == 3 && buildMap(img)) { if (img->bitspersample == 8) img->put.contig = initCIELabConversion(img); break; } } return ((img->get!=NULL) && (img->put.contig!=NULL));
+ show +
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
} /* * Select the appropriate conversion routine for unpacked data. * * NB: we assume that unpacked single channel data is directed * to the "packed routines. */ static int PickSeparateCase(TIFFRGBAImage* img)

[CVE-2023-40093_1.diff] tif_getimage.c #49
-static int -PickSeparateCase(TIFFRGBAImage* img) +static int PickSeparateCase(TIFFRGBAImage *img) - img->get = TIFFIsTiled(img->tif) ? gtTileSeparate : gtStripSeparate; - img->put.separate = NULL; - switch (img->photometric) { - case PHOTOMETRIC_MINISWHITE: - case PHOTOMETRIC_MINISBLACK: - /* greyscale images processed pretty much as RGB by gtTileSeparate */ - case PHOTOMETRIC_RGB: - switch (img->bitspersample) { - case 8: - if (img->alpha == EXTRASAMPLE_ASSOCALPHA) - img->put.separate = putRGBAAseparate8bittile; - else if (img->alpha == EXTRASAMPLE_UNASSALPHA) - { - if (BuildMapUaToAa(img)) - img->put.separate = putRGBUAseparate8bittile; - } - else - img->put.separate = putRGBseparate8bittile; - break; - case 16: - if (img->alpha == EXTRASAMPLE_ASSOCALPHA) - { - if (BuildMapBitdepth16To8(img)) - img->put.separate = putRGBAAseparate16bittile; - } - else if (img->alpha == EXTRASAMPLE_UNASSALPHA) - { - if (BuildMapBitdepth16To8(img) && - BuildMapUaToAa(img)) - img->put.separate = putRGBUAseparate16bittile; - } - else - { - if (BuildMapBitdepth16To8(img)) - img->put.separate = putRGBseparate16bittile; - } - break; - } - break; - case PHOTOMETRIC_SEPARATED: - if (img->bitspersample == 8 && img->samplesperpixel == 4) - { - img->alpha = 1; // Not alpha, but seems like the only way to get 4th band - img->put.separate = putCMYKseparate8bittile; - } - break; - case PHOTOMETRIC_YCBCR: - if ((img->bitspersample==8) && (img->samplesperpixel==3)) - { - if (initYCbCrConversion(img)!=0) - { - uint16 hs, vs; - TIFFGetFieldDefaulted(img->tif, TIFFTAG_YCBCRSUBSAMPLING, &hs, &vs); - switch ((hs<<4)|vs) { - case 0x11: - img->put.separate = putseparate8bitYCbCr11tile; - break; - /* TODO: add other cases here */ - } - } - } - break; - } - return ((img->get!=NULL) && (img->put.separate!=NULL)); + img->get = TIFFIsTiled(img->tif) ? gtTileSeparate : gtStripSeparate; + img->put.separate = NULL; + switch (img->photometric) + { + case PHOTOMETRIC_MINISWHITE: + case PHOTOMETRIC_MINISBLACK: + /* greyscale images processed pretty much as RGB by gtTileSeparate + */ + case PHOTOMETRIC_RGB: + switch (img->bitspersample) + { + case 8: + if (img->alpha == EXTRASAMPLE_ASSOCALPHA) + img->put.separate = putRGBAAseparate8bittile; + else if (img->alpha == EXTRASAMPLE_UNASSALPHA) + { + if (BuildMapUaToAa(img)) + img->put.separate = putRGBUAseparate8bittile; + } + else + img->put.separate = putRGBseparate8bittile; + break; + case 16: + if (img->alpha == EXTRASAMPLE_ASSOCALPHA) + { + if (BuildMapBitdepth16To8(img)) + img->put.separate = putRGBAAseparate16bittile; + } + else if (img->alpha == EXTRASAMPLE_UNASSALPHA) + { + if (BuildMapBitdepth16To8(img) && BuildMapUaToAa(img)) + img->put.separate = putRGBUAseparate16bittile; + } + else + { + if (BuildMapBitdepth16To8(img)) + img->put.separate = putRGBseparate16bittile; + } + break; + } + break; + case PHOTOMETRIC_SEPARATED: + if (img->bitspersample == 8 && img->samplesperpixel == 4) + { + img->alpha = + 1; // Not alpha, but seems like the only way to get 4th band + img->put.separate = putCMYKseparate8bittile; + } + break; + case PHOTOMETRIC_YCBCR: + if ((img->bitspersample == 8) && (img->samplesperpixel == 3)) + { + if (initYCbCrConversion(img) != 0) + { + uint16_t hs, vs; + TIFFGetFieldDefaulted(img->tif, TIFFTAG_YCBCRSUBSAMPLING, + &hs, &vs); + switch ((hs << 4) | vs) + { + case 0x11: + img->put.separate = putseparate8bitYCbCr11tile; + break; + /* TODO: add other cases here */ + } + } + } + break; + } + return ((img->get != NULL) && (img->put.separate != NULL)); -static int -BuildMapUaToAa(TIFFRGBAImage* img) +static int BuildMapUaToAa(TIFFRGBAImage *img) - static const char module[]="BuildMapUaToAa"; - uint8* m; - uint16 na,nv; - assert(img->UaToAa==NULL); - img->UaToAa=_TIFFmalloc(65536); - if (img->UaToAa==NULL) - { - TIFFErrorExt(img->tif->tif_clientdata,module,"Out of memory"); - return(0); - } - m=img->UaToAa; - for (na=0; na<256; na++) - { - for (nv=0; nv<256; nv++) - *m++=(uint8)((nv*na+127)/255); - } - return(1); + static const char module[] = "BuildMapUaToAa"; + uint8_t *m; + uint16_t na, nv; + assert(img->UaToAa == NULL); + img->UaToAa = _TIFFmallocExt(img->tif, 65536); + if (img->UaToAa == NULL) + { + TIFFErrorExtR(img->tif, module, "Out of memory"); + return (0); + } + m = img->UaToAa; + for (na = 0; na < 256; na++) + { + for (nv = 0; nv < 256; nv++) + *m++ = (uint8_t)((nv * na + 127) / 255); + } + return (1); -static int -BuildMapBitdepth16To8(TIFFRGBAImage* img) +static int BuildMapBitdepth16To8(TIFFRGBAImage *img) - static const char module[]="BuildMapBitdepth16To8"; - uint8* m; - uint32 n; - assert(img->Bitdepth16To8==NULL); - img->Bitdepth16To8=_TIFFmalloc(65536); - if (img->Bitdepth16To8==NULL) - { - TIFFErrorExt(img->tif->tif_clientdata,module,"Out of memory"); - return(0); - } - m=img->Bitdepth16To8; - for (n=0; n<65536; n++) - *m++=(uint8)((n+128)/257); - return(1); + static const char module[] = "BuildMapBitdepth16To8"; + uint8_t *m; + uint32_t n; + assert(img->Bitdepth16To8 == NULL); + img->Bitdepth16To8 = _TIFFmallocExt(img->tif, 65536); + if (img->Bitdepth16To8 == NULL) + { + TIFFErrorExtR(img->tif, module, "Out of memory"); + return (0); + } + m = img->Bitdepth16To8; + for (n = 0; n < 65536; n++) + *m++ = (uint8_t)((n + 128) / 257); + return (1); -
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/libtiff/tif_getimage.c
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
} return ((img->get!=NULL) && (img->put.contig!=NULL)); } /* * Select the appropriate conversion routine for unpacked data. * * NB: we assume that unpacked single channel data is directed * to the "packed routines. */
+ show +
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
static int PickSeparateCase(TIFFRGBAImage* img) { img->get = TIFFIsTiled(img->tif) ? gtTileSeparate : gtStripSeparate; img->put.separate = NULL; switch (img->photometric) { case PHOTOMETRIC_MINISWHITE: case PHOTOMETRIC_MINISBLACK: /* greyscale images processed pretty much as RGB by gtTileSeparate */ case PHOTOMETRIC_RGB: switch (img->bitspersample) { case 8: if (img->alpha == EXTRASAMPLE_ASSOCALPHA) img->put.separate = putRGBAAseparate8bittile; else if (img->alpha == EXTRASAMPLE_UNASSALPHA) { if (BuildMapUaToAa(img)) img->put.separate = putRGBUAseparate8bittile; } else img->put.separate = putRGBseparate8bittile; break; case 16: if (img->alpha == EXTRASAMPLE_ASSOCALPHA) { if (BuildMapBitdepth16To8(img)) img->put.separate = putRGBAAseparate16bittile; } else if (img->alpha == EXTRASAMPLE_UNASSALPHA) { if (BuildMapBitdepth16To8(img) && BuildMapUaToAa(img)) img->put.separate = putRGBUAseparate16bittile; } else { if (BuildMapBitdepth16To8(img)) img->put.separate = putRGBseparate16bittile; } break; } break; case PHOTOMETRIC_SEPARATED: if (img->bitspersample == 8 && img->samplesperpixel == 4) { img->alpha = 1; // Not alpha, but seems like the only way to get 4th band img->put.separate = putCMYKseparate8bittile; } break; case PHOTOMETRIC_YCBCR: if ((img->bitspersample==8) && (img->samplesperpixel==3)) { if (initYCbCrConversion(img)!=0) { uint16 hs, vs; TIFFGetFieldDefaulted(img->tif, TIFFTAG_YCBCRSUBSAMPLING, &hs, &vs); switch ((hs<<4)|vs) { case 0x11: img->put.separate = putseparate8bitYCbCr11tile; break; /* TODO: add other cases here */ } } } break; } return ((img->get!=NULL) && (img->put.separate!=NULL)); } static int BuildMapUaToAa(TIFFRGBAImage* img) { static const char module[]="BuildMapUaToAa"; uint8* m; uint16 na,nv; assert(img->UaToAa==NULL); img->UaToAa=_TIFFmalloc(65536); if (img->UaToAa==NULL) { TIFFErrorExt(img->tif->tif_clientdata,module,"Out of memory"); return(0); } m=img->UaToAa; for (na=0; na<256; na++) { for (nv=0; nv<256; nv++) *m++=(uint8)((nv*na+127)/255); } return(1); } static int BuildMapBitdepth16To8(TIFFRGBAImage* img) { static const char module[]="BuildMapBitdepth16To8"; uint8* m; uint32 n; assert(img->Bitdepth16To8==NULL); img->Bitdepth16To8=_TIFFmalloc(65536); if (img->Bitdepth16To8==NULL) { TIFFErrorExt(img->tif->tif_clientdata,module,"Out of memory"); return(0); } m=img->Bitdepth16To8; for (n=0; n<65536; n++) *m++=(uint8)((n+128)/257); return(1);
+ show +
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
} /* * Read a whole strip off data from the file, and convert to RGBA form. * If this is the last strip, then it will only contain the portion of * the strip that is actually within the image space. The result is * organized in bottom to top form. */

[CVE-2023-40093_1.diff] tif_dir.c #3
-static int -OkToChangeTag(TIFF* tif, uint32 tag) +static int OkToChangeTag(TIFF *tif, uint32_t tag) - const TIFFField* fip = TIFFFindField(tif, tag, TIFF_ANY); - if (!fip) { /* unknown tag */ - TIFFErrorExt(tif->tif_clientdata, "TIFFSetField", "%s: Unknown %stag %u", - tif->tif_name, isPseudoTag(tag) ? "pseudo-" : "", tag); - return (0); - } - if (tag != TIFFTAG_IMAGELENGTH && (tif->tif_flags & TIFF_BEENWRITING) && - !fip->field_oktochange) { - /* - * Consult info table to see if tag can be changed - * after we've started writing. We only allow changes - * to those tags that don't/shouldn't affect the - * compression and/or format of the data. - */ - TIFFErrorExt(tif->tif_clientdata, "TIFFSetField", - "%s: Cannot modify tag \"%s\" while writing", - tif->tif_name, fip->field_name); - return (0); - } - return (1); + const TIFFField *fip = TIFFFindField(tif, tag, TIFF_ANY); + if (!fip) + { /* unknown tag */ + TIFFErrorExtR(tif, "TIFFSetField", "%s: Unknown %stag %" PRIu32, + tif->tif_name, isPseudoTag(tag) ? "pseudo-" : "", tag); + return (0); + } + if (tag != TIFFTAG_IMAGELENGTH && (tif->tif_flags & TIFF_BEENWRITING) && + !fip->field_oktochange) + { + /* + * Consult info table to see if tag can be changed + * after we've started writing. We only allow changes + * to those tags that don't/shouldn't affect the + * compression and/or format of the data. + */ + TIFFErrorExtR(tif, "TIFFSetField", + "%s: Cannot modify tag \"%s\" while writing", + tif->tif_name, fip->field_name); + return (0); + } + return (1);
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/libtiff/tif_dir.c
749
750
751
752
753
754
755
756
757
758
/* * Return 1/0 according to whether or not * it is permissible to set the tag's value. * Note that we allow ImageLength to be changed * so that we can append and extend to images. * Any other tag may not be altered once writing * has commenced, unless its value has no effect * on the format of the data that is written. */
+ show +
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
static int OkToChangeTag(TIFF* tif, uint32 tag) { const TIFFField* fip = TIFFFindField(tif, tag, TIFF_ANY); if (!fip) { /* unknown tag */ TIFFErrorExt(tif->tif_clientdata, "TIFFSetField", "%s: Unknown %stag %u", tif->tif_name, isPseudoTag(tag) ? "pseudo-" : "", tag); return (0); } if (tag != TIFFTAG_IMAGELENGTH && (tif->tif_flags & TIFF_BEENWRITING) && !fip->field_oktochange) { /* * Consult info table to see if tag can be changed * after we've started writing. We only allow changes * to those tags that don't/shouldn't affect the * compression and/or format of the data. */ TIFFErrorExt(tif->tif_clientdata, "TIFFSetField", "%s: Cannot modify tag \"%s\" while writing", tif->tif_name, fip->field_name); return (0); } return (1);
+ show +
782
783
784
785
786
787
788
789
790
791
} /* * Record the value of a field in the * internal directory structure. The * field will be written to the file * when/if the directory structure is * updated. */ int

[CVE-2023-40093_1.diff] tiffio.h #4
-#define TIFFPRINT_NONE 0x0 /* no extra info */ -#define TIFFPRINT_STRIPS 0x1 /* strips/tiles info */ -#define TIFFPRINT_CURVES 0x2 /* color/gray response curves */ -#define TIFFPRINT_COLORMAP 0x4 /* colormap */ -#define TIFFPRINT_JPEGQTABLES 0x100 /* JPEG Q matrices */ -#define TIFFPRINT_JPEGACTABLES 0x200 /* JPEG AC tables */ -#define TIFFPRINT_JPEGDCTABLES 0x200 /* JPEG DC tables */ +#define TIFFPRINT_NONE 0x0 /* no extra info */ +#define TIFFPRINT_STRIPS 0x1 /* strips/tiles info */ +#define TIFFPRINT_CURVES 0x2 /* color/gray response curves */ +#define TIFFPRINT_COLORMAP 0x4 /* colormap */ +#define TIFFPRINT_JPEGQTABLES 0x100 /* JPEG Q matrices */ +#define TIFFPRINT_JPEGACTABLES 0x200 /* JPEG AC tables */ +#define TIFFPRINT_JPEGDCTABLES 0x200 /* JPEG DC tables */ -/* +/*
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/libtiff/tiffio.h
105
106
107
108
109
110
111
112
113
114
#else typedef void* thandle_t; /* client data handle */ #endif /* USE_WIN32_FILEIO */ /* * Flags to pass to TIFFPrintDirectory to control * printing of data structures that are potentially * very large. Bit-or these flags to enable printing * multiple items. */
+ show +
115
116
117
118
119
120
121
#define TIFFPRINT_NONE 0x0 /* no extra info */ #define TIFFPRINT_STRIPS 0x1 /* strips/tiles info */ #define TIFFPRINT_CURVES 0x2 /* color/gray response curves */ #define TIFFPRINT_COLORMAP 0x4 /* colormap */ #define TIFFPRINT_JPEGQTABLES 0x100 /* JPEG Q matrices */ #define TIFFPRINT_JPEGACTABLES 0x200 /* JPEG AC tables */ #define TIFFPRINT_JPEGDCTABLES 0x200 /* JPEG DC tables */
+ show +
122
123
124
125
126
127
128
129
130
131
/* * Colour conversion stuff */ /* reference white */ #define D65_X0 (95.0470F) #define D65_Y0 (100.0F) #define D65_Z0 (108.8827F)

[CVE-2023-40093_1.diff] tif_luv.c #6
-static int -LogLuvDecodeStrip(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) +static int LogLuvDecodeStrip(TIFF *tif, uint8_t *bp, tmsize_t cc, uint16_t s) - tmsize_t rowlen = TIFFScanlineSize(tif); + tmsize_t rowlen = TIFFScanlineSize(tif); - if (rowlen == 0) - return 0; + if (rowlen == 0) + return 0; - assert(cc%rowlen == 0); - while (cc && (*tif->tif_decoderow)(tif, bp, rowlen, s)) { - bp += rowlen; - cc -= rowlen; - } - return (cc == 0); + assert(cc % rowlen == 0); + while (cc && (*tif->tif_decoderow)(tif, bp, rowlen, s)) + { + bp += rowlen; + cc -= rowlen; + } + return (cc == 0);
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/libtiff/tif_luv.c
386
387
388
389
390
391
392
393
394
395
tif->tif_rawcp = (uint8*) bp; tif->tif_rawcc = cc; return (1); } /* * Decode a strip of pixels. We break it into rows to * maintain synchrony with the encode algorithm, which * is row by row. */
+ show +
396
397
398
399
400
401
402
403
404
405
406
407
408
409
static int LogLuvDecodeStrip(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) { tmsize_t rowlen = TIFFScanlineSize(tif); if (rowlen == 0) return 0; assert(cc%rowlen == 0); while (cc && (*tif->tif_decoderow)(tif, bp, rowlen, s)) { bp += rowlen; cc -= rowlen; } return (cc == 0);
+ show +
410
411
412
413
414
415
416
417
418
419
} /* * Decode a tile of pixels. We break it into rows to * maintain synchrony with the encode algorithm, which * is row by row. */ static int LogLuvDecodeTile(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) {

[CVE-2023-40093_1.diff] tif_compress.c #2
-static int -TIFFNoEncode(TIFF* tif, const char* method) +static int TIFFNoEncode(TIFF *tif, const char *method) - const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression); + const TIFFCodec *c = TIFFFindCODEC(tif->tif_dir.td_compression); - if (c) { - TIFFErrorExt(tif->tif_clientdata, tif->tif_name, - "%s %s encoding is not implemented", - c->name, method); - } else { - TIFFErrorExt(tif->tif_clientdata, tif->tif_name, - "Compression scheme %u %s encoding is not implemented", - tif->tif_dir.td_compression, method); - } - return (-1); + if (c) + { + TIFFErrorExtR(tif, tif->tif_name, "%s %s encoding is not implemented", + c->name, method); + } + else + { + TIFFErrorExtR(tif, tif->tif_name, + "Compression scheme %" PRIu16 + " %s encoding is not implemented", + tif->tif_dir.td_compression, method); + } + return (-1); -int -_TIFFNoRowEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s) +int _TIFFNoRowEncode(TIFF *tif, uint8_t *pp, tmsize_t cc, uint16_t s) - (void) pp; (void) cc; (void) s; - return (TIFFNoEncode(tif, "scanline")); + (void)pp; + (void)cc; + (void)s; + return (TIFFNoEncode(tif, "scanline")); -int -_TIFFNoStripEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s) +int _TIFFNoStripEncode(TIFF *tif, uint8_t *pp, tmsize_t cc, uint16_t s) - (void) pp; (void) cc; (void) s; - return (TIFFNoEncode(tif, "strip")); + (void)pp; + (void)cc; + (void)s; + return (TIFFNoEncode(tif, "strip")); -int -_TIFFNoTileEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s) +int _TIFFNoTileEncode(TIFF *tif, uint8_t *pp, tmsize_t cc, uint16_t s) - (void) pp; (void) cc; (void) s; - return (TIFFNoEncode(tif, "tile")); + (void)pp; + (void)cc; + (void)s; + return (TIFFNoEncode(tif, "tile")); -static int -TIFFNoDecode(TIFF* tif, const char* method) +static int TIFFNoDecode(TIFF *tif, const char *method) - const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression); + const TIFFCodec *c = TIFFFindCODEC(tif->tif_dir.td_compression); - if (c) - TIFFErrorExt(tif->tif_clientdata, tif->tif_name, - "%s %s decoding is not implemented", - c->name, method); - else - TIFFErrorExt(tif->tif_clientdata, tif->tif_name, - "Compression scheme %u %s decoding is not implemented", - tif->tif_dir.td_compression, method); - return (0); + if (c) + TIFFErrorExtR(tif, tif->tif_name, "%s %s decoding is not implemented", + c->name, method); + else + TIFFErrorExtR(tif, tif->tif_name, + "Compression scheme %" PRIu16 + " %s decoding is not implemented", + tif->tif_dir.td_compression, method); + return (0); -static int -_TIFFNoFixupTags(TIFF* tif) +static int _TIFFNoFixupTags(TIFF *tif) - (void) tif; - return (1); + (void)tif; + return (1); -int -_TIFFNoRowDecode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s) +int _TIFFNoRowDecode(TIFF *tif, uint8_t *pp, tmsize_t cc, uint16_t s) - (void) pp; (void) cc; (void) s; - return (TIFFNoDecode(tif, "scanline")); + (void)pp; + (void)cc; + (void)s; + return (TIFFNoDecode(tif, "scanline")); -int -_TIFFNoStripDecode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s) +int _TIFFNoStripDecode(TIFF *tif, uint8_t *pp, tmsize_t cc, uint16_t s) - (void) pp; (void) cc; (void) s; - return (TIFFNoDecode(tif, "strip")); + (void)pp; + (void)cc; + (void)s; + return (TIFFNoDecode(tif, "strip")); -int -_TIFFNoTileDecode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s) +int _TIFFNoTileDecode(TIFF *tif, uint8_t *pp, tmsize_t cc, uint16_t s) - (void) pp; (void) cc; (void) s; - return (TIFFNoDecode(tif, "tile")); + (void)pp; + (void)cc; + (void)s; + return (TIFFNoDecode(tif, "tile")); -int -_TIFFNoSeek(TIFF* tif, uint32 off) +int _TIFFNoSeek(TIFF *tif, uint32_t off) - (void) off; - TIFFErrorExt(tif->tif_clientdata, tif->tif_name, - "Compression algorithm does not support random access"); - return (0); + (void)off; + TIFFErrorExtR(tif, tif->tif_name, + "Compression algorithm does not support random access"); + return (0); -int -_TIFFNoPreCode(TIFF* tif, uint16 s) +int _TIFFNoPreCode(TIFF *tif, uint16_t s) - (void) tif; (void) s; - return (1); + (void)tif; + (void)s; + return (1); -static int _TIFFtrue(TIFF* tif) { (void) tif; return (1); } -static void _TIFFvoid(TIFF* tif) { (void) tif; } - -void -_TIFFSetDefaultCompressionState(TIFF* tif) +static int _TIFFtrue(TIFF *tif) - tif->tif_fixuptags = _TIFFNoFixupTags; - tif->tif_decodestatus = TRUE; - tif->tif_setupdecode = _TIFFtrue; - tif->tif_predecode = _TIFFNoPreCode; - tif->tif_decoderow = _TIFFNoRowDecode; - tif->tif_decodestrip = _TIFFNoStripDecode; - tif->tif_decodetile = _TIFFNoTileDecode; - tif->tif_encodestatus = TRUE; - tif->tif_setupencode = _TIFFtrue; - tif->tif_preencode = _TIFFNoPreCode; - tif->tif_postencode = _TIFFtrue; - tif->tif_encoderow = _TIFFNoRowEncode; - tif->tif_encodestrip = _TIFFNoStripEncode; - tif->tif_encodetile = _TIFFNoTileEncode; - tif->tif_close = _TIFFvoid; - tif->tif_seek = _TIFFNoSeek; - tif->tif_cleanup = _TIFFvoid; - tif->tif_defstripsize = _TIFFDefaultStripSize; - tif->tif_deftilesize = _TIFFDefaultTileSize; - tif->tif_flags &= ~(TIFF_NOBITREV|TIFF_NOREADRAW); + (void)tif; + return (1); +} +static void _TIFFvoid(TIFF *tif) { (void)tif; } + +void _TIFFSetDefaultCompressionState(TIFF *tif) +{ + tif->tif_fixuptags = _TIFFNoFixupTags; + tif->tif_decodestatus = TRUE; + tif->tif_setupdecode = _TIFFtrue; + tif->tif_predecode = _TIFFNoPreCode; + tif->tif_decoderow = _TIFFNoRowDecode; + tif->tif_decodestrip = _TIFFNoStripDecode; + tif->tif_decodetile = _TIFFNoTileDecode; + tif->tif_encodestatus = TRUE; + tif->tif_setupencode = _TIFFtrue; + tif->tif_preencode = _TIFFNoPreCode; + tif->tif_postencode = _TIFFtrue; + tif->tif_encoderow = _TIFFNoRowEncode; + tif->tif_encodestrip = _TIFFNoStripEncode; + tif->tif_encodetile = _TIFFNoTileEncode; + tif->tif_close = _TIFFvoid; + tif->tif_seek = _TIFFNoSeek; + tif->tif_cleanup = _TIFFvoid; + tif->tif_defstripsize = _TIFFDefaultStripSize; + tif->tif_deftilesize = _TIFFDefaultTileSize; + tif->tif_flags &= ~(TIFF_NOBITREV | TIFF_NOREADRAW); -int -TIFFSetCompressionScheme(TIFF* tif, int scheme) +int TIFFSetCompressionScheme(TIFF *tif, int scheme) - const TIFFCodec *c = TIFFFindCODEC((uint16) scheme); + const TIFFCodec *c = TIFFFindCODEC((uint16_t)scheme); - _TIFFSetDefaultCompressionState(tif); - /* - * Don't treat an unknown compression scheme as an error. - * This permits applications to open files with data that - * the library does not have builtin support for, but which - * may still be meaningful. - */ - return (c ? (*c->init)(tif, scheme) : 1); + _TIFFSetDefaultCompressionState(tif); + /* + * Don't treat an unknown compression scheme as an error. + * This permits applications to open files with data that + * the library does not have builtin support for, but which + * may still be meaningful. + */ + return (c ? (*c->init)(tif, scheme) : 1);
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/libtiff/tif_compress.c
24
25
26
27
28
29
30
31
32
33
* OF THIS SOFTWARE. */ /* * TIFF Library * * Compression Scheme Configuration Support. */ #include "tiffiop.h"
+ show +
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
static int TIFFNoEncode(TIFF* tif, const char* method) { const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression); if (c) { TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "%s %s encoding is not implemented", c->name, method); } else { TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Compression scheme %u %s encoding is not implemented", tif->tif_dir.td_compression, method); } return (-1); } int _TIFFNoRowEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s) { (void) pp; (void) cc; (void) s; return (TIFFNoEncode(tif, "scanline")); } int _TIFFNoStripEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s) { (void) pp; (void) cc; (void) s; return (TIFFNoEncode(tif, "strip")); } int _TIFFNoTileEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s) { (void) pp; (void) cc; (void) s; return (TIFFNoEncode(tif, "tile")); } static int TIFFNoDecode(TIFF* tif, const char* method) { const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression); if (c) TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "%s %s decoding is not implemented", c->name, method); else TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Compression scheme %u %s decoding is not implemented", tif->tif_dir.td_compression, method); return (0); } static int _TIFFNoFixupTags(TIFF* tif) { (void) tif; return (1); } int _TIFFNoRowDecode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s) { (void) pp; (void) cc; (void) s; return (TIFFNoDecode(tif, "scanline")); } int _TIFFNoStripDecode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s) { (void) pp; (void) cc; (void) s; return (TIFFNoDecode(tif, "strip")); } int _TIFFNoTileDecode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s) { (void) pp; (void) cc; (void) s; return (TIFFNoDecode(tif, "tile")); } int _TIFFNoSeek(TIFF* tif, uint32 off) { (void) off; TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Compression algorithm does not support random access"); return (0); } int _TIFFNoPreCode(TIFF* tif, uint16 s) { (void) tif; (void) s; return (1); } static int _TIFFtrue(TIFF* tif) { (void) tif; return (1); } static void _TIFFvoid(TIFF* tif) { (void) tif; } void _TIFFSetDefaultCompressionState(TIFF* tif) { tif->tif_fixuptags = _TIFFNoFixupTags; tif->tif_decodestatus = TRUE; tif->tif_setupdecode = _TIFFtrue; tif->tif_predecode = _TIFFNoPreCode; tif->tif_decoderow = _TIFFNoRowDecode; tif->tif_decodestrip = _TIFFNoStripDecode; tif->tif_decodetile = _TIFFNoTileDecode; tif->tif_encodestatus = TRUE; tif->tif_setupencode = _TIFFtrue; tif->tif_preencode = _TIFFNoPreCode; tif->tif_postencode = _TIFFtrue; tif->tif_encoderow = _TIFFNoRowEncode; tif->tif_encodestrip = _TIFFNoStripEncode; tif->tif_encodetile = _TIFFNoTileEncode; tif->tif_close = _TIFFvoid; tif->tif_seek = _TIFFNoSeek; tif->tif_cleanup = _TIFFvoid; tif->tif_defstripsize = _TIFFDefaultStripSize; tif->tif_deftilesize = _TIFFDefaultTileSize; tif->tif_flags &= ~(TIFF_NOBITREV|TIFF_NOREADRAW); } int TIFFSetCompressionScheme(TIFF* tif, int scheme) { const TIFFCodec *c = TIFFFindCODEC((uint16) scheme); _TIFFSetDefaultCompressionState(tif); /* * Don't treat an unknown compression scheme as an error. * This permits applications to open files with data that * the library does not have builtin support for, but which * may still be meaningful. */ return (c ? (*c->init)(tif, scheme) : 1);
+ show +
173
174
175
176
177
178
179
180
181
182
} /* * Other compression schemes may be registered. Registered * schemes can also override the builtin versions provided * by this library. */ typedef struct _codec { struct _codec* next; TIFFCodec* info;

[CVE-2023-40093_1.diff] tif_dir.h #2
-typedef struct { - const TIFFField *info; - int count; - void *value; +typedef struct +{ + const TIFFField *info; + int count; + void *value;
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/libtiff/tif_dir.h
23
24
25
26
27
28
29
30
31
32
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ #ifndef _TIFFDIR_ #define _TIFFDIR_ /* * ``Library-private'' Directory-related Definitions. */
+ show +
33
34
35
36
typedef struct { const TIFFField *info; int count; void *value;
+ show +
37
38
39
40
41
42
43
44
45
46
} TIFFTagValue; /* * TIFF Image File Directories are comprised of a table of field * descriptors of the form shown below. The table is sorted in * ascending order by tag. The values associated with each entry are * disjoint and may appear anywhere in the file (so long as they are * placed on a word boundary). * * If the value is 4 bytes or less, in ClassicTIFF, or 8 bytes or less in

[CVE-2023-40093_1.diff] tif_dir.h #4
-#define FIELD_IGNORE 0 +#define FIELD_IGNORE 0 -#define FIELD_IMAGEDIMENSIONS 1 -#define FIELD_TILEDIMENSIONS 2 -#define FIELD_RESOLUTION 3 -#define FIELD_POSITION 4 +#define FIELD_IMAGEDIMENSIONS 1 +#define FIELD_TILEDIMENSIONS 2 +#define FIELD_RESOLUTION 3 +#define FIELD_POSITION 4 -#define FIELD_SUBFILETYPE 5 -#define FIELD_BITSPERSAMPLE 6 -#define FIELD_COMPRESSION 7 -#define FIELD_PHOTOMETRIC 8 -#define FIELD_THRESHHOLDING 9 -#define FIELD_FILLORDER 10 -#define FIELD_ORIENTATION 15 -#define FIELD_SAMPLESPERPIXEL 16 -#define FIELD_ROWSPERSTRIP 17 -#define FIELD_MINSAMPLEVALUE 18 -#define FIELD_MAXSAMPLEVALUE 19 -#define FIELD_PLANARCONFIG 20 -#define FIELD_RESOLUTIONUNIT 22 -#define FIELD_PAGENUMBER 23 -#define FIELD_STRIPBYTECOUNTS 24 -#define FIELD_STRIPOFFSETS 25 -#define FIELD_COLORMAP 26 -#define FIELD_EXTRASAMPLES 31 -#define FIELD_SAMPLEFORMAT 32 -#define FIELD_SMINSAMPLEVALUE 33 -#define FIELD_SMAXSAMPLEVALUE 34 -#define FIELD_IMAGEDEPTH 35 -#define FIELD_TILEDEPTH 36 -#define FIELD_HALFTONEHINTS 37 -#define FIELD_YCBCRSUBSAMPLING 39 -#define FIELD_YCBCRPOSITIONING 40 -#define FIELD_REFBLACKWHITE 41 -#define FIELD_TRANSFERFUNCTION 44 -#define FIELD_INKNAMES 46 -#define FIELD_SUBIFD 49 +#define FIELD_SUBFILETYPE 5 +#define FIELD_BITSPERSAMPLE 6 +#define FIELD_COMPRESSION 7 +#define FIELD_PHOTOMETRIC 8 +#define FIELD_THRESHHOLDING 9 +#define FIELD_FILLORDER 10 +#define FIELD_ORIENTATION 15 +#define FIELD_SAMPLESPERPIXEL 16 +#define FIELD_ROWSPERSTRIP 17 +#define FIELD_MINSAMPLEVALUE 18 +#define FIELD_MAXSAMPLEVALUE 19 +#define FIELD_PLANARCONFIG 20 +#define FIELD_RESOLUTIONUNIT 22 +#define FIELD_PAGENUMBER 23 +#define FIELD_STRIPBYTECOUNTS 24 +#define FIELD_STRIPOFFSETS 25 +#define FIELD_COLORMAP 26 +#define FIELD_EXTRASAMPLES 31 +#define FIELD_SAMPLEFORMAT 32 +#define FIELD_SMINSAMPLEVALUE 33 +#define FIELD_SMAXSAMPLEVALUE 34 +#define FIELD_IMAGEDEPTH 35 +#define FIELD_TILEDEPTH 36 +#define FIELD_HALFTONEHINTS 37 +#define FIELD_YCBCRSUBSAMPLING 39 +#define FIELD_YCBCRPOSITIONING 40 +#define FIELD_REFBLACKWHITE 41 +#define FIELD_TRANSFERFUNCTION 44 +#define FIELD_INKNAMES 46 +#define FIELD_SUBIFD 49 +#define FIELD_NUMBEROFINKS 50 -#define FIELD_CODEC 66 /* base of codec-private tags */ - +#define FIELD_CODEC 66 /* base of codec-private tags */
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/libtiff/tif_dir.h
122
123
124
125
126
127
128
129
130
131
* Field flags used to indicate fields that have been set in a directory, and * to reference fields when manipulating a directory. */ /* * FIELD_IGNORE is used to signify tags that are to be processed but otherwise * ignored. This permits antiquated tags to be quietly read and discarded. * Note that a bit *is* allocated for ignored tags; this is understood by the * directory reading logic which uses this fact to avoid special-case handling */
+ show +
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#define FIELD_IGNORE 0 /* multi-item fields */ #define FIELD_IMAGEDIMENSIONS 1 #define FIELD_TILEDIMENSIONS 2 #define FIELD_RESOLUTION 3 #define FIELD_POSITION 4 /* single-item fields */ #define FIELD_SUBFILETYPE 5 #define FIELD_BITSPERSAMPLE 6 #define FIELD_COMPRESSION 7 #define FIELD_PHOTOMETRIC 8 #define FIELD_THRESHHOLDING 9 #define FIELD_FILLORDER 10 #define FIELD_ORIENTATION 15 #define FIELD_SAMPLESPERPIXEL 16 #define FIELD_ROWSPERSTRIP 17 #define FIELD_MINSAMPLEVALUE 18 #define FIELD_MAXSAMPLEVALUE 19 #define FIELD_PLANARCONFIG 20 #define FIELD_RESOLUTIONUNIT 22 #define FIELD_PAGENUMBER 23 #define FIELD_STRIPBYTECOUNTS 24 #define FIELD_STRIPOFFSETS 25 #define FIELD_COLORMAP 26 #define FIELD_EXTRASAMPLES 31 #define FIELD_SAMPLEFORMAT 32 #define FIELD_SMINSAMPLEVALUE 33 #define FIELD_SMAXSAMPLEVALUE 34 #define FIELD_IMAGEDEPTH 35 #define FIELD_TILEDEPTH 36 #define FIELD_HALFTONEHINTS 37 #define FIELD_YCBCRSUBSAMPLING 39 #define FIELD_YCBCRPOSITIONING 40 #define FIELD_REFBLACKWHITE 41 #define FIELD_TRANSFERFUNCTION 44 #define FIELD_INKNAMES 46 #define FIELD_SUBIFD 49 /* FIELD_CUSTOM (see tiffio.h) 65 */ /* end of support for well-known tags; codec-private tags follow */ #define FIELD_CODEC 66 /* base of codec-private tags */
+ show +
174
175
176
177
178
179
180
181
182
183
/* * Pseudo-tags don't normally need field bits since they are not written to an * output file (by definition). The library also has express logic to always * query a codec for a pseudo-tag so allocating a field bit for one is a * waste. If codec wants to promote the notion of a pseudo-tag being ``set'' * or ``unset'' then it can do using internal state flags without polluting * the field bit space defined for real tags. */

[CVE-2023-40093_1.diff] tif_write.c #3
-tmsize_t -TIFFWriteRawStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc) +tmsize_t TIFFWriteRawStrip(TIFF *tif, uint32_t strip, void *data, tmsize_t cc) - static const char module[] = "TIFFWriteRawStrip"; - TIFFDirectory *td = &tif->tif_dir; + static const char module[] = "TIFFWriteRawStrip"; + TIFFDirectory *td = &tif->tif_dir; - if (!WRITECHECKSTRIPS(tif, module)) - return ((tmsize_t) -1); - /* - * Check strip array to make sure there's space. - * We don't support dynamically growing files that - * have data organized in separate bitplanes because - * it's too painful. In that case we require that - * the imagelength be set properly before the first - * write (so that the strips array will be fully - * allocated above). - */ - if (strip >= td->td_nstrips) { - if (td->td_planarconfig == PLANARCONFIG_SEPARATE) { - TIFFErrorExt(tif->tif_clientdata, module, - "Can not grow image by strips when using separate planes"); - return ((tmsize_t) -1); - } - /* - * Watch out for a growing image. The value of - * strips/image will initially be 1 (since it - * can't be deduced until the imagelength is known). - */ - if (strip >= td->td_stripsperimage) - td->td_stripsperimage = - TIFFhowmany_32(td->td_imagelength,td->td_rowsperstrip); - if (!TIFFGrowStrips(tif, 1, module)) - return ((tmsize_t) -1); - } - tif->tif_curstrip = strip; - if (td->td_stripsperimage == 0) { - TIFFErrorExt(tif->tif_clientdata, module,"Zero strips per image"); - return ((tmsize_t) -1); + if (!WRITECHECKSTRIPS(tif, module)) + return ((tmsize_t)-1); + /* + * Check strip array to make sure there's space. + * We don't support dynamically growing files that + * have data organized in separate bitplanes because + * it's too painful. In that case we require that + * the imagelength be set properly before the first + * write (so that the strips array will be fully + * allocated above). + */ + if (strip >= td->td_nstrips) + { + if (td->td_planarconfig == PLANARCONFIG_SEPARATE) + { + TIFFErrorExtR( + tif, module, + "Can not grow image by strips when using separate planes"); + return ((tmsize_t)-1); - tif->tif_row = (strip % td->td_stripsperimage) * td->td_rowsperstrip; - return (TIFFAppendToStrip(tif, strip, (uint8*) data, cc) ? - cc : (tmsize_t) -1); + /* + * Watch out for a growing image. The value of + * strips/image will initially be 1 (since it + * can't be deduced until the imagelength is known). + */ + if (strip >= td->td_stripsperimage) + td->td_stripsperimage = + TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip); + if (!TIFFGrowStrips(tif, 1, module)) + return ((tmsize_t)-1); + } + + if (tif->tif_curstrip != strip) + { + tif->tif_curstrip = strip; + + /* this informs TIFFAppendToStrip() we have changed or reset strip */ + tif->tif_curoff = 0; + } + + if (td->td_stripsperimage == 0) + { + TIFFErrorExtR(tif, module, "Zero strips per image"); + return ((tmsize_t)-1); + } + tif->tif_row = (strip % td->td_stripsperimage) * td->td_rowsperstrip; + return (TIFFAppendToStrip(tif, strip, (uint8_t *)data, cc) ? cc + : (tmsize_t)-1); -tmsize_t -TIFFWriteTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s) +tmsize_t TIFFWriteTile(TIFF *tif, void *buf, uint32_t x, uint32_t y, uint32_t z, + uint16_t s) - if (!TIFFCheckTile(tif, x, y, z, s)) - return ((tmsize_t)(-1)); - /* - * NB: A tile size of -1 is used instead of tif_tilesize knowing - * that TIFFWriteEncodedTile will clamp this to the tile size. - * This is done because the tile size may not be defined until - * after the output buffer is setup in TIFFWriteBufferSetup. - */ - return (TIFFWriteEncodedTile(tif, - TIFFComputeTile(tif, x, y, z, s), buf, (tmsize_t)(-1))); + if (!TIFFCheckTile(tif, x, y, z, s)) + return ((tmsize_t)(-1)); + /* + * NB: A tile size of -1 is used instead of tif_tilesize knowing + * that TIFFWriteEncodedTile will clamp this to the tile size. + * This is done because the tile size may not be defined until + * after the output buffer is setup in TIFFWriteBufferSetup. + */ + return (TIFFWriteEncodedTile(tif, TIFFComputeTile(tif, x, y, z, s), buf, + (tmsize_t)(-1)));
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/libtiff/tif_write.c
295
296
297
298
299
300
301
302
303
304
tif->tif_rawcc = 0; tif->tif_rawcp = tif->tif_rawdata; return (cc); } /* * Write the supplied data to the specified strip. * * NB: Image length must be setup before writing. */
+ show +
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
tmsize_t TIFFWriteRawStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc) { static const char module[] = "TIFFWriteRawStrip"; TIFFDirectory *td = &tif->tif_dir; if (!WRITECHECKSTRIPS(tif, module)) return ((tmsize_t) -1); /* * Check strip array to make sure there's space. * We don't support dynamically growing files that * have data organized in separate bitplanes because * it's too painful. In that case we require that * the imagelength be set properly before the first * write (so that the strips array will be fully * allocated above). */ if (strip >= td->td_nstrips) { if (td->td_planarconfig == PLANARCONFIG_SEPARATE) { TIFFErrorExt(tif->tif_clientdata, module, "Can not grow image by strips when using separate planes"); return ((tmsize_t) -1); } /* * Watch out for a growing image. The value of * strips/image will initially be 1 (since it * can't be deduced until the imagelength is known). */ if (strip >= td->td_stripsperimage) td->td_stripsperimage = TIFFhowmany_32(td->td_imagelength,td->td_rowsperstrip); if (!TIFFGrowStrips(tif, 1, module)) return ((tmsize_t) -1); } tif->tif_curstrip = strip; if (td->td_stripsperimage == 0) { TIFFErrorExt(tif->tif_clientdata, module,"Zero strips per image"); return ((tmsize_t) -1); } tif->tif_row = (strip % td->td_stripsperimage) * td->td_rowsperstrip; return (TIFFAppendToStrip(tif, strip, (uint8*) data, cc) ? cc : (tmsize_t) -1); } /* * Write and compress a tile of data. The * tile is selected by the (x,y,z,s) coordinates. */ tmsize_t TIFFWriteTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s) { if (!TIFFCheckTile(tif, x, y, z, s)) return ((tmsize_t)(-1)); /* * NB: A tile size of -1 is used instead of tif_tilesize knowing * that TIFFWriteEncodedTile will clamp this to the tile size. * This is done because the tile size may not be defined until * after the output buffer is setup in TIFFWriteBufferSetup. */ return (TIFFWriteEncodedTile(tif, TIFFComputeTile(tif, x, y, z, s), buf, (tmsize_t)(-1)));
+ show +
366
367
368
369
370
371
372
373
374
375
} /* * Encode the supplied data and write it to the * specified tile. There must be space for the * data. The function clamps individual writes * to a tile to the tile size, but does not (and * can not) check that multiple writes to the same * tile do not write more than tile size data. *

[CVE-2023-40093_1.diff] tif_jpeg.c #8
-static void -TIFFjpeg_error_exit(j_common_ptr cinfo) +static void TIFFjpeg_error_exit(j_common_ptr cinfo) - JPEGState *sp = (JPEGState *) cinfo; /* NB: cinfo assumed first */ - char buffer[JMSG_LENGTH_MAX]; + JPEGState *sp = (JPEGState *)cinfo; /* NB: cinfo assumed first */ + char buffer[JMSG_LENGTH_MAX]; - (*cinfo->err->format_message) (cinfo, buffer); - TIFFErrorExt(sp->tif->tif_clientdata, "JPEGLib", "%s", buffer); /* display the error message */ - jpeg_abort(cinfo); /* clean up libjpeg state */ - LONGJMP(sp->exit_jmpbuf, 1); /* return to libtiff caller */ + (*cinfo->err->format_message)(cinfo, buffer); + TIFFErrorExtR(sp->tif, "JPEGLib", "%s", + buffer); /* display the error message */ + jpeg_abort(cinfo); /* clean up libjpeg state */ + LONGJMP(sp->exit_jmpbuf, 1); /* return to libtiff caller */
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/libtiff/tif_jpeg.c
210
211
212
213
214
215
216
217
218
219
* when a fatal error is encountered within the JPEG * library. We also direct libjpeg error and warning * messages through the appropriate libtiff handlers. */ /* * Error handling routines (these replace corresponding * IJG routines from jerror.c). These are used for both * compression and decompression. */
+ show +
220
221
222
223
224
225
226
227
228
229
static void TIFFjpeg_error_exit(j_common_ptr cinfo) { JPEGState *sp = (JPEGState *) cinfo; /* NB: cinfo assumed first */ char buffer[JMSG_LENGTH_MAX]; (*cinfo->err->format_message) (cinfo, buffer); TIFFErrorExt(sp->tif->tif_clientdata, "JPEGLib", "%s", buffer); /* display the error message */ jpeg_abort(cinfo); /* clean up libjpeg state */ LONGJMP(sp->exit_jmpbuf, 1); /* return to libtiff caller */
+ show +
230
231
232
233
234
235
236
237
238
239
} /* * This routine is invoked only for warning messages, * since error_exit does its own thing and trace_level * is never set > 0. */ static void TIFFjpeg_output_message(j_common_ptr cinfo) {

[CVE-2023-40093_1.diff] tif_jpeg.c #13
-static int -alloc_downsampled_buffers(TIFF* tif, jpeg_component_info* comp_info, - int num_components) +static int alloc_downsampled_buffers(TIFF *tif, jpeg_component_info *comp_info, + int num_components) - JPEGState* sp = JState(tif); - int ci; - jpeg_component_info* compptr; - JSAMPARRAY buf; - int samples_per_clump = 0; + JPEGState *sp = JState(tif); + int ci; + jpeg_component_info *compptr; + TIFF_JSAMPARRAY buf; + int samples_per_clump = 0; - for (ci = 0, compptr = comp_info; ci < num_components; - ci++, compptr++) { - samples_per_clump += compptr->h_samp_factor * - compptr->v_samp_factor; - buf = TIFFjpeg_alloc_sarray(sp, JPOOL_IMAGE, - compptr->width_in_blocks * DCTSIZE, - (JDIMENSION) (compptr->v_samp_factor*DCTSIZE)); - if (buf == NULL) - return (0); - sp->ds_buffer[ci] = buf; - } - sp->samplesperclump = samples_per_clump; - return (1); + for (ci = 0, compptr = comp_info; ci < num_components; ci++, compptr++) + { + samples_per_clump += compptr->h_samp_factor * compptr->v_samp_factor; + buf = (TIFF_JSAMPARRAY)TIFFjpeg_alloc_sarray( + sp, JPOOL_IMAGE, compptr->width_in_blocks * DCTSIZE, + (JDIMENSION)(compptr->v_samp_factor * DCTSIZE)); + if (buf == NULL) + return (0); + sp->ds_buffer[ci] = buf; + } + sp->samplesperclump = samples_per_clump; + return (1); -
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/libtiff/tif_jpeg.c
631
632
633
634
635
636
637
638
639
640
sp->src.init_source = tables_init_source; } /* * Allocate downsampled-data buffers needed for downsampled I/O. * We use values computed in jpeg_start_compress or jpeg_start_decompress. * We use libjpeg's allocator so that buffers will be released automatically * when done with strip/tile. * This is also a handy place to compute samplesperclump, bytesperline. */
+ show +
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
static int alloc_downsampled_buffers(TIFF* tif, jpeg_component_info* comp_info, int num_components) { JPEGState* sp = JState(tif); int ci; jpeg_component_info* compptr; JSAMPARRAY buf; int samples_per_clump = 0; for (ci = 0, compptr = comp_info; ci < num_components; ci++, compptr++) { samples_per_clump += compptr->h_samp_factor * compptr->v_samp_factor; buf = TIFFjpeg_alloc_sarray(sp, JPOOL_IMAGE, compptr->width_in_blocks * DCTSIZE, (JDIMENSION) (compptr->v_samp_factor*DCTSIZE)); if (buf == NULL) return (0); sp->ds_buffer[ci] = buf; } sp->samplesperclump = samples_per_clump; return (1);
+ show +
664
665
666
667
668
669
670
671
672
673
} /* * JPEG Decoding. */ #ifdef CHECK_JPEG_YCBCR_SUBSAMPLING #define JPEG_MARKER_SOF0 0xC0

[CVE-2023-40093_1.diff] tif_jpeg.c #19
-static int JPEGInitializeLibJPEG( TIFF * tif, int decompress ) +static int JPEGInitializeLibJPEG(TIFF *tif, int decompress) - JPEGState* sp = JState(tif); + JPEGState *sp = JState(tif); - if(sp->cinfo_initialized) + if (sp->cinfo_initialized) - if( !decompress && sp->cinfo.comm.is_decompressor ) - TIFFjpeg_destroy( sp ); - else if( decompress && !sp->cinfo.comm.is_decompressor ) - TIFFjpeg_destroy( sp ); + if (!decompress && sp->cinfo.comm.is_decompressor) + TIFFjpeg_destroy(sp); + else if (decompress && !sp->cinfo.comm.is_decompressor) + TIFFjpeg_destroy(sp);
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/libtiff/tif_jpeg.c
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
* or decompressor that occurs after the reading of the directory. * * In an ideal world compressors or decompressors would be setup * at the point where a single tile or strip was accessed (for read or write) * so that stuff like update of missing tiles, or replacement of tiles could * be done. However, we aren't trying to crack that nut just yet ... * * NFW, Feb 3rd, 2003. */
+ show +
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
static int JPEGInitializeLibJPEG( TIFF * tif, int decompress ) { JPEGState* sp = JState(tif); if(sp->cinfo_initialized) { if( !decompress && sp->cinfo.comm.is_decompressor ) TIFFjpeg_destroy( sp ); else if( decompress && !sp->cinfo.comm.is_decompressor ) TIFFjpeg_destroy( sp );
+ show +
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
else return 1; sp->cinfo_initialized = 0; } /* * Initialize libjpeg. */ if ( decompress ) {

[CVE-2023-40093_1.diff] tif_codec.c #5
-int -TIFFIsCODECConfigured(uint16 scheme) +int TIFFIsCODECConfigured(uint16_t scheme) - const TIFFCodec* codec = TIFFFindCODEC(scheme); + const TIFFCodec *codec = TIFFFindCODEC(scheme); - if(codec == NULL) { - return 0; - } - if(codec->init == NULL) { - return 0; - } - if(codec->init != NotConfigured){ - return 1; - } - return 0; + if (codec == NULL) + { + return 0; + } + if (codec->init == NULL) + { + return 0; + } + if (codec->init != NotConfigured) + { + return 1; + } + return 0; - -/* - * Local Variables: - * mode: c - * c-basic-offset: 8 - * fill-column: 78 - * End: - */
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/libtiff/tif_codec.c
132
133
134
135
136
137
138
139
140
141
/* TIFFIsCODECConfigured() */ /************************************************************************/ /** * Check whether we have working codec for the specific coding scheme. * * @return returns 1 if the codec is configured and working. Otherwise * 0 will be returned. */
+ show +
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
int TIFFIsCODECConfigured(uint16 scheme) { const TIFFCodec* codec = TIFFFindCODEC(scheme); if(codec == NULL) { return 0; } if(codec->init == NULL) { return 0; } if(codec->init != NotConfigured){ return 1; } return 0;
+ show +
157
158
159
160
161
162
163
164
165
} /* * Local Variables: * mode: c * c-basic-offset: 8 * fill-column: 78 * End: */

[CVE-2023-40093_1.diff] safe_conversions.h #14
-// Convience wrapper returns a StrictNumeric from the provided arithmetic type. +// Convenience wrapper returns a StrictNumeric from the provided arithmetic +// type. -// Overload the ostream output operator to make logging work nicely. -template <typename T> -std::ostream& operator<<(std::ostream& os, const StrictNumeric<T>& value) { - os << static_cast<T>(value); - return os; -} -
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/base/numerics/safe_conversions.h
224
225
226
227
228
229
230
231
232
233
}; // Convience wrapper returns a StrictNumeric from the provided arithmetic type. template <typename T> constexpr StrictNumeric<typename UnderlyingType<T>::type> MakeStrictNum( const T value) { return value; } // Overload the ostream output operator to make logging work nicely.
+ show +
234
235
236
237
template <typename T> std::ostream& operator<<(std::ostream& os, const StrictNumeric<T>& value) { os << static_cast<T>(value); return os;
+ show +
238
239
240
241
242
243
244
245
246
247
} #define STRICT_COMPARISON_OP(NAME, OP) \ template <typename L, typename R, \ typename std::enable_if< \ internal::IsStrictOp<L, R>::value>::type* = nullptr> \ constexpr bool operator OP(const L lhs, const R rhs) { \ return SafeCompare<NAME, typename UnderlyingType<L>::type, \ typename UnderlyingType<R>::type>(lhs, rhs); \ }
/media/esteban/ACOS/ResurrectionX/external/libchrome/base/numerics/safe_conversions.h
293
294
295
296
297
298
299
300
301
302
}; // Convience wrapper returns a StrictNumeric from the provided arithmetic type. template <typename T> constexpr StrictNumeric<typename UnderlyingType<T>::type> MakeStrictNum( const T value) { return value; } // Overload the ostream output operator to make logging work nicely.
+ show +
303
304
305
306
template <typename T> std::ostream& operator<<(std::ostream& os, const StrictNumeric<T>& value) { os << static_cast<T>(value); return os;
+ show +
307
308
309
310
311
312
313
314
315
316
} #define BASE_NUMERIC_COMPARISON_OPERATORS(CLASS, NAME, OP) \ template <typename L, typename R, \ typename std::enable_if< \ internal::Is##CLASS##Op<L, R>::value>::type* = nullptr> \ constexpr bool operator OP(const L lhs, const R rhs) { \ return SafeCompare<NAME, typename UnderlyingType<L>::type, \ typename UnderlyingType<R>::type>(lhs, rhs); \ }
/media/esteban/ACOS/ResurrectionX/external/v8/src/base/safe_conversions.h
312
313
314
315
316
317
318
319
320
321
// Convience wrapper returns a StrictNumeric from the provided arithmetic type. template <typename T> constexpr StrictNumeric<typename UnderlyingType<T>::type> MakeStrictNum( const T value) { return value; } #if !BASE_NUMERICS_DISABLE_OSTREAM_OPERATORS // Overload the ostream output operator to make logging work nicely.
+ show +
322
323
324
325
template <typename T> std::ostream& operator<<(std::ostream& os, const StrictNumeric<T>& value) { os << static_cast<T>(value); return os;
+ show +
326
327
328
329
330
331
332
333
334
335
} #endif #define BASE_NUMERIC_COMPARISON_OPERATORS(CLASS, NAME, OP) \ template <typename L, typename R, \ typename std::enable_if< \ internal::Is##CLASS##Op<L, R>::value>::type* = nullptr> \ constexpr bool operator OP(const L lhs, const R rhs) { \ return SafeCompare<NAME, typename UnderlyingType<L>::type, \ typename UnderlyingType<R>::type>(lhs, rhs); \

[CVE-2015-0973_1.diff] png.c #3
+#ifdef __GNUC__ +/* This exists solely to work round a warning from GNU C. */ +static int /* PRIVATE */ +png_gt(size_t a, size_t b) +{ + return a > b; +} +#else +# define png_gt(a,b) ((a) > (b)) +#endif + + else if (width > PNG_UINT_31_MAX) + { + png_warning(png_ptr, "Invalid image width in IHDR"); + error = 1; + } + + else if (png_gt(width, + (PNG_SIZE_MAX >> 3) /* 8-byte RGBA pixels */ + - 48 /* big_row_buf hack */ + - 1 /* filter byte */ + - 7*8 /* rounding width to multiple of 8 pix */ + - 8)) /* extra max_pixel_depth pad */ + { + /* The size of the row must be within the limits of this architecture. + * Because the read code can perform arbitrary transformations the + * maximum size is checked here. Because the code in png_read_start_row + * adds extra space "for safety's sake" in several places a conservative + * limit is used here. + * + * NOTE: it would be far better to check the size that is actually used, + * but the effect in the real world is minor and the changes are more + * extensive, therefore much more dangerous and much more difficult to + * write in a way that avoids compiler warnings. + */ + png_warning(png_ptr, "Image width is too large for this architecture"); + error = 1; + } + +# ifdef PNG_SET_USER_LIMITS_SUPPORTED + else if (width > png_ptr->user_width_max) +# else + else if (width > PNG_USER_WIDTH_MAX) +# endif + { + png_warning(png_ptr, "Image width exceeds user limit in IHDR"); + error = 1; + } -# ifdef PNG_SET_USER_LIMITS_SUPPORTED - if (width > png_ptr->user_width_max) - -# else - if (width > PNG_USER_WIDTH_MAX) -# endif - { - png_warning(png_ptr, "Image width exceeds user limit in IHDR"); - error = 1; - }
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/libpng16/png.c
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
* * NOTE: it would be far better to check the size that is actually used, * but the effect in the real world is minor and the changes are more * extensive, therefore much more dangerous and much more difficult to * write in a way that avoids compiler warnings. */ png_warning(png_ptr, "Image width is too large for this architecture"); error = 1; }
+ show +
2557
2558
2559
2560
2561
2562
2563
2564
#ifdef PNG_SET_USER_LIMITS_SUPPORTED if (width > png_ptr->user_width_max) #else if (width > PNG_USER_WIDTH_MAX) #endif { png_warning(png_ptr, "Image width exceeds user limit in IHDR"); error = 1;
+ show +
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
} if (height == 0) { png_warning(png_ptr, "Image height is zero in IHDR"); error = 1; } if (height > PNG_UINT_31_MAX) {
/media/esteban/ACOS/ResurrectionX/external/libpng/png.c
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
* * NOTE: it would be far better to check the size that is actually used, * but the effect in the real world is minor and the changes are more * extensive, therefore much more dangerous and much more difficult to * write in a way that avoids compiler warnings. */ png_warning(png_ptr, "Image width is too large for this architecture"); error = 1; }
+ show +
2595
2596
2597
2598
2599
2600
2601
2602
#ifdef PNG_SET_USER_LIMITS_SUPPORTED if (width > png_ptr->user_width_max) #else if (width > PNG_USER_WIDTH_MAX) #endif { png_warning(png_ptr, "Image width exceeds user limit in IHDR"); error = 1;
+ show +
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
} if (height == 0) { png_warning(png_ptr, "Image height is zero in IHDR"); error = 1; } if (height > PNG_UINT_31_MAX) {

[CVE-2023-40093_1.diff] agg_path_storage.cpp #2
+} // namespace pdfium +namespace pdfium +{ -path_storage::path_storage() : - m_total_vertices(0), - m_total_blocks(0), - m_max_blocks(0), - m_coord_blocks(0), - m_cmd_blocks(0), - m_iterator(0) -{ +path_storage::path_storage() = default; +path_storage::path_storage(path_storage&& other) { + m_total_vertices = other.m_total_vertices; + m_total_blocks = other.m_total_blocks; + m_max_blocks = other.m_max_blocks; + m_coord_blocks = other.m_coord_blocks; + m_cmd_blocks = other.m_cmd_blocks; + m_iterator = other.m_iterator; + other.m_total_vertices = 0; + other.m_total_blocks = 0; + other.m_max_blocks = 0; + other.m_coord_blocks = nullptr; + other.m_cmd_blocks = nullptr; + other.m_iterator = 0;
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/agg23/agg_path_storage.cpp
34
35
36
37
38
39
40
41
42
43
{ if(m_total_blocks) { float** coord_blk = m_coord_blocks + m_total_blocks - 1; while(m_total_blocks--) { FX_Free(*coord_blk); --coord_blk; } FX_Free(m_coord_blocks); } }
+ show +
44
45
46
47
48
49
50
path_storage::path_storage() : m_total_vertices(0), m_total_blocks(0), m_max_blocks(0), m_coord_blocks(0), m_cmd_blocks(0), m_iterator(0)
+ show +
51
52
53
54
55
56
57
58
59
60
{ } void path_storage::allocate_block(unsigned nb) { if(nb >= m_max_blocks) { float** new_coords = FX_Alloc2D(float*, m_max_blocks + block_pool, 2); unsigned char** new_cmds = (unsigned char**)(new_coords + m_max_blocks + block_pool); if(m_coord_blocks) {

[CVE-2023-40093_1.diff] agg_curves.h #2
+} // namespace pdfium +namespace pdfium +{ +} // namespace pdfium +namespace pdfium +{ +} // namespace pdfium +namespace pdfium +{ +} // namespace pdfium +namespace pdfium +{ +} // namespace pdfium +namespace pdfium +{ +} // namespace pdfium +namespace pdfium +{ +} // namespace pdfium +namespace pdfium +{ - unsigned vertex_flag(float* x, float* y, int& flag) - { - if(m_count >= m_points.size()) { - return path_cmd_stop; - } - const point_type& p = m_points[m_count++]; - *x = p.x; - *y = p.y; - flag = p.flag; - return (m_count == 1) ? path_cmd_move_to : path_cmd_line_to; - } - int count() - { - return m_points.size(); - }
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/agg23/agg_curves.h
98
99
100
101
102
103
104
105
106
107
unsigned vertex(float* x, float* y) { if(m_count >= m_points.size()) { return path_cmd_stop; } const point_type& p = m_points[m_count++]; *x = p.x; *y = p.y; return (m_count == 1) ? path_cmd_move_to : path_cmd_line_to; }
+ show +
108
109
110
111
112
113
114
115
116
117
118
119
120
121
unsigned vertex_flag(float* x, float* y, int& flag) { if(m_count >= m_points.size()) { return path_cmd_stop; } const point_type& p = m_points[m_count++]; *x = p.x; *y = p.y; flag = p.flag; return (m_count == 1) ? path_cmd_move_to : path_cmd_line_to; } int count() { return m_points.size();
+ show +
122
123
124
125
126
127
128
129
130
131
} private: void bezier(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4); void recursive_bezier(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4,

[CVE-2023-40093_1.diff] agg_curves.h #3
- unsigned vertex_curve_flag(float* x, float* y, int& flag) - { - return m_curve_div.vertex_flag(x, y, flag); - } - int count() - { - return m_curve_div.count(); - } +} // namespace pdfium
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/agg23/agg_curves.h
166
167
168
169
170
171
172
173
174
175
init(cp[0], cp[1], cp[2], cp[3], cp[4], cp[5], cp[6], cp[7]); } void rewind(unsigned path_id) { m_curve_div.rewind(path_id); } unsigned vertex(float* x, float* y) { return m_curve_div.vertex(x, y); }
+ show +
176
177
178
179
180
181
182
unsigned vertex_curve_flag(float* x, float* y, int& flag) { return m_curve_div.vertex_flag(x, y, flag); } int count() { return m_curve_div.count();
+ show +
183
184
185
186
187
188
} private: curve4_div m_curve_div; }; } #endif

[CVE-2023-40093_1.diff] agg_path_storage.h #3
+namespace pdfium +{ + path_storage(path_storage&& other); + path_storage& operator=(path_storage&&) = delete; + path_storage(const path_storage&) = delete; + path_storage& operator=(const path_storage&) = delete; - template<class VertexSource> - void add_path_curve(VertexSource& vs, - unsigned path_id = 0, - bool solid_path = true) - { - float x, y; - unsigned cmd; - int flag; - vs.rewind(path_id); - while(!is_stop(cmd = vs.vertex_curve_flag(&x, &y, flag))) { - if(is_move_to(cmd) && solid_path && m_total_vertices) { - cmd = path_cmd_line_to | flag; - } - add_vertex(x, y, cmd | flag); - } - }
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/agg23/agg_path_storage.h
63
64
65
66
67
68
69
70
71
72
float x, y; unsigned cmd; vs.rewind(path_id); while(!is_stop(cmd = vs.vertex(&x, &y))) { if(is_move_to(cmd) && solid_path && m_total_vertices) { cmd = path_cmd_line_to; } add_vertex(x, y, cmd); } }
+ show +
73
74
75
76
77
78
79
80
81
82
83
84
85
86
template<class VertexSource> void add_path_curve(VertexSource& vs, unsigned path_id = 0, bool solid_path = true) { float x, y; unsigned cmd; int flag; vs.rewind(path_id); while(!is_stop(cmd = vs.vertex_curve_flag(&x, &y, flag))) { if(is_move_to(cmd) && solid_path && m_total_vertices) { cmd = path_cmd_line_to | flag; } add_vertex(x, y, cmd | flag);
+ show +
87
88
89
90
91
92
93
94
95
96
} } unsigned total_vertices() const { return m_total_vertices; } unsigned vertex(unsigned idx, float* x, float* y) const { unsigned nb = idx >> block_shift; const float* pv = m_coord_blocks[nb] + ((idx & block_mask) << 1);

[CVE-2023-40093_1.diff] agg_path_storage.h #4
- unsigned m_total_vertices; - unsigned m_total_blocks; - unsigned m_max_blocks; - float** m_coord_blocks; - unsigned char** m_cmd_blocks; - unsigned m_iterator; + unsigned m_total_vertices = 0; + unsigned m_total_blocks = 0; + unsigned m_max_blocks = 0; + float** m_coord_blocks = nullptr; + unsigned char** m_cmd_blocks = nullptr; + unsigned m_iterator = 0;
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/agg23/agg_path_storage.h
107
108
109
110
111
112
113
114
115
116
return m_cmd_blocks[idx >> block_shift][idx & block_mask] & path_flags_jr; } void rewind(unsigned path_id); unsigned vertex(float* x, float* y); void add_vertex(float x, float y, unsigned cmd); void end_poly(); private: void allocate_block(unsigned nb); unsigned char* storage_ptrs(float** xy_ptr); private:
+ show +
117
118
119
120
121
122
unsigned m_total_vertices; unsigned m_total_blocks; unsigned m_max_blocks; float** m_coord_blocks; unsigned char** m_cmd_blocks; unsigned m_iterator;
+ show +
123
124
125
126
127
128
129
130
131
132
}; inline unsigned path_storage::vertex(float* x, float* y) { if(m_iterator >= m_total_vertices) { return path_cmd_stop; } return vertex(m_iterator++, x, y); } inline unsigned path_storage::prev_vertex(float* x, float* y) const {

[CVE-2023-40093_1.diff] 0027-changes-from-beginning-of-time.patch #2
+ Curve -> Evals = NULL; + } -- if (Curve) _cmsFree(ContextID, Curve); -+ if (Curve) { -+ _cmsFree(ContextID, Curve); -+ Curve = NULL; -+ } - } - - // Utility function, free 3 gamma tables -@@ -799,7 +814,10 @@ void CMSEXPORT cmsFreeToneCurveTriple(cmsToneCurve* Curve[3]) - // Duplicate a gamma table - cmsToneCurve* CMSEXPORT cmsDupToneCurve(const cmsToneCurve* In) - { -- if (In == NULL || In ->Segments == NULL || In ->Table16 == NULL) return NULL; -+ // Xiaochuan Liu -+ // fix openpdf bug(mantis id:0055683, google id:360198) -+ // the function CurveSetElemTypeFree in cmslut.c also needs to check pointer -+ if (In == NULL || In ->InterpParams == NULL || In ->Segments == NULL || In ->Table16 == NULL) return NULL; - - return AllocateToneCurveStruct(In ->InterpParams ->ContextID, In ->nEntries, In ->nSegments, In ->Segments, In ->Table16); + _cmsFree(ContextID, Curve);
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/0027-changes-from-beginning-of-time.patch
59
60
61
62
63
64
65
66
67
68
_cmsFree(ContextID, Curve ->SegInterp); + Curve ->SegInterp = NULL; } - if (Curve -> Evals) + if (Curve -> Evals) { _cmsFree(ContextID, Curve -> Evals); + Curve -> Evals = NULL; + }
+ show +
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
- if (Curve) _cmsFree(ContextID, Curve); + if (Curve) { + _cmsFree(ContextID, Curve); + Curve = NULL; + } } // Utility function, free 3 gamma tables @@ -799,7 +814,10 @@ void CMSEXPORT cmsFreeToneCurveTriple(cmsToneCurve* Curve[3]) // Duplicate a gamma table cmsToneCurve* CMSEXPORT cmsDupToneCurve(const cmsToneCurve* In) { - if (In == NULL || In ->Segments == NULL || In ->Table16 == NULL) return NULL; + // Xiaochuan Liu + // fix openpdf bug(mantis id:0055683, google id:360198) + // the function CurveSetElemTypeFree in cmslut.c also needs to check pointer + if (In == NULL || In ->InterpParams == NULL || In ->Segments == NULL || In ->Table16 == NULL) return NULL; return AllocateToneCurveStruct(In ->InterpParams ->ContextID, In ->nEntries, In ->nSegments, In ->Segments, In ->Table16);
+ show +
88
89
90
91
92
93
94
95
96
97
} diff --git a/third_party/lcms/src/cmsio0.c b/third_party/lcms/src/cmsio0.c index 1b026488d..cc5f89064 100644 --- a/third_party/lcms/src/cmsio0.c +++ b/third_party/lcms/src/cmsio0.c @@ -479,6 +479,14 @@ cmsIOHANDLER* CMSEXPORT cmsGetProfileIOhandler(cmsHPROFILE hProfile) return Icc->IOhandler; } +#ifdef _WIN32_WCE

[CVE-2023-40093_1.diff] lcms2_plugin.h #7
-typedef cmsUInt8Number* (* cmsFormatter16)(register struct _cmstransform_struct* CMMcargo, - register cmsUInt16Number Values[], - register cmsUInt8Number* Buffer, - register cmsUInt32Number Stride); +typedef cmsUInt8Number* (* cmsFormatter16)(CMSREGISTER struct _cmstransform_struct* CMMcargo, + CMSREGISTER cmsUInt16Number Values[], + CMSREGISTER cmsUInt8Number* Buffer, + CMSREGISTER cmsUInt32Number Stride);
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/include/lcms2_plugin.h
333
334
335
336
337
338
339
340
341
342
} cmsPluginParametricCurves; //---------------------------------------------------------------------------------------------------------- // Formatters. This plug-in adds new handlers, replacing them if they already exist. Formatters dealing with // cmsFloat32Number (bps = 4) or double (bps = 0) types are requested via FormatterFloat callback. Others come across // Formatter16 callback struct _cmstransform_struct;
+ show +
343
344
345
346
typedef cmsUInt8Number* (* cmsFormatter16)(register struct _cmstransform_struct* CMMcargo, register cmsUInt16Number Values[], register cmsUInt8Number* Buffer, register cmsUInt32Number Stride);
+ show +
347
348
349
350
351
352
353
354
355
356
typedef cmsUInt8Number* (* cmsFormatterFloat)(struct _cmstransform_struct* CMMcargo, cmsFloat32Number Values[], cmsUInt8Number* Buffer, cmsUInt32Number Stride); // This type holds a pointer to a formatter that can be either 16 bits or cmsFloat32Number typedef union { cmsFormatter16 Fmt16; cmsFormatterFloat FmtFloat;

[CVE-2023-40093_1.diff] cmscnvrt.c #2
-// Link several profiles to obtain a single LUT modelling the whole color transform. Intents, Black point -// compensation and Adaptation parameters may vary across profiles. BPC and Adaptation refers to the PCS -// after the profile. I.e, BPC[0] refers to connexion between profile(0) and profile(1) -cmsPipeline* _cmsLinkProfiles(cmsContext ContextID, - cmsUInt32Number nProfiles, - cmsUInt32Number Intents[], - cmsHPROFILE hProfiles[], - cmsBool BPC[], - cmsFloat64Number AdaptationStates[], - cmsUInt32Number dwFlags); - -//--------------------------------------------------------------------------------- -
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmscnvrt.c
23
24
25
26
27
28
29
30
31
32
// //--------------------------------------------------------------------------------- // #include "lcms2_internal.h" // Link several profiles to obtain a single LUT modelling the whole color transform. Intents, Black point // compensation and Adaptation parameters may vary across profiles. BPC and Adaptation refers to the PCS // after the profile. I.e, BPC[0] refers to connexion between profile(0) and profile(1)
+ show +
33
34
35
36
37
38
39
cmsPipeline* _cmsLinkProfiles(cmsContext ContextID, cmsUInt32Number nProfiles, cmsUInt32Number Intents[], cmsHPROFILE hProfiles[], cmsBool BPC[], cmsFloat64Number AdaptationStates[], cmsUInt32Number dwFlags);
+ show +
40
41
42
43
44
45
46
47
48
49
//--------------------------------------------------------------------------------- // This is the default routine for ICC-style intents. A user may decide to override it by using a plugin. // Supported intents are perceptual, relative colorimetric, saturation and ICC-absolute colorimetric static cmsPipeline* DefaultICCintents(cmsContext ContextID, cmsUInt32Number nProfiles, cmsUInt32Number Intents[], cmsHPROFILE hProfiles[],

[CVE-2023-40093_1.diff] cmscnvrt.c #4
- _cmsReadMediaWhitePoint(&WhitePointIn, hProfiles[i-1]); - _cmsReadCHAD(&ChromaticAdaptationMatrixIn, hProfiles[i-1]); + if (!_cmsReadMediaWhitePoint(&WhitePointIn, hProfiles[i - 1])) return FALSE; + if (!_cmsReadCHAD(&ChromaticAdaptationMatrixIn, hProfiles[i - 1])) return FALSE; - _cmsReadMediaWhitePoint(&WhitePointOut, hProfiles[i]); - _cmsReadCHAD(&ChromaticAdaptationMatrixOut, hProfiles[i]); + if (!_cmsReadMediaWhitePoint(&WhitePointOut, hProfiles[i])) return FALSE; + if (!_cmsReadCHAD(&ChromaticAdaptationMatrixOut, hProfiles[i])) return FALSE;
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmscnvrt.c
375
376
377
378
379
380
381
382
383
384
// m and off are set to identity and this is detected latter on _cmsMAT3identity(m); _cmsVEC3init(off, 0, 0, 0); // If intent is abs. colorimetric, if (Intent == INTENT_ABSOLUTE_COLORIMETRIC) { cmsCIEXYZ WhitePointIn, WhitePointOut; cmsMAT3 ChromaticAdaptationMatrixIn, ChromaticAdaptationMatrixOut;
+ show +
385
386
387
388
389
_cmsReadMediaWhitePoint(&WhitePointIn, hProfiles[i-1]); _cmsReadCHAD(&ChromaticAdaptationMatrixIn, hProfiles[i-1]); _cmsReadMediaWhitePoint(&WhitePointOut, hProfiles[i]); _cmsReadCHAD(&ChromaticAdaptationMatrixOut, hProfiles[i]);
+ show +
390
391
392
393
394
395
396
397
398
399
if (!ComputeAbsoluteIntent(AdaptationState, &WhitePointIn, &ChromaticAdaptationMatrixIn, &WhitePointOut, &ChromaticAdaptationMatrixOut, m)) return FALSE; } else { // Rest of intents may apply BPC. if (BPC) {

[CVE-2023-40093_1.diff] cmsxform.c #9
+// returns original flags +cmsUInt32Number CMSEXPORT _cmsGetTransformFlags(struct _cmstransform_struct* CMMcargo) +{ + _cmsAssert(CMMcargo != NULL); + return CMMcargo->dwOriginalFlags; +} + +// Returns the worker callback for parallelization plug-ins +_cmsTransform2Fn CMSEXPORT _cmsGetTransformWorker(struct _cmstransform_struct* CMMcargo) +{ + _cmsAssert(CMMcargo != NULL); + return CMMcargo->Worker; +} + +// This field holds maximum number of workers or -1 to auto +cmsInt32Number CMSEXPORT _cmsGetTransformMaxWorkers(struct _cmstransform_struct* CMMcargo) +{ + _cmsAssert(CMMcargo != NULL); + return CMMcargo->MaxWorkers; +} + +// This field is actually unused and reserved +cmsUInt32Number CMSEXPORT _cmsGetTransformWorkerFlags(struct _cmstransform_struct* CMMcargo) +{ + _cmsAssert(CMMcargo != NULL); + return CMMcargo->WorkerFlags; +} + +// In the case there is a parallelization plug-in, let it to do its job +static +void ParalellizeIfSuitable(_cmsTRANSFORM* p) +{ + _cmsParallelizationPluginChunkType* ctx = (_cmsParallelizationPluginChunkType*)_cmsContextGetClientChunk(p->ContextID, ParallelizationPlugin); + + _cmsAssert(p != NULL); + if (ctx != NULL && ctx->SchedulerFn != NULL) { + + p->Worker = p->xform; + p->xform = ctx->SchedulerFn; + p->MaxWorkers = ctx->MaxWorkers; + p->WorkerFlags = ctx->WorkerFlags; + } +} + + +/** +* An empty unroll to avoid a check with NULL on cmsDoTransform() +*/ +static +cmsUInt8Number* UnrollNothing(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride) +{ + return accum; + + cmsUNUSED_PARAMETER(info); + cmsUNUSED_PARAMETER(wIn); + cmsUNUSED_PARAMETER(Stride); +} + +static +cmsUInt8Number* PackNothing(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride) +{ + return output; + + cmsUNUSED_PARAMETER(info); + cmsUNUSED_PARAMETER(wOut); + cmsUNUSED_PARAMETER(Stride); +} - for (Plugin = ctx->TransformCollection; - Plugin != NULL; - Plugin = Plugin->Next) { + if (!(*dwFlags & cmsFLAGS_NOOPTIMIZE)) + { + for (Plugin = ctx->TransformCollection; + Plugin != NULL; + Plugin = Plugin->Next) { - if (Plugin->Factory(&p->xform, &p->UserData, &p->FreeUserData, &p->Lut, InputFormat, OutputFormat, dwFlags)) { + if (Plugin->Factory(&p->xform, &p->UserData, &p->FreeUserData, &p->Lut, InputFormat, OutputFormat, dwFlags)) { - // Last plugin in the declaration order takes control. We just keep - // the original parameters as a logging. - // Note that cmsFLAGS_CAN_CHANGE_FORMATTER is not set, so by default - // an optimized transform is not reusable. The plug-in can, however, change - // the flags and make it suitable. + // Last plugin in the declaration order takes control. We just keep + // the original parameters as a logging. + // Note that cmsFLAGS_CAN_CHANGE_FORMATTER is not set, so by default + // an optimized transform is not reusable. The plug-in can, however, change + // the flags and make it suitable. - p->ContextID = ContextID; - p->InputFormat = *InputFormat; - p->OutputFormat = *OutputFormat; - p->dwOriginalFlags = *dwFlags; + p->ContextID = ContextID; + p->InputFormat = *InputFormat; + p->OutputFormat = *OutputFormat; + p->dwOriginalFlags = *dwFlags; - // Fill the formatters just in case the optimized routine is interested. - // No error is thrown if the formatter doesn't exist. It is up to the optimization - // factory to decide what to do in those cases. - p->FromInput = _cmsGetFormatter(ContextID, *InputFormat, cmsFormatterInput, CMS_PACK_FLAGS_16BITS).Fmt16; - p->ToOutput = _cmsGetFormatter(ContextID, *OutputFormat, cmsFormatterOutput, CMS_PACK_FLAGS_16BITS).Fmt16; - p->FromInputFloat = _cmsGetFormatter(ContextID, *InputFormat, cmsFormatterInput, CMS_PACK_FLAGS_FLOAT).FmtFloat; - p->ToOutputFloat = _cmsGetFormatter(ContextID, *OutputFormat, cmsFormatterOutput, CMS_PACK_FLAGS_FLOAT).FmtFloat; + // Fill the formatters just in case the optimized routine is interested. + // No error is thrown if the formatter doesn't exist. It is up to the optimization + // factory to decide what to do in those cases. + p->FromInput = _cmsGetFormatter(ContextID, *InputFormat, cmsFormatterInput, CMS_PACK_FLAGS_16BITS).Fmt16; + p->ToOutput = _cmsGetFormatter(ContextID, *OutputFormat, cmsFormatterOutput, CMS_PACK_FLAGS_16BITS).Fmt16; + p->FromInputFloat = _cmsGetFormatter(ContextID, *InputFormat, cmsFormatterInput, CMS_PACK_FLAGS_FLOAT).FmtFloat; + p->ToOutputFloat = _cmsGetFormatter(ContextID, *OutputFormat, cmsFormatterOutput, CMS_PACK_FLAGS_FLOAT).FmtFloat; - // Save the day? (Ignore the warning) - if (Plugin->OldXform) { - p->OldXform = (_cmsTransformFn) p->xform; - p->xform = _cmsTransform2toTransformAdaptor; - } - - return p; - } - } + // Save the day? (Ignore the warning) + if (Plugin->OldXform) { + p->OldXform = (_cmsTransformFn)(void*)p->xform; + p->xform = _cmsTransform2toTransformAdaptor; + } - // Not suitable for the transform plug-in, let's check the pipeline plug-in - _cmsOptimizePipeline(ContextID, &p->Lut, Intent, InputFormat, OutputFormat, dwFlags); + ParalellizeIfSuitable(p); + return p; + } + } + } + + // Not suitable for the transform plug-in, let's check the pipeline plug-in + _cmsOptimizePipeline(ContextID, &p->Lut, Intent, InputFormat, OutputFormat, dwFlags); - if (_cmsFormatterIsFloat(*InputFormat) && _cmsFormatterIsFloat(*OutputFormat)) { + if (_cmsFormatterIsFloat(*OutputFormat)) {
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmsxform.c
765
766
767
768
769
770
771
772
773
774
cmsPipelineFree(lut); return NULL; } // Store the proposed pipeline p->Lut = lut; // Let's see if any plug-in want to do the transform by itself if (p->Lut != NULL) {
+ show +
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
for (Plugin = ctx->TransformCollection; Plugin != NULL; Plugin = Plugin->Next) { if (Plugin->Factory(&p->xform, &p->UserData, &p->FreeUserData, &p->Lut, InputFormat, OutputFormat, dwFlags)) { // Last plugin in the declaration order takes control. We just keep // the original parameters as a logging. // Note that cmsFLAGS_CAN_CHANGE_FORMATTER is not set, so by default // an optimized transform is not reusable. The plug-in can, however, change // the flags and make it suitable. p->ContextID = ContextID; p->InputFormat = *InputFormat; p->OutputFormat = *OutputFormat; p->dwOriginalFlags = *dwFlags; // Fill the formatters just in case the optimized routine is interested. // No error is thrown if the formatter doesn't exist. It is up to the optimization // factory to decide what to do in those cases. p->FromInput = _cmsGetFormatter(ContextID, *InputFormat, cmsFormatterInput, CMS_PACK_FLAGS_16BITS).Fmt16; p->ToOutput = _cmsGetFormatter(ContextID, *OutputFormat, cmsFormatterOutput, CMS_PACK_FLAGS_16BITS).Fmt16; p->FromInputFloat = _cmsGetFormatter(ContextID, *InputFormat, cmsFormatterInput, CMS_PACK_FLAGS_FLOAT).FmtFloat; p->ToOutputFloat = _cmsGetFormatter(ContextID, *OutputFormat, cmsFormatterOutput, CMS_PACK_FLAGS_FLOAT).FmtFloat; // Save the day? if (Plugin->OldXform) { p->OldXform = (_cmsTransformFn) p->xform; p->xform = _cmsTransform2toTransformAdaptor; } return p; } } // Not suitable for the transform plug-in, let's check the pipeline plug-in _cmsOptimizePipeline(ContextID, &p->Lut, Intent, InputFormat, OutputFormat, dwFlags); } // Check whatever this is a true floating point transform if (_cmsFormatterIsFloat(*InputFormat) && _cmsFormatterIsFloat(*OutputFormat)) {
+ show +
816
817
818
819
820
821
822
823
824
825
// Get formatter function always return a valid union, but the contents of this union may be NULL. p ->FromInputFloat = _cmsGetFormatter(ContextID, *InputFormat, cmsFormatterInput, CMS_PACK_FLAGS_FLOAT).FmtFloat; p ->ToOutputFloat = _cmsGetFormatter(ContextID, *OutputFormat, cmsFormatterOutput, CMS_PACK_FLAGS_FLOAT).FmtFloat; *dwFlags |= cmsFLAGS_CAN_CHANGE_FORMATTER; if (p ->FromInputFloat == NULL || p ->ToOutputFloat == NULL) { cmsSignalError(ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unsupported raster format"); cmsDeleteTransform(p);

[CVE-2023-40093_1.diff] cmsintrp.c #5
- if (val2 == 1.0) { - Output[0] = LutTable[p -> Domain[0]]; - return; + if (val2 == 1.0 || p->Domain[0] == 0) { + Output[0] = LutTable[p -> Domain[0]]; + else + { + val2 *= p->Domain[0]; - val2 *= p -> Domain[0]; + cell0 = (int)floor(val2); + cell1 = (int)ceil(val2); - cell0 = (int) floor(val2); - cell1 = (int) ceil(val2); + // Rest is 16 LSB bits + rest = val2 - cell0; - // Rest is 16 LSB bits - rest = val2 - cell0; + y0 = LutTable[cell0]; + y1 = LutTable[cell1]; - y0 = LutTable[cell0] ; - y1 = LutTable[cell1] ; - - Output[0] = y0 + (y1 - y0) * rest; + Output[0] = y0 + (y1 - y0) * rest; + } -static -void Eval1Input(register const cmsUInt16Number Input[], - register cmsUInt16Number Output[], - register const cmsInterpParams* p16) +static CMS_NO_SANITIZE +void Eval1Input(CMSREGISTER const cmsUInt16Number Input[], + CMSREGISTER cmsUInt16Number Output[], + CMSREGISTER const cmsInterpParams* p16)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmsintrp.c
225
226
227
228
229
230
231
232
233
234
const cmsInterpParams* p) { cmsFloat32Number y1, y0; cmsFloat32Number val2, rest; int cell0, cell1; const cmsFloat32Number* LutTable = (cmsFloat32Number*) p ->Table; val2 = fclamp(Value[0]); // if last value...
+ show +
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
if (val2 == 1.0) { Output[0] = LutTable[p -> Domain[0]]; return; } val2 *= p -> Domain[0]; cell0 = (int) floor(val2); cell1 = (int) ceil(val2); // Rest is 16 LSB bits rest = val2 - cell0; y0 = LutTable[cell0] ; y1 = LutTable[cell1] ; Output[0] = y0 + (y1 - y0) * rest; } // Eval gray LUT having only one input channel static void Eval1Input(register const cmsUInt16Number Input[], register cmsUInt16Number Output[], register const cmsInterpParams* p16)
+ show +
261
262
263
264
265
266
267
268
269
270
{ cmsS15Fixed16Number fk; cmsS15Fixed16Number k0, k1, rk, K0, K1; int v; cmsUInt32Number OutChan; const cmsUInt16Number* LutTable = (cmsUInt16Number*) p16 -> Table; v = Input[0] * p16 -> Domain[0]; fk = _cmsToFixedDomain(v);

[CVE-2023-40093_1.diff] cmsintrp.c #6
- v = Input[0] * p16 -> Domain[0]; - fk = _cmsToFixedDomain(v); - k0 = FIXED_TO_INT(fk); - rk = (cmsUInt16Number) FIXED_REST_TO_INT(fk); + // if last value... + if (Input[0] == 0xffff || p16->Domain[0] == 0) { - k1 = k0 + (Input[0] != 0xFFFFU ? 1 : 0); + cmsUInt32Number y0 = p16->Domain[0] * p16->opta[0]; + + for (OutChan = 0; OutChan < p16->nOutputs; OutChan++) { + Output[OutChan] = LutTable[y0 + OutChan]; + } + } + else + { - K0 = p16 -> opta[0] * k0; - K1 = p16 -> opta[0] * k1; + v = Input[0] * p16->Domain[0]; + fk = _cmsToFixedDomain(v); - for (OutChan=0; OutChan < p16->nOutputs; OutChan++) { + k0 = FIXED_TO_INT(fk); + rk = (cmsUInt16Number)FIXED_REST_TO_INT(fk); - Output[OutChan] = LinearInterp(rk, LutTable[K0+OutChan], LutTable[K1+OutChan]); + k1 = k0 + (Input[0] != 0xFFFFU ? 1 : 0); + + K0 = p16->opta[0] * k0; + K1 = p16->opta[0] * k1; + + for (OutChan = 0; OutChan < p16->nOutputs; OutChan++) { + + Output[OutChan] = LinearInterp(rk, LutTable[K0 + OutChan], LutTable[K1 + OutChan]); + }
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmsintrp.c
258
259
260
261
262
263
264
265
266
267
void Eval1Input(register const cmsUInt16Number Input[], register cmsUInt16Number Output[], register const cmsInterpParams* p16) { cmsS15Fixed16Number fk; cmsS15Fixed16Number k0, k1, rk, K0, K1; int v; cmsUInt32Number OutChan; const cmsUInt16Number* LutTable = (cmsUInt16Number*) p16 -> Table;
+ show +
268
269
270
271
272
273
274
275
276
277
278
279
280
281
v = Input[0] * p16 -> Domain[0]; fk = _cmsToFixedDomain(v); k0 = FIXED_TO_INT(fk); rk = (cmsUInt16Number) FIXED_REST_TO_INT(fk); k1 = k0 + (Input[0] != 0xFFFFU ? 1 : 0); K0 = p16 -> opta[0] * k0; K1 = p16 -> opta[0] * k1; for (OutChan=0; OutChan < p16->nOutputs; OutChan++) { Output[OutChan] = LinearInterp(rk, LutTable[K0+OutChan], LutTable[K1+OutChan]);
+ show +
282
283
284
285
286
287
288
289
290
291
} } // Eval gray LUT having only one input channel static void Eval1InputFloat(const cmsFloat32Number Value[], cmsFloat32Number Output[], const cmsInterpParams* p)

[CVE-2023-40093_1.diff] cmsintrp.c #7
- // if last value... - if (val2 == 1.0) { - Output[0] = LutTable[p -> Domain[0]]; - return; - } + // if last value... + if (val2 == 1.0 || p->Domain[0] == 0) { - val2 *= p -> Domain[0]; + cmsUInt32Number start = p->Domain[0] * p->opta[0]; - cell0 = (int) floor(val2); - cell1 = (int) ceil(val2); + for (OutChan = 0; OutChan < p->nOutputs; OutChan++) { + Output[OutChan] = LutTable[start + OutChan]; + } + } + else + { + val2 *= p->Domain[0]; - // Rest is 16 LSB bits - rest = val2 - cell0; + cell0 = (int)floor(val2); + cell1 = (int)ceil(val2); - cell0 *= p -> opta[0]; - cell1 *= p -> opta[0]; + // Rest is 16 LSB bits + rest = val2 - cell0; - for (OutChan=0; OutChan < p->nOutputs; OutChan++) { + cell0 *= p->opta[0]; + cell1 *= p->opta[0]; - y0 = LutTable[cell0 + OutChan] ; - y1 = LutTable[cell1 + OutChan] ; + for (OutChan = 0; OutChan < p->nOutputs; OutChan++) { + + y0 = LutTable[cell0 + OutChan]; + y1 = LutTable[cell1 + OutChan]; - } + } + }
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmsintrp.c
292
293
294
295
296
297
298
299
300
301
{ cmsFloat32Number y1, y0; cmsFloat32Number val2, rest; int cell0, cell1; cmsUInt32Number OutChan; const cmsFloat32Number* LutTable = (cmsFloat32Number*) p ->Table; val2 = fclamp(Value[0]); // if last value...
+ show +
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
if (val2 == 1.0) { Output[0] = LutTable[p -> Domain[0]]; return; } val2 *= p -> Domain[0]; cell0 = (int) floor(val2); cell1 = (int) ceil(val2); // Rest is 16 LSB bits rest = val2 - cell0; cell0 *= p -> opta[0]; cell1 *= p -> opta[0]; for (OutChan=0; OutChan < p->nOutputs; OutChan++) { y0 = LutTable[cell0 + OutChan] ; y1 = LutTable[cell1 + OutChan] ;
+ show +
322
323
324
325
326
327
328
329
330
331
Output[OutChan] = y0 + (y1 - y0) * rest; } } // Bilinear interpolation (16 bits) - cmsFloat32Number version static void BilinearInterpFloat(const cmsFloat32Number Input[], cmsFloat32Number Output[], const cmsInterpParams* p)

[CVE-2023-40093_1.diff] cmsintrp.c #8
-static -void BilinearInterp16(register const cmsUInt16Number Input[], - register cmsUInt16Number Output[], - register const cmsInterpParams* p) +static CMS_NO_SANITIZE +void BilinearInterp16(CMSREGISTER const cmsUInt16Number Input[], + CMSREGISTER cmsUInt16Number Output[], + CMSREGISTER const cmsInterpParams* p)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmsintrp.c
371
372
373
374
375
376
377
378
379
380
Output[OutChan] = dxy; } # undef LERP # undef DENS } // Bilinear interpolation (16 bits) - optimized version
+ show +
381
382
383
384
static void BilinearInterp16(register const cmsUInt16Number Input[], register cmsUInt16Number Output[], register const cmsInterpParams* p)
+ show +
385
386
387
388
389
390
391
392
393
394
{ #define DENS(i,j) (LutTable[(i)+(j)+OutChan]) #define LERP(a,l,h) (cmsUInt16Number) (l + ROUND_FIXED_TO_INT(((h-l)*a))) const cmsUInt16Number* LutTable = (cmsUInt16Number*) p ->Table; int OutChan, TotalOut; cmsS15Fixed16Number fx, fy; register int rx, ry; int x0, y0;

[CVE-2023-40093_1.diff] cmsintrp.c #9
- register int rx, ry; - int x0, y0; - register int X0, X1, Y0, Y1; - int d00, d01, d10, d11, - dx0, dx1, - dxy; + CMSREGISTER int rx, ry; + int x0, y0; + CMSREGISTER int X0, X1, Y0, Y1; + + int d00, d01, d10, d11, + dx0, dx1, + dxy;
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmsintrp.c
383
384
385
386
387
388
389
390
391
392
register cmsUInt16Number Output[], register const cmsInterpParams* p) { #define DENS(i,j) (LutTable[(i)+(j)+OutChan]) #define LERP(a,l,h) (cmsUInt16Number) (l + ROUND_FIXED_TO_INT(((h-l)*a))) const cmsUInt16Number* LutTable = (cmsUInt16Number*) p ->Table; int OutChan, TotalOut; cmsS15Fixed16Number fx, fy;
+ show +
393
394
395
396
397
398
register int rx, ry; int x0, y0; register int X0, X1, Y0, Y1; int d00, d01, d10, d11, dx0, dx1, dxy;
+ show +
399
400
401
402
403
404
405
406
407
408
TotalOut = p -> nOutputs; fx = _cmsToFixedDomain((int) Input[0] * p -> Domain[0]); x0 = FIXED_TO_INT(fx); rx = FIXED_REST_TO_INT(fx); // Rest in 0..1.0 domain fy = _cmsToFixedDomain((int) Input[1] * p -> Domain[1]); y0 = FIXED_TO_INT(fy);

[CVE-2023-40093_1.diff] cmsintrp.c #10
+ - d000, d001, d010, d011, - d100, d101, d110, d111, - dx00, dx01, dx10, dx11, - dxy0, dxy1, dxyz; + d000, d001, d010, d011, + d100, d101, d110, d111, + dx00, dx01, dx10, dx11, + dxy0, dxy1, dxyz;
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmsintrp.c
445
446
447
448
449
450
451
452
453
454
{ # define LERP(a,l,h) (cmsFloat32Number) ((l)+(((h)-(l))*(a))) # define DENS(i,j,k) (LutTable[(i)+(j)+(k)+OutChan]) const cmsFloat32Number* LutTable = (cmsFloat32Number*) p ->Table; cmsFloat32Number px, py, pz; int x0, y0, z0, X0, Y0, Z0, X1, Y1, Z1; int TotalOut, OutChan; cmsFloat32Number fx, fy, fz,
+ show +
455
456
457
458
d000, d001, d010, d011, d100, d101, d110, d111, dx00, dx01, dx10, dx11, dxy0, dxy1, dxyz;
+ show +
459
460
461
462
463
464
465
466
467
468
TotalOut = p -> nOutputs; // We need some clipping here px = fclamp(Input[0]) * p->Domain[0]; py = fclamp(Input[1]) * p->Domain[1]; pz = fclamp(Input[2]) * p->Domain[2]; x0 = (int) _cmsQuickFloor(px); fx = px - (cmsFloat32Number) x0; y0 = (int) _cmsQuickFloor(py); fy = py - (cmsFloat32Number) y0;

[CVE-2023-40093_1.diff] cmsintrp.c #11
-static -void TrilinearInterp16(register const cmsUInt16Number Input[], - register cmsUInt16Number Output[], - register const cmsInterpParams* p) +static CMS_NO_SANITIZE +void TrilinearInterp16(CMSREGISTER const cmsUInt16Number Input[], + CMSREGISTER cmsUInt16Number Output[], + CMSREGISTER const cmsInterpParams* p)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmsintrp.c
502
503
504
505
506
507
508
509
510
511
Output[OutChan] = dxyz; } # undef LERP # undef DENS } // Trilinear interpolation (16 bits) - optimized version
+ show +
512
513
514
515
static void TrilinearInterp16(register const cmsUInt16Number Input[], register cmsUInt16Number Output[], register const cmsInterpParams* p)
+ show +
516
517
518
519
520
521
522
523
524
525
{ #define DENS(i,j,k) (LutTable[(i)+(j)+(k)+OutChan]) #define LERP(a,l,h) (cmsUInt16Number) (l + ROUND_FIXED_TO_INT(((h-l)*a))) const cmsUInt16Number* LutTable = (cmsUInt16Number*) p ->Table; int OutChan, TotalOut; cmsS15Fixed16Number fx, fy, fz; register int rx, ry, rz; int x0, y0, z0;

[CVE-2023-40093_1.diff] cmsintrp.c #12
- register int rx, ry, rz; - int x0, y0, z0; - register int X0, X1, Y0, Y1, Z0, Z1; - int d000, d001, d010, d011, - d100, d101, d110, d111, - dx00, dx01, dx10, dx11, - dxy0, dxy1, dxyz; + CMSREGISTER int rx, ry, rz; + int x0, y0, z0; + CMSREGISTER int X0, X1, Y0, Y1, Z0, Z1; + int d000, d001, d010, d011, + d100, d101, d110, d111, + dx00, dx01, dx10, dx11, + dxy0, dxy1, dxyz;
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmsintrp.c
514
515
516
517
518
519
520
521
522
523
register cmsUInt16Number Output[], register const cmsInterpParams* p) { #define DENS(i,j,k) (LutTable[(i)+(j)+(k)+OutChan]) #define LERP(a,l,h) (cmsUInt16Number) (l + ROUND_FIXED_TO_INT(((h-l)*a))) const cmsUInt16Number* LutTable = (cmsUInt16Number*) p ->Table; int OutChan, TotalOut; cmsS15Fixed16Number fx, fy, fz;
+ show +
524
525
526
527
528
529
530
register int rx, ry, rz; int x0, y0, z0; register int X0, X1, Y0, Y1, Z0, Z1; int d000, d001, d010, d011, d100, d101, d110, d111, dx00, dx01, dx10, dx11, dxy0, dxy1, dxyz;
+ show +
531
532
533
534
535
536
537
538
539
540
TotalOut = p -> nOutputs; fx = _cmsToFixedDomain((int) Input[0] * p -> Domain[0]); x0 = FIXED_TO_INT(fx); rx = FIXED_REST_TO_INT(fx); // Rest in 0..1.0 domain fy = _cmsToFixedDomain((int) Input[1] * p -> Domain[1]); y0 = FIXED_TO_INT(fy);

[CVE-2023-40093_1.diff] cmsintrp.c #16
-static -void Eval4Inputs(register const cmsUInt16Number Input[], - register cmsUInt16Number Output[], - register const cmsInterpParams* p16) +static CMS_NO_SANITIZE +void Eval4Inputs(CMSREGISTER const cmsUInt16Number Input[], + CMSREGISTER cmsUInt16Number Output[], + CMSREGISTER const cmsInterpParams* p16)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmsintrp.c
816
817
818
819
820
821
822
823
824
825
c3 -= c0; Rest = c1 * rx + c2 * ry + c3 * rz + 0x8001; *Output++ = (cmsUInt16Number) c0 + ((Rest + (Rest>>16))>>16); } } } } #define DENS(i,j,k) (LutTable[(i)+(j)+(k)+OutChan])
+ show +
826
827
828
829
static void Eval4Inputs(register const cmsUInt16Number Input[], register cmsUInt16Number Output[], register const cmsInterpParams* p16)
+ show +
830
831
832
833
834
835
836
837
838
839
{ const cmsUInt16Number* LutTable; cmsS15Fixed16Number fk; cmsS15Fixed16Number k0, rk; int K0, K1; cmsS15Fixed16Number fx, fy, fz; cmsS15Fixed16Number rx, ry, rz; int x0, y0, z0; cmsS15Fixed16Number X0, X1, Y0, Y1, Z0, Z1; cmsUInt32Number i;

[CVE-2023-40093_1.diff] cmstypes.c #32
- if (!ReadCountAndSting(self, io, mlu, &SizeOfTag, "nm")) goto Error; - if (!ReadCountAndSting(self, io, mlu, &SizeOfTag, "#0")) goto Error; - if (!ReadCountAndSting(self, io, mlu, &SizeOfTag, "#1")) goto Error; - if (!ReadCountAndSting(self, io, mlu, &SizeOfTag, "#2")) goto Error; - if (!ReadCountAndSting(self, io, mlu, &SizeOfTag, "#3")) goto Error; + if (!ReadCountAndString(self, io, mlu, &SizeOfTag, "nm")) goto Error; + if (!ReadCountAndString(self, io, mlu, &SizeOfTag, "#0")) goto Error; + if (!ReadCountAndString(self, io, mlu, &SizeOfTag, "#1")) goto Error; + if (!ReadCountAndString(self, io, mlu, &SizeOfTag, "#2")) goto Error; + if (!ReadCountAndString(self, io, mlu, &SizeOfTag, "#3")) goto Error;
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmstypes.c
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
return TRUE; } static void *Type_CrdInfo_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsUInt32Number* nItems, cmsUInt32Number SizeOfTag) { cmsMLU* mlu = cmsMLUalloc(self ->ContextID, 5); *nItems = 0;
+ show +
3686
3687
3688
3689
3690
if (!ReadCountAndSting(self, io, mlu, &SizeOfTag, "nm")) goto Error; if (!ReadCountAndSting(self, io, mlu, &SizeOfTag, "#0")) goto Error; if (!ReadCountAndSting(self, io, mlu, &SizeOfTag, "#1")) goto Error; if (!ReadCountAndSting(self, io, mlu, &SizeOfTag, "#2")) goto Error; if (!ReadCountAndSting(self, io, mlu, &SizeOfTag, "#3")) goto Error;
+ show +
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
*nItems = 1; return (void*) mlu; Error: cmsMLUfree(mlu); return NULL; }

[CVE-2023-40093_1.diff] cmstypes.c #33
- if (!WriteCountAndSting(self, io, mlu, "nm")) goto Error; - if (!WriteCountAndSting(self, io, mlu, "#0")) goto Error; - if (!WriteCountAndSting(self, io, mlu, "#1")) goto Error; - if (!WriteCountAndSting(self, io, mlu, "#2")) goto Error; - if (!WriteCountAndSting(self, io, mlu, "#3")) goto Error; + if (!WriteCountAndString(self, io, mlu, "nm")) goto Error; + if (!WriteCountAndString(self, io, mlu, "#0")) goto Error; + if (!WriteCountAndString(self, io, mlu, "#1")) goto Error; + if (!WriteCountAndString(self, io, mlu, "#2")) goto Error; + if (!WriteCountAndString(self, io, mlu, "#3")) goto Error;
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmstypes.c
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
return NULL; } static cmsBool Type_CrdInfo_Write(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, void* Ptr, cmsUInt32Number nItems) { cmsMLU* mlu = (cmsMLU*) Ptr;
+ show +
3707
3708
3709
3710
3711
if (!WriteCountAndSting(self, io, mlu, "nm")) goto Error; if (!WriteCountAndSting(self, io, mlu, "#0")) goto Error; if (!WriteCountAndSting(self, io, mlu, "#1")) goto Error; if (!WriteCountAndSting(self, io, mlu, "#2")) goto Error; if (!WriteCountAndSting(self, io, mlu, "#3")) goto Error;
+ show +
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
return TRUE; Error: return FALSE; cmsUNUSED_PARAMETER(nItems); }

[CVE-2023-40093_1.diff] cmstypes.c #34
- case cmsSigFormulaCurveSeg: { + case cmsSigFormulaCurveSeg: { - cmsUInt16Number Type; - cmsUInt32Number ParamsByType[] = {4, 5, 5 }; + cmsUInt16Number Type; + cmsUInt32Number ParamsByType[] = { 4, 5, 5 }; - if (!_cmsReadUInt16Number(io, &Type)) goto Error; - if (!_cmsReadUInt16Number(io, NULL)) goto Error; + if (!_cmsReadUInt16Number(io, &Type)) goto Error; + if (!_cmsReadUInt16Number(io, NULL)) goto Error; - Segments[i].Type = Type + 6; - if (Type > 2) goto Error; + Segments[i].Type = Type + 6; + if (Type > 2) goto Error; - for (j=0; j < ParamsByType[Type]; j++) { + for (j = 0; j < ParamsByType[Type]; j++) { - cmsFloat32Number f; - if (!_cmsReadFloat32Number(io, &f)) goto Error; - Segments[i].Params[j] = f; - } - } - break; + cmsFloat32Number f; + if (!_cmsReadFloat32Number(io, &f)) goto Error; + Segments[i].Params[j] = f; + } + } + break; - case cmsSigSampledCurveSeg: { - cmsUInt32Number Count; + case cmsSigSampledCurveSeg: { + cmsUInt32Number Count; - if (!_cmsReadUInt32Number(io, &Count)) goto Error; + if (!_cmsReadUInt32Number(io, &Count)) goto Error; - Segments[i].nGridPoints = Count; - Segments[i].SampledPoints = (cmsFloat32Number*) _cmsCalloc(self ->ContextID, Count, sizeof(cmsFloat32Number)); - if (Segments[i].SampledPoints == NULL) goto Error; + // The first point is implicit in the last stage, we allocate an extra note to be populated latter on + Count++; + Segments[i].nGridPoints = Count; + Segments[i].SampledPoints = (cmsFloat32Number*)_cmsCalloc(self->ContextID, Count, sizeof(cmsFloat32Number)); + if (Segments[i].SampledPoints == NULL) goto Error; - for (j=0; j < Count; j++) { - if (!_cmsReadFloat32Number(io, &Segments[i].SampledPoints[j])) goto Error; - } - } - break; + Segments[i].SampledPoints[0] = 0; + for (j = 1; j < Count; j++) { + if (!_cmsReadFloat32Number(io, &Segments[i].SampledPoints[j])) goto Error; + } + } + break;
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmstypes.c
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
Segments[nSegments-1].x1 = 1E22F; // A big cmsFloat32Number number // Read segments for (i=0; i < nSegments; i++) { if (!_cmsReadUInt32Number(io, (cmsUInt32Number*) &ElementSig)) goto Error; if (!_cmsReadUInt32Number(io, NULL)) goto Error; switch (ElementSig) {
+ show +
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
case cmsSigFormulaCurveSeg: { cmsUInt16Number Type; cmsUInt32Number ParamsByType[] = {4, 5, 5 }; if (!_cmsReadUInt16Number(io, &Type)) goto Error; if (!_cmsReadUInt16Number(io, NULL)) goto Error; Segments[i].Type = Type + 6; if (Type > 2) goto Error; for (j=0; j < ParamsByType[Type]; j++) { cmsFloat32Number f; if (!_cmsReadFloat32Number(io, &f)) goto Error; Segments[i].Params[j] = f; } } break; case cmsSigSampledCurveSeg: { cmsUInt32Number Count; if (!_cmsReadUInt32Number(io, &Count)) goto Error; Segments[i].nGridPoints = Count; Segments[i].SampledPoints = (cmsFloat32Number*) _cmsCalloc(self ->ContextID, Count, sizeof(cmsFloat32Number)); if (Segments[i].SampledPoints == NULL) goto Error; for (j=0; j < Count; j++) { if (!_cmsReadFloat32Number(io, &Segments[i].SampledPoints[j])) goto Error; } } break;
+ show +
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
default: { char String[5]; _cmsTagSignature2String(String, (cmsTagSignature) ElementSig); cmsSignalError(self->ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unknown curve element type '%s' found.", String); } goto Error;

[CVE-2023-40093_1.diff] cmspack.c #5
-cmsUInt8Number* Unroll4BytesReverse(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll4BytesReverse(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
179
180
181
182
183
184
185
186
187
188
wIn[2] = FROM_8_TO_16(*accum); accum++; // Y wIn[3] = FROM_8_TO_16(*accum); accum++; // K return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
189
190
191
192
cmsUInt8Number* Unroll4BytesReverse(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
193
194
195
196
197
198
199
200
201
202
{ wIn[0] = FROM_8_TO_16(REVERSE_FLAVOR_8(*accum)); accum++; // C wIn[1] = FROM_8_TO_16(REVERSE_FLAVOR_8(*accum)); accum++; // M wIn[2] = FROM_8_TO_16(REVERSE_FLAVOR_8(*accum)); accum++; // Y wIn[3] = FROM_8_TO_16(REVERSE_FLAVOR_8(*accum)); accum++; // K return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #6
-cmsUInt8Number* Unroll4BytesSwapFirst(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll4BytesSwapFirst(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
196
197
198
199
200
201
202
203
204
205
wIn[2] = FROM_8_TO_16(REVERSE_FLAVOR_8(*accum)); accum++; // Y wIn[3] = FROM_8_TO_16(REVERSE_FLAVOR_8(*accum)); accum++; // K return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
206
207
208
209
cmsUInt8Number* Unroll4BytesSwapFirst(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
210
211
212
213
214
215
216
217
218
219
{ wIn[3] = FROM_8_TO_16(*accum); accum++; // K wIn[0] = FROM_8_TO_16(*accum); accum++; // C wIn[1] = FROM_8_TO_16(*accum); accum++; // M wIn[2] = FROM_8_TO_16(*accum); accum++; // Y return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #7
-cmsUInt8Number* Unroll4BytesSwap(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll4BytesSwap(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
214
215
216
217
218
219
220
221
222
223
wIn[2] = FROM_8_TO_16(*accum); accum++; // Y return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } // KYMC static
+ show +
224
225
226
227
cmsUInt8Number* Unroll4BytesSwap(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
228
229
230
231
232
233
234
235
236
237
{ wIn[3] = FROM_8_TO_16(*accum); accum++; // K wIn[2] = FROM_8_TO_16(*accum); accum++; // Y wIn[1] = FROM_8_TO_16(*accum); accum++; // M wIn[0] = FROM_8_TO_16(*accum); accum++; // C return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #8
-cmsUInt8Number* Unroll4BytesSwapSwapFirst(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll4BytesSwapSwapFirst(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
231
232
233
234
235
236
237
238
239
240
wIn[1] = FROM_8_TO_16(*accum); accum++; // M wIn[0] = FROM_8_TO_16(*accum); accum++; // C return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
241
242
243
244
cmsUInt8Number* Unroll4BytesSwapSwapFirst(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
245
246
247
248
249
250
251
252
253
254
{ wIn[2] = FROM_8_TO_16(*accum); accum++; // K wIn[1] = FROM_8_TO_16(*accum); accum++; // Y wIn[0] = FROM_8_TO_16(*accum); accum++; // M wIn[3] = FROM_8_TO_16(*accum); accum++; // C return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #9
-cmsUInt8Number* Unroll3Bytes(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll3Bytes(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
248
249
250
251
252
253
254
255
256
257
wIn[0] = FROM_8_TO_16(*accum); accum++; // M wIn[3] = FROM_8_TO_16(*accum); accum++; // C return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
258
259
260
261
cmsUInt8Number* Unroll3Bytes(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
262
263
264
265
266
267
268
269
270
271
{ wIn[0] = FROM_8_TO_16(*accum); accum++; // R wIn[1] = FROM_8_TO_16(*accum); accum++; // G wIn[2] = FROM_8_TO_16(*accum); accum++; // B return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #10
-cmsUInt8Number* Unroll3BytesSkip1Swap(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll3BytesSkip1Swap(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
264
265
266
267
268
269
270
271
272
273
wIn[1] = FROM_8_TO_16(*accum); accum++; // G wIn[2] = FROM_8_TO_16(*accum); accum++; // B return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
274
275
276
277
cmsUInt8Number* Unroll3BytesSkip1Swap(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
278
279
280
281
282
283
284
285
286
287
{ accum++; // A wIn[2] = FROM_8_TO_16(*accum); accum++; // B wIn[1] = FROM_8_TO_16(*accum); accum++; // G wIn[0] = FROM_8_TO_16(*accum); accum++; // R return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #11
-cmsUInt8Number* Unroll3BytesSkip1SwapSwapFirst(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll3BytesSkip1SwapSwapFirst(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
281
282
283
284
285
286
287
288
289
290
wIn[1] = FROM_8_TO_16(*accum); accum++; // G wIn[0] = FROM_8_TO_16(*accum); accum++; // R return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
291
292
293
294
cmsUInt8Number* Unroll3BytesSkip1SwapSwapFirst(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
295
296
297
298
299
300
301
302
303
304
{ wIn[2] = FROM_8_TO_16(*accum); accum++; // B wIn[1] = FROM_8_TO_16(*accum); accum++; // G wIn[0] = FROM_8_TO_16(*accum); accum++; // R accum++; // A return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #12
-cmsUInt8Number* Unroll3BytesSkip1SwapFirst(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll3BytesSkip1SwapFirst(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
298
299
300
301
302
303
304
305
306
307
wIn[0] = FROM_8_TO_16(*accum); accum++; // R accum++; // A return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
308
309
310
311
cmsUInt8Number* Unroll3BytesSkip1SwapFirst(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
312
313
314
315
316
317
318
319
320
321
{ accum++; // A wIn[0] = FROM_8_TO_16(*accum); accum++; // R wIn[1] = FROM_8_TO_16(*accum); accum++; // G wIn[2] = FROM_8_TO_16(*accum); accum++; // B return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #13
-cmsUInt8Number* Unroll3BytesSwap(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll3BytesSwap(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
317
318
319
320
321
322
323
324
325
326
return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } // BRG static
+ show +
327
328
329
330
cmsUInt8Number* Unroll3BytesSwap(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
331
332
333
334
335
336
337
338
339
340
{ wIn[2] = FROM_8_TO_16(*accum); accum++; // B wIn[1] = FROM_8_TO_16(*accum); accum++; // G wIn[0] = FROM_8_TO_16(*accum); accum++; // R return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #14
-cmsUInt8Number* UnrollLabV2_8(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* UnrollLabV2_8(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
333
334
335
336
337
338
339
340
341
342
wIn[1] = FROM_8_TO_16(*accum); accum++; // G wIn[0] = FROM_8_TO_16(*accum); accum++; // R return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
343
344
345
346
cmsUInt8Number* UnrollLabV2_8(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
347
348
349
350
351
352
353
354
355
356
{ wIn[0] = FomLabV2ToLabV4(FROM_8_TO_16(*accum)); accum++; // L wIn[1] = FomLabV2ToLabV4(FROM_8_TO_16(*accum)); accum++; // a wIn[2] = FomLabV2ToLabV4(FROM_8_TO_16(*accum)); accum++; // b return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #15
-cmsUInt8Number* UnrollALabV2_8(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* UnrollALabV2_8(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
349
350
351
352
353
354
355
356
357
358
wIn[1] = FomLabV2ToLabV4(FROM_8_TO_16(*accum)); accum++; // a wIn[2] = FomLabV2ToLabV4(FROM_8_TO_16(*accum)); accum++; // b return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
359
360
361
362
cmsUInt8Number* UnrollALabV2_8(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
363
364
365
366
367
368
369
370
371
372
{ accum++; // A wIn[0] = FomLabV2ToLabV4(FROM_8_TO_16(*accum)); accum++; // L wIn[1] = FomLabV2ToLabV4(FROM_8_TO_16(*accum)); accum++; // a wIn[2] = FomLabV2ToLabV4(FROM_8_TO_16(*accum)); accum++; // b return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #16
-cmsUInt8Number* UnrollLabV2_16(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* UnrollLabV2_16(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
366
367
368
369
370
371
372
373
374
375
wIn[1] = FomLabV2ToLabV4(FROM_8_TO_16(*accum)); accum++; // a wIn[2] = FomLabV2ToLabV4(FROM_8_TO_16(*accum)); accum++; // b return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
376
377
378
379
cmsUInt8Number* UnrollLabV2_16(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
380
381
382
383
384
385
386
387
388
389
{ wIn[0] = FomLabV2ToLabV4(*(cmsUInt16Number*) accum); accum += 2; // L wIn[1] = FomLabV2ToLabV4(*(cmsUInt16Number*) accum); accum += 2; // a wIn[2] = FomLabV2ToLabV4(*(cmsUInt16Number*) accum); accum += 2; // b return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #17
-cmsUInt8Number* Unroll2Bytes(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll2Bytes(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
383
384
385
386
387
388
389
390
391
392
wIn[2] = FomLabV2ToLabV4(*(cmsUInt16Number*) accum); accum += 2; // b return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } // for duplex static
+ show +
393
394
395
396
cmsUInt8Number* Unroll2Bytes(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
397
398
399
400
401
402
403
404
405
406
{ wIn[0] = FROM_8_TO_16(*accum); accum++; // ch1 wIn[1] = FROM_8_TO_16(*accum); accum++; // ch2 return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #18
-cmsUInt8Number* Unroll1Byte(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll1Byte(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
402
403
404
405
406
407
408
409
410
411
cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } // Monochrome duplicates L into RGB for null-transforms static
+ show +
412
413
414
415
cmsUInt8Number* Unroll1Byte(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
416
417
418
419
420
421
422
423
424
425
{ wIn[0] = wIn[1] = wIn[2] = FROM_8_TO_16(*accum); accum++; // L return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #19
-cmsUInt8Number* Unroll1ByteSkip1(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll1ByteSkip1(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
417
418
419
420
421
422
423
424
425
426
wIn[0] = wIn[1] = wIn[2] = FROM_8_TO_16(*accum); accum++; // L return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
427
428
429
430
cmsUInt8Number* Unroll1ByteSkip1(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
431
432
433
434
435
436
437
438
439
440
{ wIn[0] = wIn[1] = wIn[2] = FROM_8_TO_16(*accum); accum++; // L accum += 1; return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #20
-cmsUInt8Number* Unroll1ByteSkip2(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll1ByteSkip2(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
432
433
434
435
436
437
438
439
440
441
wIn[0] = wIn[1] = wIn[2] = FROM_8_TO_16(*accum); accum++; // L accum += 1; return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
442
443
444
445
cmsUInt8Number* Unroll1ByteSkip2(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
446
447
448
449
450
451
452
453
454
455
{ wIn[0] = wIn[1] = wIn[2] = FROM_8_TO_16(*accum); accum++; // L accum += 2; return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #21
-cmsUInt8Number* Unroll1ByteReversed(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll1ByteReversed(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
447
448
449
450
451
452
453
454
455
456
wIn[0] = wIn[1] = wIn[2] = FROM_8_TO_16(*accum); accum++; // L accum += 2; return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
457
458
459
460
cmsUInt8Number* Unroll1ByteReversed(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
461
462
463
464
465
466
467
468
469
470
{ wIn[0] = wIn[1] = wIn[2] = REVERSE_FLAVOR_16(FROM_8_TO_16(*accum)); accum++; // L return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #22
-cmsUInt8Number* UnrollAnyWords(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* UnrollAnyWords(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
462
463
464
465
466
467
468
469
470
471
wIn[0] = wIn[1] = wIn[2] = REVERSE_FLAVOR_16(FROM_8_TO_16(*accum)); accum++; // L return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
472
473
474
475
cmsUInt8Number* UnrollAnyWords(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
476
477
478
479
480
481
482
483
484
485
{ int nChan = T_CHANNELS(info -> InputFormat); int SwapEndian = T_ENDIAN16(info -> InputFormat); int DoSwap = T_DOSWAP(info ->InputFormat); int Reverse = T_FLAVOR(info ->InputFormat); int SwapFirst = T_SWAPFIRST(info -> InputFormat); int Extra = T_EXTRA(info -> InputFormat); int ExtraFirst = DoSwap ^ SwapFirst; int i;

[CVE-2023-40093_1.diff] cmspack.c #23
+ -cmsUInt8Number* UnrollPlanarWords(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* UnrollAnyWordsPremul(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride) +{ + cmsUInt32Number nChan = T_CHANNELS(info -> InputFormat); + cmsUInt32Number SwapEndian = T_ENDIAN16(info -> InputFormat); + cmsUInt32Number DoSwap = T_DOSWAP(info ->InputFormat); + cmsUInt32Number Reverse = T_FLAVOR(info ->InputFormat); + cmsUInt32Number SwapFirst = T_SWAPFIRST(info -> InputFormat); + cmsUInt32Number ExtraFirst = DoSwap ^ SwapFirst; + cmsUInt32Number i; + + cmsUInt16Number alpha = (ExtraFirst ? accum[0] : accum[nChan - 1]); + cmsUInt32Number alpha_factor = _cmsToFixedDomain(FROM_8_TO_16(alpha)); + + if (ExtraFirst) { + accum += sizeof(cmsUInt16Number); + } + + for (i=0; i < nChan; i++) { + + cmsUInt32Number index = DoSwap ? (nChan - i - 1) : i; + cmsUInt32Number v = *(cmsUInt16Number*) accum; + + if (SwapEndian) + v = CHANGE_ENDIAN(v); + + if (alpha_factor > 0) { + + v = (v << 16) / alpha_factor; + if (v > 0xffff) v = 0xffff; + } + + wIn[index] = (cmsUInt16Number) (Reverse ? REVERSE_FLAVOR_16(v) : v); + + accum += sizeof(cmsUInt16Number); + } + + if (!ExtraFirst) { + accum += sizeof(cmsUInt16Number); + } + + return accum; + + cmsUNUSED_PARAMETER(Stride); +} + + + +static +cmsUInt8Number* UnrollPlanarWords(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
511
512
513
514
515
516
517
518
519
520
memmove(&wIn[0], &wIn[1], (nChan-1) * sizeof(cmsUInt16Number)); wIn[nChan-1] = tmp; } return accum; cmsUNUSED_PARAMETER(Stride); } static
+ show +
521
522
523
524
cmsUInt8Number* UnrollPlanarWords(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
525
526
527
528
529
530
531
532
533
534
{ int nChan = T_CHANNELS(info -> InputFormat); int DoSwap= T_DOSWAP(info ->InputFormat); int Reverse= T_FLAVOR(info ->InputFormat); int SwapEndian = T_ENDIAN16(info -> InputFormat); int i; cmsUInt8Number* Init = accum; if (DoSwap) { accum += T_EXTRA(info -> InputFormat) * Stride * sizeof(cmsUInt16Number);

[CVE-2023-40093_1.diff] cmspack.c #27
-cmsUInt8Number* Unroll4WordsSwapFirst(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll4WordsSwapFirst(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
579
580
581
582
583
584
585
586
587
588
wIn[2] = REVERSE_FLAVOR_16(*(cmsUInt16Number*) accum); accum+= 2; // Y wIn[3] = REVERSE_FLAVOR_16(*(cmsUInt16Number*) accum); accum+= 2; // K return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
589
590
591
592
cmsUInt8Number* Unroll4WordsSwapFirst(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
593
594
595
596
597
598
599
600
601
602
{ wIn[3] = *(cmsUInt16Number*) accum; accum+= 2; // K wIn[0] = *(cmsUInt16Number*) accum; accum+= 2; // C wIn[1] = *(cmsUInt16Number*) accum; accum+= 2; // M wIn[2] = *(cmsUInt16Number*) accum; accum+= 2; // Y return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #28
-cmsUInt8Number* Unroll4WordsSwap(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll4WordsSwap(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
597
598
599
600
601
602
603
604
605
606
wIn[2] = *(cmsUInt16Number*) accum; accum+= 2; // Y return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } // KYMC static
+ show +
607
608
609
610
cmsUInt8Number* Unroll4WordsSwap(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
611
612
613
614
615
616
617
618
619
620
{ wIn[3] = *(cmsUInt16Number*) accum; accum+= 2; // K wIn[2] = *(cmsUInt16Number*) accum; accum+= 2; // Y wIn[1] = *(cmsUInt16Number*) accum; accum+= 2; // M wIn[0] = *(cmsUInt16Number*) accum; accum+= 2; // C return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #29
-cmsUInt8Number* Unroll4WordsSwapSwapFirst(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll4WordsSwapSwapFirst(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
614
615
616
617
618
619
620
621
622
623
wIn[1] = *(cmsUInt16Number*) accum; accum+= 2; // M wIn[0] = *(cmsUInt16Number*) accum; accum+= 2; // C return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
624
625
626
627
cmsUInt8Number* Unroll4WordsSwapSwapFirst(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
628
629
630
631
632
633
634
635
636
637
{ wIn[2] = *(cmsUInt16Number*) accum; accum+= 2; // K wIn[1] = *(cmsUInt16Number*) accum; accum+= 2; // Y wIn[0] = *(cmsUInt16Number*) accum; accum+= 2; // M wIn[3] = *(cmsUInt16Number*) accum; accum+= 2; // C return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #30
-cmsUInt8Number* Unroll3Words(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll3Words(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
631
632
633
634
635
636
637
638
639
640
wIn[0] = *(cmsUInt16Number*) accum; accum+= 2; // M wIn[3] = *(cmsUInt16Number*) accum; accum+= 2; // C return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
641
642
643
644
cmsUInt8Number* Unroll3Words(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
645
646
647
648
649
650
651
652
653
654
{ wIn[0] = *(cmsUInt16Number*) accum; accum+= 2; // C R wIn[1] = *(cmsUInt16Number*) accum; accum+= 2; // M G wIn[2] = *(cmsUInt16Number*) accum; accum+= 2; // Y B return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #31
-cmsUInt8Number* Unroll3WordsSwap(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll3WordsSwap(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
647
648
649
650
651
652
653
654
655
656
wIn[1] = *(cmsUInt16Number*) accum; accum+= 2; // M G wIn[2] = *(cmsUInt16Number*) accum; accum+= 2; // Y B return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
657
658
659
660
cmsUInt8Number* Unroll3WordsSwap(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
661
662
663
664
665
666
667
668
669
670
{ wIn[2] = *(cmsUInt16Number*) accum; accum+= 2; // C R wIn[1] = *(cmsUInt16Number*) accum; accum+= 2; // M G wIn[0] = *(cmsUInt16Number*) accum; accum+= 2; // Y B return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #32
-cmsUInt8Number* Unroll3WordsSkip1Swap(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll3WordsSkip1Swap(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
663
664
665
666
667
668
669
670
671
672
wIn[1] = *(cmsUInt16Number*) accum; accum+= 2; // M G wIn[0] = *(cmsUInt16Number*) accum; accum+= 2; // Y B return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
673
674
675
676
cmsUInt8Number* Unroll3WordsSkip1Swap(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
677
678
679
680
681
682
683
684
685
686
{ accum += 2; // A wIn[2] = *(cmsUInt16Number*) accum; accum += 2; // R wIn[1] = *(cmsUInt16Number*) accum; accum += 2; // G wIn[0] = *(cmsUInt16Number*) accum; accum += 2; // B return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #33
-cmsUInt8Number* Unroll3WordsSkip1SwapFirst(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll3WordsSkip1SwapFirst(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
680
681
682
683
684
685
686
687
688
689
wIn[1] = *(cmsUInt16Number*) accum; accum += 2; // G wIn[0] = *(cmsUInt16Number*) accum; accum += 2; // B return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
690
691
692
693
cmsUInt8Number* Unroll3WordsSkip1SwapFirst(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
694
695
696
697
698
699
700
701
702
703
{ accum += 2; // A wIn[0] = *(cmsUInt16Number*) accum; accum += 2; // R wIn[1] = *(cmsUInt16Number*) accum; accum += 2; // G wIn[2] = *(cmsUInt16Number*) accum; accum += 2; // B return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #34
-cmsUInt8Number* Unroll1Word(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll1Word(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
697
698
699
700
701
702
703
704
705
706
wIn[1] = *(cmsUInt16Number*) accum; accum += 2; // G wIn[2] = *(cmsUInt16Number*) accum; accum += 2; // B return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
707
708
709
710
cmsUInt8Number* Unroll1Word(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
711
712
713
714
715
716
717
718
719
720
{ wIn[0] = wIn[1] = wIn[2] = *(cmsUInt16Number*) accum; accum+= 2; // L return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static

[CVE-2023-40093_1.diff] cmspack.c #35
-cmsUInt8Number* Unroll1WordReversed(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll1WordReversed(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
711
712
713
714
715
716
717
718
719
720
{ wIn[0] = wIn[1] = wIn[2] = *(cmsUInt16Number*) accum; accum+= 2; // L return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
721
722
723
724
cmsUInt8Number* Unroll1WordReversed(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
725
726
727
728
729
730
731
732
733
734
{ wIn[0] = wIn[1] = wIn[2] = REVERSE_FLAVOR_16(*(cmsUInt16Number*) accum); accum+= 2; return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static

[CVE-2023-40093_1.diff] cmspack.c #36
-cmsUInt8Number* Unroll1WordSkip3(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll1WordSkip3(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
725
726
727
728
729
730
731
732
733
734
{ wIn[0] = wIn[1] = wIn[2] = REVERSE_FLAVOR_16(*(cmsUInt16Number*) accum); accum+= 2; return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
735
736
737
738
cmsUInt8Number* Unroll1WordSkip3(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
739
740
741
742
743
744
745
746
747
748
{ wIn[0] = wIn[1] = wIn[2] = *(cmsUInt16Number*) accum; accum += 8; return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #37
-cmsUInt8Number* Unroll2Words(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* Unroll2Words(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
741
742
743
744
745
746
747
748
749
750
accum += 8; return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
751
752
753
754
cmsUInt8Number* Unroll2Words(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
755
756
757
758
759
760
761
762
763
764
{ wIn[0] = *(cmsUInt16Number*) accum; accum += 2; // ch1 wIn[1] = *(cmsUInt16Number*) accum; accum += 2; // ch2 return accum; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #42
+// Return the size in bytes of a given formatter +static +cmsUInt32Number PixelSize(cmsUInt32Number Format) +{ + cmsUInt32Number fmt_bytes = T_BYTES(Format); + + // For double, the T_BYTES field is zero + if (fmt_bytes == 0) + return sizeof(cmsUInt64Number); + + // Otherwise, it is already correct for all formats + return fmt_bytes; +} + -cmsUInt8Number* UnrollDoubleTo16(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* UnrollDoubleTo16(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
908
909
910
911
912
913
914
915
916
917
case PT_MCH13: case PT_MCH14: case PT_MCH15: return TRUE; default: return FALSE; } } // Inks does come in percentage, remaining cases are between 0..1.0, again to 16 bits static
+ show +
918
919
920
921
cmsUInt8Number* UnrollDoubleTo16(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
922
923
924
925
926
927
928
929
930
931
{ int nChan = T_CHANNELS(info -> InputFormat); int DoSwap = T_DOSWAP(info ->InputFormat); int Reverse = T_FLAVOR(info ->InputFormat); int SwapFirst = T_SWAPFIRST(info -> InputFormat); int Extra = T_EXTRA(info -> InputFormat); int ExtraFirst = DoSwap ^ SwapFirst; int Planar = T_PLANAR(info -> InputFormat); cmsFloat64Number v;

[CVE-2023-40093_1.diff] cmspack.c #44
+ Stride /= PixelSize(info->InputFormat); + -cmsUInt8Number* UnrollFloatTo16(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* UnrollFloatTo16(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
964
965
966
967
968
969
970
971
972
973
if (T_PLANAR(info -> InputFormat)) return accum + sizeof(cmsFloat64Number); else return accum + (nChan + Extra) * sizeof(cmsFloat64Number); } static
+ show +
974
975
976
977
cmsUInt8Number* UnrollFloatTo16(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
978
979
980
981
982
983
984
985
986
987
{ int nChan = T_CHANNELS(info -> InputFormat); int DoSwap = T_DOSWAP(info ->InputFormat); int Reverse = T_FLAVOR(info ->InputFormat); int SwapFirst = T_SWAPFIRST(info -> InputFormat); int Extra = T_EXTRA(info -> InputFormat); int ExtraFirst = DoSwap ^ SwapFirst; int Planar = T_PLANAR(info -> InputFormat); cmsFloat32Number v;

[CVE-2023-40093_1.diff] cmspack.c #46
+ Stride /= PixelSize(info->InputFormat); -cmsUInt8Number* UnrollDouble1Chan(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* UnrollDouble1Chan(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
return accum + sizeof(cmsFloat32Number); else return accum + (nChan + Extra) * sizeof(cmsFloat32Number); } // For 1 channel, we need to duplicate data (it comes in 0..1.0 range) static
+ show +
1032
1033
1034
1035
cmsUInt8Number* UnrollDouble1Chan(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
{ cmsFloat64Number* Inks = (cmsFloat64Number*) accum; wIn[0] = wIn[1] = wIn[2] = _cmsQuickSaturateWord(Inks[0] * 65535.0); return accum + sizeof(cmsFloat64Number); cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #63
-cmsUInt8Number* Pack6Bytes(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack6Bytes(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
*(cmsUInt16Number*) output = v; output += (Stride * sizeof(cmsUInt16Number)); } return (Init + sizeof(cmsUInt16Number)); } // CMYKcm (unrolled for speed) static
+ show +
1457
1458
1459
1460
cmsUInt8Number* Pack6Bytes(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
{ *output++ = FROM_16_TO_8(wOut[0]); *output++ = FROM_16_TO_8(wOut[1]); *output++ = FROM_16_TO_8(wOut[2]); *output++ = FROM_16_TO_8(wOut[3]); *output++ = FROM_16_TO_8(wOut[4]); *output++ = FROM_16_TO_8(wOut[5]); return output;

[CVE-2023-40093_1.diff] cmspack.c #64
-cmsUInt8Number* Pack6BytesSwap(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack6BytesSwap(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } // KCMYcm static
+ show +
1478
1479
1480
1481
cmsUInt8Number* Pack6BytesSwap(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
{ *output++ = FROM_16_TO_8(wOut[5]); *output++ = FROM_16_TO_8(wOut[4]); *output++ = FROM_16_TO_8(wOut[3]); *output++ = FROM_16_TO_8(wOut[2]); *output++ = FROM_16_TO_8(wOut[1]); *output++ = FROM_16_TO_8(wOut[0]); return output;

[CVE-2023-40093_1.diff] cmspack.c #65
-cmsUInt8Number* Pack6Words(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack6Words(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
*output++ = FROM_16_TO_8(wOut[0]); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } // CMYKcm static
+ show +
1498
1499
1500
1501
cmsUInt8Number* Pack6Words(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
{ *(cmsUInt16Number*) output = wOut[0]; output+= 2; *(cmsUInt16Number*) output = wOut[1]; output+= 2; *(cmsUInt16Number*) output = wOut[2]; output+= 2; *(cmsUInt16Number*) output = wOut[3]; output+= 2; *(cmsUInt16Number*) output = wOut[4];

[CVE-2023-40093_1.diff] cmspack.c #66
-cmsUInt8Number* Pack6WordsSwap(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack6WordsSwap(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
output+= 2; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } // KCMYcm static
+ show +
1524
1525
1526
1527
cmsUInt8Number* Pack6WordsSwap(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
{ *(cmsUInt16Number*) output = wOut[5]; output+= 2; *(cmsUInt16Number*) output = wOut[4]; output+= 2; *(cmsUInt16Number*) output = wOut[3]; output+= 2; *(cmsUInt16Number*) output = wOut[2]; output+= 2; *(cmsUInt16Number*) output = wOut[1];

[CVE-2023-40093_1.diff] cmspack.c #67
-cmsUInt8Number* Pack4Bytes(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack4Bytes(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
output+= 2; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
1550
1551
1552
1553
cmsUInt8Number* Pack4Bytes(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
{ *output++ = FROM_16_TO_8(wOut[0]); *output++ = FROM_16_TO_8(wOut[1]); *output++ = FROM_16_TO_8(wOut[2]); *output++ = FROM_16_TO_8(wOut[3]); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #68
-cmsUInt8Number* Pack4BytesReverse(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack4BytesReverse(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
*output++ = FROM_16_TO_8(wOut[2]); *output++ = FROM_16_TO_8(wOut[3]); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
1567
1568
1569
1570
cmsUInt8Number* Pack4BytesReverse(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
{ *output++ = REVERSE_FLAVOR_8(FROM_16_TO_8(wOut[0])); *output++ = REVERSE_FLAVOR_8(FROM_16_TO_8(wOut[1])); *output++ = REVERSE_FLAVOR_8(FROM_16_TO_8(wOut[2])); *output++ = REVERSE_FLAVOR_8(FROM_16_TO_8(wOut[3])); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #69
-cmsUInt8Number* Pack4BytesSwapFirst(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack4BytesSwapFirst(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
*output++ = REVERSE_FLAVOR_8(FROM_16_TO_8(wOut[3])); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
1585
1586
1587
1588
cmsUInt8Number* Pack4BytesSwapFirst(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
{ *output++ = FROM_16_TO_8(wOut[3]); *output++ = FROM_16_TO_8(wOut[0]); *output++ = FROM_16_TO_8(wOut[1]); *output++ = FROM_16_TO_8(wOut[2]); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #70
-cmsUInt8Number* Pack4BytesSwap(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack4BytesSwap(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
*output++ = FROM_16_TO_8(wOut[2]); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } // ABGR static
+ show +
1603
1604
1605
1606
cmsUInt8Number* Pack4BytesSwap(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
{ *output++ = FROM_16_TO_8(wOut[3]); *output++ = FROM_16_TO_8(wOut[2]); *output++ = FROM_16_TO_8(wOut[1]); *output++ = FROM_16_TO_8(wOut[0]); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #71
-cmsUInt8Number* Pack4BytesSwapSwapFirst(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack4BytesSwapSwapFirst(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
*output++ = FROM_16_TO_8(wOut[1]); *output++ = FROM_16_TO_8(wOut[0]); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
1620
1621
1622
1623
cmsUInt8Number* Pack4BytesSwapSwapFirst(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
{ *output++ = FROM_16_TO_8(wOut[2]); *output++ = FROM_16_TO_8(wOut[1]); *output++ = FROM_16_TO_8(wOut[0]); *output++ = FROM_16_TO_8(wOut[3]); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #72
-cmsUInt8Number* Pack4Words(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack4Words(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
*output++ = FROM_16_TO_8(wOut[0]); *output++ = FROM_16_TO_8(wOut[3]); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
1637
1638
1639
1640
cmsUInt8Number* Pack4Words(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
{ *(cmsUInt16Number*) output = wOut[0]; output+= 2; *(cmsUInt16Number*) output = wOut[1]; output+= 2; *(cmsUInt16Number*) output = wOut[2]; output+= 2; *(cmsUInt16Number*) output = wOut[3]; output+= 2;

[CVE-2023-40093_1.diff] cmspack.c #73
-cmsUInt8Number* Pack4WordsReverse(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack4WordsReverse(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
*(cmsUInt16Number*) output = wOut[3]; output+= 2; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
1658
1659
1660
1661
cmsUInt8Number* Pack4WordsReverse(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
{ *(cmsUInt16Number*) output = REVERSE_FLAVOR_16(wOut[0]); output+= 2; *(cmsUInt16Number*) output = REVERSE_FLAVOR_16(wOut[1]); output+= 2; *(cmsUInt16Number*) output = REVERSE_FLAVOR_16(wOut[2]); output+= 2; *(cmsUInt16Number*) output = REVERSE_FLAVOR_16(wOut[3]); output+= 2;

[CVE-2023-40093_1.diff] cmspack.c #74
-cmsUInt8Number* Pack4WordsSwap(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack4WordsSwap(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
output+= 2; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } // ABGR static
+ show +
1680
1681
1682
1683
cmsUInt8Number* Pack4WordsSwap(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
{ *(cmsUInt16Number*) output = wOut[3]; output+= 2; *(cmsUInt16Number*) output = wOut[2]; output+= 2; *(cmsUInt16Number*) output = wOut[1]; output+= 2; *(cmsUInt16Number*) output = wOut[0]; output+= 2;

[CVE-2023-40093_1.diff] cmspack.c #75
-cmsUInt8Number* Pack4WordsBigEndian(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack4WordsBigEndian(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
output+= 2; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } // CMYK static
+ show +
1702
1703
1704
1705
cmsUInt8Number* Pack4WordsBigEndian(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
{ *(cmsUInt16Number*) output = CHANGE_ENDIAN(wOut[0]); output+= 2; *(cmsUInt16Number*) output = CHANGE_ENDIAN(wOut[1]); output+= 2; *(cmsUInt16Number*) output = CHANGE_ENDIAN(wOut[2]); output+= 2; *(cmsUInt16Number*) output = CHANGE_ENDIAN(wOut[3]); output+= 2;

[CVE-2023-40093_1.diff] cmspack.c #76
-cmsUInt8Number* PackLabV2_8(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* PackLabV2_8(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
output+= 2; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
1724
1725
1726
1727
cmsUInt8Number* PackLabV2_8(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
{ *output++ = FROM_16_TO_8(FomLabV4ToLabV2(wOut[0])); *output++ = FROM_16_TO_8(FomLabV4ToLabV2(wOut[1])); *output++ = FROM_16_TO_8(FomLabV4ToLabV2(wOut[2])); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #77
-cmsUInt8Number* PackALabV2_8(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* PackALabV2_8(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
*output++ = FROM_16_TO_8(FomLabV4ToLabV2(wOut[1])); *output++ = FROM_16_TO_8(FomLabV4ToLabV2(wOut[2])); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
1740
1741
1742
1743
cmsUInt8Number* PackALabV2_8(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
{ output++; *output++ = FROM_16_TO_8(FomLabV4ToLabV2(wOut[0])); *output++ = FROM_16_TO_8(FomLabV4ToLabV2(wOut[1])); *output++ = FROM_16_TO_8(FomLabV4ToLabV2(wOut[2])); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #78
-cmsUInt8Number* PackLabV2_16(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* PackLabV2_16(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
*output++ = FROM_16_TO_8(FomLabV4ToLabV2(wOut[1])); *output++ = FROM_16_TO_8(FomLabV4ToLabV2(wOut[2])); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
1757
1758
1759
1760
cmsUInt8Number* PackLabV2_16(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
{ *(cmsUInt16Number*) output = FomLabV4ToLabV2(wOut[0]); output += 2; *(cmsUInt16Number*) output = FomLabV4ToLabV2(wOut[1]); output += 2; *(cmsUInt16Number*) output = FomLabV4ToLabV2(wOut[2]); output += 2; return output;

[CVE-2023-40093_1.diff] cmspack.c #79
-cmsUInt8Number* Pack3Bytes(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack3Bytes(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
*(cmsUInt16Number*) output = FomLabV4ToLabV2(wOut[2]); output += 2; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
1776
1777
1778
1779
cmsUInt8Number* Pack3Bytes(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
{ *output++ = FROM_16_TO_8(wOut[0]); *output++ = FROM_16_TO_8(wOut[1]); *output++ = FROM_16_TO_8(wOut[2]); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #80
-cmsUInt8Number* Pack3BytesOptimized(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack3BytesOptimized(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
*output++ = FROM_16_TO_8(wOut[1]); *output++ = FROM_16_TO_8(wOut[2]); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
1792
1793
1794
1795
cmsUInt8Number* Pack3BytesOptimized(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
{ *output++ = (wOut[0] & 0xFF); *output++ = (wOut[1] & 0xFF); *output++ = (wOut[2] & 0xFF); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #81
-cmsUInt8Number* Pack3BytesSwap(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack3BytesSwap(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
*output++ = (wOut[1] & 0xFF); *output++ = (wOut[2] & 0xFF); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
1808
1809
1810
1811
cmsUInt8Number* Pack3BytesSwap(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
{ *output++ = FROM_16_TO_8(wOut[2]); *output++ = FROM_16_TO_8(wOut[1]); *output++ = FROM_16_TO_8(wOut[0]); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #82
-cmsUInt8Number* Pack3BytesSwapOptimized(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack3BytesSwapOptimized(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
*output++ = FROM_16_TO_8(wOut[1]); *output++ = FROM_16_TO_8(wOut[0]); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
1824
1825
1826
1827
cmsUInt8Number* Pack3BytesSwapOptimized(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
{ *output++ = (wOut[2] & 0xFF); *output++ = (wOut[1] & 0xFF); *output++ = (wOut[0] & 0xFF); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #83
-cmsUInt8Number* Pack3Words(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack3Words(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
*output++ = (wOut[0] & 0xFF); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
1841
1842
1843
1844
cmsUInt8Number* Pack3Words(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
{ *(cmsUInt16Number*) output = wOut[0]; output+= 2; *(cmsUInt16Number*) output = wOut[1]; output+= 2; *(cmsUInt16Number*) output = wOut[2]; output+= 2; return output;

[CVE-2023-40093_1.diff] cmspack.c #84
-cmsUInt8Number* Pack3WordsSwap(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack3WordsSwap(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
*(cmsUInt16Number*) output = wOut[2]; output+= 2; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
1860
1861
1862
1863
cmsUInt8Number* Pack3WordsSwap(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
{ *(cmsUInt16Number*) output = wOut[2]; output+= 2; *(cmsUInt16Number*) output = wOut[1]; output+= 2; *(cmsUInt16Number*) output = wOut[0]; output+= 2; return output;

[CVE-2023-40093_1.diff] cmspack.c #85
-cmsUInt8Number* Pack3WordsBigEndian(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack3WordsBigEndian(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
*(cmsUInt16Number*) output = wOut[0]; output+= 2; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
1879
1880
1881
1882
cmsUInt8Number* Pack3WordsBigEndian(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
{ *(cmsUInt16Number*) output = CHANGE_ENDIAN(wOut[0]); output+= 2; *(cmsUInt16Number*) output = CHANGE_ENDIAN(wOut[1]); output+= 2; *(cmsUInt16Number*) output = CHANGE_ENDIAN(wOut[2]); output+= 2; return output;

[CVE-2023-40093_1.diff] cmspack.c #86
-cmsUInt8Number* Pack3BytesAndSkip1(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack3BytesAndSkip1(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
*(cmsUInt16Number*) output = CHANGE_ENDIAN(wOut[2]); output+= 2; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
1898
1899
1900
1901
cmsUInt8Number* Pack3BytesAndSkip1(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
{ *output++ = FROM_16_TO_8(wOut[0]); *output++ = FROM_16_TO_8(wOut[1]); *output++ = FROM_16_TO_8(wOut[2]); output++; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #87
-cmsUInt8Number* Pack3BytesAndSkip1Optimized(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack3BytesAndSkip1Optimized(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
*output++ = FROM_16_TO_8(wOut[2]); output++; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
1915
1916
1917
1918
cmsUInt8Number* Pack3BytesAndSkip1Optimized(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
{ *output++ = (wOut[0] & 0xFF); *output++ = (wOut[1] & 0xFF); *output++ = (wOut[2] & 0xFF); output++; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #88
-cmsUInt8Number* Pack3BytesAndSkip1SwapFirst(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack3BytesAndSkip1SwapFirst(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
output++; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
1933
1934
1935
1936
cmsUInt8Number* Pack3BytesAndSkip1SwapFirst(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
{ output++; *output++ = FROM_16_TO_8(wOut[0]); *output++ = FROM_16_TO_8(wOut[1]); *output++ = FROM_16_TO_8(wOut[2]); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #89
-cmsUInt8Number* Pack3BytesAndSkip1SwapFirstOptimized(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack3BytesAndSkip1SwapFirstOptimized(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
*output++ = FROM_16_TO_8(wOut[1]); *output++ = FROM_16_TO_8(wOut[2]); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
1950
1951
1952
1953
cmsUInt8Number* Pack3BytesAndSkip1SwapFirstOptimized(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
{ output++; *output++ = (wOut[0] & 0xFF); *output++ = (wOut[1] & 0xFF); *output++ = (wOut[2] & 0xFF); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #90
-cmsUInt8Number* Pack3BytesAndSkip1Swap(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack3BytesAndSkip1Swap(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
*output++ = (wOut[1] & 0xFF); *output++ = (wOut[2] & 0xFF); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
1967
1968
1969
1970
cmsUInt8Number* Pack3BytesAndSkip1Swap(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
{ output++; *output++ = FROM_16_TO_8(wOut[2]); *output++ = FROM_16_TO_8(wOut[1]); *output++ = FROM_16_TO_8(wOut[0]); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #91
-cmsUInt8Number* Pack3BytesAndSkip1SwapOptimized(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack3BytesAndSkip1SwapOptimized(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
*output++ = FROM_16_TO_8(wOut[1]); *output++ = FROM_16_TO_8(wOut[0]); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
1984
1985
1986
1987
cmsUInt8Number* Pack3BytesAndSkip1SwapOptimized(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
{ output++; *output++ = (wOut[2] & 0xFF); *output++ = (wOut[1] & 0xFF); *output++ = (wOut[0] & 0xFF); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #92
-cmsUInt8Number* Pack3BytesAndSkip1SwapSwapFirst(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack3BytesAndSkip1SwapSwapFirst(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
*output++ = (wOut[0] & 0xFF); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
2002
2003
2004
2005
cmsUInt8Number* Pack3BytesAndSkip1SwapSwapFirst(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
{ *output++ = FROM_16_TO_8(wOut[2]); *output++ = FROM_16_TO_8(wOut[1]); *output++ = FROM_16_TO_8(wOut[0]); output++; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #93
-cmsUInt8Number* Pack3BytesAndSkip1SwapSwapFirstOptimized(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack3BytesAndSkip1SwapSwapFirstOptimized(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
*output++ = FROM_16_TO_8(wOut[0]); output++; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
2019
2020
2021
2022
cmsUInt8Number* Pack3BytesAndSkip1SwapSwapFirstOptimized(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
{ *output++ = (wOut[2] & 0xFF); *output++ = (wOut[1] & 0xFF); *output++ = (wOut[0] & 0xFF); output++; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride);

[CVE-2023-40093_1.diff] cmspack.c #94
-cmsUInt8Number* Pack3WordsAndSkip1(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack3WordsAndSkip1(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
*output++ = (wOut[0] & 0xFF); output++; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
2036
2037
2038
2039
cmsUInt8Number* Pack3WordsAndSkip1(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
{ *(cmsUInt16Number*) output = wOut[0]; output+= 2; *(cmsUInt16Number*) output = wOut[1]; output+= 2; *(cmsUInt16Number*) output = wOut[2]; output+= 2; output+= 2; return output;

[CVE-2023-40093_1.diff] cmspack.c #95
-cmsUInt8Number* Pack3WordsAndSkip1Swap(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack3WordsAndSkip1Swap(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
output+= 2; output+= 2; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
2056
2057
2058
2059
cmsUInt8Number* Pack3WordsAndSkip1Swap(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
{ output+= 2; *(cmsUInt16Number*) output = wOut[2]; output+= 2; *(cmsUInt16Number*) output = wOut[1]; output+= 2; *(cmsUInt16Number*) output = wOut[0]; output+= 2; return output;

[CVE-2023-40093_1.diff] cmspack.c #96
-cmsUInt8Number* Pack3WordsAndSkip1SwapFirst(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack3WordsAndSkip1SwapFirst(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
output+= 2; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
2077
2078
2079
2080
cmsUInt8Number* Pack3WordsAndSkip1SwapFirst(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
{ output+= 2; *(cmsUInt16Number*) output = wOut[0]; output+= 2; *(cmsUInt16Number*) output = wOut[1]; output+= 2; *(cmsUInt16Number*) output = wOut[2]; output+= 2; return output;

[CVE-2023-40093_1.diff] cmspack.c #97
-cmsUInt8Number* Pack3WordsAndSkip1SwapSwapFirst(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack3WordsAndSkip1SwapSwapFirst(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
output+= 2; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
2098
2099
2100
2101
cmsUInt8Number* Pack3WordsAndSkip1SwapSwapFirst(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
{ *(cmsUInt16Number*) output = wOut[2]; output+= 2; *(cmsUInt16Number*) output = wOut[1]; output+= 2; *(cmsUInt16Number*) output = wOut[0]; output+= 2; output+= 2; return output;

[CVE-2023-40093_1.diff] cmspack.c #98
-cmsUInt8Number* Pack1Byte(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack1Byte(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
2120
2121
2122
2123
cmsUInt8Number* Pack1Byte(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
{ *output++ = FROM_16_TO_8(wOut[0]); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #99
-cmsUInt8Number* Pack1ByteReversed(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack1ByteReversed(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
*output++ = FROM_16_TO_8(wOut[0]); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
2135
2136
2137
2138
cmsUInt8Number* Pack1ByteReversed(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
{ *output++ = FROM_16_TO_8(REVERSE_FLAVOR_16(wOut[0])); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #100
-cmsUInt8Number* Pack1ByteSkip1(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack1ByteSkip1(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
*output++ = FROM_16_TO_8(REVERSE_FLAVOR_16(wOut[0])); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
2150
2151
2152
2153
cmsUInt8Number* Pack1ByteSkip1(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
{ *output++ = FROM_16_TO_8(wOut[0]); output++; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #101
-cmsUInt8Number* Pack1ByteSkip1SwapFirst(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack1ByteSkip1SwapFirst(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
output++; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
2166
2167
2168
2169
cmsUInt8Number* Pack1ByteSkip1SwapFirst(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
{ output++; *output++ = FROM_16_TO_8(wOut[0]); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #102
-cmsUInt8Number* Pack1Word(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack1Word(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
output++; *output++ = FROM_16_TO_8(wOut[0]); return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
2181
2182
2183
2184
cmsUInt8Number* Pack1Word(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
{ *(cmsUInt16Number*) output = wOut[0]; output+= 2; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #103
-cmsUInt8Number* Pack1WordReversed(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack1WordReversed(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
output+= 2; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
2197
2198
2199
2200
cmsUInt8Number* Pack1WordReversed(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
{ *(cmsUInt16Number*) output = REVERSE_FLAVOR_16(wOut[0]); output+= 2; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #104
-cmsUInt8Number* Pack1WordBigEndian(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack1WordBigEndian(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
*(cmsUInt16Number*) output = REVERSE_FLAVOR_16(wOut[0]); output+= 2; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
2212
2213
2214
2215
cmsUInt8Number* Pack1WordBigEndian(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
{ *(cmsUInt16Number*) output = CHANGE_ENDIAN(wOut[0]); output+= 2; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #105
-cmsUInt8Number* Pack1WordSkip1(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack1WordSkip1(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
output+= 2; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
2228
2229
2230
2231
cmsUInt8Number* Pack1WordSkip1(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
{ *(cmsUInt16Number*) output = wOut[0]; output+= 4; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #106
-cmsUInt8Number* Pack1WordSkip1SwapFirst(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* Pack1WordSkip1SwapFirst(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
*(cmsUInt16Number*) output = wOut[0]; output+= 4; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } static
+ show +
2243
2244
2245
2246
cmsUInt8Number* Pack1WordSkip1SwapFirst(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
{ output += 2; *(cmsUInt16Number*) output = wOut[0]; output+= 2; return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); }

[CVE-2023-40093_1.diff] cmspack.c #107
-cmsUInt8Number* PackLabDoubleFrom16(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* PackLabDoubleFrom16(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
return output; cmsUNUSED_PARAMETER(info); cmsUNUSED_PARAMETER(Stride); } // Unencoded Float values -- don't try optimize speed static
+ show +
2261
2262
2263
2264
cmsUInt8Number* PackLabDoubleFrom16(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
{ if (T_PLANAR(info -> OutputFormat)) { cmsCIELab Lab; cmsFloat64Number* Out = (cmsFloat64Number*) output; cmsLabEncoded2Float(&Lab, wOut); Out[0] = Lab.L; Out[Stride] = Lab.a;

[CVE-2023-40093_1.diff] cmspack.c #108
-cmsUInt8Number* PackLabFloatFrom16(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* PackLabFloatFrom16(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
} else { cmsLabEncoded2Float((cmsCIELab*) output, wOut); return output + (sizeof(cmsCIELab) + T_EXTRA(info ->OutputFormat) * sizeof(cmsFloat64Number)); } } static
+ show +
2288
2289
2290
2291
cmsUInt8Number* PackLabFloatFrom16(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
{ cmsCIELab Lab; cmsLabEncoded2Float(&Lab, wOut); if (T_PLANAR(info -> OutputFormat)) { cmsFloat32Number* Out = (cmsFloat32Number*) output; Out[0] = (cmsFloat32Number)Lab.L; Out[Stride] = (cmsFloat32Number)Lab.a;

[CVE-2023-40093_1.diff] cmspack.c #110
+ Stride /= PixelSize(info->OutputFormat); + -cmsUInt8Number* PackXYZDoubleFrom16(register _cmsTRANSFORM* Info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* PackXYZDoubleFrom16(CMSREGISTER _cmsTRANSFORM* Info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
((cmsFloat32Number*) output)[0] = (cmsFloat32Number) Lab.L; ((cmsFloat32Number*) output)[1] = (cmsFloat32Number) Lab.a; ((cmsFloat32Number*) output)[2] = (cmsFloat32Number) Lab.b; return output + (3 + T_EXTRA(info ->OutputFormat)) * sizeof(cmsFloat32Number); } } static
+ show +
2317
2318
2319
2320
cmsUInt8Number* PackXYZDoubleFrom16(register _cmsTRANSFORM* Info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
{ if (T_PLANAR(Info -> OutputFormat)) { cmsCIEXYZ XYZ; cmsFloat64Number* Out = (cmsFloat64Number*) output; cmsXYZEncoded2Float(&XYZ, wOut); Out[0] = XYZ.X; Out[Stride] = XYZ.Y; Out[Stride*2] = XYZ.Z;

[CVE-2023-40093_1.diff] cmspack.c #112
+ Stride /= PixelSize(Info->OutputFormat); + -cmsUInt8Number* PackXYZFloatFrom16(register _cmsTRANSFORM* Info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* PackXYZFloatFrom16(CMSREGISTER _cmsTRANSFORM* Info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
} else { cmsXYZEncoded2Float((cmsCIEXYZ*) output, wOut); return output + (sizeof(cmsCIEXYZ) + T_EXTRA(Info ->OutputFormat) * sizeof(cmsFloat64Number)); } } static
+ show +
2344
2345
2346
2347
cmsUInt8Number* PackXYZFloatFrom16(register _cmsTRANSFORM* Info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
{ if (T_PLANAR(Info -> OutputFormat)) { cmsCIEXYZ XYZ; cmsFloat32Number* Out = (cmsFloat32Number*) output; cmsXYZEncoded2Float(&XYZ, wOut); Out[0] = (cmsFloat32Number) XYZ.X; Out[Stride] = (cmsFloat32Number) XYZ.Y; Out[Stride*2] = (cmsFloat32Number) XYZ.Z;

[CVE-2023-40093_1.diff] cmspack.c #114
+ Stride /= PixelSize(Info->OutputFormat); + -cmsUInt8Number* PackDoubleFrom16(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* PackDoubleFrom16(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
Out[0] = (cmsFloat32Number) XYZ.X; Out[1] = (cmsFloat32Number) XYZ.Y; Out[2] = (cmsFloat32Number) XYZ.Z; return output + (3 * sizeof(cmsFloat32Number) + T_EXTRA(Info ->OutputFormat) * sizeof(cmsFloat32Number)); } } static
+ show +
2377
2378
2379
2380
cmsUInt8Number* PackDoubleFrom16(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
{ int nChan = T_CHANNELS(info -> OutputFormat); int DoSwap = T_DOSWAP(info ->OutputFormat); int Reverse = T_FLAVOR(info ->OutputFormat); int Extra = T_EXTRA(info -> OutputFormat); int SwapFirst = T_SWAPFIRST(info -> OutputFormat); int Planar = T_PLANAR(info -> OutputFormat); int ExtraFirst = DoSwap ^ SwapFirst; cmsFloat64Number maximum = IsInkSpace(info ->OutputFormat) ? 655.35 : 65535.0; cmsFloat64Number v = 0;

[CVE-2023-40093_1.diff] cmspack.c #116
+ Stride /= PixelSize(info->OutputFormat); + -cmsUInt8Number* PackFloatFrom16(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* PackFloatFrom16(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
if (T_PLANAR(info -> OutputFormat)) return output + sizeof(cmsFloat64Number); else return output + (nChan + Extra) * sizeof(cmsFloat64Number); } static
+ show +
2428
2429
2430
2431
cmsUInt8Number* PackFloatFrom16(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
{ int nChan = T_CHANNELS(info->OutputFormat); int DoSwap = T_DOSWAP(info->OutputFormat); int Reverse = T_FLAVOR(info->OutputFormat); int Extra = T_EXTRA(info->OutputFormat); int SwapFirst = T_SWAPFIRST(info->OutputFormat); int Planar = T_PLANAR(info->OutputFormat); int ExtraFirst = DoSwap ^ SwapFirst; cmsFloat64Number maximum = IsInkSpace(info->OutputFormat) ? 655.35 : 65535.0; cmsFloat64Number v = 0;

[CVE-2023-40093_1.diff] cmspack.c #125
+ Stride /= PixelSize(Info->OutputFormat); + + Stride /= PixelSize(Info->OutputFormat); + + Stride /= PixelSize(Info->OutputFormat); + + Stride /= PixelSize(Info->OutputFormat); + -cmsUInt8Number* UnrollHalfTo16(register _cmsTRANSFORM* info, - register cmsUInt16Number wIn[], - register cmsUInt8Number* accum, - register cmsUInt32Number Stride) +cmsUInt8Number* UnrollHalfTo16(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wIn[], + CMSREGISTER cmsUInt8Number* accum, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
} // ---------------------------------------------------------------------------------------------------------------- #ifndef CMS_NO_HALF_SUPPORT // Decodes an stream of half floats to wIn[] described by input format static
+ show +
2703
2704
2705
2706
cmsUInt8Number* UnrollHalfTo16(register _cmsTRANSFORM* info, register cmsUInt16Number wIn[], register cmsUInt8Number* accum, register cmsUInt32Number Stride)
+ show +
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
{ int nChan = T_CHANNELS(info -> InputFormat); int DoSwap = T_DOSWAP(info ->InputFormat); int Reverse = T_FLAVOR(info ->InputFormat); int SwapFirst = T_SWAPFIRST(info -> InputFormat); int Extra = T_EXTRA(info -> InputFormat); int ExtraFirst = DoSwap ^ SwapFirst; int Planar = T_PLANAR(info -> InputFormat); cmsFloat32Number v;

[CVE-2023-40093_1.diff] cmspack.c #129
+ Stride /= PixelSize(info->OutputFormat); -cmsUInt8Number* PackHalfFrom16(register _cmsTRANSFORM* info, - register cmsUInt16Number wOut[], - register cmsUInt8Number* output, - register cmsUInt32Number Stride) +cmsUInt8Number* PackHalfFrom16(CMSREGISTER _cmsTRANSFORM* info, + CMSREGISTER cmsUInt16Number wOut[], + CMSREGISTER cmsUInt8Number* output, + CMSREGISTER cmsUInt32Number Stride)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
} if (T_PLANAR(info -> InputFormat)) return accum + sizeof(cmsUInt16Number); else return accum + (nChan + Extra) * sizeof(cmsUInt16Number); } static
+ show +
2806
2807
2808
2809
cmsUInt8Number* PackHalfFrom16(register _cmsTRANSFORM* info, register cmsUInt16Number wOut[], register cmsUInt8Number* output, register cmsUInt32Number Stride)
+ show +
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
{ int nChan = T_CHANNELS(info->OutputFormat); int DoSwap = T_DOSWAP(info->OutputFormat); int Reverse = T_FLAVOR(info->OutputFormat); int Extra = T_EXTRA(info->OutputFormat); int SwapFirst = T_SWAPFIRST(info->OutputFormat); int Planar = T_PLANAR(info->OutputFormat); int ExtraFirst = DoSwap ^ SwapFirst; cmsFloat32Number maximum = IsInkSpace(info->OutputFormat) ? 655.35F : 65535.0F; cmsFloat32Number v = 0;

[CVE-2023-40093_1.diff] cmspack.c #137
-cmsFormatter _cmsGetFormatter(cmsContext ContextID, - cmsUInt32Number Type, // Specific type, i.e. TYPE_RGB_8 - cmsFormatterDirection Dir, - cmsUInt32Number dwFlags) +cmsFormatter CMSEXPORT _cmsGetFormatter(cmsContext ContextID, + cmsUInt32Number Type, // Specific type, i.e. TYPE_RGB_8 + cmsFormatterDirection Dir, + cmsUInt32Number dwFlags) + if (T_CHANNELS(Type) == 0) { + static const cmsFormatter nullFormatter = { 0 }; + return nullFormatter; + } +
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmspack.c
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
if (fl == NULL) return FALSE; fl ->Factory = Plugin ->FormattersFactory; fl ->Next = ctx -> FactoryList; ctx ->FactoryList = fl; return TRUE; }
+ show +
3293
3294
3295
3296
cmsFormatter _cmsGetFormatter(cmsContext ContextID, cmsUInt32Number Type, // Specific type, i.e. TYPE_RGB_8 cmsFormatterDirection Dir, cmsUInt32Number dwFlags)
+ show +
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
{ _cmsFormattersPluginChunkType* ctx = ( _cmsFormattersPluginChunkType*) _cmsContextGetClientChunk(ContextID, FormattersPlugin); cmsFormattersFactoryList* f; for (f =ctx->FactoryList; f != NULL; f = f ->Next) { cmsFormatter fn = f ->Factory(Type, Dir, dwFlags); if (fn.Fmt16 != NULL) return fn; }

[CVE-2023-40093_1.diff] cmsio0.c #18
+ + for (i = 0; i < Icc->TagCount; i++) { + for (j = 0; j < Icc->TagCount; j++) { + + // Tags cannot be duplicate + if ((i != j) && (Icc->TagNames[i] == Icc->TagNames[j])) { + cmsSignalError(Icc->ContextID, cmsERROR_RANGE, "Duplicate tag found"); + return FALSE; + } + + } + } + - cmsUInt32Number TagSize = FileOrig -> TagSizes[i]; - cmsUInt32Number TagOffset = FileOrig -> TagOffsets[i]; - void* Mem; + if (FileOrig->IOhandler != NULL) + { + cmsUInt32Number TagSize = FileOrig->TagSizes[i]; + cmsUInt32Number TagOffset = FileOrig->TagOffsets[i]; + void* Mem; - if (!FileOrig ->IOhandler->Seek(FileOrig ->IOhandler, TagOffset)) return FALSE; + if (!FileOrig->IOhandler->Seek(FileOrig->IOhandler, TagOffset)) return FALSE; - Mem = _cmsMalloc(Icc ->ContextID, TagSize); - if (Mem == NULL) return FALSE; + Mem = _cmsMalloc(Icc->ContextID, TagSize); + if (Mem == NULL) return FALSE; - if (FileOrig ->IOhandler->Read(FileOrig->IOhandler, Mem, TagSize, 1) != 1) return FALSE; - if (!io ->Write(io, TagSize, Mem)) return FALSE; - _cmsFree(Icc ->ContextID, Mem); + if (FileOrig->IOhandler->Read(FileOrig->IOhandler, Mem, TagSize, 1) != 1) return FALSE; + if (!io->Write(io, TagSize, Mem)) return FALSE; + _cmsFree(Icc->ContextID, Mem); - Icc -> TagSizes[i] = (io ->UsedSpace - Begin); + Icc->TagSizes[i] = (io->UsedSpace - Begin); - // Align to 32 bit boundary. - if (! _cmsWriteAlignment(io)) - return FALSE; + // Align to 32 bit boundary. + if (!_cmsWriteAlignment(io)) + return FALSE; + }
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmsio0.c
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
Icc -> TagOffsets[i] = Begin = io ->UsedSpace; Data = (cmsUInt8Number*) Icc -> TagPtrs[i]; if (!Data) { // Reach here if we are copying a tag from a disk-based ICC profile which has not been modified by user. // In this case a blind copy of the block data is performed if (FileOrig != NULL && Icc -> TagOffsets[i]) {
+ show +
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
cmsUInt32Number TagSize = FileOrig -> TagSizes[i]; cmsUInt32Number TagOffset = FileOrig -> TagOffsets[i]; void* Mem; if (!FileOrig ->IOhandler->Seek(FileOrig ->IOhandler, TagOffset)) return FALSE; Mem = _cmsMalloc(Icc ->ContextID, TagSize); if (Mem == NULL) return FALSE; if (FileOrig ->IOhandler->Read(FileOrig->IOhandler, Mem, TagSize, 1) != 1) return FALSE; if (!io ->Write(io, TagSize, Mem)) return FALSE; _cmsFree(Icc ->ContextID, Mem); Icc -> TagSizes[i] = (io ->UsedSpace - Begin); // Align to 32 bit boundary. if (! _cmsWriteAlignment(io)) return FALSE;
+ show +
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
} continue; } // Should this tag be saved as RAW? If so, tagsizes should be specified in advance (no further cooking is done) if (Icc ->TagSaveAsRaw[i]) { if (io -> Write(io, Icc ->TagSizes[i], Data) != 1) return FALSE;

[CVE-2023-40093_1.diff] cmsio0.c #20
+// Free one tag contents +static +void freeOneTag(_cmsICCPROFILE* Icc, cmsUInt32Number i) +{ + if (Icc->TagPtrs[i]) { + cmsTagTypeHandler* TypeHandler = Icc->TagTypeHandlers[i]; + + if (TypeHandler != NULL) { + cmsTagTypeHandler LocalTypeHandler = *TypeHandler; + + LocalTypeHandler.ContextID = Icc->ContextID; + LocalTypeHandler.ICCVersion = Icc->Version; + LocalTypeHandler.FreePtr(&LocalTypeHandler, Icc->TagPtrs[i]); + } + else + _cmsFree(Icc->ContextID, Icc->TagPtrs[i]); + } +} - if (Icc -> TagPtrs[i]) { - - cmsTagTypeHandler* TypeHandler = Icc ->TagTypeHandlers[i]; - - if (TypeHandler != NULL) { - cmsTagTypeHandler LocalTypeHandler = *TypeHandler; - - LocalTypeHandler.ContextID = Icc ->ContextID; // As an additional parameters - LocalTypeHandler.ICCVersion = Icc ->Version; - LocalTypeHandler.FreePtr(&LocalTypeHandler, Icc -> TagPtrs[i]); - } - else - _cmsFree(Icc ->ContextID, Icc ->TagPtrs[i]); - } + freeOneTag(Icc, i);
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmsio0.c
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
// Was open in write mode? if (Icc ->IsWrite) { Icc ->IsWrite = FALSE; // Assure no further writting rc &= cmsSaveProfileToFile(hProfile, Icc ->IOhandler->PhysicalFile); } for (i=0; i < Icc -> TagCount; i++) {
+ show +
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
if (Icc -> TagPtrs[i]) { cmsTagTypeHandler* TypeHandler = Icc ->TagTypeHandlers[i]; if (TypeHandler != NULL) { cmsTagTypeHandler LocalTypeHandler = *TypeHandler; LocalTypeHandler.ContextID = Icc ->ContextID; // As an additional parameters LocalTypeHandler.ICCVersion = Icc ->Version; LocalTypeHandler.FreePtr(&LocalTypeHandler, Icc -> TagPtrs[i]); } else _cmsFree(Icc ->ContextID, Icc ->TagPtrs[i]);
+ show +
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
} } if (Icc ->IOhandler != NULL) { rc &= cmsCloseIOhandler(Icc->IOhandler); } _cmsDestroyMutex(Icc->ContextID, Icc->UsrMutex); _cmsFree(Icc ->ContextID, Icc); // Free placeholder memory

[CVE-2023-40093_1.diff] cmswtpnt.c #2
- // Obtain y(x) - y = -3.000*(x*x) + 2.870*x - 0.275; + // Obtain y(x) + y = -3.000*(x*x) + 2.870*x - 0.275; - // wave factors (not used, but here for futures extensions) + // wave factors (not used, but here for futures extensions) - // M1 = (-1.3515 - 1.7703*x + 5.9114 *y)/(0.0241 + 0.2562*x - 0.7341*y); - // M2 = (0.0300 - 31.4424*x + 30.0717*y)/(0.0241 + 0.2562*x - 0.7341*y); + // M1 = (-1.3515 - 1.7703*x + 5.9114 *y)/(0.0241 + 0.2562*x - 0.7341*y); + // M2 = (0.0300 - 31.4424*x + 30.0717*y)/(0.0241 + 0.2562*x - 0.7341*y); - WhitePoint -> x = x; - WhitePoint -> y = y; - WhitePoint -> Y = 1.0; + WhitePoint -> x = x; + WhitePoint -> y = y; + WhitePoint -> Y = 1.0; - return TRUE; + return TRUE;
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmswtpnt.c
70
71
72
73
74
75
76
77
78
79
{ x = -2.0064*(1E9/T3) + 1.9018*(1E6/T2) + 0.24748*(1E3/T) + 0.237040; } else { cmsSignalError(0, cmsERROR_RANGE, "cmsWhitePointFromTemp: invalid temp"); return FALSE; } // Obtain y(x)
+ show +
80
81
82
83
84
85
86
87
88
89
90
91
y = -3.000*(x*x) + 2.870*x - 0.275; // wave factors (not used, but here for futures extensions) // M1 = (-1.3515 - 1.7703*x + 5.9114 *y)/(0.0241 + 0.2562*x - 0.7341*y); // M2 = (0.0300 - 31.4424*x + 30.0717*y)/(0.0241 + 0.2562*x - 0.7341*y); WhitePoint -> x = x; WhitePoint -> y = y; WhitePoint -> Y = 1.0; return TRUE;
+ show +
92
93
94
95
96
97
98
99
100
101
} typedef struct { cmsFloat64Number mirek; // temp (in microreciprocal kelvin) cmsFloat64Number ut; // u coord of intersection w/ blackbody locus cmsFloat64Number vt; // v coord of intersection w/ blackbody locus cmsFloat64Number tt; // slope of ISOTEMPERATURE. line

[CVE-2023-40093_1.diff] cmscgats.c #35
- t -> SampleID = idField; - - for (i=0; i < t -> nPatches; i++) { - - char *Data = GetData(it8, i, idField); - if (Data) { - char Buffer[256]; - - strncpy(Buffer, Data, 255); - Buffer[255] = 0; - - if (strlen(Buffer) <= strlen(Data)) - strcpy(Data, Buffer); - else - SetData(it8, i, idField, Buffer); - - } - } - + t -> SampleID = idField; - if ((cmsstrcasecmp(Fld, "LABEL") == 0) || Fld[0] == '$' ) { + if ((cmsstrcasecmp(Fld, "LABEL") == 0) || Fld[0] == '$') { - // Search for table references... - for (i=0; i < t -> nPatches; i++) { + // Search for table references... + for (i = 0; i < t->nPatches; i++) { - char *Label = GetData(it8, i, idField); + char* Label = GetData(it8, i, idField); - if (Label) { + if (Label) { - cmsUInt32Number k; + cmsUInt32Number k; - // This is the label, search for a table containing - // this property + // This is the label, search for a table containing + // this property - for (k=0; k < it8 ->TablesCount; k++) { + for (k = 0; k < it8->TablesCount; k++) { - TABLE* Table = it8 ->Tab + k; - KEYVALUE* p; + TABLE* Table = it8->Tab + k; + KEYVALUE* p; - if (IsAvailableOnList(Table->HeaderList, Label, NULL, &p)) { + if (IsAvailableOnList(Table->HeaderList, Label, NULL, &p)) { - // Available, keep type and table - char Buffer[256]; + // Available, keep type and table + char Buffer[256]; - char *Type = p ->Value; - int nTable = (int) k; + char* Type = p->Value; + int nTable = (int)k; - snprintf(Buffer, 255, "%s %d %s", Label, nTable, Type ); + snprintf(Buffer, 255, "%s %d %s", Label, nTable, Type); - SetData(it8, i, idField, Buffer); - } - } + SetData(it8, i, idField, Buffer); + } + } - } + } - } + } - } + } - } - } + } + }
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmscgats.c
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
SynError(it8, "Undefined DATA_FORMAT"); return; } Fld = t->DataFormat[idField]; if (!Fld) continue; if (cmsstrcasecmp(Fld, "SAMPLE_ID") == 0) {
+ show +
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
t -> SampleID = idField; for (i=0; i < t -> nPatches; i++) { char *Data = GetData(it8, i, idField); if (Data) { char Buffer[256]; strncpy(Buffer, Data, 255); Buffer[255] = 0; if (strlen(Buffer) <= strlen(Data)) strcpy(Data, Buffer); else SetData(it8, i, idField, Buffer); } } } // "LABEL" is an extension. It keeps references to forward tables if ((cmsstrcasecmp(Fld, "LABEL") == 0) || Fld[0] == '$' ) { // Search for table references... for (i=0; i < t -> nPatches; i++) { char *Label = GetData(it8, i, idField); if (Label) { cmsUInt32Number k; // This is the label, search for a table containing // this property for (k=0; k < it8 ->TablesCount; k++) { TABLE* Table = it8 ->Tab + k; KEYVALUE* p; if (IsAvailableOnList(Table->HeaderList, Label, NULL, &p)) { // Available, keep type and table char Buffer[256]; char *Type = p ->Value; int nTable = (int) k; snprintf(Buffer, 255, "%s %d %s", Label, nTable, Type ); SetData(it8, i, idField, Buffer);
+ show +
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
} } } } }

[CVE-2023-40093_1.diff] cmscgats.c #37
+ if (it8->MemoryBlock == NULL) + { + cmsIT8Free(hIT8); + return FALSE; + } - Props = (char **) AllocChunk(it8, sizeof(char *) * n); + Props = (char**)AllocChunk(it8, sizeof(char*) * n); + if (Props != NULL) { - // Pass#2 - Fill pointers - n = 0; - for (p = t -> HeaderList; p != NULL; p = p->Next) { - Props[n++] = p -> Keyword; - } + // Pass#2 - Fill pointers + n = 0; + for (p = t->HeaderList; p != NULL; p = p->Next) { + Props[n++] = p->Keyword; + } - *PropertyNames = Props; + } + *PropertyNames = Props; +
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmscgats.c
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
t = GetTable(it8); // Pass#1 - count properties n = 0; for (p = t -> HeaderList; p != NULL; p = p->Next) { n++; }
+ show +
2419
2420
2421
2422
2423
2424
2425
2426
2427
Props = (char **) AllocChunk(it8, sizeof(char *) * n); // Pass#2 - Fill pointers n = 0; for (p = t -> HeaderList; p != NULL; p = p->Next) { Props[n++] = p -> Keyword; } *PropertyNames = Props;
+ show +
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
return n; } cmsUInt32Number CMSEXPORT cmsIT8EnumPropertyMulti(cmsHANDLE hIT8, const char* cProp, const char ***SubpropertyNames) { cmsIT8* it8 = (cmsIT8*) hIT8; KEYVALUE *p, *tmp; cmsUInt32Number n; const char **Props; TABLE* t;

[CVE-2023-40093_1.diff] cmscgats.c #38
+ if (Props != NULL) { - // Pass#2 - Fill pointers - n = 0; - for (tmp = p; tmp != NULL; tmp = tmp->NextSubkey) { - if(tmp->Subkey != NULL) - Props[n++] = p ->Subkey; + // Pass#2 - Fill pointers + n = 0; + for (tmp = p; tmp != NULL; tmp = tmp->NextSubkey) { + if (tmp->Subkey != NULL) + Props[n++] = p->Subkey; + }
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmscgats.c
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
n = 0; for (tmp = p; tmp != NULL; tmp = tmp->NextSubkey) { if(tmp->Subkey != NULL) n++; } Props = (const char **) AllocChunk(it8, sizeof(char *) * n); // Pass#2 - Fill pointers
+ show +
2461
2462
2463
2464
n = 0; for (tmp = p; tmp != NULL; tmp = tmp->NextSubkey) { if(tmp->Subkey != NULL) Props[n++] = p ->Subkey;
+ show +
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
} *SubpropertyNames = Props; return n; } static int LocatePatch(cmsIT8* it8, const char* cPatch) { int i;

[CVE-2023-40093_1.diff] cmsps2.c #11
- const char* PostMaj, - const char* PreMin, - const char* PostMin, - int FixWhite, - cmsColorSpaceSignature ColorSpace) + const char* PostMaj, + const char* PreMin, + const char* PostMin, + int FixWhite, + cmsColorSpaceSignature ColorSpace)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmsps2.c
655
656
657
658
659
660
661
662
663
664
WriteByte(sc -> m, wByteOut); } return 1; } // Writes a Pipeline on memstream. Could be 8 or 16 bits based static void WriteCLUT(cmsIOHANDLER* m, cmsStage* mpe, const char* PreMaj,
+ show +
665
666
667
668
669
const char* PostMaj, const char* PreMin, const char* PostMin, int FixWhite, cmsColorSpaceSignature ColorSpace)
+ show +
670
671
672
673
674
675
676
677
678
679
{ cmsUInt32Number i; cmsPsSamplerCargo sc; sc.FirstComponent = -1; sc.SecondComponent = -1; sc.Pipeline = (_cmsStageCLutData *) mpe ->Data; sc.m = m; sc.PreMaj = PreMaj; sc.PostMaj= PostMaj;

[CVE-2023-40093_1.diff] cmsgamma.c #2
- 9, // # of curve types - { 1, 2, 3, 4, 5, 6, 7, 8, 108 }, // Parametric curve ID - { 1, 3, 4, 5, 7, 4, 5, 5, 1 }, // Parameters by type - DefaultEvalParametricFn, // Evaluator - NULL // Next in chain + 10, // # of curve types + { 1, 2, 3, 4, 5, 6, 7, 8, 108, 109 }, // Parametric curve ID + { 1, 3, 4, 5, 7, 4, 5, 5, 1, 1 }, // Parameters by type + DefaultEvalParametricFn, // Evaluator + NULL // Next in chain
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmsgamma.c
51
52
53
54
55
56
57
58
59
60
struct _cmsParametricCurvesCollection_st* Next; // Next in list } _cmsParametricCurvesCollection; // This is the default (built-in) evaluator static cmsFloat64Number DefaultEvalParametricFn(cmsInt32Number Type, const cmsFloat64Number Params[], cmsFloat64Number R); // The built-in list static _cmsParametricCurvesCollection DefaultCurves = {
+ show +
61
62
63
64
65
9, // # of curve types { 1, 2, 3, 4, 5, 6, 7, 8, 108 }, // Parametric curve ID { 1, 3, 4, 5, 7, 4, 5, 5, 1 }, // Parameters by type DefaultEvalParametricFn, // Evaluator NULL // Next in chain
+ show +
66
67
68
69
70
71
72
73
74
75
}; // Duplicates the zone of memory used by the plug-in in the new context static void DupPluginCurvesList(struct _cmsContext_struct* ctx, const struct _cmsContext_struct* src) { _cmsCurvesPluginChunkType newHead = { NULL }; _cmsParametricCurvesCollection* entry; _cmsParametricCurvesCollection* Anterior = NULL;

[CVE-2023-40093_1.diff] cmsopt.c #10
- // Named color pipelines cannot be optimized either - for (mpe = cmsPipelineGetPtrToFirstStage(Src); - mpe != NULL; - mpe = cmsStageNext(mpe)) { - if (cmsStageType(mpe) == cmsSigNamedColorElemType) return FALSE; - } -
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmsopt.c
651
652
653
654
655
656
657
658
659
660
OutputColorSpace = _cmsICCcolorSpace(T_COLORSPACE(*OutputFormat)); nGridPoints = _cmsReasonableGridpointsByColorspace(ColorSpace, *dwFlags); // For empty LUTs, 2 points are enough if (cmsPipelineStageCount(*Lut) == 0) nGridPoints = 2; Src = *Lut; // Named color pipelines cannot be optimized either
+ show +
661
662
663
664
for (mpe = cmsPipelineGetPtrToFirstStage(Src); mpe != NULL; mpe = cmsStageNext(mpe)) { if (cmsStageType(mpe) == cmsSigNamedColorElemType) return FALSE;
+ show +
665
666
667
668
669
670
671
672
673
674
} // Allocate an empty LUT Dest = cmsPipelineAlloc(Src ->ContextID, Src ->InputChannels, Src ->OutputChannels); if (!Dest) return FALSE; // Prelinearization tables are kept unless indicated by flags if (*dwFlags & cmsFLAGS_CLUT_PRE_LINEARIZATION) { // Get a pointer to the prelinearization element

[CVE-2023-40093_1.diff] cmsopt.c #16
- - // Named color pipelines cannot be optimized either - for (mpe = cmsPipelineGetPtrToFirstStage(OriginalLut); - mpe != NULL; - mpe = cmsStageNext(mpe)) { - if (cmsStageType(mpe) == cmsSigNamedColorElemType) return FALSE; - } - +
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmsopt.c
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
if (T_PLANAR(*OutputFormat)) return FALSE; // On 16 bits, user has to specify the feature if (!_cmsFormatterIs8bit(*InputFormat)) { if (!(*dwFlags & cmsFLAGS_CLUT_PRE_LINEARIZATION)) return FALSE; } OriginalLut = *Lut; // Named color pipelines cannot be optimized either
+ show +
1058
1059
1060
1061
for (mpe = cmsPipelineGetPtrToFirstStage(OriginalLut); mpe != NULL; mpe = cmsStageNext(mpe)) { if (cmsStageType(mpe) == cmsSigNamedColorElemType) return FALSE;
+ show +
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
} ColorSpace = _cmsICCcolorSpace(T_COLORSPACE(*InputFormat)); OutputColorSpace = _cmsICCcolorSpace(T_COLORSPACE(*OutputFormat)); nGridPoints = _cmsReasonableGridpointsByColorspace(ColorSpace, *dwFlags); // Empty gamma containers memset(Trans, 0, sizeof(Trans)); memset(TransReverse, 0, sizeof(TransReverse));

[CVE-2023-40093_1.diff] cmsopt.c #23
-// A fast matrix-shaper evaluator for 8 bits. This is a bit ticky since I'm using 1.14 signed fixed point +// A fast matrix-shaper evaluator for 8 bits. This is a bit tricky since I'm using 1.14 signed fixed point -static -void MatShaperEval16(register const cmsUInt16Number In[], - register cmsUInt16Number Out[], - register const void* D) +static CMS_NO_SANITIZE +void MatShaperEval16(CMSREGISTER const cmsUInt16Number In[], + CMSREGISTER cmsUInt16Number Out[], + CMSREGISTER const void* D)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmsopt.c
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
static void* DupMatShaper(cmsContext ContextID, const void* Data) { return _cmsDupMem(ContextID, Data, sizeof(MatShaper8Data)); } // A fast matrix-shaper evaluator for 8 bits. This is a bit ticky since I'm using 1.14 signed fixed point // to accomplish some performance. Actually it takes 256x3 16 bits tables and 16385 x 3 tables of 8 bits, // in total about 50K, and the performance boost is huge!
+ show +
1510
1511
1512
1513
static void MatShaperEval16(register const cmsUInt16Number In[], register cmsUInt16Number Out[], register const void* D)
+ show +
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
{ MatShaper8Data* p = (MatShaper8Data*) D; cmsS1Fixed14Number l1, l2, l3, r, g, b; cmsUInt32Number ri, gi, bi; // In this case (and only in this case!) we can use this simplification since // In[] is assured to come from a 8 bit number. (a << 8 | a) ri = In[0] & 0xFF; gi = In[1] & 0xFF; bi = In[2] & 0xFF;

[CVE-2023-40093_1.diff] cmsplugin.c #6
+ #elif !defined(_MSC_VER) && (defined(__STDC_VERSION__) && __STDC_VERSION__ < 199901L) + return TRUE; - cmsUInt32Number tmp; + union typeConverter { + cmsUInt32Number integer; + cmsFloat32Number floating_point; + } tmp; - _cmsAssert(io != NULL); - - tmp = *(cmsUInt32Number*) (void*) &n; - tmp = _cmsAdjustEndianess32(tmp); - if (io -> Write(io, sizeof(cmsUInt32Number), &tmp) != 1) + tmp.floating_point = n; + tmp.integer = _cmsAdjustEndianess32(tmp.integer); + if (io -> Write(io, sizeof(cmsUInt32Number), &tmp.integer) != 1)
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmsplugin.c
282
283
284
285
286
287
288
289
290
291
tmp = _cmsAdjustEndianess32(n); if (io -> Write(io, sizeof(cmsUInt32Number), &tmp) != 1) return FALSE; return TRUE; } cmsBool CMSEXPORT _cmsWriteFloat32Number(cmsIOHANDLER* io, cmsFloat32Number n) {
+ show +
292
293
294
295
296
297
298
cmsUInt32Number tmp; _cmsAssert(io != NULL); tmp = *(cmsUInt32Number*) (void*) &n; tmp = _cmsAdjustEndianess32(tmp); if (io -> Write(io, sizeof(cmsUInt32Number), &tmp) != 1)
+ show +
299
300
301
302
303
304
305
306
307
308
return FALSE; return TRUE; } cmsBool CMSEXPORT _cmsWriteUInt64Number(cmsIOHANDLER* io, cmsUInt64Number* n) { cmsUInt64Number tmp; _cmsAssert(io != NULL);

[CVE-2023-40093_1.diff] cmsplugin.c #10
+ cmsUInt8Number* ptr; + // setlocale may be active, no commas are needed in PS generator + // and PS generator is our only client + for (ptr = Buffer; *ptr; ptr++) + { + if (*ptr == ',') *ptr = '.'; + } + + case cmsPluginParalellizationSig: + if (!_cmsRegisterParallelizationPlugin(id, Plugin)) return FALSE; + break; + - NULL, // Not in the linked list - NULL, // No suballocator - { - NULL, // UserPtr, - &_cmsLogErrorChunk, // Logger, - &_cmsAlarmCodesChunk, // AlarmCodes, - &_cmsAdaptationStateChunk, // AdaptationState, - &_cmsMemPluginChunk, // MemPlugin, - &_cmsInterpPluginChunk, // InterpPlugin, - &_cmsCurvesPluginChunk, // CurvesPlugin, - &_cmsFormattersPluginChunk, // FormattersPlugin, - &_cmsTagTypePluginChunk, // TagTypePlugin, - &_cmsTagPluginChunk, // TagPlugin, - &_cmsIntentsPluginChunk, // IntentPlugin, - &_cmsMPETypePluginChunk, // MPEPlugin, - &_cmsOptimizationPluginChunk, // OptimizationPlugin, - &_cmsTransformPluginChunk, // TransformPlugin, - &_cmsMutexPluginChunk // MutexPlugin + NULL, // Not in the linked list + NULL, // No suballocator + { + NULL, // UserPtr, + &_cmsLogErrorChunk, // Logger, + &_cmsAlarmCodesChunk, // AlarmCodes, + &_cmsAdaptationStateChunk, // AdaptationState, + &_cmsMemPluginChunk, // MemPlugin, + &_cmsInterpPluginChunk, // InterpPlugin, + &_cmsCurvesPluginChunk, // CurvesPlugin, + &_cmsFormattersPluginChunk, // FormattersPlugin, + &_cmsTagTypePluginChunk, // TagTypePlugin, + &_cmsTagPluginChunk, // TagPlugin, + &_cmsIntentsPluginChunk, // IntentPlugin, + &_cmsMPETypePluginChunk, // MPEPlugin, + &_cmsOptimizationPluginChunk, // OptimizationPlugin, + &_cmsTransformPluginChunk, // TransformPlugin, + &_cmsMutexPluginChunk, // MutexPlugin, + &_cmsParallelizationPluginChunk // ParallelizationPlugin
/media/esteban/ACOS/ResurrectionX/external/pdfium/third_party/lcms/src/cmsplugin.c
612
613
614
615
616
617
618
619
620
621
void CMSEXPORT cmsUnregisterPlugins(void) { cmsUnregisterPluginsTHR(NULL); } // The Global storage for system context. This is the one and only global variable // pointers structure. All global vars are referenced here. static struct _cmsContext_struct globalContext = {
+ show +
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
NULL, // Not in the linked list NULL, // No suballocator { NULL, // UserPtr, &_cmsLogErrorChunk, // Logger, &_cmsAlarmCodesChunk, // AlarmCodes, &_cmsAdaptationStateChunk, // AdaptationState, &_cmsMemPluginChunk, // MemPlugin, &_cmsInterpPluginChunk, // InterpPlugin, &_cmsCurvesPluginChunk, // CurvesPlugin, &_cmsFormattersPluginChunk, // FormattersPlugin, &_cmsTagTypePluginChunk, // TagTypePlugin, &_cmsTagPluginChunk, // TagPlugin, &_cmsIntentsPluginChunk, // IntentPlugin, &_cmsMPETypePluginChunk, // MPEPlugin, &_cmsOptimizationPluginChunk, // OptimizationPlugin, &_cmsTransformPluginChunk, // TransformPlugin, &_cmsMutexPluginChunk // MutexPlugin
+ show +
640
641
642
643
644
645
646
647
648
649
}, { NULL, NULL, NULL, NULL, NULL, NULL } // The default memory allocator is not used for context 0 }; // The context pool (linked list head) static _cmsMutex _cmsContextPoolHeadMutex = CMS_MUTEX_INITIALIZER; static struct _cmsContext_struct* _cmsContextPoolHead = NULL;

[CVE-2018-9472_1.diff] os400config.h.in #8
-/* Define to 1 if you have the `strdup' function. */ -#define HAVE_STRDUP 1 - -/* Define to 1 if you have the `strerror' function. */ -#define HAVE_STRERROR 1 -
/media/esteban/ACOS/ResurrectionX/external/json-c/config.h
76
77
78
79
80
81
82
83
84
85
/* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the `strcasecmp' function. */ #define HAVE_STRCASECMP 1
+ show +
86
87
88
89
90
/* Define to 1 if you have the `strdup' function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1
+ show +
91
92
93
94
95
96
97
98
99
100
/* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the `strncasecmp' function. */ #define HAVE_STRNCASECMP 1
/media/esteban/ACOS/ResurrectionX/external/ntfs-3g/config.h
193
194
195
196
197
198
199
200
201
202
/* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the `strcasecmp' function. */ #define HAVE_STRCASECMP 1 /* Define to 1 if you have the `strchr' function. */ #define HAVE_STRCHR 1
+ show +
203
204
205
206
207
/* Define to 1 if you have the `strdup' function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1
+ show +
208
209
210
211
212
213
214
215
216
217
/* Define to 1 if you have the `strftime' function. */ #define HAVE_STRFTIME 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1
/media/esteban/ACOS/ResurrectionX/external/rsync/config.h
405
406
407
408
409
410
411
412
413
414
/* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the `strcasecmp' function. */ #define HAVE_STRCASECMP 1 /* Define to 1 if you have the `strchr' function. */ #define HAVE_STRCHR 1
+ show +
415
416
417
418
419
/* Define to 1 if you have the `strdup' function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1
+ show +
420
421
422
423
424
425
426
427
428
429
/* Define to 1 if you have the `strftime' function. */ #define HAVE_STRFTIME 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1
/media/esteban/ACOS/ResurrectionX/external/libxml2/config.h
188
189
190
191
192
193
194
195
196
197
/* Define to 1 if you have the <stdarg.h> header file. */ #define HAVE_STDARG_H 1 /* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1
+ show +
198
199
200
201
202
/* Define to 1 if you have the `strdup' function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1
+ show +
203
204
205
206
207
208
209
210
211
212
/* Define to 1 if you have the `strftime' function. */ #define HAVE_STRFTIME 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1

[CVE-2018-9472_1.diff] config.vms #3
-/* Define to 1 if you have the `strdup' function. */ -#define HAVE_STRDUP 1 - -/* Define to 1 if you have the `strerror' function. */ -#define HAVE_STRERROR 1 -
/media/esteban/ACOS/ResurrectionX/external/json-c/config.h
76
77
78
79
80
81
82
83
84
85
/* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the `strcasecmp' function. */ #define HAVE_STRCASECMP 1
+ show +
86
87
88
89
90
/* Define to 1 if you have the `strdup' function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1
+ show +
91
92
93
94
95
96
97
98
99
100
/* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the `strncasecmp' function. */ #define HAVE_STRNCASECMP 1
/media/esteban/ACOS/ResurrectionX/external/ntfs-3g/config.h
193
194
195
196
197
198
199
200
201
202
/* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the `strcasecmp' function. */ #define HAVE_STRCASECMP 1 /* Define to 1 if you have the `strchr' function. */ #define HAVE_STRCHR 1
+ show +
203
204
205
206
207
/* Define to 1 if you have the `strdup' function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1
+ show +
208
209
210
211
212
213
214
215
216
217
/* Define to 1 if you have the `strftime' function. */ #define HAVE_STRFTIME 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1
/media/esteban/ACOS/ResurrectionX/external/rsync/config.h
405
406
407
408
409
410
411
412
413
414
/* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the `strcasecmp' function. */ #define HAVE_STRCASECMP 1 /* Define to 1 if you have the `strchr' function. */ #define HAVE_STRCHR 1
+ show +
415
416
417
418
419
/* Define to 1 if you have the `strdup' function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1
+ show +
420
421
422
423
424
425
426
427
428
429
/* Define to 1 if you have the `strftime' function. */ #define HAVE_STRFTIME 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1
/media/esteban/ACOS/ResurrectionX/external/libxml2/config.h
188
189
190
191
192
193
194
195
196
197
/* Define to 1 if you have the <stdarg.h> header file. */ #define HAVE_STDARG_H 1 /* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1
+ show +
198
199
200
201
202
/* Define to 1 if you have the `strdup' function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1
+ show +
203
204
205
206
207
208
209
210
211
212
/* Define to 1 if you have the `strftime' function. */ #define HAVE_STRFTIME 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1

[CVE-2018-9466_1.diff] os400config.h.in #8
-/* Define to 1 if you have the `strdup' function. */ -#define HAVE_STRDUP 1 - -/* Define to 1 if you have the `strerror' function. */ -#define HAVE_STRERROR 1 -
/media/esteban/ACOS/ResurrectionX/external/json-c/config.h
76
77
78
79
80
81
82
83
84
85
/* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the `strcasecmp' function. */ #define HAVE_STRCASECMP 1
+ show +
86
87
88
89
90
/* Define to 1 if you have the `strdup' function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1
+ show +
91
92
93
94
95
96
97
98
99
100
/* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the `strncasecmp' function. */ #define HAVE_STRNCASECMP 1
/media/esteban/ACOS/ResurrectionX/external/ntfs-3g/config.h
193
194
195
196
197
198
199
200
201
202
/* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the `strcasecmp' function. */ #define HAVE_STRCASECMP 1 /* Define to 1 if you have the `strchr' function. */ #define HAVE_STRCHR 1
+ show +
203
204
205
206
207
/* Define to 1 if you have the `strdup' function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1
+ show +
208
209
210
211
212
213
214
215
216
217
/* Define to 1 if you have the `strftime' function. */ #define HAVE_STRFTIME 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1
/media/esteban/ACOS/ResurrectionX/external/rsync/config.h
405
406
407
408
409
410
411
412
413
414
/* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the `strcasecmp' function. */ #define HAVE_STRCASECMP 1 /* Define to 1 if you have the `strchr' function. */ #define HAVE_STRCHR 1
+ show +
415
416
417
418
419
/* Define to 1 if you have the `strdup' function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1
+ show +
420
421
422
423
424
425
426
427
428
429
/* Define to 1 if you have the `strftime' function. */ #define HAVE_STRFTIME 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1
/media/esteban/ACOS/ResurrectionX/external/libxml2/config.h
188
189
190
191
192
193
194
195
196
197
/* Define to 1 if you have the <stdarg.h> header file. */ #define HAVE_STDARG_H 1 /* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1
+ show +
198
199
200
201
202
/* Define to 1 if you have the `strdup' function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1
+ show +
203
204
205
206
207
208
209
210
211
212
/* Define to 1 if you have the `strftime' function. */ #define HAVE_STRFTIME 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1

[CVE-2018-9466_1.diff] config.vms #3
-/* Define to 1 if you have the `strdup' function. */ -#define HAVE_STRDUP 1 - -/* Define to 1 if you have the `strerror' function. */ -#define HAVE_STRERROR 1 -
/media/esteban/ACOS/ResurrectionX/external/json-c/config.h
76
77
78
79
80
81
82
83
84
85
/* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the `strcasecmp' function. */ #define HAVE_STRCASECMP 1
+ show +
86
87
88
89
90
/* Define to 1 if you have the `strdup' function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1
+ show +
91
92
93
94
95
96
97
98
99
100
/* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the `strncasecmp' function. */ #define HAVE_STRNCASECMP 1
/media/esteban/ACOS/ResurrectionX/external/ntfs-3g/config.h
193
194
195
196
197
198
199
200
201
202
/* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the `strcasecmp' function. */ #define HAVE_STRCASECMP 1 /* Define to 1 if you have the `strchr' function. */ #define HAVE_STRCHR 1
+ show +
203
204
205
206
207
/* Define to 1 if you have the `strdup' function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1
+ show +
208
209
210
211
212
213
214
215
216
217
/* Define to 1 if you have the `strftime' function. */ #define HAVE_STRFTIME 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1
/media/esteban/ACOS/ResurrectionX/external/rsync/config.h
405
406
407
408
409
410
411
412
413
414
/* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the `strcasecmp' function. */ #define HAVE_STRCASECMP 1 /* Define to 1 if you have the `strchr' function. */ #define HAVE_STRCHR 1
+ show +
415
416
417
418
419
/* Define to 1 if you have the `strdup' function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1
+ show +
420
421
422
423
424
425
426
427
428
429
/* Define to 1 if you have the `strftime' function. */ #define HAVE_STRFTIME 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1
/media/esteban/ACOS/ResurrectionX/external/libxml2/config.h
188
189
190
191
192
193
194
195
196
197
/* Define to 1 if you have the <stdarg.h> header file. */ #define HAVE_STDARG_H 1 /* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1
+ show +
198
199
200
201
202
/* Define to 1 if you have the `strdup' function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1
+ show +
203
204
205
206
207
208
209
210
211
212
/* Define to 1 if you have the `strftime' function. */ #define HAVE_STRFTIME 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1

[CVE-2020-0478_1.diff] CMakeLists.txt #3
-# Where Google Test's .h files can be found. -include_directories( - ${gtest_SOURCE_DIR}/include - ${gtest_SOURCE_DIR}) +# Create the CMake package file descriptors. +if (INSTALL_GTEST) + include(CMakePackageConfigHelpers) + set(cmake_package_name GTest) + set(targets_export_name ${cmake_package_name}Targets CACHE INTERNAL "") + set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated" CACHE INTERNAL "") + set(cmake_files_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${cmake_package_name}") + set(version_file "${generated_dir}/${cmake_package_name}ConfigVersion.cmake") + write_basic_package_version_file(${version_file} COMPATIBILITY AnyNewerVersion) + install(EXPORT ${targets_export_name} + NAMESPACE ${cmake_package_name}:: + DESTINATION ${cmake_files_install_dir}) + set(config_file "${generated_dir}/${cmake_package_name}Config.cmake") + configure_package_config_file("${gtest_SOURCE_DIR}/cmake/Config.cmake.in" + "${config_file}" INSTALL_DESTINATION ${cmake_files_install_dir}) + install(FILES ${version_file} ${config_file} + DESTINATION ${cmake_files_install_dir}) +endif() -# Where Google Test's libraries can be found. -link_directories(${gtest_BINARY_DIR}/src) +# Where Google Test's .h files can be found. +set(gtest_build_include_dirs + "${gtest_SOURCE_DIR}/include" + "${gtest_SOURCE_DIR}") +include_directories(${gtest_build_include_dirs})
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/CMakeLists.txt
44
45
46
47
48
49
50
51
52
53
if (COMMAND set_up_hermetic_build) set_up_hermetic_build() endif() # Define helper functions and macros used by Google Test. include(cmake/internal_utils.cmake) config_compiler_and_linker() # Defined in internal_utils.cmake.
+ show +
54
55
56
57
58
59
60
# Where Google Test's .h files can be found. include_directories( ${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR}) # Where Google Test's libraries can be found. link_directories(${gtest_BINARY_DIR}/src)
+ show +
61
62
63
64
65
66
67
68
69
70
######################################################################## # # Defines the gtest & gtest_main libraries. User tests should link # with one of them. # Google Test libraries. We build them using more strict warnings than what # are used for other targets, to ensure that gtest can be compiled by a user # aggressive about warnings. cxx_library(gtest "${cxx_strict}" src/gtest-all.cc)
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/CMakeLists.txt
54
55
56
57
58
59
60
61
62
63
if (gtest_hide_internal_symbols) set(CMAKE_CXX_VISIBILITY_PRESET hidden) set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) endif() # Define helper functions and macros used by Google Test. include(cmake/internal_utils.cmake) config_compiler_and_linker() # Defined in internal_utils.cmake.
+ show +
64
65
66
67
68
69
70
# Where Google Test's .h files can be found. include_directories( ${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR}) # Where Google Test's libraries can be found. link_directories(${gtest_BINARY_DIR}/src)
+ show +
71
72
73
74
75
76
77
78
79
80
# Summary of tuple support for Microsoft Visual Studio: # Compiler version(MS) version(cmake) Support # ---------- ----------- -------------- ----------------------------- # <= VS 2010 <= 10 <= 1600 Use Google Tests's own tuple. # VS 2012 11 1700 std::tr1::tuple + _VARIADIC_MAX=10 # VS 2013 12 1800 std::tr1::tuple if (MSVC AND MSVC_VERSION EQUAL 1700) add_definitions(/D _VARIADIC_MAX=10) endif()

[CVE-2020-0470_1.diff] CMakeLists.txt #3
-# Where Google Test's .h files can be found. -include_directories( - ${gtest_SOURCE_DIR}/include - ${gtest_SOURCE_DIR}) +# Create the CMake package file descriptors. +if (INSTALL_GTEST) + include(CMakePackageConfigHelpers) + set(cmake_package_name GTest) + set(targets_export_name ${cmake_package_name}Targets CACHE INTERNAL "") + set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated" CACHE INTERNAL "") + set(cmake_files_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${cmake_package_name}") + set(version_file "${generated_dir}/${cmake_package_name}ConfigVersion.cmake") + write_basic_package_version_file(${version_file} COMPATIBILITY AnyNewerVersion) + install(EXPORT ${targets_export_name} + NAMESPACE ${cmake_package_name}:: + DESTINATION ${cmake_files_install_dir}) + set(config_file "${generated_dir}/${cmake_package_name}Config.cmake") + configure_package_config_file("${gtest_SOURCE_DIR}/cmake/Config.cmake.in" + "${config_file}" INSTALL_DESTINATION ${cmake_files_install_dir}) + install(FILES ${version_file} ${config_file} + DESTINATION ${cmake_files_install_dir}) +endif() -# Where Google Test's libraries can be found. -link_directories(${gtest_BINARY_DIR}/src) +# Where Google Test's .h files can be found. +set(gtest_build_include_dirs + "${gtest_SOURCE_DIR}/include" + "${gtest_SOURCE_DIR}") +include_directories(${gtest_build_include_dirs})
/media/esteban/ACOS/ResurrectionX/external/google-breakpad/src/testing/gtest/CMakeLists.txt
44
45
46
47
48
49
50
51
52
53
if (COMMAND set_up_hermetic_build) set_up_hermetic_build() endif() # Define helper functions and macros used by Google Test. include(cmake/internal_utils.cmake) config_compiler_and_linker() # Defined in internal_utils.cmake.
+ show +
54
55
56
57
58
59
60
# Where Google Test's .h files can be found. include_directories( ${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR}) # Where Google Test's libraries can be found. link_directories(${gtest_BINARY_DIR}/src)
+ show +
61
62
63
64
65
66
67
68
69
70
######################################################################## # # Defines the gtest & gtest_main libraries. User tests should link # with one of them. # Google Test libraries. We build them using more strict warnings than what # are used for other targets, to ensure that gtest can be compiled by a user # aggressive about warnings. cxx_library(gtest "${cxx_strict}" src/gtest-all.cc)
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/CMakeLists.txt
54
55
56
57
58
59
60
61
62
63
if (gtest_hide_internal_symbols) set(CMAKE_CXX_VISIBILITY_PRESET hidden) set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) endif() # Define helper functions and macros used by Google Test. include(cmake/internal_utils.cmake) config_compiler_and_linker() # Defined in internal_utils.cmake.
+ show +
64
65
66
67
68
69
70
# Where Google Test's .h files can be found. include_directories( ${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR}) # Where Google Test's libraries can be found. link_directories(${gtest_BINARY_DIR}/src)
+ show +
71
72
73
74
75
76
77
78
79
80
# Summary of tuple support for Microsoft Visual Studio: # Compiler version(MS) version(cmake) Support # ---------- ----------- -------------- ----------------------------- # <= VS 2010 <= 10 <= 1600 Use Google Tests's own tuple. # VS 2012 11 1700 std::tr1::tuple + _VARIADIC_MAX=10 # VS 2013 12 1800 std::tr1::tuple if (MSVC AND MSVC_VERSION EQUAL 1700) add_definitions(/D _VARIADIC_MAX=10) endif()

[CVE-2020-0478_1.diff] aom_thread.h #3
-#if _WIN32_WINNT >= 0x0501 // Windows XP or greater -#define WaitForSingleObject(obj, timeout) \ - WaitForSingleObjectEx(obj, timeout, FALSE /*bAlertable*/) -#endif -
/media/esteban/ACOS/ResurrectionX/external/webp/src/utils/thread_utils.c
60
61
62
63
64
65
66
67
68
69
//------------------------------------------------------------------------------ // simplistic pthread emulation layer #include <process.h> // _beginthreadex requires __stdcall #define THREADFN unsigned int __stdcall #define THREAD_RETURN(val) (unsigned int)((DWORD_PTR)val)
+ show +
70
71
72
73
#if _WIN32_WINNT >= 0x0501 // Windows XP or greater #define WaitForSingleObject(obj, timeout) \ WaitForSingleObjectEx(obj, timeout, FALSE /*bAlertable*/) #endif
+ show +
74
75
76
77
78
79
80
81
82
83
static int pthread_create(pthread_t* const thread, const void* attr, unsigned int (__stdcall *start)(void*), void* arg) { (void)attr; #ifdef USE_CREATE_THREAD *thread = CreateThread(NULL, /* lpThreadAttributes */ 0, /* dwStackSize */ start, arg, 0, /* dwStackSize */
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vpx_util/vpx_thread.h
59
60
61
62
63
64
65
66
67
68
// _beginthreadex requires __stdcall #if defined(__GNUC__) && \ (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) #define THREADFN __attribute__((force_align_arg_pointer)) unsigned int __stdcall #else #define THREADFN unsigned int __stdcall #endif #define THREAD_RETURN(val) (unsigned int)((DWORD_PTR)val)
+ show +
69
70
71
72
#if _WIN32_WINNT >= 0x0501 // Windows XP or greater #define WaitForSingleObject(obj, timeout) \ WaitForSingleObjectEx(obj, timeout, FALSE /*bAlertable*/) #endif
+ show +
73
74
75
76
77
78
79
80
81
82
static INLINE int pthread_create(pthread_t *const thread, const void *attr, unsigned int(__stdcall *start)(void *), void *arg) { (void)attr; #ifdef USE_CREATE_THREAD *thread = CreateThread(NULL, /* lpThreadAttributes */ 0, /* dwStackSize */ start, arg, 0, /* dwStackSize */ NULL); /* lpThreadId */
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_util/aom_thread.h
57
58
59
60
61
62
63
64
65
66
#define USE_CREATE_THREAD #endif //------------------------------------------------------------------------------ // simplistic pthread emulation layer // _beginthreadex requires __stdcall #define THREADFN unsigned int __stdcall #define THREAD_RETURN(val) (unsigned int)((DWORD_PTR)val)
+ show +
67
68
69
70
#if _WIN32_WINNT >= 0x0501 // Windows XP or greater #define WaitForSingleObject(obj, timeout) \ WaitForSingleObjectEx(obj, timeout, FALSE /*bAlertable*/) #endif
+ show +
71
72
73
74
75
76
77
78
79
80
static INLINE int pthread_create(pthread_t *const thread, const void *attr, unsigned int(__stdcall *start)(void *), void *arg) { (void)attr; #ifdef USE_CREATE_THREAD *thread = CreateThread(NULL, /* lpThreadAttributes */ 0, /* dwStackSize */ start, arg, 0, /* dwStackSize */ NULL); /* lpThreadId */

[CVE-2020-0470_1.diff] aom_thread.h #3
-#if _WIN32_WINNT >= 0x0501 // Windows XP or greater -#define WaitForSingleObject(obj, timeout) \ - WaitForSingleObjectEx(obj, timeout, FALSE /*bAlertable*/) -#endif -
/media/esteban/ACOS/ResurrectionX/external/webp/src/utils/thread_utils.c
60
61
62
63
64
65
66
67
68
69
//------------------------------------------------------------------------------ // simplistic pthread emulation layer #include <process.h> // _beginthreadex requires __stdcall #define THREADFN unsigned int __stdcall #define THREAD_RETURN(val) (unsigned int)((DWORD_PTR)val)
+ show +
70
71
72
73
#if _WIN32_WINNT >= 0x0501 // Windows XP or greater #define WaitForSingleObject(obj, timeout) \ WaitForSingleObjectEx(obj, timeout, FALSE /*bAlertable*/) #endif
+ show +
74
75
76
77
78
79
80
81
82
83
static int pthread_create(pthread_t* const thread, const void* attr, unsigned int (__stdcall *start)(void*), void* arg) { (void)attr; #ifdef USE_CREATE_THREAD *thread = CreateThread(NULL, /* lpThreadAttributes */ 0, /* dwStackSize */ start, arg, 0, /* dwStackSize */
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vpx_util/vpx_thread.h
59
60
61
62
63
64
65
66
67
68
// _beginthreadex requires __stdcall #if defined(__GNUC__) && \ (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) #define THREADFN __attribute__((force_align_arg_pointer)) unsigned int __stdcall #else #define THREADFN unsigned int __stdcall #endif #define THREAD_RETURN(val) (unsigned int)((DWORD_PTR)val)
+ show +
69
70
71
72
#if _WIN32_WINNT >= 0x0501 // Windows XP or greater #define WaitForSingleObject(obj, timeout) \ WaitForSingleObjectEx(obj, timeout, FALSE /*bAlertable*/) #endif
+ show +
73
74
75
76
77
78
79
80
81
82
static INLINE int pthread_create(pthread_t *const thread, const void *attr, unsigned int(__stdcall *start)(void *), void *arg) { (void)attr; #ifdef USE_CREATE_THREAD *thread = CreateThread(NULL, /* lpThreadAttributes */ 0, /* dwStackSize */ start, arg, 0, /* dwStackSize */ NULL); /* lpThreadId */
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_util/aom_thread.h
57
58
59
60
61
62
63
64
65
66
#define USE_CREATE_THREAD #endif //------------------------------------------------------------------------------ // simplistic pthread emulation layer // _beginthreadex requires __stdcall #define THREADFN unsigned int __stdcall #define THREAD_RETURN(val) (unsigned int)((DWORD_PTR)val)
+ show +
67
68
69
70
#if _WIN32_WINNT >= 0x0501 // Windows XP or greater #define WaitForSingleObject(obj, timeout) \ WaitForSingleObjectEx(obj, timeout, FALSE /*bAlertable*/) #endif
+ show +
71
72
73
74
75
76
77
78
79
80
static INLINE int pthread_create(pthread_t *const thread, const void *attr, unsigned int(__stdcall *start)(void *), void *arg) { (void)attr; #ifdef USE_CREATE_THREAD *thread = CreateThread(NULL, /* lpThreadAttributes */ 0, /* dwStackSize */ start, arg, 0, /* dwStackSize */ NULL); /* lpThreadId */

[CVE-2021-39667_1.diff] ih264d_parse_slice.c #1
- /* Increment only if the current slice has atleast 1 more MB */ - if (ps_dec->u4_first_slice_in_pic == 0 && - (ps_dec->ps_parse_cur_slice->u4_first_mb_in_slice < - (UWORD32)(ps_dec->u2_total_mbs_coded >> ps_dec->ps_cur_slice->u1_mbaff_frame_flag))) - { - ps_dec->ps_parse_cur_slice++; - ps_dec->u2_cur_slice_num++; - // in the case of single core increment ps_decode_cur_slice - if(ps_dec->u1_separate_parse == 0) - { - ps_dec->ps_decode_cur_slice++; - } - } - - ps_dec->u1_slice_header_done = 0; - -
/media/esteban/ACOS/ResurrectionX/external/libavc/decoder/ih264d_parse_slice.c
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
+ ps_dec->i4_max_poc + ps_dec->u1_max_dec_frame_buffering + 1; /*If i4_prev_max_display_seq overflows integer range, reset it */ ps_dec->i4_prev_max_display_seq = (u8_temp > 0x7fffffff)? 0 : u8_temp; ps_dec->i4_max_poc = 0; } } /* Increment only if the current slice has atleast 1 more MB */
+ show +
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
if (ps_dec->u4_first_slice_in_pic == 0 && (ps_dec->ps_parse_cur_slice->u4_first_mb_in_slice < (UWORD32)(ps_dec->u2_total_mbs_coded >> ps_dec->ps_cur_slice->u1_mbaff_frame_flag))) { ps_dec->ps_parse_cur_slice++; ps_dec->u2_cur_slice_num++; // in the case of single core increment ps_decode_cur_slice if(ps_dec->u1_separate_parse == 0) { ps_dec->ps_decode_cur_slice++; } } ps_dec->u1_slice_header_done = 0;
+ show +
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
/*--------------------------------------------------------------------*/ /* Copy the values read from the bitstream to the slice header and then*/ /* If the slice is first slice in picture, then do Start of Picture */ /* processing. */ /*--------------------------------------------------------------------*/ ps_cur_slice->i4_delta_pic_order_cnt[0] = i_delta_poc[0]; ps_cur_slice->i4_delta_pic_order_cnt[1] = i_delta_poc[1]; ps_cur_slice->u4_idr_pic_id = u4_idr_pic_id; ps_cur_slice->u2_first_mb_in_slice = u2_first_mb_in_slice;

[CVE-2020-0002_1.diff] ih264d_api.c #2
+ { + UWORD8 i; + struct pic_buffer_t *ps_init_dpb; + ps_init_dpb = ps_dec->ps_dpb_mgr->ps_init_dpb[0][0]; + for(i = 0; i < 2 * MAX_REF_BUFS; i++) + { + ps_init_dpb->pu1_buf1 = NULL; + ps_init_dpb->u1_long_term_frm_idx = MAX_REF_BUFS + 1; + ps_dec->ps_dpb_mgr->ps_init_dpb[0][i] = ps_init_dpb; + ps_dec->ps_dpb_mgr->ps_mod_dpb[0][i] = ps_init_dpb; + ps_init_dpb++; + } + + ps_init_dpb = ps_dec->ps_dpb_mgr->ps_init_dpb[1][0]; + for(i = 0; i < 2 * MAX_REF_BUFS; i++) + { + ps_init_dpb->pu1_buf1 = NULL; + ps_init_dpb->u1_long_term_frm_idx = MAX_REF_BUFS + 1; + ps_dec->ps_dpb_mgr->ps_init_dpb[1][i] = ps_init_dpb; + ps_dec->ps_dpb_mgr->ps_mod_dpb[1][i] = ps_init_dpb; + ps_init_dpb++; + } + } + - { - UWORD8 i; - struct pic_buffer_t *ps_init_dpb; - ps_init_dpb = ps_dec->ps_dpb_mgr->ps_init_dpb[0][0]; - for(i = 0; i < 2 * MAX_REF_BUFS; i++) - { - ps_init_dpb->pu1_buf1 = NULL; - ps_init_dpb->u1_long_term_frm_idx = MAX_REF_BUFS + 1; - ps_dec->ps_dpb_mgr->ps_init_dpb[0][i] = ps_init_dpb; - ps_dec->ps_dpb_mgr->ps_mod_dpb[0][i] = ps_init_dpb; - ps_init_dpb++; - } - - ps_init_dpb = ps_dec->ps_dpb_mgr->ps_init_dpb[1][0]; - for(i = 0; i < 2 * MAX_REF_BUFS; i++) - { - ps_init_dpb->pu1_buf1 = NULL; - ps_init_dpb->u1_long_term_frm_idx = MAX_REF_BUFS + 1; - ps_dec->ps_dpb_mgr->ps_init_dpb[1][i] = ps_init_dpb; - ps_dec->ps_dpb_mgr->ps_mod_dpb[1][i] = ps_init_dpb; - ps_init_dpb++; - } - }
/media/esteban/ACOS/ResurrectionX/external/libavc/decoder/ih264d_api.c
957
958
959
960
961
962
963
964
965
966
size = (sizeof(neighbouradd_t) << 2); memset(ps_dec->ps_left_mvpred_addr, 0 ,size); size = sizeof(buf_mgr_t) + ithread_get_mutex_lock_size(); memset(ps_dec->pv_mv_buf_mgr, 0, size); /* Free any dynamic buffers that are allocated */ ih264d_free_dynamic_bufs(ps_dec); {
+ show +
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
UWORD8 i; struct pic_buffer_t *ps_init_dpb; ps_init_dpb = ps_dec->ps_dpb_mgr->ps_init_dpb[0][0]; for(i = 0; i < 2 * MAX_REF_BUFS; i++) { ps_init_dpb->pu1_buf1 = NULL; ps_init_dpb->u1_long_term_frm_idx = MAX_REF_BUFS + 1; ps_dec->ps_dpb_mgr->ps_init_dpb[0][i] = ps_init_dpb; ps_dec->ps_dpb_mgr->ps_mod_dpb[0][i] = ps_init_dpb; ps_init_dpb++; } ps_init_dpb = ps_dec->ps_dpb_mgr->ps_init_dpb[1][0]; for(i = 0; i < 2 * MAX_REF_BUFS; i++) { ps_init_dpb->pu1_buf1 = NULL; ps_init_dpb->u1_long_term_frm_idx = MAX_REF_BUFS + 1; ps_dec->ps_dpb_mgr->ps_init_dpb[1][i] = ps_init_dpb; ps_dec->ps_dpb_mgr->ps_mod_dpb[1][i] = ps_init_dpb; ps_init_dpb++;
+ show +
987
988
989
990
991
992
993
994
995
996
} } ps_cur_slice = ps_dec->ps_cur_slice; ps_dec->init_done = 0; ps_dec->u4_num_cores = 1; ps_dec->u2_pic_ht = ps_dec->u2_pic_wd = 0;

[CVE-2017-13264_1.diff] ih264d_api.c #2
- if(ps_dec->ps_out_buffer->u4_num_bufs < u4_min_num_out_bufs) - return IV_FAIL; - for(i = 0; i < u4_min_num_out_bufs; i++) + if(0 == ps_dec->u4_share_disp_buf) - if(ps_dec->ps_out_buffer->u4_min_out_buf_size[i] - < au4_min_out_buf_size[i]) - return (IV_FAIL); + if(ps_dec->ps_out_buffer->u4_num_bufs < u4_min_num_out_bufs) + return IV_FAIL; + + for(i = 0; i < u4_min_num_out_bufs; i++) + { + if(ps_dec->ps_out_buffer->u4_min_out_buf_size[i] + < au4_min_out_buf_size[i]) + return (IV_FAIL); + } + } + else + { + if(ps_dec->disp_bufs[0].u4_num_bufs < u4_min_num_out_bufs) + return IV_FAIL; + + for(i = 0; i < u4_min_num_out_bufs; i++) + { + /* We need to check only with the disp_buffer[0], because we have + * already ensured that all the buffers are of the same size in + * ih264d_set_display_frame. + */ + if(ps_dec->disp_bufs[0].u4_bufsize[i] < au4_min_out_buf_size[i]) + return (IV_FAIL); + } +
/media/esteban/ACOS/ResurrectionX/external/libavc/decoder/ih264d_api.c
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
if(ps_dec->u4_app_disp_width > pic_wd) pic_wd = ps_dec->u4_app_disp_width; u4_min_num_out_bufs = ih264d_get_outbuf_size(pic_wd, pic_ht, ps_dec->u1_chroma_format, &au4_min_out_buf_size[0]); if(0 == ps_dec->u4_share_disp_buf) {
+ show +
1742
1743
1744
1745
1746
1747
1748
1749
if(ps_dec->ps_out_buffer->u4_num_bufs < u4_min_num_out_bufs) return IV_FAIL; for(i = 0; i < u4_min_num_out_bufs; i++) { if(ps_dec->ps_out_buffer->u4_min_out_buf_size[i] < au4_min_out_buf_size[i]) return (IV_FAIL);
+ show +
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
} } else { if(ps_dec->disp_bufs[0].u4_num_bufs < u4_min_num_out_bufs) return IV_FAIL; for(i = 0; i < u4_min_num_out_bufs; i++) { /* We need to check only with the disp_buffer[0], because we have

[CVE-2017-0757_1.diff] ih264d_api.c #5
- /*!*/ - if(ps_dec->u1_chroma_format == IV_YUV_420P) + ps_ctl_op->u4_min_num_out_bufs = ih264d_get_outbuf_size( + pic_wd, pic_ht, ps_dec->u1_chroma_format, + &au4_min_out_buf_size[0]); + + for(i = 0; i < ps_ctl_op->u4_min_num_out_bufs; i++) - ps_ctl_op->u4_min_out_buf_size[0] = (pic_wd * pic_ht); - ps_ctl_op->u4_min_out_buf_size[1] = (pic_wd * pic_ht) - >> 2; - ps_ctl_op->u4_min_out_buf_size[2] = (pic_wd * pic_ht) - >> 2; + ps_ctl_op->u4_min_out_buf_size[i] = au4_min_out_buf_size[i]; - else if(ps_dec->u1_chroma_format == IV_YUV_422ILE) - { - ps_ctl_op->u4_min_out_buf_size[0] = (pic_wd * pic_ht) - * 2; - ps_ctl_op->u4_min_out_buf_size[1] = - ps_ctl_op->u4_min_out_buf_size[2] = 0; - } - else if(ps_dec->u1_chroma_format == IV_RGB_565) - { - ps_ctl_op->u4_min_out_buf_size[0] = (pic_wd * pic_ht) - * 2; - ps_ctl_op->u4_min_out_buf_size[1] = - ps_ctl_op->u4_min_out_buf_size[2] = 0; - } - else if((ps_dec->u1_chroma_format == IV_YUV_420SP_UV) - || (ps_dec->u1_chroma_format == IV_YUV_420SP_VU)) - { - ps_ctl_op->u4_min_out_buf_size[0] = (pic_wd * pic_ht); - ps_ctl_op->u4_min_out_buf_size[1] = (pic_wd * pic_ht) - >> 1; - ps_ctl_op->u4_min_out_buf_size[2] = 0; - } +
/media/esteban/ACOS/ResurrectionX/external/libavc/decoder/ih264d_api.c
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
ps_ctl_op->u4_error_code = ERROR_FEATURE_UNAVAIL; return IV_FAIL; } for(i = 0; i < ps_ctl_op->u4_min_num_in_bufs; i++) { ps_ctl_op->u4_min_in_buf_size[i] = MAX(256000, pic_wd * pic_ht * 3 / 2); } /*!*/
+ show +
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
if(ps_dec->u1_chroma_format == IV_YUV_420P) { ps_ctl_op->u4_min_out_buf_size[0] = (pic_wd * pic_ht); ps_ctl_op->u4_min_out_buf_size[1] = (pic_wd * pic_ht) >> 2; ps_ctl_op->u4_min_out_buf_size[2] = (pic_wd * pic_ht) >> 2; } else if(ps_dec->u1_chroma_format == IV_YUV_422ILE) { ps_ctl_op->u4_min_out_buf_size[0] = (pic_wd * pic_ht) * 2; ps_ctl_op->u4_min_out_buf_size[1] = ps_ctl_op->u4_min_out_buf_size[2] = 0; } else if(ps_dec->u1_chroma_format == IV_RGB_565) { ps_ctl_op->u4_min_out_buf_size[0] = (pic_wd * pic_ht) * 2; ps_ctl_op->u4_min_out_buf_size[1] = ps_ctl_op->u4_min_out_buf_size[2] = 0; } else if((ps_dec->u1_chroma_format == IV_YUV_420SP_UV) || (ps_dec->u1_chroma_format == IV_YUV_420SP_VU)) { ps_ctl_op->u4_min_out_buf_size[0] = (pic_wd * pic_ht); ps_ctl_op->u4_min_out_buf_size[1] = (pic_wd * pic_ht) >> 1; ps_ctl_op->u4_min_out_buf_size[2] = 0;
+ show +
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
} ps_dec->u4_num_disp_bufs_requested = ps_ctl_op->u4_num_disp_bufs; return IV_SUCCESS; } /*****************************************************************************/ /* */ /* Function Name : ih264d_get_buf_info */ /* */

[CVE-2021-0516_1.diff] p2p_pd.c #1
+ dev = p2p_get_device(p2p, sa); - dev = p2p_get_device(p2p, sa); - if (!dev) { - p2p_dbg(p2p, - "Provision Discovery device not found " - MACSTR, MAC2STR(sa)); - goto out; - } + p2p_dbg(p2p, + "Provision Discovery device not found " + MACSTR, MAC2STR(sa)); + goto out;
/media/esteban/ACOS/ResurrectionX/external/wpa_supplicant_8/src/p2p/p2p_pd.c
588
589
590
591
592
593
594
595
596
597
p2p_dbg(p2p, "Provision Discovery Request from unknown peer " MACSTR, MAC2STR(sa)); if (p2p_add_device(p2p, sa, rx_freq, NULL, 0, data + 1, len - 1, 0)) { p2p_dbg(p2p, "Provision Discovery Request add device failed " MACSTR, MAC2STR(sa)); goto out; }
+ show +
598
599
600
601
602
603
dev = p2p_get_device(p2p, sa); if (!dev) { p2p_dbg(p2p, "Provision Discovery device not found " MACSTR, MAC2STR(sa)); goto out;
+ show +
604
605
606
607
608
609
610
611
612
613
} } else if (msg.wfd_subelems) { wpabuf_free(dev->info.wfd_subelems); dev->info.wfd_subelems = wpabuf_dup(msg.wfd_subelems); } if (!msg.adv_id) { allowed_config_methods |= WPS_CONFIG_PUSHBUTTON; if (!(msg.wps_config_methods & allowed_config_methods)) { p2p_dbg(p2p,

[CVE-2024-43091_1.diff] SkEmbossMaskFilter.cpp #1
- size_t planeSize = dst->computeImageSize(); - if (0 == planeSize) { - return false; // too big to allocate, abort + size_t totalSize = dst->computeTotalImageSize(); + if (totalSize == 0) { + return false; // too big to allocate, abort - dst->fImage = SkMask::AllocImage(planeSize * 3); + size_t planeSize = dst->computeImageSize(); + SkASSERT(planeSize != 0); // if totalSize didn't overflow, this can't either + dst->fImage = SkMask::AllocImage(totalSize);
/media/esteban/ACOS/ResurrectionX/external/skqp/src/effects/SkEmbossMaskFilter.cpp
88
89
90
91
92
93
94
95
96
97
} if (src.fImage == nullptr) { return true; } // create a larger buffer for the other two channels (should force fBlur to do this for us) { uint8_t* alphaPlane = dst->fImage;
+ show +
98
99
100
101
102
size_t planeSize = dst->computeImageSize(); if (0 == planeSize) { return false; // too big to allocate, abort } dst->fImage = SkMask::AllocImage(planeSize * 3);
+ show +
103
104
105
106
107
108
109
110
111
112
memcpy(dst->fImage, alphaPlane, planeSize); SkMask::FreeImage(alphaPlane); } // run the light direction through the matrix... Light light = fLight; matrix.mapVectors((SkVector*)(void*)light.fDirection, (SkVector*)(void*)fLight.fDirection, 1); // now restore the length of the XY component
/media/esteban/ACOS/ResurrectionX/external/skia/src/effects/SkEmbossMaskFilter.cpp
88
89
90
91
92
93
94
95
96
97
} if (src.fImage == nullptr) { return true; } // create a larger buffer for the other two channels (should force fBlur to do this for us) { uint8_t* alphaPlane = dst->fImage;
+ show +
98
99
100
101
102
size_t planeSize = dst->computeImageSize(); if (0 == planeSize) { return false; // too big to allocate, abort } dst->fImage = SkMask::AllocImage(planeSize * 3);
+ show +
103
104
105
106
107
108
109
110
111
112
memcpy(dst->fImage, alphaPlane, planeSize); SkMask::FreeImage(alphaPlane); } // run the light direction through the matrix... Light light = fLight; matrix.mapVectors((SkVector*)(void*)light.fDirection, (SkVector*)(void*)fLight.fDirection, 1); // now restore the length of the XY component

[CVE-2020-0478_1.diff] yv12config.c #4
- if (external_frame_size != (size_t)external_frame_size) return -1; + if (external_frame_size != (size_t)external_frame_size) + return AOM_CODEC_MEM_ERROR; - if (cb(cb_priv, (size_t)external_frame_size, fb) < 0) return -1; + if (cb(cb_priv, (size_t)external_frame_size, fb) < 0) + return AOM_CODEC_MEM_ERROR; - if (fb->data == NULL || fb->size < external_frame_size) return -1; + if (fb->data == NULL || fb->size < external_frame_size) + return AOM_CODEC_MEM_ERROR; - ybf->buffer_alloc = (uint8_t *)yv12_align_addr(fb->data, 32); + ybf->buffer_alloc = (uint8_t *)aom_align_addr(fb->data, 32);
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vpx_scale/generic/yv12config.c
200
201
202
203
204
205
206
207
208
209
if (frame_size > SIZE_MAX) { return -1; } if (cb != NULL) { const int align_addr_extra_size = 31; const uint64_t external_frame_size = frame_size + align_addr_extra_size; assert(fb != NULL);
+ show +
210
211
212
213
214
215
216
217
if (external_frame_size != (size_t)external_frame_size) return -1; // Allocation to hold larger frame, or first allocation. if (cb(cb_priv, (size_t)external_frame_size, fb) < 0) return -1; if (fb->data == NULL || fb->size < external_frame_size) return -1; ybf->buffer_alloc = (uint8_t *)yv12_align_addr(fb->data, 32);
+ show +
218
219
220
221
222
223
224
225
226
227
#if defined(__has_feature) #if __has_feature(memory_sanitizer) // This memset is needed for fixing the issue of using uninitialized // value in msan test. It will cause a perf loss, so only do this for // msan test. memset(ybf->buffer_alloc, 0, (size_t)frame_size); #endif #endif } else if (frame_size > ybf->buffer_alloc_sz) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_scale/generic/yv12config.c
71
72
73
74
75
76
77
78
79
80
// frame buffers were allocated in a single allocation. if (alloc_size > AOM_MAX_ALLOCABLE_MEMORY / REF_FRAMES) return -1; #endif if (cb != NULL) { const int align_addr_extra_size = 31; const uint64_t external_frame_size = frame_size + align_addr_extra_size; assert(fb != NULL);
+ show +
81
82
83
84
85
86
87
88
if (external_frame_size != (size_t)external_frame_size) return -1; // Allocation to hold larger frame, or first allocation. if (cb(cb_priv, (size_t)external_frame_size, fb) < 0) return -1; if (fb->data == NULL || fb->size < external_frame_size) return -1; ybf->buffer_alloc = (uint8_t *)yv12_align_addr(fb->data, 32);
+ show +
89
90
91
92
93
94
95
96
97
98
#if defined(__has_feature) #if __has_feature(memory_sanitizer) // This memset is needed for fixing the issue of using uninitialized // value in msan test. It will cause a perf loss, so only do this for // msan test. memset(ybf->buffer_alloc, 0, (size_t)frame_size); #endif #endif } else if (frame_size > ybf->buffer_alloc_sz) {

[CVE-2020-0470_1.diff] yv12config.c #4
- if (external_frame_size != (size_t)external_frame_size) return -1; + if (external_frame_size != (size_t)external_frame_size) + return AOM_CODEC_MEM_ERROR; - if (cb(cb_priv, (size_t)external_frame_size, fb) < 0) return -1; + if (cb(cb_priv, (size_t)external_frame_size, fb) < 0) + return AOM_CODEC_MEM_ERROR; - if (fb->data == NULL || fb->size < external_frame_size) return -1; + if (fb->data == NULL || fb->size < external_frame_size) + return AOM_CODEC_MEM_ERROR; - ybf->buffer_alloc = (uint8_t *)yv12_align_addr(fb->data, 32); + ybf->buffer_alloc = (uint8_t *)aom_align_addr(fb->data, 32);
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vpx_scale/generic/yv12config.c
200
201
202
203
204
205
206
207
208
209
if (frame_size > SIZE_MAX) { return -1; } if (cb != NULL) { const int align_addr_extra_size = 31; const uint64_t external_frame_size = frame_size + align_addr_extra_size; assert(fb != NULL);
+ show +
210
211
212
213
214
215
216
217
if (external_frame_size != (size_t)external_frame_size) return -1; // Allocation to hold larger frame, or first allocation. if (cb(cb_priv, (size_t)external_frame_size, fb) < 0) return -1; if (fb->data == NULL || fb->size < external_frame_size) return -1; ybf->buffer_alloc = (uint8_t *)yv12_align_addr(fb->data, 32);
+ show +
218
219
220
221
222
223
224
225
226
227
#if defined(__has_feature) #if __has_feature(memory_sanitizer) // This memset is needed for fixing the issue of using uninitialized // value in msan test. It will cause a perf loss, so only do this for // msan test. memset(ybf->buffer_alloc, 0, (size_t)frame_size); #endif #endif } else if (frame_size > ybf->buffer_alloc_sz) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_scale/generic/yv12config.c
71
72
73
74
75
76
77
78
79
80
// frame buffers were allocated in a single allocation. if (alloc_size > AOM_MAX_ALLOCABLE_MEMORY / REF_FRAMES) return -1; #endif if (cb != NULL) { const int align_addr_extra_size = 31; const uint64_t external_frame_size = frame_size + align_addr_extra_size; assert(fb != NULL);
+ show +
81
82
83
84
85
86
87
88
if (external_frame_size != (size_t)external_frame_size) return -1; // Allocation to hold larger frame, or first allocation. if (cb(cb_priv, (size_t)external_frame_size, fb) < 0) return -1; if (fb->data == NULL || fb->size < external_frame_size) return -1; ybf->buffer_alloc = (uint8_t *)yv12_align_addr(fb->data, 32);
+ show +
89
90
91
92
93
94
95
96
97
98
#if defined(__has_feature) #if __has_feature(memory_sanitizer) // This memset is needed for fixing the issue of using uninitialized // value in msan test. It will cause a perf loss, so only do this for // msan test. memset(ybf->buffer_alloc, 0, (size_t)frame_size); #endif #endif } else if (frame_size > ybf->buffer_alloc_sz) {

[CVE-2017-13194_1.diff] vpx_image.c #1
- /* Calculate storage sizes given the chroma subsampling */ - align = (1 << xcs) - 1; - w = (d_w + align) & ~align; - align = (1 << ycs) - 1; - h = (d_h + align) & ~align; + /* Calculate storage sizes. If the buffer was allocated externally, the width + * and height shouldn't be adjusted. */ + w = d_w; + h = d_h;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vpx/src/vpx_image.c
86
87
88
89
90
91
92
93
94
95
img->self_allocd = 1; } else { memset(img, 0, sizeof(vpx_image_t)); } img->img_data = img_data; if (!img_data) { uint64_t alloc_size; /* Calculate storage sizes given the chroma subsampling */
+ show +
96
97
98
99
align = (1 << xcs) - 1; w = (d_w + align) & ~align; align = (1 << ycs) - 1; h = (d_h + align) & ~align;
+ show +
100
101
102
103
104
105
106
107
108
109
s = (fmt & VPX_IMG_FMT_PLANAR) ? w : bps * w / 8; s = (s + stride_align - 1) & ~(stride_align - 1); stride_in_bytes = (fmt & VPX_IMG_FMT_HIGHBITDEPTH) ? s * 2 : s; alloc_size = (fmt & VPX_IMG_FMT_PLANAR) ? (uint64_t)h * s * bps / 8 : (uint64_t)h * s; if (alloc_size != (size_t)alloc_size) goto fail; img->img_data = (uint8_t *)vpx_memalign(buf_align, (size_t)alloc_size);

[CVE-2020-0478_1.diff] external_frame_buffer_test.cc #1
- if (img->fb_priv != NULL) { - const struct ExternalFrameBuffer *const ext_fb = - reinterpret_cast<ExternalFrameBuffer *>(img->fb_priv); + const struct ExternalFrameBuffer *const ext_fb = + reinterpret_cast<ExternalFrameBuffer *>(img->fb_priv); - ASSERT_TRUE(img->planes[0] >= ext_fb->data && - img->planes[0] < (ext_fb->data + ext_fb->size)); - } + ASSERT_TRUE(img->planes[0] >= ext_fb->data && + img->planes[0] < (ext_fb->data + ext_fb->size));
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/test/external_frame_buffer_test.cc
110
111
112
113
114
115
116
117
118
119
} EXPECT_EQ(1, ext_fb->in_use); ext_fb->in_use = 0; num_used_buffers_--; return 0; } // Checks that the ximage data is contained within the external frame buffer // private data passed back in the ximage. void CheckXImageFrameBuffer(const vpx_image_t *img) {
+ show +
120
121
122
123
124
125
if (img->fb_priv != NULL) { const struct ExternalFrameBuffer *const ext_fb = reinterpret_cast<ExternalFrameBuffer *>(img->fb_priv); ASSERT_TRUE(img->planes[0] >= ext_fb->data && img->planes[0] < (ext_fb->data + ext_fb->size));
+ show +
126
127
128
129
130
131
132
133
134
135
} } int num_used_buffers() const { return num_used_buffers_; } private: // Returns the index of the first free frame buffer. Returns |num_buffers_| // if there are no free frame buffers. int FindFreeBufferIndex() { int i;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/external_frame_buffer_test.cc
110
111
112
113
114
115
116
117
118
119
} EXPECT_EQ(1, ext_fb->in_use); ext_fb->in_use = 0; num_used_buffers_--; return 0; } // Checks that the aom_image_t data is contained within the external frame // buffer private data passed back in the aom_image_t. void CheckImageFrameBuffer(const aom_image_t *img) {
+ show +
120
121
122
123
124
125
if (img->fb_priv != NULL) { const struct ExternalFrameBuffer *const ext_fb = reinterpret_cast<ExternalFrameBuffer *>(img->fb_priv); ASSERT_TRUE(img->planes[0] >= ext_fb->data && img->planes[0] < (ext_fb->data + ext_fb->size));
+ show +
126
127
128
129
130
131
132
133
134
135
} } int num_used_buffers() const { return num_used_buffers_; } private: // Returns the index of the first free frame buffer. Returns |num_buffers_| // if there are no free frame buffers. int FindFreeBufferIndex() { int i;

[CVE-2020-0470_1.diff] external_frame_buffer_test.cc #1
- if (img->fb_priv != NULL) { - const struct ExternalFrameBuffer *const ext_fb = - reinterpret_cast<ExternalFrameBuffer *>(img->fb_priv); + const struct ExternalFrameBuffer *const ext_fb = + reinterpret_cast<ExternalFrameBuffer *>(img->fb_priv); - ASSERT_TRUE(img->planes[0] >= ext_fb->data && - img->planes[0] < (ext_fb->data + ext_fb->size)); - } + ASSERT_TRUE(img->planes[0] >= ext_fb->data && + img->planes[0] < (ext_fb->data + ext_fb->size));
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/test/external_frame_buffer_test.cc
110
111
112
113
114
115
116
117
118
119
} EXPECT_EQ(1, ext_fb->in_use); ext_fb->in_use = 0; num_used_buffers_--; return 0; } // Checks that the ximage data is contained within the external frame buffer // private data passed back in the ximage. void CheckXImageFrameBuffer(const vpx_image_t *img) {
+ show +
120
121
122
123
124
125
if (img->fb_priv != NULL) { const struct ExternalFrameBuffer *const ext_fb = reinterpret_cast<ExternalFrameBuffer *>(img->fb_priv); ASSERT_TRUE(img->planes[0] >= ext_fb->data && img->planes[0] < (ext_fb->data + ext_fb->size));
+ show +
126
127
128
129
130
131
132
133
134
135
} } int num_used_buffers() const { return num_used_buffers_; } private: // Returns the index of the first free frame buffer. Returns |num_buffers_| // if there are no free frame buffers. int FindFreeBufferIndex() { int i;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/external_frame_buffer_test.cc
110
111
112
113
114
115
116
117
118
119
} EXPECT_EQ(1, ext_fb->in_use); ext_fb->in_use = 0; num_used_buffers_--; return 0; } // Checks that the aom_image_t data is contained within the external frame // buffer private data passed back in the aom_image_t. void CheckImageFrameBuffer(const aom_image_t *img) {
+ show +
120
121
122
123
124
125
if (img->fb_priv != NULL) { const struct ExternalFrameBuffer *const ext_fb = reinterpret_cast<ExternalFrameBuffer *>(img->fb_priv); ASSERT_TRUE(img->planes[0] >= ext_fb->data && img->planes[0] < (ext_fb->data + ext_fb->size));
+ show +
126
127
128
129
130
131
132
133
134
135
} } int num_used_buffers() const { return num_used_buffers_; } private: // Returns the index of the first free frame buffer. Returns |num_buffers_| // if there are no free frame buffers. int FindFreeBufferIndex() { int i;

[CVE-2020-0478_1.diff] mcomp.c #21
-static const MV search_pos[4] = { - { -1, 0 }, - { 0, -1 }, - { 0, 1 }, - { 1, 0 }, -}; - +// A special fast version of motion search used in rt mode
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vp9/encoder/vp9_mcomp.c
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
this_sad = vpx_vector_var(&ref[this_pos], src, bwl); if (this_sad < best_sad) { best_sad = this_sad; center = this_pos; } } return (center - (bw >> 1)); }
+ show +
2120
2121
2122
2123
2124
2125
static const MV search_pos[4] = { { -1, 0 }, { 0, -1 }, { 0, 1 }, { 1, 0 }, };
+ show +
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
unsigned int vp9_int_pro_motion_estimation(const VP9_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row, int mi_col, const MV *ref_mv) { MACROBLOCKD *xd = &x->e_mbd; MODE_INFO *mi = xd->mi[0]; struct buf_2d backup_yv12[MAX_MB_PLANE] = { { 0, 0 } }; DECLARE_ALIGNED(16, int16_t, hbuf[128]); DECLARE_ALIGNED(16, int16_t, vbuf[128]); DECLARE_ALIGNED(16, int16_t, src_hbuf[64]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/mcomp.c
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
this_sad = aom_vector_var(&ref[this_pos], src, bwl); if (this_sad < best_sad) { best_sad = this_sad; center = this_pos; } } return (center - (bw >> 1)); }
+ show +
2165
2166
2167
2168
2169
2170
static const MV search_pos[4] = { { -1, 0 }, { 0, -1 }, { 0, 1 }, { 1, 0 }, };
+ show +
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
unsigned int av1_int_pro_motion_estimation(const AV1_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row, int mi_col, const MV *ref_mv) { MACROBLOCKD *xd = &x->e_mbd; MB_MODE_INFO *mi = xd->mi[0]; struct buf_2d backup_yv12[MAX_MB_PLANE] = { { 0, 0, 0, 0, 0 } }; DECLARE_ALIGNED(16, int16_t, hbuf[256]); DECLARE_ALIGNED(16, int16_t, vbuf[256]); DECLARE_ALIGNED(16, int16_t, src_hbuf[128]);

[CVE-2020-0470_1.diff] mcomp.c #21
-static const MV search_pos[4] = { - { -1, 0 }, - { 0, -1 }, - { 0, 1 }, - { 1, 0 }, -}; - +// A special fast version of motion search used in rt mode
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vp9/encoder/vp9_mcomp.c
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
this_sad = vpx_vector_var(&ref[this_pos], src, bwl); if (this_sad < best_sad) { best_sad = this_sad; center = this_pos; } } return (center - (bw >> 1)); }
+ show +
2120
2121
2122
2123
2124
2125
static const MV search_pos[4] = { { -1, 0 }, { 0, -1 }, { 0, 1 }, { 1, 0 }, };
+ show +
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
unsigned int vp9_int_pro_motion_estimation(const VP9_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row, int mi_col, const MV *ref_mv) { MACROBLOCKD *xd = &x->e_mbd; MODE_INFO *mi = xd->mi[0]; struct buf_2d backup_yv12[MAX_MB_PLANE] = { { 0, 0 } }; DECLARE_ALIGNED(16, int16_t, hbuf[128]); DECLARE_ALIGNED(16, int16_t, vbuf[128]); DECLARE_ALIGNED(16, int16_t, src_hbuf[64]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/mcomp.c
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
this_sad = aom_vector_var(&ref[this_pos], src, bwl); if (this_sad < best_sad) { best_sad = this_sad; center = this_pos; } } return (center - (bw >> 1)); }
+ show +
2165
2166
2167
2168
2169
2170
static const MV search_pos[4] = { { -1, 0 }, { 0, -1 }, { 0, 1 }, { 1, 0 }, };
+ show +
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
unsigned int av1_int_pro_motion_estimation(const AV1_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row, int mi_col, const MV *ref_mv) { MACROBLOCKD *xd = &x->e_mbd; MB_MODE_INFO *mi = xd->mi[0]; struct buf_2d backup_yv12[MAX_MB_PLANE] = { { 0, 0, 0, 0, 0 } }; DECLARE_ALIGNED(16, int16_t, hbuf[256]); DECLARE_ALIGNED(16, int16_t, vbuf[256]); DECLARE_ALIGNED(16, int16_t, src_hbuf[128]);

[CVE-2020-0478_1.diff] tpl_model.c #3
-static void tpl_model_update_b(TplDepFrame *tpl_frame, TplDepStats *tpl_stats, - int mi_row, int mi_col, const BLOCK_SIZE bsize) { - TplDepFrame *ref_tpl_frame = &tpl_frame[tpl_stats->ref_frame_index]; - TplDepStats *ref_stats = ref_tpl_frame->tpl_stats_ptr; - MV mv = tpl_stats->mv.as_mv; - int mv_row = mv.row >> 3; - int mv_col = mv.col >> 3; +int av1_tpl_ptr_pos(int mi_row, int mi_col, int stride, uint8_t right_shift) { + return (mi_row >> right_shift) * stride + (mi_col >> right_shift); +} - int ref_pos_row = mi_row * MI_SIZE + mv_row; - int ref_pos_col = mi_col * MI_SIZE + mv_col; +static int64_t delta_rate_cost(int64_t delta_rate, int64_t recrf_dist, + int64_t srcrf_dist, int pix_num) { + double beta = (double)srcrf_dist / recrf_dist; + int64_t rate_cost = delta_rate; + + if (srcrf_dist <= 128) return rate_cost; + + double dr = + (double)(delta_rate >> (TPL_DEP_COST_SCALE_LOG2 + AV1_PROB_COST_SHIFT)) / + pix_num; + + double log_den = log(beta) / log(2.0) + 2.0 * dr; + + if (log_den > log(10.0) / log(2.0)) { + rate_cost = (int64_t)((log(1.0 / beta) * pix_num) / log(2.0) / 2.0); + rate_cost <<= (TPL_DEP_COST_SCALE_LOG2 + AV1_PROB_COST_SHIFT); + return rate_cost; + } + + double num = pow(2.0, log_den); + double den = num * beta + (1 - beta) * beta; + + rate_cost = (int64_t)((pix_num * log(num / den)) / log(2.0) / 2.0); + + rate_cost <<= (TPL_DEP_COST_SCALE_LOG2 + AV1_PROB_COST_SHIFT); + + return rate_cost; +} + +static AOM_INLINE void tpl_model_update_b(TplParams *const tpl_data, int mi_row, + int mi_col, const BLOCK_SIZE bsize, + int frame_idx) { + TplDepFrame *tpl_frame_ptr = &tpl_data->tpl_frame[frame_idx]; + TplDepStats *tpl_ptr = tpl_frame_ptr->tpl_stats_ptr; + TplDepFrame *tpl_frame = tpl_data->tpl_frame; + const uint8_t block_mis_log2 = tpl_data->tpl_stats_block_mis_log2; + TplDepStats *tpl_stats_ptr = &tpl_ptr[av1_tpl_ptr_pos( + mi_row, mi_col, tpl_frame->stride, block_mis_log2)]; + + if (tpl_stats_ptr->ref_frame_index < 0) return; + const int ref_frame_index = tpl_stats_ptr->ref_frame_index; + TplDepFrame *ref_tpl_frame = + &tpl_frame[tpl_frame[frame_idx].ref_map_index[ref_frame_index]]; + TplDepStats *ref_stats_ptr = ref_tpl_frame->tpl_stats_ptr; + + if (tpl_frame[frame_idx].ref_map_index[ref_frame_index] < 0) return; + + const FULLPEL_MV full_mv = + get_fullmv_from_mv(&tpl_stats_ptr->mv[ref_frame_index].as_mv); + const int ref_pos_row = mi_row * MI_SIZE + full_mv.row; + const int ref_pos_col = mi_col * MI_SIZE + full_mv.col;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vp9/encoder/vp9_encoder.c
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
const int64_t mc_flow = tpl_ptr->mc_flow; const int64_t mc_ref_cost = tpl_ptr->mc_ref_cost; *tpl_ptr = *src_stats; tpl_ptr->mc_flow = mc_flow; tpl_ptr->mc_ref_cost = mc_ref_cost; tpl_ptr->mc_dep_cost = tpl_ptr->intra_cost + tpl_ptr->mc_flow; } } }
+ show +
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
static void tpl_model_update_b(TplDepFrame *tpl_frame, TplDepStats *tpl_stats, int mi_row, int mi_col, const BLOCK_SIZE bsize) { TplDepFrame *ref_tpl_frame = &tpl_frame[tpl_stats->ref_frame_index]; TplDepStats *ref_stats = ref_tpl_frame->tpl_stats_ptr; MV mv = tpl_stats->mv.as_mv; int mv_row = mv.row >> 3; int mv_col = mv.col >> 3; int ref_pos_row = mi_row * MI_SIZE + mv_row; int ref_pos_col = mi_col * MI_SIZE + mv_col;
+ show +
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
const int bw = 4 << b_width_log2_lookup[bsize]; const int bh = 4 << b_height_log2_lookup[bsize]; const int mi_height = num_8x8_blocks_high_lookup[bsize]; const int mi_width = num_8x8_blocks_wide_lookup[bsize]; const int pix_num = bw * bh; // top-left on grid block location in pixel int grid_pos_row_base = round_floor(ref_pos_row, bh) * bh; int grid_pos_col_base = round_floor(ref_pos_col, bw) * bw;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/tpl_model.c
273
274
275
276
277
278
279
280
281
282
case 3: width = ref_pos_col + bw - grid_pos_col; height = ref_pos_row + bh - grid_pos_row; break; default: assert(0); } return width * height; }
+ show +
283
284
285
286
287
288
289
290
291
292
static void tpl_model_update_b(TplDepFrame *tpl_frame, TplDepStats *tpl_stats, int mi_row, int mi_col, const BLOCK_SIZE bsize) { TplDepFrame *ref_tpl_frame = &tpl_frame[tpl_stats->ref_frame_index]; TplDepStats *ref_stats = ref_tpl_frame->tpl_stats_ptr; MV mv = tpl_stats->mv.as_mv; int mv_row = mv.row >> 3; int mv_col = mv.col >> 3; int ref_pos_row = mi_row * MI_SIZE + mv_row; int ref_pos_col = mi_col * MI_SIZE + mv_col;
+ show +
293
294
295
296
297
298
299
300
301
302
const int bw = 4 << mi_size_wide_log2[bsize]; const int bh = 4 << mi_size_high_log2[bsize]; const int mi_height = mi_size_high[bsize]; const int mi_width = mi_size_wide[bsize]; const int pix_num = bw * bh; // top-left on grid block location in pixel int grid_pos_row_base = round_floor(ref_pos_row, bh) * bh; int grid_pos_col_base = round_floor(ref_pos_col, bw) * bw;

[CVE-2020-0478_1.diff] tpl_model.c #5
+ int64_t cur_dep_dist = tpl_stats_ptr->recrf_dist - tpl_stats_ptr->srcrf_dist; + int64_t mc_dep_dist = (int64_t)( + tpl_stats_ptr->mc_dep_dist * + ((double)(tpl_stats_ptr->recrf_dist - tpl_stats_ptr->srcrf_dist) / + tpl_stats_ptr->recrf_dist)); + int64_t delta_rate = tpl_stats_ptr->recrf_rate - tpl_stats_ptr->srcrf_rate; + int64_t mc_dep_rate = + delta_rate_cost(tpl_stats_ptr->mc_dep_rate, tpl_stats_ptr->recrf_dist, + tpl_stats_ptr->srcrf_dist, pix_num); + + const int step = 1 << block_mis_log2; - int64_t mc_flow = tpl_stats->mc_dep_cost - - (tpl_stats->mc_dep_cost * tpl_stats->inter_cost) / - tpl_stats->intra_cost; + for (int idy = 0; idy < mi_height; idy += step) { + for (int idx = 0; idx < mi_width; idx += step) { + TplDepStats *des_stats = &ref_stats_ptr[av1_tpl_ptr_pos( + ref_mi_row + idy, ref_mi_col + idx, ref_tpl_frame->stride, + block_mis_log2)]; + des_stats->mc_dep_dist += + ((cur_dep_dist + mc_dep_dist) * overlap_area) / pix_num; + des_stats->mc_dep_rate += + ((delta_rate + mc_dep_rate) * overlap_area) / pix_num; - int idx, idy; - - for (idy = 0; idy < mi_height; ++idy) { - for (idx = 0; idx < mi_width; ++idx) { - TplDepStats *des_stats = - &ref_stats[(ref_mi_row + idy) * ref_tpl_frame->stride + - (ref_mi_col + idx)]; - - des_stats->mc_flow += (mc_flow * overlap_area) / pix_num;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vp9/encoder/vp9_encoder.c
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
int grid_pos_row = grid_pos_row_base + bh * (block >> 1); int grid_pos_col = grid_pos_col_base + bw * (block & 0x01); if (grid_pos_row >= 0 && grid_pos_row < ref_tpl_frame->mi_rows * MI_SIZE && grid_pos_col >= 0 && grid_pos_col < ref_tpl_frame->mi_cols * MI_SIZE) { int overlap_area = get_overlap_area( grid_pos_row, grid_pos_col, ref_pos_row, ref_pos_col, block, bsize); int ref_mi_row = round_floor(grid_pos_row, bh) * mi_height; int ref_mi_col = round_floor(grid_pos_col, bw) * mi_width;
+ show +
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
int64_t mc_flow = tpl_stats->mc_dep_cost - (tpl_stats->mc_dep_cost * tpl_stats->inter_cost) / tpl_stats->intra_cost; int idx, idy; for (idy = 0; idy < mi_height; ++idy) { for (idx = 0; idx < mi_width; ++idx) { TplDepStats *des_stats = &ref_stats[(ref_mi_row + idy) * ref_tpl_frame->stride + (ref_mi_col + idx)]; des_stats->mc_flow += (mc_flow * overlap_area) / pix_num;
+ show +
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
des_stats->mc_ref_cost += ((tpl_stats->intra_cost - tpl_stats->inter_cost) * overlap_area) / pix_num; assert(overlap_area >= 0); } } } } }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/tpl_model.c
306
307
308
309
310
311
312
313
314
315
int grid_pos_row = grid_pos_row_base + bh * (block >> 1); int grid_pos_col = grid_pos_col_base + bw * (block & 0x01); if (grid_pos_row >= 0 && grid_pos_row < ref_tpl_frame->mi_rows * MI_SIZE && grid_pos_col >= 0 && grid_pos_col < ref_tpl_frame->mi_cols * MI_SIZE) { int overlap_area = get_overlap_area( grid_pos_row, grid_pos_col, ref_pos_row, ref_pos_col, block, bsize); int ref_mi_row = round_floor(grid_pos_row, bh) * mi_height; int ref_mi_col = round_floor(grid_pos_col, bw) * mi_width;
+ show +
316
317
318
319
320
321
322
323
324
325
326
327
328
int64_t mc_flow = tpl_stats->mc_dep_cost - (tpl_stats->mc_dep_cost * tpl_stats->inter_cost) / tpl_stats->intra_cost; int idx, idy; for (idy = 0; idy < mi_height; ++idy) { for (idx = 0; idx < mi_width; ++idx) { TplDepStats *des_stats = &ref_stats[(ref_mi_row + idy) * ref_tpl_frame->stride + (ref_mi_col + idx)]; des_stats->mc_flow += (mc_flow * overlap_area) / pix_num;
+ show +
329
330
331
332
333
334
335
336
337
338
assert(overlap_area >= 0); } } } } } static void tpl_model_update(TplDepFrame *tpl_frame, TplDepStats *tpl_stats, int mi_row, int mi_col, const BLOCK_SIZE bsize) { int idx, idy;

[CVE-2020-0470_1.diff] tpl_model.c #3
-static void tpl_model_update_b(TplDepFrame *tpl_frame, TplDepStats *tpl_stats, - int mi_row, int mi_col, const BLOCK_SIZE bsize) { - TplDepFrame *ref_tpl_frame = &tpl_frame[tpl_stats->ref_frame_index]; - TplDepStats *ref_stats = ref_tpl_frame->tpl_stats_ptr; - MV mv = tpl_stats->mv.as_mv; - int mv_row = mv.row >> 3; - int mv_col = mv.col >> 3; +int av1_tpl_ptr_pos(int mi_row, int mi_col, int stride, uint8_t right_shift) { + return (mi_row >> right_shift) * stride + (mi_col >> right_shift); +} - int ref_pos_row = mi_row * MI_SIZE + mv_row; - int ref_pos_col = mi_col * MI_SIZE + mv_col; +static int64_t delta_rate_cost(int64_t delta_rate, int64_t recrf_dist, + int64_t srcrf_dist, int pix_num) { + double beta = (double)srcrf_dist / recrf_dist; + int64_t rate_cost = delta_rate; + + if (srcrf_dist <= 128) return rate_cost; + + double dr = + (double)(delta_rate >> (TPL_DEP_COST_SCALE_LOG2 + AV1_PROB_COST_SHIFT)) / + pix_num; + + double log_den = log(beta) / log(2.0) + 2.0 * dr; + + if (log_den > log(10.0) / log(2.0)) { + rate_cost = (int64_t)((log(1.0 / beta) * pix_num) / log(2.0) / 2.0); + rate_cost <<= (TPL_DEP_COST_SCALE_LOG2 + AV1_PROB_COST_SHIFT); + return rate_cost; + } + + double num = pow(2.0, log_den); + double den = num * beta + (1 - beta) * beta; + + rate_cost = (int64_t)((pix_num * log(num / den)) / log(2.0) / 2.0); + + rate_cost <<= (TPL_DEP_COST_SCALE_LOG2 + AV1_PROB_COST_SHIFT); + + return rate_cost; +} + +static AOM_INLINE void tpl_model_update_b(TplParams *const tpl_data, int mi_row, + int mi_col, const BLOCK_SIZE bsize, + int frame_idx) { + TplDepFrame *tpl_frame_ptr = &tpl_data->tpl_frame[frame_idx]; + TplDepStats *tpl_ptr = tpl_frame_ptr->tpl_stats_ptr; + TplDepFrame *tpl_frame = tpl_data->tpl_frame; + const uint8_t block_mis_log2 = tpl_data->tpl_stats_block_mis_log2; + TplDepStats *tpl_stats_ptr = &tpl_ptr[av1_tpl_ptr_pos( + mi_row, mi_col, tpl_frame->stride, block_mis_log2)]; + + if (tpl_stats_ptr->ref_frame_index < 0) return; + const int ref_frame_index = tpl_stats_ptr->ref_frame_index; + TplDepFrame *ref_tpl_frame = + &tpl_frame[tpl_frame[frame_idx].ref_map_index[ref_frame_index]]; + TplDepStats *ref_stats_ptr = ref_tpl_frame->tpl_stats_ptr; + + if (tpl_frame[frame_idx].ref_map_index[ref_frame_index] < 0) return; + + const FULLPEL_MV full_mv = + get_fullmv_from_mv(&tpl_stats_ptr->mv[ref_frame_index].as_mv); + const int ref_pos_row = mi_row * MI_SIZE + full_mv.row; + const int ref_pos_col = mi_col * MI_SIZE + full_mv.col;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vp9/encoder/vp9_encoder.c
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
const int64_t mc_flow = tpl_ptr->mc_flow; const int64_t mc_ref_cost = tpl_ptr->mc_ref_cost; *tpl_ptr = *src_stats; tpl_ptr->mc_flow = mc_flow; tpl_ptr->mc_ref_cost = mc_ref_cost; tpl_ptr->mc_dep_cost = tpl_ptr->intra_cost + tpl_ptr->mc_flow; } } }
+ show +
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
static void tpl_model_update_b(TplDepFrame *tpl_frame, TplDepStats *tpl_stats, int mi_row, int mi_col, const BLOCK_SIZE bsize) { TplDepFrame *ref_tpl_frame = &tpl_frame[tpl_stats->ref_frame_index]; TplDepStats *ref_stats = ref_tpl_frame->tpl_stats_ptr; MV mv = tpl_stats->mv.as_mv; int mv_row = mv.row >> 3; int mv_col = mv.col >> 3; int ref_pos_row = mi_row * MI_SIZE + mv_row; int ref_pos_col = mi_col * MI_SIZE + mv_col;
+ show +
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
const int bw = 4 << b_width_log2_lookup[bsize]; const int bh = 4 << b_height_log2_lookup[bsize]; const int mi_height = num_8x8_blocks_high_lookup[bsize]; const int mi_width = num_8x8_blocks_wide_lookup[bsize]; const int pix_num = bw * bh; // top-left on grid block location in pixel int grid_pos_row_base = round_floor(ref_pos_row, bh) * bh; int grid_pos_col_base = round_floor(ref_pos_col, bw) * bw;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/tpl_model.c
273
274
275
276
277
278
279
280
281
282
case 3: width = ref_pos_col + bw - grid_pos_col; height = ref_pos_row + bh - grid_pos_row; break; default: assert(0); } return width * height; }
+ show +
283
284
285
286
287
288
289
290
291
292
static void tpl_model_update_b(TplDepFrame *tpl_frame, TplDepStats *tpl_stats, int mi_row, int mi_col, const BLOCK_SIZE bsize) { TplDepFrame *ref_tpl_frame = &tpl_frame[tpl_stats->ref_frame_index]; TplDepStats *ref_stats = ref_tpl_frame->tpl_stats_ptr; MV mv = tpl_stats->mv.as_mv; int mv_row = mv.row >> 3; int mv_col = mv.col >> 3; int ref_pos_row = mi_row * MI_SIZE + mv_row; int ref_pos_col = mi_col * MI_SIZE + mv_col;
+ show +
293
294
295
296
297
298
299
300
301
302
const int bw = 4 << mi_size_wide_log2[bsize]; const int bh = 4 << mi_size_high_log2[bsize]; const int mi_height = mi_size_high[bsize]; const int mi_width = mi_size_wide[bsize]; const int pix_num = bw * bh; // top-left on grid block location in pixel int grid_pos_row_base = round_floor(ref_pos_row, bh) * bh; int grid_pos_col_base = round_floor(ref_pos_col, bw) * bw;

[CVE-2020-0470_1.diff] tpl_model.c #5
+ int64_t cur_dep_dist = tpl_stats_ptr->recrf_dist - tpl_stats_ptr->srcrf_dist; + int64_t mc_dep_dist = (int64_t)( + tpl_stats_ptr->mc_dep_dist * + ((double)(tpl_stats_ptr->recrf_dist - tpl_stats_ptr->srcrf_dist) / + tpl_stats_ptr->recrf_dist)); + int64_t delta_rate = tpl_stats_ptr->recrf_rate - tpl_stats_ptr->srcrf_rate; + int64_t mc_dep_rate = + delta_rate_cost(tpl_stats_ptr->mc_dep_rate, tpl_stats_ptr->recrf_dist, + tpl_stats_ptr->srcrf_dist, pix_num); + + const int step = 1 << block_mis_log2; - int64_t mc_flow = tpl_stats->mc_dep_cost - - (tpl_stats->mc_dep_cost * tpl_stats->inter_cost) / - tpl_stats->intra_cost; + for (int idy = 0; idy < mi_height; idy += step) { + for (int idx = 0; idx < mi_width; idx += step) { + TplDepStats *des_stats = &ref_stats_ptr[av1_tpl_ptr_pos( + ref_mi_row + idy, ref_mi_col + idx, ref_tpl_frame->stride, + block_mis_log2)]; + des_stats->mc_dep_dist += + ((cur_dep_dist + mc_dep_dist) * overlap_area) / pix_num; + des_stats->mc_dep_rate += + ((delta_rate + mc_dep_rate) * overlap_area) / pix_num; - int idx, idy; - - for (idy = 0; idy < mi_height; ++idy) { - for (idx = 0; idx < mi_width; ++idx) { - TplDepStats *des_stats = - &ref_stats[(ref_mi_row + idy) * ref_tpl_frame->stride + - (ref_mi_col + idx)]; - - des_stats->mc_flow += (mc_flow * overlap_area) / pix_num;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vp9/encoder/vp9_encoder.c
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
int grid_pos_row = grid_pos_row_base + bh * (block >> 1); int grid_pos_col = grid_pos_col_base + bw * (block & 0x01); if (grid_pos_row >= 0 && grid_pos_row < ref_tpl_frame->mi_rows * MI_SIZE && grid_pos_col >= 0 && grid_pos_col < ref_tpl_frame->mi_cols * MI_SIZE) { int overlap_area = get_overlap_area( grid_pos_row, grid_pos_col, ref_pos_row, ref_pos_col, block, bsize); int ref_mi_row = round_floor(grid_pos_row, bh) * mi_height; int ref_mi_col = round_floor(grid_pos_col, bw) * mi_width;
+ show +
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
int64_t mc_flow = tpl_stats->mc_dep_cost - (tpl_stats->mc_dep_cost * tpl_stats->inter_cost) / tpl_stats->intra_cost; int idx, idy; for (idy = 0; idy < mi_height; ++idy) { for (idx = 0; idx < mi_width; ++idx) { TplDepStats *des_stats = &ref_stats[(ref_mi_row + idy) * ref_tpl_frame->stride + (ref_mi_col + idx)]; des_stats->mc_flow += (mc_flow * overlap_area) / pix_num;
+ show +
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
des_stats->mc_ref_cost += ((tpl_stats->intra_cost - tpl_stats->inter_cost) * overlap_area) / pix_num; assert(overlap_area >= 0); } } } } }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/tpl_model.c
306
307
308
309
310
311
312
313
314
315
int grid_pos_row = grid_pos_row_base + bh * (block >> 1); int grid_pos_col = grid_pos_col_base + bw * (block & 0x01); if (grid_pos_row >= 0 && grid_pos_row < ref_tpl_frame->mi_rows * MI_SIZE && grid_pos_col >= 0 && grid_pos_col < ref_tpl_frame->mi_cols * MI_SIZE) { int overlap_area = get_overlap_area( grid_pos_row, grid_pos_col, ref_pos_row, ref_pos_col, block, bsize); int ref_mi_row = round_floor(grid_pos_row, bh) * mi_height; int ref_mi_col = round_floor(grid_pos_col, bw) * mi_width;
+ show +
316
317
318
319
320
321
322
323
324
325
326
327
328
int64_t mc_flow = tpl_stats->mc_dep_cost - (tpl_stats->mc_dep_cost * tpl_stats->inter_cost) / tpl_stats->intra_cost; int idx, idy; for (idy = 0; idy < mi_height; ++idy) { for (idx = 0; idx < mi_width; ++idx) { TplDepStats *des_stats = &ref_stats[(ref_mi_row + idy) * ref_tpl_frame->stride + (ref_mi_col + idx)]; des_stats->mc_flow += (mc_flow * overlap_area) / pix_num;
+ show +
329
330
331
332
333
334
335
336
337
338
assert(overlap_area >= 0); } } } } } static void tpl_model_update(TplDepFrame *tpl_frame, TplDepStats *tpl_stats, int mi_row, int mi_col, const BLOCK_SIZE bsize) { int idx, idy;

[CVE-2020-0478_1.diff] lookahead.h #2
+enum { ENCODE_STAGE, LAP_STAGE, MAX_STAGES } UENUM1BYTE(COMPRESSOR_STAGE); + +struct read_ctx { + int sz; /* Number of buffers currently in the queue */ + int read_idx; /* Read index */ + int pop_sz; /* Size to check for pop condition */ + int valid; /* Is this ctx valid? */ +}; + - int max_sz; /* Absolute size of the queue */ - int sz; /* Number of buffers currently in the queue */ - int read_idx; /* Read index */ - int write_idx; /* Write index */ - struct lookahead_entry *buf; /* Buffer list */ + int max_sz; /* Absolute size of the queue */ + int write_idx; /* Write index */ + struct read_ctx read_ctxs[MAX_STAGES]; /* Read context */ + struct lookahead_entry *buf; /* Buffer list */
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vp9/encoder/vp9_lookahead.h
25
26
27
28
29
30
31
32
33
34
YV12_BUFFER_CONFIG img; int64_t ts_start; int64_t ts_end; vpx_enc_frame_flags_t flags; }; // The max of past frames we want to keep in the queue. #define MAX_PRE_FRAMES 1 struct lookahead_ctx {
+ show +
35
36
37
38
39
int max_sz; /* Absolute size of the queue */ int sz; /* Number of buffers currently in the queue */ int read_idx; /* Read index */ int write_idx; /* Write index */ struct lookahead_entry *buf; /* Buffer list */
+ show +
40
41
42
43
44
45
46
47
48
49
}; /**\brief Initializes the lookahead stage * * The lookahead stage is a queue of frame buffers on which some analysis * may be done when buffers are enqueued. */ struct lookahead_ctx *vp9_lookahead_init(unsigned int width, unsigned int height, unsigned int subsampling_x,
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/lookahead.h
25
26
27
28
29
30
31
32
33
34
YV12_BUFFER_CONFIG img; int64_t ts_start; int64_t ts_end; aom_enc_frame_flags_t flags; }; // The max of past frames we want to keep in the queue. #define MAX_PRE_FRAMES 1 struct lookahead_ctx {
+ show +
35
36
37
38
39
int max_sz; /* Absolute size of the queue */ int sz; /* Number of buffers currently in the queue */ int read_idx; /* Read index */ int write_idx; /* Write index */ struct lookahead_entry *buf; /* Buffer list */
+ show +
40
41
42
43
44
45
46
47
48
49
}; /**\brief Initializes the lookahead stage * * The lookahead stage is a queue of frame buffers on which some analysis * may be done when buffers are enqueued. */ struct lookahead_ctx *av1_lookahead_init( unsigned int width, unsigned int height, unsigned int subsampling_x, unsigned int subsampling_y, int use_highbitdepth, unsigned int depth,

[CVE-2020-0470_1.diff] lookahead.h #2
+enum { ENCODE_STAGE, LAP_STAGE, MAX_STAGES } UENUM1BYTE(COMPRESSOR_STAGE); + +struct read_ctx { + int sz; /* Number of buffers currently in the queue */ + int read_idx; /* Read index */ + int pop_sz; /* Size to check for pop condition */ + int valid; /* Is this ctx valid? */ +}; + - int max_sz; /* Absolute size of the queue */ - int sz; /* Number of buffers currently in the queue */ - int read_idx; /* Read index */ - int write_idx; /* Write index */ - struct lookahead_entry *buf; /* Buffer list */ + int max_sz; /* Absolute size of the queue */ + int write_idx; /* Write index */ + struct read_ctx read_ctxs[MAX_STAGES]; /* Read context */ + struct lookahead_entry *buf; /* Buffer list */
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vp9/encoder/vp9_lookahead.h
25
26
27
28
29
30
31
32
33
34
YV12_BUFFER_CONFIG img; int64_t ts_start; int64_t ts_end; vpx_enc_frame_flags_t flags; }; // The max of past frames we want to keep in the queue. #define MAX_PRE_FRAMES 1 struct lookahead_ctx {
+ show +
35
36
37
38
39
int max_sz; /* Absolute size of the queue */ int sz; /* Number of buffers currently in the queue */ int read_idx; /* Read index */ int write_idx; /* Write index */ struct lookahead_entry *buf; /* Buffer list */
+ show +
40
41
42
43
44
45
46
47
48
49
}; /**\brief Initializes the lookahead stage * * The lookahead stage is a queue of frame buffers on which some analysis * may be done when buffers are enqueued. */ struct lookahead_ctx *vp9_lookahead_init(unsigned int width, unsigned int height, unsigned int subsampling_x,
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/lookahead.h
25
26
27
28
29
30
31
32
33
34
YV12_BUFFER_CONFIG img; int64_t ts_start; int64_t ts_end; aom_enc_frame_flags_t flags; }; // The max of past frames we want to keep in the queue. #define MAX_PRE_FRAMES 1 struct lookahead_ctx {
+ show +
35
36
37
38
39
int max_sz; /* Absolute size of the queue */ int sz; /* Number of buffers currently in the queue */ int read_idx; /* Read index */ int write_idx; /* Write index */ struct lookahead_entry *buf; /* Buffer list */
+ show +
40
41
42
43
44
45
46
47
48
49
}; /**\brief Initializes the lookahead stage * * The lookahead stage is a queue of frame buffers on which some analysis * may be done when buffers are enqueued. */ struct lookahead_ctx *av1_lookahead_init( unsigned int width, unsigned int height, unsigned int subsampling_x, unsigned int subsampling_y, int use_highbitdepth, unsigned int depth,

[CVE-2020-0478_1.diff] var_based_part.c #14
+#if CONFIG_AV1_HIGHBITDEPTH + if (highbd_flag & YV12_FLAG_HIGHBITDEPTH) { + s_avg = aom_highbd_avg_4x4(s + y4_idx * sp + x4_idx, sp); + if (!is_key_frame) + d_avg = aom_highbd_avg_4x4(d + y4_idx * dp + x4_idx, dp); + } else { + s_avg = aom_avg_4x4(s + y4_idx * sp + x4_idx, sp); + if (!is_key_frame) d_avg = aom_avg_4x4(d + y4_idx * dp + x4_idx, dp); + } +#else +#endif + +// TODO(kyslov) Bring back threshold adjustment based on content state + (void)width; + (void)height; + (void)content_state; - if (width <= 640 && height <= 480) - return (5 * threshold_base) >> 2; - else if ((content_state == kLowSadLowSumdiff) || - (content_state == kHighSadLowSumdiff) || - (content_state == kLowVarHighSumdiff)) - return (5 * threshold_base) >> 2; - } else if (speed == 7) { - if ((content_state == kLowSadLowSumdiff) || - (content_state == kHighSadLowSumdiff) || - (content_state == kLowVarHighSumdiff)) { - return (5 * threshold_base) >> 2; - } + return (5 * threshold_base) >> 2;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vp9/encoder/vp9_encodeframe.c
515
516
517
518
519
520
521
522
523
524
return 0; } return 0; } static int64_t scale_part_thresh_sumdiff(int64_t threshold_base, int speed, int width, int height, int content_state) { if (speed >= 8) {
+ show +
525
526
527
528
529
530
531
532
533
534
535
if (width <= 640 && height <= 480) return (5 * threshold_base) >> 2; else if ((content_state == kLowSadLowSumdiff) || (content_state == kHighSadLowSumdiff) || (content_state == kLowVarHighSumdiff)) return (5 * threshold_base) >> 2; } else if (speed == 7) { if ((content_state == kLowSadLowSumdiff) || (content_state == kHighSadLowSumdiff) || (content_state == kLowVarHighSumdiff)) { return (5 * threshold_base) >> 2;
+ show +
536
537
538
539
540
541
542
543
544
545
} } return threshold_base; } // Set the variance split thresholds for following the block sizes: // 0 - threshold_64x64, 1 - threshold_32x32, 2 - threshold_16x16, // 3 - vbp_threshold_8x8. vbp_threshold_8x8 (to split to 4x4 partition) is // currently only used on key frame. static void set_vbp_thresholds(VP9_COMP *cpi, int64_t thresholds[], int q,
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/var_based_part.c
326
327
328
329
330
331
332
333
334
335
sse = sum * sum; } fill_variance(sse, sum, 0, &vst->split[k].part_variances.none); } } static int64_t scale_part_thresh_sumdiff(int64_t threshold_base, int speed, int width, int height, int content_state) { if (speed >= 8) {
+ show +
336
337
338
339
340
341
342
343
344
345
346
if (width <= 640 && height <= 480) return (5 * threshold_base) >> 2; else if ((content_state == kLowSadLowSumdiff) || (content_state == kHighSadLowSumdiff) || (content_state == kLowVarHighSumdiff)) return (5 * threshold_base) >> 2; } else if (speed == 7) { if ((content_state == kLowSadLowSumdiff) || (content_state == kHighSadLowSumdiff) || (content_state == kLowVarHighSumdiff)) { return (5 * threshold_base) >> 2;
+ show +
347
348
349
350
351
352
353
354
355
356
} } return threshold_base; } // Set the variance split thresholds for following the block sizes: // 0 - threshold_128x128, 1 - threshold_64x64, 2 - threshold_32x32, // 3 - vbp_threshold_16x16. 4 - vbp_threshold_8x8 (to split to 4x4 partition) is // currently only used on key frame. static void set_vbp_thresholds(AV1_COMP *cpi, int64_t thresholds[], int q,

[CVE-2020-0470_1.diff] var_based_part.c #14
+#if CONFIG_AV1_HIGHBITDEPTH + if (highbd_flag & YV12_FLAG_HIGHBITDEPTH) { + s_avg = aom_highbd_avg_4x4(s + y4_idx * sp + x4_idx, sp); + if (!is_key_frame) + d_avg = aom_highbd_avg_4x4(d + y4_idx * dp + x4_idx, dp); + } else { + s_avg = aom_avg_4x4(s + y4_idx * sp + x4_idx, sp); + if (!is_key_frame) d_avg = aom_avg_4x4(d + y4_idx * dp + x4_idx, dp); + } +#else +#endif + +// TODO(kyslov) Bring back threshold adjustment based on content state + (void)width; + (void)height; + (void)content_state; - if (width <= 640 && height <= 480) - return (5 * threshold_base) >> 2; - else if ((content_state == kLowSadLowSumdiff) || - (content_state == kHighSadLowSumdiff) || - (content_state == kLowVarHighSumdiff)) - return (5 * threshold_base) >> 2; - } else if (speed == 7) { - if ((content_state == kLowSadLowSumdiff) || - (content_state == kHighSadLowSumdiff) || - (content_state == kLowVarHighSumdiff)) { - return (5 * threshold_base) >> 2; - } + return (5 * threshold_base) >> 2;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vp9/encoder/vp9_encodeframe.c
515
516
517
518
519
520
521
522
523
524
return 0; } return 0; } static int64_t scale_part_thresh_sumdiff(int64_t threshold_base, int speed, int width, int height, int content_state) { if (speed >= 8) {
+ show +
525
526
527
528
529
530
531
532
533
534
535
if (width <= 640 && height <= 480) return (5 * threshold_base) >> 2; else if ((content_state == kLowSadLowSumdiff) || (content_state == kHighSadLowSumdiff) || (content_state == kLowVarHighSumdiff)) return (5 * threshold_base) >> 2; } else if (speed == 7) { if ((content_state == kLowSadLowSumdiff) || (content_state == kHighSadLowSumdiff) || (content_state == kLowVarHighSumdiff)) { return (5 * threshold_base) >> 2;
+ show +
536
537
538
539
540
541
542
543
544
545
} } return threshold_base; } // Set the variance split thresholds for following the block sizes: // 0 - threshold_64x64, 1 - threshold_32x32, 2 - threshold_16x16, // 3 - vbp_threshold_8x8. vbp_threshold_8x8 (to split to 4x4 partition) is // currently only used on key frame. static void set_vbp_thresholds(VP9_COMP *cpi, int64_t thresholds[], int q,
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/var_based_part.c
326
327
328
329
330
331
332
333
334
335
sse = sum * sum; } fill_variance(sse, sum, 0, &vst->split[k].part_variances.none); } } static int64_t scale_part_thresh_sumdiff(int64_t threshold_base, int speed, int width, int height, int content_state) { if (speed >= 8) {
+ show +
336
337
338
339
340
341
342
343
344
345
346
if (width <= 640 && height <= 480) return (5 * threshold_base) >> 2; else if ((content_state == kLowSadLowSumdiff) || (content_state == kHighSadLowSumdiff) || (content_state == kLowVarHighSumdiff)) return (5 * threshold_base) >> 2; } else if (speed == 7) { if ((content_state == kLowSadLowSumdiff) || (content_state == kHighSadLowSumdiff) || (content_state == kLowVarHighSumdiff)) { return (5 * threshold_base) >> 2;
+ show +
347
348
349
350
351
352
353
354
355
356
} } return threshold_base; } // Set the variance split thresholds for following the block sizes: // 0 - threshold_128x128, 1 - threshold_64x64, 2 - threshold_32x32, // 3 - vbp_threshold_16x16. 4 - vbp_threshold_8x8 (to split to 4x4 partition) is // currently only used on key frame. static void set_vbp_thresholds(AV1_COMP *cpi, int64_t thresholds[], int q,

[CVE-2020-0478_1.diff] mv.h #5
-static INLINE void clamp_mv(MV *mv, int min_col, int max_col, int min_row, - int max_row) { - mv->col = clamp(mv->col, min_col, max_col); - mv->row = clamp(mv->row, min_row, max_row); +static INLINE void clamp_mv(MV *mv, const SubpelMvLimits *mv_limits) { + mv->col = clamp(mv->col, mv_limits->col_min, mv_limits->col_max); + mv->row = clamp(mv->row, mv_limits->row_min, mv_limits->row_max); +} + +static INLINE void clamp_fullmv(FULLPEL_MV *mv, const FullMvLimits *mv_limits) { + mv->col = clamp(mv->col, mv_limits->col_min, mv_limits->col_max); + mv->row = clamp(mv->row, mv_limits->row_min, mv_limits->row_max);
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vp9/common/vp9_mv.h
35
36
37
38
39
40
41
42
43
44
} MV32; static INLINE int is_zero_mv(const MV *mv) { return *((const uint32_t *)mv) == 0; } static INLINE int is_equal_mv(const MV *a, const MV *b) { return *((const uint32_t *)a) == *((const uint32_t *)b); }
+ show +
45
46
47
48
static INLINE void clamp_mv(MV *mv, int min_col, int max_col, int min_row, int max_row) { mv->col = clamp(mv->col, min_col, max_col); mv->row = clamp(mv->row, min_row, max_row);
+ show +
49
50
51
52
53
54
55
} #ifdef __cplusplus } // extern "C" #endif #endif // VPX_VP9_COMMON_VP9_MV_H_
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/mv.h
281
282
283
284
285
286
287
288
289
290
} CANDIDATE_MV; static INLINE int is_zero_mv(const MV *mv) { return *((const uint32_t *)mv) == 0; } static INLINE int is_equal_mv(const MV *a, const MV *b) { return *((const uint32_t *)a) == *((const uint32_t *)b); }
+ show +
291
292
293
294
static INLINE void clamp_mv(MV *mv, int min_col, int max_col, int min_row, int max_row) { mv->col = clamp(mv->col, min_col, max_col); mv->row = clamp(mv->row, min_row, max_row);
+ show +
295
296
297
298
299
300
301
} #ifdef __cplusplus } // extern "C" #endif #endif // AOM_AV1_COMMON_MV_H_

[CVE-2020-0470_1.diff] mv.h #5
-static INLINE void clamp_mv(MV *mv, int min_col, int max_col, int min_row, - int max_row) { - mv->col = clamp(mv->col, min_col, max_col); - mv->row = clamp(mv->row, min_row, max_row); +static INLINE void clamp_mv(MV *mv, const SubpelMvLimits *mv_limits) { + mv->col = clamp(mv->col, mv_limits->col_min, mv_limits->col_max); + mv->row = clamp(mv->row, mv_limits->row_min, mv_limits->row_max); +} + +static INLINE void clamp_fullmv(FULLPEL_MV *mv, const FullMvLimits *mv_limits) { + mv->col = clamp(mv->col, mv_limits->col_min, mv_limits->col_max); + mv->row = clamp(mv->row, mv_limits->row_min, mv_limits->row_max);
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vp9/common/vp9_mv.h
35
36
37
38
39
40
41
42
43
44
} MV32; static INLINE int is_zero_mv(const MV *mv) { return *((const uint32_t *)mv) == 0; } static INLINE int is_equal_mv(const MV *a, const MV *b) { return *((const uint32_t *)a) == *((const uint32_t *)b); }
+ show +
45
46
47
48
static INLINE void clamp_mv(MV *mv, int min_col, int max_col, int min_row, int max_row) { mv->col = clamp(mv->col, min_col, max_col); mv->row = clamp(mv->row, min_row, max_row);
+ show +
49
50
51
52
53
54
55
} #ifdef __cplusplus } // extern "C" #endif #endif // VPX_VP9_COMMON_VP9_MV_H_
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/mv.h
281
282
283
284
285
286
287
288
289
290
} CANDIDATE_MV; static INLINE int is_zero_mv(const MV *mv) { return *((const uint32_t *)mv) == 0; } static INLINE int is_equal_mv(const MV *a, const MV *b) { return *((const uint32_t *)a) == *((const uint32_t *)b); }
+ show +
291
292
293
294
static INLINE void clamp_mv(MV *mv, int min_col, int max_col, int min_row, int max_row) { mv->col = clamp(mv->col, min_col, max_col); mv->row = clamp(mv->row, min_row, max_row);
+ show +
295
296
297
298
299
300
301
} #ifdef __cplusplus } // extern "C" #endif #endif // AOM_AV1_COMMON_MV_H_

[CVE-2020-0478_1.diff] encodemv.h #2
+void av1_update_mv_stats(const MV *mv, const MV *ref, nmv_context *mvctx, + MvSubpelPrecision precision); + - if (mv->row == 0) { - return mv->col == 0 ? MV_JOINT_ZERO : MV_JOINT_HNZVZ; - } else { - return mv->col == 0 ? MV_JOINT_HZVNZ : MV_JOINT_HNZVNZ; - } + // row: Z col: Z | MV_JOINT_ZERO (0) + // row: Z col: NZ | MV_JOINT_HNZVZ (1) + // row: NZ col: Z | MV_JOINT_HZVNZ (2) + // row: NZ col: NZ | MV_JOINT_HNZVNZ (3) + return (!!mv->col) | ((!!mv->row) << 1); +} + +static INLINE int av1_mv_class_base(MV_CLASS_TYPE c) { + return c ? CLASS0_SIZE << (c + 2) : 0; +} + +// If n != 0, returns the floor of log base 2 of n. If n == 0, returns 0. +static INLINE uint8_t av1_log_in_base_2(unsigned int n) { + // get_msb() is only valid when n != 0. + return n == 0 ? 0 : get_msb(n); +} + +static INLINE MV_CLASS_TYPE av1_get_mv_class(int z, int *offset) { + const MV_CLASS_TYPE c = (z >= CLASS0_SIZE * 4096) + ? MV_CLASS_10 + : (MV_CLASS_TYPE)av1_log_in_base_2(z >> 3); + if (offset) *offset = z - av1_mv_class_base(c); + return c;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vp9/common/vp9_entropymv.h
95
96
97
98
99
100
101
102
103
104
vpx_prob class0_hp; vpx_prob hp; } nmv_component; typedef struct { vpx_prob joints[MV_JOINTS - 1]; nmv_component comps[2]; } nmv_context; static INLINE MV_JOINT_TYPE vp9_get_mv_joint(const MV *mv) {
+ show +
105
106
107
108
if (mv->row == 0) { return mv->col == 0 ? MV_JOINT_ZERO : MV_JOINT_HNZVZ; } else { return mv->col == 0 ? MV_JOINT_HZVNZ : MV_JOINT_HNZVNZ;
+ show +
109
110
111
112
113
114
115
116
117
118
} } MV_CLASS_TYPE vp9_get_mv_class(int z, int *offset); typedef struct { unsigned int sign[2]; unsigned int classes[MV_CLASSES]; unsigned int class0[CLASS0_SIZE]; unsigned int bits[MV_OFFSET_BITS][2];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodemv.h
34
35
36
37
38
39
40
41
42
43
const MV_REFERENCE_FRAME *ref_frame, int ref_mv_idx, const MB_MODE_INFO_EXT *mbmi_ext); void av1_find_best_ref_mvs_from_stack(int allow_hp, const MB_MODE_INFO_EXT *mbmi_ext, MV_REFERENCE_FRAME ref_frame, int_mv *nearest_mv, int_mv *near_mv, int is_integer); static INLINE MV_JOINT_TYPE av1_get_mv_joint(const MV *mv) {
+ show +
44
45
46
47
if (mv->row == 0) { return mv->col == 0 ? MV_JOINT_ZERO : MV_JOINT_HNZVZ; } else { return mv->col == 0 ? MV_JOINT_HZVNZ : MV_JOINT_HNZVNZ;
+ show +
48
49
50
51
52
53
54
55
} } #ifdef __cplusplus } // extern "C" #endif #endif // AOM_AV1_ENCODER_ENCODEMV_H_

[CVE-2020-0470_1.diff] encodemv.h #2
+void av1_update_mv_stats(const MV *mv, const MV *ref, nmv_context *mvctx, + MvSubpelPrecision precision); + - if (mv->row == 0) { - return mv->col == 0 ? MV_JOINT_ZERO : MV_JOINT_HNZVZ; - } else { - return mv->col == 0 ? MV_JOINT_HZVNZ : MV_JOINT_HNZVNZ; - } + // row: Z col: Z | MV_JOINT_ZERO (0) + // row: Z col: NZ | MV_JOINT_HNZVZ (1) + // row: NZ col: Z | MV_JOINT_HZVNZ (2) + // row: NZ col: NZ | MV_JOINT_HNZVNZ (3) + return (!!mv->col) | ((!!mv->row) << 1); +} + +static INLINE int av1_mv_class_base(MV_CLASS_TYPE c) { + return c ? CLASS0_SIZE << (c + 2) : 0; +} + +// If n != 0, returns the floor of log base 2 of n. If n == 0, returns 0. +static INLINE uint8_t av1_log_in_base_2(unsigned int n) { + // get_msb() is only valid when n != 0. + return n == 0 ? 0 : get_msb(n); +} + +static INLINE MV_CLASS_TYPE av1_get_mv_class(int z, int *offset) { + const MV_CLASS_TYPE c = (z >= CLASS0_SIZE * 4096) + ? MV_CLASS_10 + : (MV_CLASS_TYPE)av1_log_in_base_2(z >> 3); + if (offset) *offset = z - av1_mv_class_base(c); + return c;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vp9/common/vp9_entropymv.h
95
96
97
98
99
100
101
102
103
104
vpx_prob class0_hp; vpx_prob hp; } nmv_component; typedef struct { vpx_prob joints[MV_JOINTS - 1]; nmv_component comps[2]; } nmv_context; static INLINE MV_JOINT_TYPE vp9_get_mv_joint(const MV *mv) {
+ show +
105
106
107
108
if (mv->row == 0) { return mv->col == 0 ? MV_JOINT_ZERO : MV_JOINT_HNZVZ; } else { return mv->col == 0 ? MV_JOINT_HZVNZ : MV_JOINT_HNZVNZ;
+ show +
109
110
111
112
113
114
115
116
117
118
} } MV_CLASS_TYPE vp9_get_mv_class(int z, int *offset); typedef struct { unsigned int sign[2]; unsigned int classes[MV_CLASSES]; unsigned int class0[CLASS0_SIZE]; unsigned int bits[MV_OFFSET_BITS][2];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodemv.h
34
35
36
37
38
39
40
41
42
43
const MV_REFERENCE_FRAME *ref_frame, int ref_mv_idx, const MB_MODE_INFO_EXT *mbmi_ext); void av1_find_best_ref_mvs_from_stack(int allow_hp, const MB_MODE_INFO_EXT *mbmi_ext, MV_REFERENCE_FRAME ref_frame, int_mv *nearest_mv, int_mv *near_mv, int is_integer); static INLINE MV_JOINT_TYPE av1_get_mv_joint(const MV *mv) {
+ show +
44
45
46
47
if (mv->row == 0) { return mv->col == 0 ? MV_JOINT_ZERO : MV_JOINT_HNZVZ; } else { return mv->col == 0 ? MV_JOINT_HZVNZ : MV_JOINT_HNZVNZ;
+ show +
48
49
50
51
52
53
54
55
} } #ifdef __cplusplus } // extern "C" #endif #endif // AOM_AV1_ENCODER_ENCODEMV_H_

[CVE-2020-0478_1.diff] reconinter.h #9
+ const SubpelMvLimits mv_limits = { + xd->mb_to_left_edge * (1 << (1 - ss_x)) - spel_left, + xd->mb_to_right_edge * (1 << (1 - ss_x)) + spel_right, + xd->mb_to_top_edge * (1 << (1 - ss_y)) - spel_top, + xd->mb_to_bottom_edge * (1 << (1 - ss_y)) + spel_bottom + }; - clamp_mv(&clamped_mv, xd->mb_to_left_edge * (1 << (1 - ss_x)) - spel_left, - xd->mb_to_right_edge * (1 << (1 - ss_x)) + spel_right, - xd->mb_to_top_edge * (1 << (1 - ss_y)) - spel_top, - xd->mb_to_bottom_edge * (1 << (1 - ss_y)) + spel_bottom); + clamp_mv(&clamped_mv, &mv_limits);
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vp9/common/vp9_reconinter.c
94
95
96
97
98
99
100
101
102
103
// discarded and the MV limited to 16 pixels with equivalent results. const int spel_left = (VP9_INTERP_EXTEND + bw) << SUBPEL_BITS; const int spel_right = spel_left - SUBPEL_SHIFTS; const int spel_top = (VP9_INTERP_EXTEND + bh) << SUBPEL_BITS; const int spel_bottom = spel_top - SUBPEL_SHIFTS; MV clamped_mv = { src_mv->row * (1 << (1 - ss_y)), src_mv->col * (1 << (1 - ss_x)) }; assert(ss_x <= 1); assert(ss_y <= 1);
+ show +
104
105
106
107
clamp_mv(&clamped_mv, xd->mb_to_left_edge * (1 << (1 - ss_x)) - spel_left, xd->mb_to_right_edge * (1 << (1 - ss_x)) + spel_right, xd->mb_to_top_edge * (1 << (1 - ss_y)) - spel_top, xd->mb_to_bottom_edge * (1 << (1 - ss_y)) + spel_bottom);
+ show +
108
109
110
111
112
113
114
115
116
117
return clamped_mv; } MV average_split_mvs(const struct macroblockd_plane *pd, const MODE_INFO *mi, int ref, int block) { const int ss_idx = ((pd->subsampling_x > 0) << 1) | (pd->subsampling_y > 0); MV res = { 0, 0 }; switch (ss_idx) { case 0: res = mi->bmi[block].as_mv[ref].as_mv; break;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/reconinter.h
231
232
233
234
235
236
237
238
239
240
// discarded and the MV limited to 16 pixels with equivalent results. const int spel_left = (AOM_INTERP_EXTEND + bw) << SUBPEL_BITS; const int spel_right = spel_left - SUBPEL_SHIFTS; const int spel_top = (AOM_INTERP_EXTEND + bh) << SUBPEL_BITS; const int spel_bottom = spel_top - SUBPEL_SHIFTS; MV clamped_mv = { (int16_t)(src_mv->row * (1 << (1 - ss_y))), (int16_t)(src_mv->col * (1 << (1 - ss_x))) }; assert(ss_x <= 1); assert(ss_y <= 1);
+ show +
241
242
243
244
clamp_mv(&clamped_mv, xd->mb_to_left_edge * (1 << (1 - ss_x)) - spel_left, xd->mb_to_right_edge * (1 << (1 - ss_x)) + spel_right, xd->mb_to_top_edge * (1 << (1 - ss_y)) - spel_top, xd->mb_to_bottom_edge * (1 << (1 - ss_y)) + spel_bottom);
+ show +
245
246
247
248
249
250
251
252
253
254
return clamped_mv; } static INLINE int64_t scaled_buffer_offset(int x_offset, int y_offset, int stride, const struct scale_factors *sf) { const int x = sf ? sf->scale_value_x(x_offset, sf) >> SCALE_EXTRA_BITS : x_offset; const int y =

[CVE-2020-0470_1.diff] reconinter.h #9
+ const SubpelMvLimits mv_limits = { + xd->mb_to_left_edge * (1 << (1 - ss_x)) - spel_left, + xd->mb_to_right_edge * (1 << (1 - ss_x)) + spel_right, + xd->mb_to_top_edge * (1 << (1 - ss_y)) - spel_top, + xd->mb_to_bottom_edge * (1 << (1 - ss_y)) + spel_bottom + }; - clamp_mv(&clamped_mv, xd->mb_to_left_edge * (1 << (1 - ss_x)) - spel_left, - xd->mb_to_right_edge * (1 << (1 - ss_x)) + spel_right, - xd->mb_to_top_edge * (1 << (1 - ss_y)) - spel_top, - xd->mb_to_bottom_edge * (1 << (1 - ss_y)) + spel_bottom); + clamp_mv(&clamped_mv, &mv_limits);
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vp9/common/vp9_reconinter.c
94
95
96
97
98
99
100
101
102
103
// discarded and the MV limited to 16 pixels with equivalent results. const int spel_left = (VP9_INTERP_EXTEND + bw) << SUBPEL_BITS; const int spel_right = spel_left - SUBPEL_SHIFTS; const int spel_top = (VP9_INTERP_EXTEND + bh) << SUBPEL_BITS; const int spel_bottom = spel_top - SUBPEL_SHIFTS; MV clamped_mv = { src_mv->row * (1 << (1 - ss_y)), src_mv->col * (1 << (1 - ss_x)) }; assert(ss_x <= 1); assert(ss_y <= 1);
+ show +
104
105
106
107
clamp_mv(&clamped_mv, xd->mb_to_left_edge * (1 << (1 - ss_x)) - spel_left, xd->mb_to_right_edge * (1 << (1 - ss_x)) + spel_right, xd->mb_to_top_edge * (1 << (1 - ss_y)) - spel_top, xd->mb_to_bottom_edge * (1 << (1 - ss_y)) + spel_bottom);
+ show +
108
109
110
111
112
113
114
115
116
117
return clamped_mv; } MV average_split_mvs(const struct macroblockd_plane *pd, const MODE_INFO *mi, int ref, int block) { const int ss_idx = ((pd->subsampling_x > 0) << 1) | (pd->subsampling_y > 0); MV res = { 0, 0 }; switch (ss_idx) { case 0: res = mi->bmi[block].as_mv[ref].as_mv; break;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/reconinter.h
231
232
233
234
235
236
237
238
239
240
// discarded and the MV limited to 16 pixels with equivalent results. const int spel_left = (AOM_INTERP_EXTEND + bw) << SUBPEL_BITS; const int spel_right = spel_left - SUBPEL_SHIFTS; const int spel_top = (AOM_INTERP_EXTEND + bh) << SUBPEL_BITS; const int spel_bottom = spel_top - SUBPEL_SHIFTS; MV clamped_mv = { (int16_t)(src_mv->row * (1 << (1 - ss_y))), (int16_t)(src_mv->col * (1 << (1 - ss_x))) }; assert(ss_x <= 1); assert(ss_y <= 1);
+ show +
241
242
243
244
clamp_mv(&clamped_mv, xd->mb_to_left_edge * (1 << (1 - ss_x)) - spel_left, xd->mb_to_right_edge * (1 << (1 - ss_x)) + spel_right, xd->mb_to_top_edge * (1 << (1 - ss_y)) - spel_top, xd->mb_to_bottom_edge * (1 << (1 - ss_y)) + spel_bottom);
+ show +
245
246
247
248
249
250
251
252
253
254
return clamped_mv; } static INLINE int64_t scaled_buffer_offset(int x_offset, int y_offset, int stride, const struct scale_factors *sf) { const int x = sf ? sf->scale_value_x(x_offset, sf) >> SCALE_EXTRA_BITS : x_offset; const int y =

[CVE-2020-0478_1.diff] onyxc_int.h #18
- xd->mb_to_top_edge = -((mi_row * MI_SIZE) * 8); - xd->mb_to_bottom_edge = ((mi_rows - bh - mi_row) * MI_SIZE) * 8; - xd->mb_to_left_edge = -((mi_col * MI_SIZE) * 8); - xd->mb_to_right_edge = ((mi_cols - bw - mi_col) * MI_SIZE) * 8; + xd->mb_to_top_edge = -GET_MV_SUBPEL(mi_row * MI_SIZE); + xd->mb_to_bottom_edge = GET_MV_SUBPEL((mi_rows - bh - mi_row) * MI_SIZE); + xd->mb_to_left_edge = -GET_MV_SUBPEL((mi_col * MI_SIZE)); + xd->mb_to_right_edge = GET_MV_SUBPEL((mi_cols - bw - mi_col) * MI_SIZE); + + xd->mi_row = mi_row; + xd->mi_col = mi_col;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vp9/common/vp9_onyxc_int.h
365
366
367
368
369
370
371
372
373
374
} static INLINE int calc_mi_size(int len) { // len is in mi units. return len + MI_BLOCK_SIZE; } static INLINE void set_mi_row_col(MACROBLOCKD *xd, const TileInfo *const tile, int mi_row, int bh, int mi_col, int bw, int mi_rows, int mi_cols) {
+ show +
375
376
377
378
xd->mb_to_top_edge = -((mi_row * MI_SIZE) * 8); xd->mb_to_bottom_edge = ((mi_rows - bh - mi_row) * MI_SIZE) * 8; xd->mb_to_left_edge = -((mi_col * MI_SIZE) * 8); xd->mb_to_right_edge = ((mi_cols - bw - mi_col) * MI_SIZE) * 8;
+ show +
379
380
381
382
383
384
385
386
387
388
// Are edges available for intra prediction? xd->above_mi = (mi_row != 0) ? xd->mi[-xd->mi_stride] : NULL; xd->left_mi = (mi_col > tile->mi_col_start) ? xd->mi[-1] : NULL; } static INLINE void update_partition_context(MACROBLOCKD *xd, int mi_row, int mi_col, BLOCK_SIZE subsize, BLOCK_SIZE bsize) { PARTITION_CONTEXT *const above_ctx = xd->above_seg_context + mi_col;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/onyxc_int.h
818
819
820
821
822
823
824
825
826
827
xd->plane[i].height = (bh * MI_SIZE) >> xd->plane[i].subsampling_y; xd->plane[i].width = AOMMAX(xd->plane[i].width, 4); xd->plane[i].height = AOMMAX(xd->plane[i].height, 4); } } static INLINE void set_mi_row_col(MACROBLOCKD *xd, const TileInfo *const tile, int mi_row, int bh, int mi_col, int bw, int mi_rows, int mi_cols) {
+ show +
828
829
830
831
xd->mb_to_top_edge = -((mi_row * MI_SIZE) * 8); xd->mb_to_bottom_edge = ((mi_rows - bh - mi_row) * MI_SIZE) * 8; xd->mb_to_left_edge = -((mi_col * MI_SIZE) * 8); xd->mb_to_right_edge = ((mi_cols - bw - mi_col) * MI_SIZE) * 8;
+ show +
832
833
834
835
836
837
838
839
840
841
// Are edges available for intra prediction? xd->up_available = (mi_row > tile->mi_row_start); const int ss_x = xd->plane[1].subsampling_x; const int ss_y = xd->plane[1].subsampling_y; xd->left_available = (mi_col > tile->mi_col_start); xd->chroma_up_available = xd->up_available; xd->chroma_left_available = xd->left_available;

[CVE-2020-0470_1.diff] onyxc_int.h #18
- xd->mb_to_top_edge = -((mi_row * MI_SIZE) * 8); - xd->mb_to_bottom_edge = ((mi_rows - bh - mi_row) * MI_SIZE) * 8; - xd->mb_to_left_edge = -((mi_col * MI_SIZE) * 8); - xd->mb_to_right_edge = ((mi_cols - bw - mi_col) * MI_SIZE) * 8; + xd->mb_to_top_edge = -GET_MV_SUBPEL(mi_row * MI_SIZE); + xd->mb_to_bottom_edge = GET_MV_SUBPEL((mi_rows - bh - mi_row) * MI_SIZE); + xd->mb_to_left_edge = -GET_MV_SUBPEL((mi_col * MI_SIZE)); + xd->mb_to_right_edge = GET_MV_SUBPEL((mi_cols - bw - mi_col) * MI_SIZE); + + xd->mi_row = mi_row; + xd->mi_col = mi_col;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vp9/common/vp9_onyxc_int.h
365
366
367
368
369
370
371
372
373
374
} static INLINE int calc_mi_size(int len) { // len is in mi units. return len + MI_BLOCK_SIZE; } static INLINE void set_mi_row_col(MACROBLOCKD *xd, const TileInfo *const tile, int mi_row, int bh, int mi_col, int bw, int mi_rows, int mi_cols) {
+ show +
375
376
377
378
xd->mb_to_top_edge = -((mi_row * MI_SIZE) * 8); xd->mb_to_bottom_edge = ((mi_rows - bh - mi_row) * MI_SIZE) * 8; xd->mb_to_left_edge = -((mi_col * MI_SIZE) * 8); xd->mb_to_right_edge = ((mi_cols - bw - mi_col) * MI_SIZE) * 8;
+ show +
379
380
381
382
383
384
385
386
387
388
// Are edges available for intra prediction? xd->above_mi = (mi_row != 0) ? xd->mi[-xd->mi_stride] : NULL; xd->left_mi = (mi_col > tile->mi_col_start) ? xd->mi[-1] : NULL; } static INLINE void update_partition_context(MACROBLOCKD *xd, int mi_row, int mi_col, BLOCK_SIZE subsize, BLOCK_SIZE bsize) { PARTITION_CONTEXT *const above_ctx = xd->above_seg_context + mi_col;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/onyxc_int.h
818
819
820
821
822
823
824
825
826
827
xd->plane[i].height = (bh * MI_SIZE) >> xd->plane[i].subsampling_y; xd->plane[i].width = AOMMAX(xd->plane[i].width, 4); xd->plane[i].height = AOMMAX(xd->plane[i].height, 4); } } static INLINE void set_mi_row_col(MACROBLOCKD *xd, const TileInfo *const tile, int mi_row, int bh, int mi_col, int bw, int mi_rows, int mi_cols) {
+ show +
828
829
830
831
xd->mb_to_top_edge = -((mi_row * MI_SIZE) * 8); xd->mb_to_bottom_edge = ((mi_rows - bh - mi_row) * MI_SIZE) * 8; xd->mb_to_left_edge = -((mi_col * MI_SIZE) * 8); xd->mb_to_right_edge = ((mi_cols - bw - mi_col) * MI_SIZE) * 8;
+ show +
832
833
834
835
836
837
838
839
840
841
// Are edges available for intra prediction? xd->up_available = (mi_row > tile->mi_row_start); const int ss_x = xd->plane[1].subsampling_x; const int ss_y = xd->plane[1].subsampling_y; xd->left_available = (mi_col > tile->mi_col_start); xd->chroma_up_available = xd->up_available; xd->chroma_left_available = xd->left_available;

[CVE-2020-0478_1.diff] mkvmuxerutil.cc #2
- return frame->CanBeSimpleBlock() ? - WriteSimpleBlock(writer, frame, relative_timecode) : - WriteBlock(writer, frame, relative_timecode, - cluster->timecode_scale()); + return frame->CanBeSimpleBlock() + ? WriteSimpleBlock(writer, frame, relative_timecode) + : WriteBlock(writer, frame, relative_timecode, + cluster->timecode_scale());
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/libwebm/mkvmuxer/mkvmuxerutil.cc
555
556
557
558
559
560
561
562
563
564
// Technically the timecode for a block can be less than the // timecode for the cluster itself (remember that block timecode // is a signed, 16-bit integer). However, as a simplification we // only permit non-negative cluster-relative timecodes for blocks. const int64 relative_timecode = cluster->GetRelativeTimecode( frame->timestamp() / cluster->timecode_scale()); if (relative_timecode < 0 || relative_timecode > kMaxBlockTimecode) return 0;
+ show +
565
566
567
568
return frame->CanBeSimpleBlock() ? WriteSimpleBlock(writer, frame, relative_timecode) : WriteBlock(writer, frame, relative_timecode, cluster->timecode_scale());
+ show +
569
570
571
572
573
574
575
576
577
578
} uint64 WriteVoidElement(IMkvWriter* writer, uint64 size) { if (!writer) return false; // Subtract one for the void ID and the coded size. uint64 void_entry_size = size - 1 - GetCodedUIntSize(size - 1); uint64 void_size = EbmlMasterElementSize(libwebm::kMkvVoid, void_entry_size) + void_entry_size;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/libwebm/mkvmuxer/mkvmuxerutil.cc
555
556
557
558
559
560
561
562
563
564
// Technically the timecode for a block can be less than the // timecode for the cluster itself (remember that block timecode // is a signed, 16-bit integer). However, as a simplification we // only permit non-negative cluster-relative timecodes for blocks. const int64 relative_timecode = cluster->GetRelativeTimecode( frame->timestamp() / cluster->timecode_scale()); if (relative_timecode < 0 || relative_timecode > kMaxBlockTimecode) return 0;
+ show +
565
566
567
568
return frame->CanBeSimpleBlock() ? WriteSimpleBlock(writer, frame, relative_timecode) : WriteBlock(writer, frame, relative_timecode, cluster->timecode_scale());
+ show +
569
570
571
572
573
574
575
576
577
578
} uint64 WriteVoidElement(IMkvWriter* writer, uint64 size) { if (!writer) return false; // Subtract one for the void ID and the coded size. uint64 void_entry_size = size - 1 - GetCodedUIntSize(size - 1); uint64 void_size = EbmlMasterElementSize(libwebm::kMkvVoid, void_entry_size) + void_entry_size;

[CVE-2020-0470_1.diff] mkvmuxerutil.cc #2
- return frame->CanBeSimpleBlock() ? - WriteSimpleBlock(writer, frame, relative_timecode) : - WriteBlock(writer, frame, relative_timecode, - cluster->timecode_scale()); + return frame->CanBeSimpleBlock() + ? WriteSimpleBlock(writer, frame, relative_timecode) + : WriteBlock(writer, frame, relative_timecode, + cluster->timecode_scale());
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/third_party/libwebm/mkvmuxer/mkvmuxerutil.cc
555
556
557
558
559
560
561
562
563
564
// Technically the timecode for a block can be less than the // timecode for the cluster itself (remember that block timecode // is a signed, 16-bit integer). However, as a simplification we // only permit non-negative cluster-relative timecodes for blocks. const int64 relative_timecode = cluster->GetRelativeTimecode( frame->timestamp() / cluster->timecode_scale()); if (relative_timecode < 0 || relative_timecode > kMaxBlockTimecode) return 0;
+ show +
565
566
567
568
return frame->CanBeSimpleBlock() ? WriteSimpleBlock(writer, frame, relative_timecode) : WriteBlock(writer, frame, relative_timecode, cluster->timecode_scale());
+ show +
569
570
571
572
573
574
575
576
577
578
} uint64 WriteVoidElement(IMkvWriter* writer, uint64 size) { if (!writer) return false; // Subtract one for the void ID and the coded size. uint64 void_entry_size = size - 1 - GetCodedUIntSize(size - 1); uint64 void_size = EbmlMasterElementSize(libwebm::kMkvVoid, void_entry_size) + void_entry_size;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/libwebm/mkvmuxer/mkvmuxerutil.cc
555
556
557
558
559
560
561
562
563
564
// Technically the timecode for a block can be less than the // timecode for the cluster itself (remember that block timecode // is a signed, 16-bit integer). However, as a simplification we // only permit non-negative cluster-relative timecodes for blocks. const int64 relative_timecode = cluster->GetRelativeTimecode( frame->timestamp() / cluster->timecode_scale()); if (relative_timecode < 0 || relative_timecode > kMaxBlockTimecode) return 0;
+ show +
565
566
567
568
return frame->CanBeSimpleBlock() ? WriteSimpleBlock(writer, frame, relative_timecode) : WriteBlock(writer, frame, relative_timecode, cluster->timecode_scale());
+ show +
569
570
571
572
573
574
575
576
577
578
} uint64 WriteVoidElement(IMkvWriter* writer, uint64 size) { if (!writer) return false; // Subtract one for the void ID and the coded size. uint64 void_entry_size = size - 1 - GetCodedUIntSize(size - 1); uint64 void_size = EbmlMasterElementSize(libwebm::kMkvVoid, void_entry_size) + void_entry_size;

[CVE-2020-0478_1.diff] loopfilter.c #3
+#if CONFIG_AV1_HIGHBITDEPTH +#endif - const int8_t ps1 = (int8_t)*op1 ^ 0x80; - const int8_t ps0 = (int8_t)*op0 ^ 0x80; - const int8_t qs0 = (int8_t)*oq0 ^ 0x80; - const int8_t qs1 = (int8_t)*oq1 ^ 0x80; - const uint8_t hev = hev_mask(thresh, *op1, *op0, *oq0, *oq1); + const int8_t ps1 = (int8_t)(*op1 ^ 0x80); + const int8_t ps0 = (int8_t)(*op0 ^ 0x80); + const int8_t qs0 = (int8_t)(*oq0 ^ 0x80); + const int8_t qs1 = (int8_t)(*oq1 ^ 0x80); + const int8_t hev = hev_mask(thresh, *op1, *op0, *oq0, *oq1);
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vpx_dsp/loopfilter.c
74
75
76
77
78
79
80
81
82
83
int8_t hev = 0; hev |= (abs(p1 - p0) > thresh) * -1; hev |= (abs(q1 - q0) > thresh) * -1; return hev; } static INLINE void filter4(int8_t mask, uint8_t thresh, uint8_t *op1, uint8_t *op0, uint8_t *oq0, uint8_t *oq1) { int8_t filter1, filter2;
+ show +
84
85
86
87
88
const int8_t ps1 = (int8_t)*op1 ^ 0x80; const int8_t ps0 = (int8_t)*op0 ^ 0x80; const int8_t qs0 = (int8_t)*oq0 ^ 0x80; const int8_t qs1 = (int8_t)*oq1 ^ 0x80; const uint8_t hev = hev_mask(thresh, *op1, *op0, *oq0, *oq1);
+ show +
89
90
91
92
93
94
95
96
97
98
// add outer taps if we have high edge variance int8_t filter = signed_char_clamp(ps1 - qs1) & hev; // inner taps filter = signed_char_clamp(filter + 3 * (qs0 - ps0)) & mask; // save bottom 3 bits so that we round one side +4 and the other +3 // if it equals 4 we'll set it to adjust by -1 to account for the fact // we'd round it by 3 the other way
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/loopfilter.c
96
97
98
99
100
101
102
103
104
105
int8_t hev = 0; hev |= (abs(p1 - p0) > thresh) * -1; hev |= (abs(q1 - q0) > thresh) * -1; return hev; } static INLINE void filter4(int8_t mask, uint8_t thresh, uint8_t *op1, uint8_t *op0, uint8_t *oq0, uint8_t *oq1) { int8_t filter1, filter2;
+ show +
106
107
108
109
110
const int8_t ps1 = (int8_t)*op1 ^ 0x80; const int8_t ps0 = (int8_t)*op0 ^ 0x80; const int8_t qs0 = (int8_t)*oq0 ^ 0x80; const int8_t qs1 = (int8_t)*oq1 ^ 0x80; const uint8_t hev = hev_mask(thresh, *op1, *op0, *oq0, *oq1);
+ show +
111
112
113
114
115
116
117
118
119
120
// add outer taps if we have high edge variance int8_t filter = signed_char_clamp(ps1 - qs1) & hev; // inner taps filter = signed_char_clamp(filter + 3 * (qs0 - ps0)) & mask; // save bottom 3 bits so that we round one side +4 and the other +3 // if it equals 4 we'll set to adjust by -1 to account for the fact // we'd round 3 the other way

[CVE-2020-0470_1.diff] loopfilter.c #3
+#if CONFIG_AV1_HIGHBITDEPTH +#endif - const int8_t ps1 = (int8_t)*op1 ^ 0x80; - const int8_t ps0 = (int8_t)*op0 ^ 0x80; - const int8_t qs0 = (int8_t)*oq0 ^ 0x80; - const int8_t qs1 = (int8_t)*oq1 ^ 0x80; - const uint8_t hev = hev_mask(thresh, *op1, *op0, *oq0, *oq1); + const int8_t ps1 = (int8_t)(*op1 ^ 0x80); + const int8_t ps0 = (int8_t)(*op0 ^ 0x80); + const int8_t qs0 = (int8_t)(*oq0 ^ 0x80); + const int8_t qs1 = (int8_t)(*oq1 ^ 0x80); + const int8_t hev = hev_mask(thresh, *op1, *op0, *oq0, *oq1);
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vpx_dsp/loopfilter.c
74
75
76
77
78
79
80
81
82
83
int8_t hev = 0; hev |= (abs(p1 - p0) > thresh) * -1; hev |= (abs(q1 - q0) > thresh) * -1; return hev; } static INLINE void filter4(int8_t mask, uint8_t thresh, uint8_t *op1, uint8_t *op0, uint8_t *oq0, uint8_t *oq1) { int8_t filter1, filter2;
+ show +
84
85
86
87
88
const int8_t ps1 = (int8_t)*op1 ^ 0x80; const int8_t ps0 = (int8_t)*op0 ^ 0x80; const int8_t qs0 = (int8_t)*oq0 ^ 0x80; const int8_t qs1 = (int8_t)*oq1 ^ 0x80; const uint8_t hev = hev_mask(thresh, *op1, *op0, *oq0, *oq1);
+ show +
89
90
91
92
93
94
95
96
97
98
// add outer taps if we have high edge variance int8_t filter = signed_char_clamp(ps1 - qs1) & hev; // inner taps filter = signed_char_clamp(filter + 3 * (qs0 - ps0)) & mask; // save bottom 3 bits so that we round one side +4 and the other +3 // if it equals 4 we'll set it to adjust by -1 to account for the fact // we'd round it by 3 the other way
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/loopfilter.c
96
97
98
99
100
101
102
103
104
105
int8_t hev = 0; hev |= (abs(p1 - p0) > thresh) * -1; hev |= (abs(q1 - q0) > thresh) * -1; return hev; } static INLINE void filter4(int8_t mask, uint8_t thresh, uint8_t *op1, uint8_t *op0, uint8_t *oq0, uint8_t *oq1) { int8_t filter1, filter2;
+ show +
106
107
108
109
110
const int8_t ps1 = (int8_t)*op1 ^ 0x80; const int8_t ps0 = (int8_t)*op0 ^ 0x80; const int8_t qs0 = (int8_t)*oq0 ^ 0x80; const int8_t qs1 = (int8_t)*oq1 ^ 0x80; const uint8_t hev = hev_mask(thresh, *op1, *op0, *oq0, *oq1);
+ show +
111
112
113
114
115
116
117
118
119
120
// add outer taps if we have high edge variance int8_t filter = signed_char_clamp(ps1 - qs1) & hev; // inner taps filter = signed_char_clamp(filter + 3 * (qs0 - ps0)) & mask; // save bottom 3 bits so that we round one side +4 and the other +3 // if it equals 4 we'll set to adjust by -1 to account for the fact // we'd round 3 the other way

[CVE-2020-0478_1.diff] psnrhvs.c #6
- s_gmean += dct_s[i * 8 + j]; - d_gmean += dct_d[i * 8 + j]; - s_means[sub] += dct_s[i * 8 + j]; - d_means[sub] += dct_d[i * 8 + j]; + dct_d[i * 8 + j] += (int)(delt + 0.5f); - s_gmean /= 64.f; - d_gmean /= 64.f; - for (i = 0; i < 4; i++) s_means[i] /= 16.f; - for (i = 0; i < 4; i++) d_means[i] /= 16.f; - for (i = 0; i < 8; i++) { - for (j = 0; j < 8; j++) { - int sub = ((i & 12) >> 2) + ((j & 12) >> 1); - s_gvar += (dct_s[i * 8 + j] - s_gmean) * (dct_s[i * 8 + j] - s_gmean); - d_gvar += (dct_d[i * 8 + j] - d_gmean) * (dct_d[i * 8 + j] - d_gmean); - s_vars[sub] += (dct_s[i * 8 + j] - s_means[sub]) * - (dct_s[i * 8 + j] - s_means[sub]); - d_vars[sub] += (dct_d[i * 8 + j] - d_means[sub]) * - (dct_d[i * 8 + j] - d_means[sub]); + for (i = 1; i < 7; i++) { + for (j = 1; j < 7; j++) { + s_gx = (dct_s[(i - 1) * 8 + j - 1] * 3 - + dct_s[(i - 1) * 8 + j + 1] * 3 + dct_s[i * 8 + j - 1] * 10 - + dct_s[i * 8 + j + 1] * 10 + dct_s[(i + 1) * 8 + j - 1] * 3 - + dct_s[(i + 1) * 8 + j + 1] * 3) / + (pix_max * 16.f); + s_gy = (dct_s[(i - 1) * 8 + j - 1] * 3 - + dct_s[(i + 1) * 8 + j - 1] * 3 + dct_s[(i - 1) * 8 + j] * 10 - + dct_s[(i + 1) * 8 + j] * 10 + dct_s[(i - 1) * 8 + j + 1] * 3 - + dct_s[(i + 1) * 8 + j + 1] * 3) / + (pix_max * 16.f); + g = sqrt(s_gx * s_gx + s_gy * s_gy); + if (g > 0.1f) n++; + s_gmean += g; - s_gvar *= 1 / 63.f * 64; - d_gvar *= 1 / 63.f * 64; - for (i = 0; i < 4; i++) s_vars[i] *= 1 / 15.f * 16; - for (i = 0; i < 4; i++) d_vars[i] *= 1 / 15.f * 16; - if (s_gvar > 0) - s_gvar = (s_vars[0] + s_vars[1] + s_vars[2] + s_vars[3]) / s_gvar; - if (d_gvar > 0) - d_gvar = (d_vars[0] + d_vars[1] + d_vars[2] + d_vars[3]) / d_gvar; + s_gvar = 1.f / (36 - n + 1) * s_gmean / 36.f;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vpx_dsp/psnrhvs.c
176
177
178
179
180
181
182
183
184
185
for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { int sub = ((i & 12) >> 2) + ((j & 12) >> 1); if (bit_depth == 8 && _shift == 0) { dct_s[i * 8 + j] = _src8[(y + i) * _systride + (j + x)]; dct_d[i * 8 + j] = _dst8[(y + i) * _dystride + (j + x)]; } else if (bit_depth == 10 || bit_depth == 12) { dct_s[i * 8 + j] = _src16[(y + i) * _systride + (j + x)] >> _shift; dct_d[i * 8 + j] = _dst16[(y + i) * _dystride + (j + x)] >> _shift; }
+ show +
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
s_gmean += dct_s[i * 8 + j]; d_gmean += dct_d[i * 8 + j]; s_means[sub] += dct_s[i * 8 + j]; d_means[sub] += dct_d[i * 8 + j]; } } s_gmean /= 64.f; d_gmean /= 64.f; for (i = 0; i < 4; i++) s_means[i] /= 16.f; for (i = 0; i < 4; i++) d_means[i] /= 16.f; for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { int sub = ((i & 12) >> 2) + ((j & 12) >> 1); s_gvar += (dct_s[i * 8 + j] - s_gmean) * (dct_s[i * 8 + j] - s_gmean); d_gvar += (dct_d[i * 8 + j] - d_gmean) * (dct_d[i * 8 + j] - d_gmean); s_vars[sub] += (dct_s[i * 8 + j] - s_means[sub]) * (dct_s[i * 8 + j] - s_means[sub]); d_vars[sub] += (dct_d[i * 8 + j] - d_means[sub]) * (dct_d[i * 8 + j] - d_means[sub]); } } s_gvar *= 1 / 63.f * 64; d_gvar *= 1 / 63.f * 64; for (i = 0; i < 4; i++) s_vars[i] *= 1 / 15.f * 16; for (i = 0; i < 4; i++) d_vars[i] *= 1 / 15.f * 16; if (s_gvar > 0) s_gvar = (s_vars[0] + s_vars[1] + s_vars[2] + s_vars[3]) / s_gvar; if (d_gvar > 0) d_gvar = (d_vars[0] + d_vars[1] + d_vars[2] + d_vars[3]) / d_gvar;
+ show +
215
216
217
218
219
220
221
222
223
224
#if CONFIG_VP9_HIGHBITDEPTH if (bit_depth == 10 || bit_depth == 12) { hbd_od_bin_fdct8x8(dct_s_coef, 8, dct_s, 8); hbd_od_bin_fdct8x8(dct_d_coef, 8, dct_d, 8); } #endif if (bit_depth == 8) { od_bin_fdct8x8(dct_s_coef, 8, dct_s, 8); od_bin_fdct8x8(dct_d_coef, 8, dct_d, 8); }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/psnrhvs.c
172
173
174
175
176
177
178
179
180
181
for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { int sub = ((i & 12) >> 2) + ((j & 12) >> 1); if (!buf_is_hbd) { dct_s[i * 8 + j] = _src8[(y + i) * _systride + (j + x)]; dct_d[i * 8 + j] = _dst8[(y + i) * _dystride + (j + x)]; } else { dct_s[i * 8 + j] = _src16[(y + i) * _systride + (j + x)] >> _shift; dct_d[i * 8 + j] = _dst16[(y + i) * _dystride + (j + x)] >> _shift; }
+ show +
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
s_gmean += dct_s[i * 8 + j]; d_gmean += dct_d[i * 8 + j]; s_means[sub] += dct_s[i * 8 + j]; d_means[sub] += dct_d[i * 8 + j]; } } s_gmean /= 64.f; d_gmean /= 64.f; for (i = 0; i < 4; i++) s_means[i] /= 16.f; for (i = 0; i < 4; i++) d_means[i] /= 16.f; for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { int sub = ((i & 12) >> 2) + ((j & 12) >> 1); s_gvar += (dct_s[i * 8 + j] - s_gmean) * (dct_s[i * 8 + j] - s_gmean); d_gvar += (dct_d[i * 8 + j] - d_gmean) * (dct_d[i * 8 + j] - d_gmean); s_vars[sub] += (dct_s[i * 8 + j] - s_means[sub]) * (dct_s[i * 8 + j] - s_means[sub]); d_vars[sub] += (dct_d[i * 8 + j] - d_means[sub]) * (dct_d[i * 8 + j] - d_means[sub]); } } s_gvar *= 1 / 63.f * 64; d_gvar *= 1 / 63.f * 64; for (i = 0; i < 4; i++) s_vars[i] *= 1 / 15.f * 16; for (i = 0; i < 4; i++) d_vars[i] *= 1 / 15.f * 16; if (s_gvar > 0) s_gvar = (s_vars[0] + s_vars[1] + s_vars[2] + s_vars[3]) / s_gvar; if (d_gvar > 0) d_gvar = (d_vars[0] + d_vars[1] + d_vars[2] + d_vars[3]) / d_gvar;
+ show +
211
212
213
214
215
216
217
218
219
220
if (!buf_is_hbd) { od_bin_fdct8x8(dct_s_coef, 8, dct_s, 8); od_bin_fdct8x8(dct_d_coef, 8, dct_d, 8); } else { hbd_od_bin_fdct8x8(dct_s_coef, 8, dct_s, 8); hbd_od_bin_fdct8x8(dct_d_coef, 8, dct_d, 8); } for (i = 0; i < 8; i++) for (j = (i == 0); j < 8; j++) s_mask += dct_s_coef[i * 8 + j] * dct_s_coef[i * 8 + j] * mask[i][j];

[CVE-2020-0478_1.diff] psnrhvs.c #7
- for (i = 0; i < 8; i++) - for (j = (i == 0); j < 8; j++) - d_mask += dct_d_coef[i * 8 + j] * dct_d_coef[i * 8 + j] * mask[i][j]; - s_mask = sqrt(s_mask * s_gvar) / 32.f; - d_mask = sqrt(d_mask * d_gvar) / 32.f; - if (d_mask > s_mask) s_mask = d_mask; + s_mask = sqrt(s_mask * s_gvar) / 8.f;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vpx_dsp/psnrhvs.c
218
219
220
221
222
223
224
225
226
227
hbd_od_bin_fdct8x8(dct_d_coef, 8, dct_d, 8); } #endif if (bit_depth == 8) { od_bin_fdct8x8(dct_s_coef, 8, dct_s, 8); od_bin_fdct8x8(dct_d_coef, 8, dct_d, 8); } for (i = 0; i < 8; i++) for (j = (i == 0); j < 8; j++) s_mask += dct_s_coef[i * 8 + j] * dct_s_coef[i * 8 + j] * mask[i][j];
+ show +
228
229
230
231
232
233
for (i = 0; i < 8; i++) for (j = (i == 0); j < 8; j++) d_mask += dct_d_coef[i * 8 + j] * dct_d_coef[i * 8 + j] * mask[i][j]; s_mask = sqrt(s_mask * s_gvar) / 32.f; d_mask = sqrt(d_mask * d_gvar) / 32.f; if (d_mask > s_mask) s_mask = d_mask;
+ show +
234
235
236
237
238
239
240
241
242
243
for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { double err; err = fabs((double)(dct_s_coef[i * 8 + j] - dct_d_coef[i * 8 + j])); if (i != 0 || j != 0) err = err < s_mask / mask[i][j] ? 0 : err - s_mask / mask[i][j]; ret += (err * _csf[i][j]) * (err * _csf[i][j]); pixels++; } }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/psnrhvs.c
211
212
213
214
215
216
217
218
219
220
if (!buf_is_hbd) { od_bin_fdct8x8(dct_s_coef, 8, dct_s, 8); od_bin_fdct8x8(dct_d_coef, 8, dct_d, 8); } else { hbd_od_bin_fdct8x8(dct_s_coef, 8, dct_s, 8); hbd_od_bin_fdct8x8(dct_d_coef, 8, dct_d, 8); } for (i = 0; i < 8; i++) for (j = (i == 0); j < 8; j++) s_mask += dct_s_coef[i * 8 + j] * dct_s_coef[i * 8 + j] * mask[i][j];
+ show +
221
222
223
224
225
226
for (i = 0; i < 8; i++) for (j = (i == 0); j < 8; j++) d_mask += dct_d_coef[i * 8 + j] * dct_d_coef[i * 8 + j] * mask[i][j]; s_mask = sqrt(s_mask * s_gvar) / 32.f; d_mask = sqrt(d_mask * d_gvar) / 32.f; if (d_mask > s_mask) s_mask = d_mask;
+ show +
227
228
229
230
231
232
233
234
235
236
for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { double err; err = fabs((double)(dct_s_coef[i * 8 + j] - dct_d_coef[i * 8 + j])); if (i != 0 || j != 0) err = err < s_mask / mask[i][j] ? 0 : err - s_mask / mask[i][j]; ret += (err * _csf[i][j]) * (err * _csf[i][j]); pixels++; } }

[CVE-2020-0470_1.diff] psnrhvs.c #6
- s_gmean += dct_s[i * 8 + j]; - d_gmean += dct_d[i * 8 + j]; - s_means[sub] += dct_s[i * 8 + j]; - d_means[sub] += dct_d[i * 8 + j]; + dct_d[i * 8 + j] += (int)(delt + 0.5f); - s_gmean /= 64.f; - d_gmean /= 64.f; - for (i = 0; i < 4; i++) s_means[i] /= 16.f; - for (i = 0; i < 4; i++) d_means[i] /= 16.f; - for (i = 0; i < 8; i++) { - for (j = 0; j < 8; j++) { - int sub = ((i & 12) >> 2) + ((j & 12) >> 1); - s_gvar += (dct_s[i * 8 + j] - s_gmean) * (dct_s[i * 8 + j] - s_gmean); - d_gvar += (dct_d[i * 8 + j] - d_gmean) * (dct_d[i * 8 + j] - d_gmean); - s_vars[sub] += (dct_s[i * 8 + j] - s_means[sub]) * - (dct_s[i * 8 + j] - s_means[sub]); - d_vars[sub] += (dct_d[i * 8 + j] - d_means[sub]) * - (dct_d[i * 8 + j] - d_means[sub]); + for (i = 1; i < 7; i++) { + for (j = 1; j < 7; j++) { + s_gx = (dct_s[(i - 1) * 8 + j - 1] * 3 - + dct_s[(i - 1) * 8 + j + 1] * 3 + dct_s[i * 8 + j - 1] * 10 - + dct_s[i * 8 + j + 1] * 10 + dct_s[(i + 1) * 8 + j - 1] * 3 - + dct_s[(i + 1) * 8 + j + 1] * 3) / + (pix_max * 16.f); + s_gy = (dct_s[(i - 1) * 8 + j - 1] * 3 - + dct_s[(i + 1) * 8 + j - 1] * 3 + dct_s[(i - 1) * 8 + j] * 10 - + dct_s[(i + 1) * 8 + j] * 10 + dct_s[(i - 1) * 8 + j + 1] * 3 - + dct_s[(i + 1) * 8 + j + 1] * 3) / + (pix_max * 16.f); + g = sqrt(s_gx * s_gx + s_gy * s_gy); + if (g > 0.1f) n++; + s_gmean += g; - s_gvar *= 1 / 63.f * 64; - d_gvar *= 1 / 63.f * 64; - for (i = 0; i < 4; i++) s_vars[i] *= 1 / 15.f * 16; - for (i = 0; i < 4; i++) d_vars[i] *= 1 / 15.f * 16; - if (s_gvar > 0) - s_gvar = (s_vars[0] + s_vars[1] + s_vars[2] + s_vars[3]) / s_gvar; - if (d_gvar > 0) - d_gvar = (d_vars[0] + d_vars[1] + d_vars[2] + d_vars[3]) / d_gvar; + s_gvar = 1.f / (36 - n + 1) * s_gmean / 36.f;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vpx_dsp/psnrhvs.c
176
177
178
179
180
181
182
183
184
185
for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { int sub = ((i & 12) >> 2) + ((j & 12) >> 1); if (bit_depth == 8 && _shift == 0) { dct_s[i * 8 + j] = _src8[(y + i) * _systride + (j + x)]; dct_d[i * 8 + j] = _dst8[(y + i) * _dystride + (j + x)]; } else if (bit_depth == 10 || bit_depth == 12) { dct_s[i * 8 + j] = _src16[(y + i) * _systride + (j + x)] >> _shift; dct_d[i * 8 + j] = _dst16[(y + i) * _dystride + (j + x)] >> _shift; }
+ show +
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
s_gmean += dct_s[i * 8 + j]; d_gmean += dct_d[i * 8 + j]; s_means[sub] += dct_s[i * 8 + j]; d_means[sub] += dct_d[i * 8 + j]; } } s_gmean /= 64.f; d_gmean /= 64.f; for (i = 0; i < 4; i++) s_means[i] /= 16.f; for (i = 0; i < 4; i++) d_means[i] /= 16.f; for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { int sub = ((i & 12) >> 2) + ((j & 12) >> 1); s_gvar += (dct_s[i * 8 + j] - s_gmean) * (dct_s[i * 8 + j] - s_gmean); d_gvar += (dct_d[i * 8 + j] - d_gmean) * (dct_d[i * 8 + j] - d_gmean); s_vars[sub] += (dct_s[i * 8 + j] - s_means[sub]) * (dct_s[i * 8 + j] - s_means[sub]); d_vars[sub] += (dct_d[i * 8 + j] - d_means[sub]) * (dct_d[i * 8 + j] - d_means[sub]); } } s_gvar *= 1 / 63.f * 64; d_gvar *= 1 / 63.f * 64; for (i = 0; i < 4; i++) s_vars[i] *= 1 / 15.f * 16; for (i = 0; i < 4; i++) d_vars[i] *= 1 / 15.f * 16; if (s_gvar > 0) s_gvar = (s_vars[0] + s_vars[1] + s_vars[2] + s_vars[3]) / s_gvar; if (d_gvar > 0) d_gvar = (d_vars[0] + d_vars[1] + d_vars[2] + d_vars[3]) / d_gvar;
+ show +
215
216
217
218
219
220
221
222
223
224
#if CONFIG_VP9_HIGHBITDEPTH if (bit_depth == 10 || bit_depth == 12) { hbd_od_bin_fdct8x8(dct_s_coef, 8, dct_s, 8); hbd_od_bin_fdct8x8(dct_d_coef, 8, dct_d, 8); } #endif if (bit_depth == 8) { od_bin_fdct8x8(dct_s_coef, 8, dct_s, 8); od_bin_fdct8x8(dct_d_coef, 8, dct_d, 8); }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/psnrhvs.c
172
173
174
175
176
177
178
179
180
181
for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { int sub = ((i & 12) >> 2) + ((j & 12) >> 1); if (!buf_is_hbd) { dct_s[i * 8 + j] = _src8[(y + i) * _systride + (j + x)]; dct_d[i * 8 + j] = _dst8[(y + i) * _dystride + (j + x)]; } else { dct_s[i * 8 + j] = _src16[(y + i) * _systride + (j + x)] >> _shift; dct_d[i * 8 + j] = _dst16[(y + i) * _dystride + (j + x)] >> _shift; }
+ show +
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
s_gmean += dct_s[i * 8 + j]; d_gmean += dct_d[i * 8 + j]; s_means[sub] += dct_s[i * 8 + j]; d_means[sub] += dct_d[i * 8 + j]; } } s_gmean /= 64.f; d_gmean /= 64.f; for (i = 0; i < 4; i++) s_means[i] /= 16.f; for (i = 0; i < 4; i++) d_means[i] /= 16.f; for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { int sub = ((i & 12) >> 2) + ((j & 12) >> 1); s_gvar += (dct_s[i * 8 + j] - s_gmean) * (dct_s[i * 8 + j] - s_gmean); d_gvar += (dct_d[i * 8 + j] - d_gmean) * (dct_d[i * 8 + j] - d_gmean); s_vars[sub] += (dct_s[i * 8 + j] - s_means[sub]) * (dct_s[i * 8 + j] - s_means[sub]); d_vars[sub] += (dct_d[i * 8 + j] - d_means[sub]) * (dct_d[i * 8 + j] - d_means[sub]); } } s_gvar *= 1 / 63.f * 64; d_gvar *= 1 / 63.f * 64; for (i = 0; i < 4; i++) s_vars[i] *= 1 / 15.f * 16; for (i = 0; i < 4; i++) d_vars[i] *= 1 / 15.f * 16; if (s_gvar > 0) s_gvar = (s_vars[0] + s_vars[1] + s_vars[2] + s_vars[3]) / s_gvar; if (d_gvar > 0) d_gvar = (d_vars[0] + d_vars[1] + d_vars[2] + d_vars[3]) / d_gvar;
+ show +
211
212
213
214
215
216
217
218
219
220
if (!buf_is_hbd) { od_bin_fdct8x8(dct_s_coef, 8, dct_s, 8); od_bin_fdct8x8(dct_d_coef, 8, dct_d, 8); } else { hbd_od_bin_fdct8x8(dct_s_coef, 8, dct_s, 8); hbd_od_bin_fdct8x8(dct_d_coef, 8, dct_d, 8); } for (i = 0; i < 8; i++) for (j = (i == 0); j < 8; j++) s_mask += dct_s_coef[i * 8 + j] * dct_s_coef[i * 8 + j] * mask[i][j];

[CVE-2020-0470_1.diff] psnrhvs.c #7
- for (i = 0; i < 8; i++) - for (j = (i == 0); j < 8; j++) - d_mask += dct_d_coef[i * 8 + j] * dct_d_coef[i * 8 + j] * mask[i][j]; - s_mask = sqrt(s_mask * s_gvar) / 32.f; - d_mask = sqrt(d_mask * d_gvar) / 32.f; - if (d_mask > s_mask) s_mask = d_mask; + s_mask = sqrt(s_mask * s_gvar) / 8.f;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vpx_dsp/psnrhvs.c
218
219
220
221
222
223
224
225
226
227
hbd_od_bin_fdct8x8(dct_d_coef, 8, dct_d, 8); } #endif if (bit_depth == 8) { od_bin_fdct8x8(dct_s_coef, 8, dct_s, 8); od_bin_fdct8x8(dct_d_coef, 8, dct_d, 8); } for (i = 0; i < 8; i++) for (j = (i == 0); j < 8; j++) s_mask += dct_s_coef[i * 8 + j] * dct_s_coef[i * 8 + j] * mask[i][j];
+ show +
228
229
230
231
232
233
for (i = 0; i < 8; i++) for (j = (i == 0); j < 8; j++) d_mask += dct_d_coef[i * 8 + j] * dct_d_coef[i * 8 + j] * mask[i][j]; s_mask = sqrt(s_mask * s_gvar) / 32.f; d_mask = sqrt(d_mask * d_gvar) / 32.f; if (d_mask > s_mask) s_mask = d_mask;
+ show +
234
235
236
237
238
239
240
241
242
243
for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { double err; err = fabs((double)(dct_s_coef[i * 8 + j] - dct_d_coef[i * 8 + j])); if (i != 0 || j != 0) err = err < s_mask / mask[i][j] ? 0 : err - s_mask / mask[i][j]; ret += (err * _csf[i][j]) * (err * _csf[i][j]); pixels++; } }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/psnrhvs.c
211
212
213
214
215
216
217
218
219
220
if (!buf_is_hbd) { od_bin_fdct8x8(dct_s_coef, 8, dct_s, 8); od_bin_fdct8x8(dct_d_coef, 8, dct_d, 8); } else { hbd_od_bin_fdct8x8(dct_s_coef, 8, dct_s, 8); hbd_od_bin_fdct8x8(dct_d_coef, 8, dct_d, 8); } for (i = 0; i < 8; i++) for (j = (i == 0); j < 8; j++) s_mask += dct_s_coef[i * 8 + j] * dct_s_coef[i * 8 + j] * mask[i][j];
+ show +
221
222
223
224
225
226
for (i = 0; i < 8; i++) for (j = (i == 0); j < 8; j++) d_mask += dct_d_coef[i * 8 + j] * dct_d_coef[i * 8 + j] * mask[i][j]; s_mask = sqrt(s_mask * s_gvar) / 32.f; d_mask = sqrt(d_mask * d_gvar) / 32.f; if (d_mask > s_mask) s_mask = d_mask;
+ show +
227
228
229
230
231
232
233
234
235
236
for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { double err; err = fabs((double)(dct_s_coef[i * 8 + j] - dct_d_coef[i * 8 + j])); if (i != 0 || j != 0) err = err < s_mask / mask[i][j] ? 0 : err - s_mask / mask[i][j]; ret += (err * _csf[i][j]) * (err * _csf[i][j]); pixels++; } }

[CVE-2020-0478_1.diff] transpose_neon.h #3
- const int16x8x2_t d0 = vpx_vtrnq_s64_to_s16(c0.val[0], c2.val[0]); - const int16x8x2_t d1 = vpx_vtrnq_s64_to_s16(c1.val[0], c3.val[0]); - const int16x8x2_t d2 = vpx_vtrnq_s64_to_s16(c0.val[1], c2.val[1]); - const int16x8x2_t d3 = vpx_vtrnq_s64_to_s16(c1.val[1], c3.val[1]); + const int16x8x2_t d0 = aom_vtrnq_s64_to_s16(c0.val[0], c2.val[0]); + const int16x8x2_t d1 = aom_vtrnq_s64_to_s16(c1.val[0], c3.val[0]); + const int16x8x2_t d2 = aom_vtrnq_s64_to_s16(c0.val[1], c2.val[1]); + const int16x8x2_t d3 = aom_vtrnq_s64_to_s16(c1.val[1], c3.val[1]);
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vpx_dsp/arm/transpose_neon.h
617
618
619
620
621
622
623
624
625
626
// Swap 64 bit elements resulting in: // d0.val[0]: 00 10 20 30 40 50 60 70 // d0.val[1]: 04 14 24 34 44 54 64 74 // d1.val[0]: 01 11 21 31 41 51 61 71 // d1.val[1]: 05 15 25 35 45 55 65 75 // d2.val[0]: 02 12 22 32 42 52 62 72 // d2.val[1]: 06 16 26 36 46 56 66 76 // d3.val[0]: 03 13 23 33 43 53 63 73 // d3.val[1]: 07 17 27 37 47 57 67 77
+ show +
627
628
629
630
const int16x8x2_t d0 = vpx_vtrnq_s64_to_s16(c0.val[0], c2.val[0]); const int16x8x2_t d1 = vpx_vtrnq_s64_to_s16(c1.val[0], c3.val[0]); const int16x8x2_t d2 = vpx_vtrnq_s64_to_s16(c0.val[1], c2.val[1]); const int16x8x2_t d3 = vpx_vtrnq_s64_to_s16(c1.val[1], c3.val[1]);
+ show +
631
632
633
634
635
636
637
638
639
640
*a0 = d0.val[0]; *a1 = d1.val[0]; *a2 = d2.val[0]; *a3 = d3.val[0]; *a4 = d0.val[1]; *a5 = d1.val[1]; *a6 = d2.val[1]; *a7 = d3.val[1]; }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/transpose_neon.h
441
442
443
444
445
446
447
448
449
450
// Swap 64 bit elements resulting in: // d0.val[0]: 00 10 20 30 40 50 60 70 // d0.val[1]: 04 14 24 34 44 54 64 74 // d1.val[0]: 01 11 21 31 41 51 61 71 // d1.val[1]: 05 15 25 35 45 55 65 75 // d2.val[0]: 02 12 22 32 42 52 62 72 // d2.val[1]: 06 16 26 36 46 56 66 76 // d3.val[0]: 03 13 23 33 43 53 63 73 // d3.val[1]: 07 17 27 37 47 57 67 77
+ show +
451
452
453
454
const int16x8x2_t d0 = vpx_vtrnq_s64_to_s16(c0.val[0], c2.val[0]); const int16x8x2_t d1 = vpx_vtrnq_s64_to_s16(c1.val[0], c3.val[0]); const int16x8x2_t d2 = vpx_vtrnq_s64_to_s16(c0.val[1], c2.val[1]); const int16x8x2_t d3 = vpx_vtrnq_s64_to_s16(c1.val[1], c3.val[1]);
+ show +
455
456
457
458
459
460
461
462
463
464
*out = d0.val[0]; *(out + 1) = d1.val[0]; *(out + 2) = d2.val[0]; *(out + 3) = d3.val[0]; *(out + 4) = d0.val[1]; *(out + 5) = d1.val[1]; *(out + 6) = d2.val[1]; *(out + 7) = d3.val[1]; }

[CVE-2020-0470_1.diff] transpose_neon.h #3
- const int16x8x2_t d0 = vpx_vtrnq_s64_to_s16(c0.val[0], c2.val[0]); - const int16x8x2_t d1 = vpx_vtrnq_s64_to_s16(c1.val[0], c3.val[0]); - const int16x8x2_t d2 = vpx_vtrnq_s64_to_s16(c0.val[1], c2.val[1]); - const int16x8x2_t d3 = vpx_vtrnq_s64_to_s16(c1.val[1], c3.val[1]); + const int16x8x2_t d0 = aom_vtrnq_s64_to_s16(c0.val[0], c2.val[0]); + const int16x8x2_t d1 = aom_vtrnq_s64_to_s16(c1.val[0], c3.val[0]); + const int16x8x2_t d2 = aom_vtrnq_s64_to_s16(c0.val[1], c2.val[1]); + const int16x8x2_t d3 = aom_vtrnq_s64_to_s16(c1.val[1], c3.val[1]);
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vpx_dsp/arm/transpose_neon.h
617
618
619
620
621
622
623
624
625
626
// Swap 64 bit elements resulting in: // d0.val[0]: 00 10 20 30 40 50 60 70 // d0.val[1]: 04 14 24 34 44 54 64 74 // d1.val[0]: 01 11 21 31 41 51 61 71 // d1.val[1]: 05 15 25 35 45 55 65 75 // d2.val[0]: 02 12 22 32 42 52 62 72 // d2.val[1]: 06 16 26 36 46 56 66 76 // d3.val[0]: 03 13 23 33 43 53 63 73 // d3.val[1]: 07 17 27 37 47 57 67 77
+ show +
627
628
629
630
const int16x8x2_t d0 = vpx_vtrnq_s64_to_s16(c0.val[0], c2.val[0]); const int16x8x2_t d1 = vpx_vtrnq_s64_to_s16(c1.val[0], c3.val[0]); const int16x8x2_t d2 = vpx_vtrnq_s64_to_s16(c0.val[1], c2.val[1]); const int16x8x2_t d3 = vpx_vtrnq_s64_to_s16(c1.val[1], c3.val[1]);
+ show +
631
632
633
634
635
636
637
638
639
640
*a0 = d0.val[0]; *a1 = d1.val[0]; *a2 = d2.val[0]; *a3 = d3.val[0]; *a4 = d0.val[1]; *a5 = d1.val[1]; *a6 = d2.val[1]; *a7 = d3.val[1]; }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/transpose_neon.h
441
442
443
444
445
446
447
448
449
450
// Swap 64 bit elements resulting in: // d0.val[0]: 00 10 20 30 40 50 60 70 // d0.val[1]: 04 14 24 34 44 54 64 74 // d1.val[0]: 01 11 21 31 41 51 61 71 // d1.val[1]: 05 15 25 35 45 55 65 75 // d2.val[0]: 02 12 22 32 42 52 62 72 // d2.val[1]: 06 16 26 36 46 56 66 76 // d3.val[0]: 03 13 23 33 43 53 63 73 // d3.val[1]: 07 17 27 37 47 57 67 77
+ show +
451
452
453
454
const int16x8x2_t d0 = vpx_vtrnq_s64_to_s16(c0.val[0], c2.val[0]); const int16x8x2_t d1 = vpx_vtrnq_s64_to_s16(c1.val[0], c3.val[0]); const int16x8x2_t d2 = vpx_vtrnq_s64_to_s16(c0.val[1], c2.val[1]); const int16x8x2_t d3 = vpx_vtrnq_s64_to_s16(c1.val[1], c3.val[1]);
+ show +
455
456
457
458
459
460
461
462
463
464
*out = d0.val[0]; *(out + 1) = d1.val[0]; *(out + 2) = d2.val[0]; *(out + 3) = d3.val[0]; *(out + 4) = d0.val[1]; *(out + 5) = d1.val[1]; *(out + 6) = d2.val[1]; *(out + 7) = d3.val[1]; }

[CVE-2020-0478_1.diff] adaptive_quantize_sse2.c #14
- - eob0 = scan_for_eob(&qcoeff0, &qcoeff1, cmp_mask0, cmp_mask1, iscan, index, - zero); - eob = _mm_max_epi16(eob, eob0); + if (is_found0) non_zero_count = calculate_non_zero_count(mask0); + if (is_found1) + non_zero_count_prescan_add_zero = calculate_non_zero_count(mask1); - *eob_ptr = accumulate_eob(eob); + for (int i = non_zero_count_prescan_add_zero - 1; i >= non_zero_count; i--) { + const int rc = scan[i]; + qcoeff_ptr[rc] = 0; + dqcoeff_ptr[rc] = 0; + } + for (int i = non_zero_count - 1; i >= 0; i--) { + const int rc = scan[i]; + if (qcoeff_ptr[rc]) { + eob = i; + break; + } + } + + *eob_ptr = eob + 1;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vpx_dsp/x86/quantize_avx.c
129
130
131
132
133
134
135
136
137
138
qcoeff0 = _mm_and_si128(qcoeff0, cmp_mask0); qcoeff1 = _mm_and_si128(qcoeff1, cmp_mask1); store_tran_low(qcoeff0, qcoeff_ptr + index); store_tran_low(qcoeff1, qcoeff_ptr + index + 8); calculate_dqcoeff_and_store(qcoeff0, dequant, dqcoeff_ptr + index); calculate_dqcoeff_and_store(qcoeff1, dequant, dqcoeff_ptr + index + 8);
+ show +
139
140
141
142
143
144
eob0 = scan_for_eob(&qcoeff0, &qcoeff1, cmp_mask0, cmp_mask1, iscan, index, zero); eob = _mm_max_epi16(eob, eob0); } *eob_ptr = accumulate_eob(eob);
+ show +
145
146
147
148
149
150
151
152
153
154
} void vpx_quantize_b_32x32_avx(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) {

[CVE-2020-0470_1.diff] adaptive_quantize_sse2.c #14
- - eob0 = scan_for_eob(&qcoeff0, &qcoeff1, cmp_mask0, cmp_mask1, iscan, index, - zero); - eob = _mm_max_epi16(eob, eob0); + if (is_found0) non_zero_count = calculate_non_zero_count(mask0); + if (is_found1) + non_zero_count_prescan_add_zero = calculate_non_zero_count(mask1); - *eob_ptr = accumulate_eob(eob); + for (int i = non_zero_count_prescan_add_zero - 1; i >= non_zero_count; i--) { + const int rc = scan[i]; + qcoeff_ptr[rc] = 0; + dqcoeff_ptr[rc] = 0; + } + for (int i = non_zero_count - 1; i >= 0; i--) { + const int rc = scan[i]; + if (qcoeff_ptr[rc]) { + eob = i; + break; + } + } + + *eob_ptr = eob + 1;
/media/esteban/ACOS/ResurrectionX/external/libvpx/libvpx/vpx_dsp/x86/quantize_avx.c
129
130
131
132
133
134
135
136
137
138
qcoeff0 = _mm_and_si128(qcoeff0, cmp_mask0); qcoeff1 = _mm_and_si128(qcoeff1, cmp_mask1); store_tran_low(qcoeff0, qcoeff_ptr + index); store_tran_low(qcoeff1, qcoeff_ptr + index + 8); calculate_dqcoeff_and_store(qcoeff0, dequant, dqcoeff_ptr + index); calculate_dqcoeff_and_store(qcoeff1, dequant, dqcoeff_ptr + index + 8);
+ show +
139
140
141
142
143
144
eob0 = scan_for_eob(&qcoeff0, &qcoeff1, cmp_mask0, cmp_mask1, iscan, index, zero); eob = _mm_max_epi16(eob, eob0); } *eob_ptr = accumulate_eob(eob);
+ show +
145
146
147
148
149
150
151
152
153
154
} void vpx_quantize_b_32x32_avx(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) {

[CVE-2023-40093_1.diff] BUILD.gn #7
+ testonly = true + defines = [] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ - "//build/config/compiler:no_chromium_code", - ":fuzzer_config", - ] + configs += [ ":fuzzer_config" ]
/media/esteban/ACOS/ResurrectionX/external/deqp-deps/SPIRV-Tools/test/fuzzers/BUILD.gn
48
49
50
51
52
53
54
55
56
57
sources = invoker.sources deps = [ "../..:spvtools", "../..:spvtools_opt", "../..:spvtools_val", ] if (defined(invoker.deps)) { deps += invoker.deps }
+ show +
58
59
60
61
62
configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code", ":fuzzer_config", ]
+ show +
63
64
65
66
67
68
69
70
71
72
} } spvtools_fuzzer("spvtools_binary_parser_fuzzer_src") { sources = [ "spvtools_binary_parser_fuzzer.cpp", ] } spvtools_fuzzer("spvtools_opt_performance_fuzzer_src") {
/media/esteban/ACOS/ResurrectionX/external/swiftshader/third_party/SPIRV-Tools/test/fuzzers/BUILD.gn
48
49
50
51
52
53
54
55
56
57
sources = invoker.sources deps = [ "../..:spvtools", "../..:spvtools_opt", "../..:spvtools_val", ] if (defined(invoker.deps)) { deps += invoker.deps }
+ show +
58
59
60
61
62
configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code", ":fuzzer_config", ]
+ show +
63
64
65
66
67
68
69
70
71
72
} } spvtools_fuzzer("spvtools_binary_parser_fuzzer_src") { sources = [ "spvtools_binary_parser_fuzzer.cpp", ] } spvtools_fuzzer("spvtools_opt_performance_fuzzer_src") {

[CVE-2017-13197_1.diff] ihevcd_parse_slice.c #1
- if((1 == ps_slice_hdr->i1_dependent_slice_flag) && (!((ps_codec->s_parse.i4_ctb_tile_x == 0) && (ps_codec->s_parse.i4_ctb_tile_y == 0)))) + if(0 == ps_codec->i4_slice_error) - if((0 == ps_pps->i1_entropy_coding_sync_enabled_flag) || (ps_pps->i1_entropy_coding_sync_enabled_flag && (0 != ps_codec->s_parse.i4_ctb_x))) + if((1 == ps_slice_hdr->i1_dependent_slice_flag) && (!((ps_codec->s_parse.i4_ctb_tile_x == 0) && (ps_codec->s_parse.i4_ctb_tile_y == 0)))) - ihevcd_cabac_reset(&ps_codec->s_parse.s_cabac, - &ps_codec->s_parse.s_bitstrm); + if((0 == ps_pps->i1_entropy_coding_sync_enabled_flag) || (ps_pps->i1_entropy_coding_sync_enabled_flag && (0 != ps_codec->s_parse.i4_ctb_x))) + { + ihevcd_cabac_reset(&ps_codec->s_parse.s_cabac, + &ps_codec->s_parse.s_bitstrm); + } - } - else if((0 == ps_pps->i1_entropy_coding_sync_enabled_flag) || (ps_pps->i1_entropy_coding_sync_enabled_flag && (0 != ps_codec->s_parse.i4_ctb_x))) - { - ret = ihevcd_cabac_init(&ps_codec->s_parse.s_cabac, - &ps_codec->s_parse.s_bitstrm, - slice_qp, - cabac_init_idc, - &gau1_ihevc_cab_ctxts[cabac_init_idc][slice_qp][0]); - if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS) + else if((0 == ps_pps->i1_entropy_coding_sync_enabled_flag) || (ps_pps->i1_entropy_coding_sync_enabled_flag && (0 != ps_codec->s_parse.i4_ctb_x))) - ps_codec->i4_slice_error = 1; - end_of_slice_flag = 1; - ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS; + ret = ihevcd_cabac_init(&ps_codec->s_parse.s_cabac, + &ps_codec->s_parse.s_bitstrm, + slice_qp, + cabac_init_idc, + &gau1_ihevc_cab_ctxts[cabac_init_idc][slice_qp][0]); + if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS) + { + ps_codec->i4_slice_error = 1; + end_of_slice_flag = 1; + ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS; + }
/media/esteban/ACOS/ResurrectionX/external/libhevc/decoder/ihevcd_parse_slice.c
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
if((0 == ps_slice_hdr->i1_dependent_slice_flag) || ((1 == ps_slice_hdr->i1_dependent_slice_flag) && ((0 == ps_codec->s_parse.i4_ctb_tile_x) && (0 == ps_codec->s_parse.i4_ctb_tile_y)))) { ps_codec->s_parse.u4_qp = slice_qp; } /*Cabac init at the beginning of a slice*/ //If the slice is a dependent slice, not present at the start of a tile if(0 == ps_codec->i4_slice_error) {
+ show +
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
if((1 == ps_slice_hdr->i1_dependent_slice_flag) && (!((ps_codec->s_parse.i4_ctb_tile_x == 0) && (ps_codec->s_parse.i4_ctb_tile_y == 0)))) { if((0 == ps_pps->i1_entropy_coding_sync_enabled_flag) || (ps_pps->i1_entropy_coding_sync_enabled_flag && (0 != ps_codec->s_parse.i4_ctb_x))) { ihevcd_cabac_reset(&ps_codec->s_parse.s_cabac, &ps_codec->s_parse.s_bitstrm); } } else if((0 == ps_pps->i1_entropy_coding_sync_enabled_flag) || (ps_pps->i1_entropy_coding_sync_enabled_flag && (0 != ps_codec->s_parse.i4_ctb_x))) { ret = ihevcd_cabac_init(&ps_codec->s_parse.s_cabac, &ps_codec->s_parse.s_bitstrm, slice_qp, cabac_init_idc, &gau1_ihevc_cab_ctxts[cabac_init_idc][slice_qp][0]); if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS) { ps_codec->i4_slice_error = 1; end_of_slice_flag = 1; ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
+ show +
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
} } } do { { WORD32 cur_ctb_idx = ps_codec->s_parse.i4_ctb_x

[CVE-2023-40093_1.diff] template_util.h #2
-// Implementation detail of base::void_t below. -template <typename...> -struct make_void { - using type = void; -}; - -} // namespace internal - -// base::void_t is an implementation of std::void_t from C++17. -// -// We use |base::internal::make_void| as a helper struct to avoid a C++14 -// defect: -// http://en.cppreference.com/w/cpp/types/void_t -// http://open-std.org/JTC1/SC22/WG21/docs/cwg_defects.html#1558 -template <typename... Ts> -using void_t = typename ::base::internal::make_void<Ts...>::type; - -namespace internal { -
/media/esteban/ACOS/ResurrectionX/external/libchrome/base/template_util.h
38
39
40
41
42
43
44
45
46
47
namespace base { template <class T> struct is_non_const_reference : std::false_type {}; template <class T> struct is_non_const_reference<T&> : std::true_type {}; template <class T> struct is_non_const_reference<const T&> : std::false_type {}; namespace internal { // Implementation detail of base::void_t below.
+ show +
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
template <typename...> struct make_void { using type = void; }; } // namespace internal // base::void_t is an implementation of std::void_t from C++17. // // We use |base::internal::make_void| as a helper struct to avoid a C++14 // defect: // http://en.cppreference.com/w/cpp/types/void_t // http://open-std.org/JTC1/SC22/WG21/docs/cwg_defects.html#1558 template <typename... Ts> using void_t = typename ::base::internal::make_void<Ts...>::type; namespace internal {
+ show +
65
66
67
68
69
70
71
72
73
74
// Uses expression SFINAE to detect whether using operator<< would work. template <typename T, typename = void> struct SupportsOstreamOperator : std::false_type {}; template <typename T> struct SupportsOstreamOperator<T, decltype(void(std::declval<std::ostream&>() << std::declval<T>()))> : std::true_type {};

[CVE-2023-40093_1.diff] safe_conversions.h #15
-using internal::strict_cast; -using internal::saturated_cast; -using internal::SafeUnsignedAbs; -using internal::StrictNumeric; -using internal::MakeStrictNum; -using internal::IsValueInRangeForNumericType; +using internal::IsValueInRangeForNumericType; +using internal::MakeStrictNum; +using internal::SafeUnsignedAbs; +using internal::saturated_cast; +using internal::strict_cast; +using internal::StrictNumeric; +// floating -> integral conversions that saturate and thus can actually return +// an integral type. In most cases, these should be preferred over the std:: +// versions. +template <typename Dst = int, + typename Src, + typename = std::enable_if_t<std::is_integral<Dst>::value && + std::is_floating_point<Src>::value>> +Dst ClampFloor(Src value) { + return saturated_cast<Dst>(std::floor(value)); +} +template <typename Dst = int, + typename Src, + typename = std::enable_if_t<std::is_integral<Dst>::value && + std::is_floating_point<Src>::value>> +Dst ClampCeil(Src value) { + return saturated_cast<Dst>(std::ceil(value)); +} +template <typename Dst = int, + typename Src, + typename = std::enable_if_t<std::is_integral<Dst>::value && + std::is_floating_point<Src>::value>> +Dst ClampRound(Src value) { + const Src rounded = + (value >= 0.0f) ? std::floor(value + 0.5f) : std::ceil(value - 0.5f); + return saturated_cast<Dst>(rounded); +} +
/media/esteban/ACOS/ResurrectionX/external/libchrome/base/numerics/safe_conversions.h
320
321
322
323
324
325
326
327
328
329
BASE_NUMERIC_COMPARISON_OPERATORS(Strict, IsGreater, >); BASE_NUMERIC_COMPARISON_OPERATORS(Strict, IsGreaterOrEqual, >=); BASE_NUMERIC_COMPARISON_OPERATORS(Strict, IsEqual, ==); BASE_NUMERIC_COMPARISON_OPERATORS(Strict, IsNotEqual, !=); }; // namespace internal using internal::as_signed; using internal::as_unsigned; using internal::checked_cast;
+ show +
330
331
332
333
334
335
using internal::strict_cast; using internal::saturated_cast; using internal::SafeUnsignedAbs; using internal::StrictNumeric; using internal::MakeStrictNum; using internal::IsValueInRangeForNumericType;
+ show +
336
337
338
339
340
341
342
343
344
using internal::IsTypeInRangeForNumericType; using internal::IsValueNegative; // Explicitly make a shorter size_t alias for convenience. using SizeT = StrictNumeric<size_t>; } // namespace base #endif // BASE_NUMERICS_SAFE_CONVERSIONS_H_

[CVE-2018-9527_1.diff] floor0.c #5
- ogg_int32_t *lsp,int m, - ogg_int32_t amp, - ogg_int32_t ampoffset, - ogg_int32_t nyq){ + ogg_int32_t *lsp,int m, + ogg_int32_t amp, + ogg_int32_t ampoffset, + ogg_int32_t nyq){
/media/esteban/ACOS/ResurrectionX/external/tremolo/Tremolo/floor0.c
137
138
139
140
141
142
143
144
145
146
static const unsigned char MLOOP_2[64]={ 0,4,5,5, 6,6,6,6, 7,7,7,7, 7,7,7,7, 8,8,8,8, 8,8,8,8, 8,8,8,8, 8,8,8,8, 9,9,9,9, 9,9,9,9, 9,9,9,9, 9,9,9,9, 9,9,9,9, 9,9,9,9, 9,9,9,9, 9,9,9,9, }; static const unsigned char MLOOP_3[8]={0,1,2,2,3,3,3,3}; void vorbis_lsp_to_curve(ogg_int32_t *curve,int n,int ln,
+ show +
147
148
149
150
ogg_int32_t *lsp,int m, ogg_int32_t amp, ogg_int32_t ampoffset, ogg_int32_t nyq){
+ show +
151
152
153
154
155
156
157
158
159
160
/* 0 <= m < 256 */ /* set up for using all int later */ int i; int ampoffseti=ampoffset*4096; int ampi=amp; ogg_int32_t *ilsp=(ogg_int32_t *)alloca(m*sizeof(*ilsp)); ogg_uint32_t inyq= (1UL<<31) / toBARK(nyq);

[CVE-2017-0814_1.diff] codebook.c #4
- ogg_uint32_t entry=marker[length]; - long chase=0; - if(count && !entry)return -1; /* overpopulated tree! */ + ogg_uint32_t entry=marker[length]; + long chase=0; + if(count && !entry)return -1; /* overpopulated tree! */ - /* chase the tree as far as it's already populated, fill in past */ - for(j=0;j<length-1;j++){ - int bit=(entry>>(length-j-1))&1; - if(chase>=top){ - if (chase < 0 || chase >= n) return 1; - top++; - r[chase*2]=top; - r[chase*2+1]=0; - }else - if (chase < 0 || chase >= n || chase*2+bit > n*2+1) return 1; - if(!r[chase*2+bit]) - r[chase*2+bit]=top; - chase=r[chase*2+bit]; - if (chase < 0 || chase >= n) return 1; - } - { - int bit=(entry>>(length-j-1))&1; - if(chase>=top){ - top++; - r[chase*2+1]=0; - } - r[chase*2+bit]= decpack(i,count++,quantvals,b,opb,maptype) | - 0x80000000; - } + /* chase the tree as far as it's already populated, fill in past */ + for(j=0;j<length-1;j++){ + int bit=(entry>>(length-j-1))&1; + if(chase>=top){ + if (chase < 0 || chase >= n) return 1; + top++; + r[chase*2]=top; + r[chase*2+1]=0; + }else + if (chase < 0 || chase >= n || chase*2+bit > n*2+1) return 1; + if(!r[chase*2+bit]) + r[chase*2+bit]=top; + chase=r[chase*2+bit]; + if (chase < 0 || chase >= n) return 1; + } + { + int bit=(entry>>(length-j-1))&1; + if(chase>=top){ + top++; + r[chase*2+1]=0; + } + r[chase*2+bit]= decpack(i,count++,quantvals,b,opb,maptype) | + 0x80000000; + } - /* Look to see if the next shorter marker points to the node - above. if so, update it and repeat. */ - for(j=length;j>0;j--){ - if(marker[j]&1){ - marker[j]=marker[j-1]<<1; - break; - } - marker[j]++; - } + /* Look to see if the next shorter marker points to the node + above. if so, update it and repeat. */ + for(j=length;j>0;j--){ + if(marker[j]&1){ + marker[j]=marker[j-1]<<1; + break; + } + marker[j]++; + } - /* prune the tree; the implicit invariant says all the longer - markers were dangling from our just-taken node. Dangle them - from our *new* node. */ - for(j=length+1;j<MARKER_SIZE;j++) - if((marker[j]>>1) == entry){ - entry=marker[j]; - marker[j]=marker[j-1]<<1; - }else - break; + /* prune the tree; the implicit invariant says all the longer + markers were dangling from our just-taken node. Dangle them + from our *new* node. */ + for(j=length+1;j<MARKER_SIZE;j++) + if((marker[j]>>1) == entry){ + entry=marker[j]; + marker[j]=marker[j-1]<<1; + }else + break;
/media/esteban/ACOS/ResurrectionX/external/tremolo/Tremolo/codebook.c
157
158
159
160
161
162
163
164
165
166
}else{ memset(marker,0,sizeof(marker)); for(i=0;i<n;i++){ long length=l[i]; if(length){ if (length < 0 || length >= MARKER_SIZE) { ALOGE("b/23881715"); return 1; }
+ show +
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
ogg_uint32_t entry=marker[length]; long chase=0; if(count && !entry)return -1; /* overpopulated tree! */ /* chase the tree as far as it's already populated, fill in past */ for(j=0;j<length-1;j++){ int bit=(entry>>(length-j-1))&1; if(chase>=top){ if (chase < 0 || chase >= n) return 1; top++; r[chase*2]=top; r[chase*2+1]=0; }else if (chase < 0 || chase >= n || chase*2+bit > n*2+1) return 1; if(!r[chase*2+bit]) r[chase*2+bit]=top; chase=r[chase*2+bit]; if (chase < 0 || chase >= n) return 1; } { int bit=(entry>>(length-j-1))&1; if(chase>=top){ top++; r[chase*2+1]=0; } r[chase*2+bit]= decpack(i,count++,quantvals,b,opb,maptype) | 0x80000000; } /* Look to see if the next shorter marker points to the node above. if so, update it and repeat. */ for(j=length;j>0;j--){ if(marker[j]&1){ marker[j]=marker[j-1]<<1; break; } marker[j]++; } /* prune the tree; the implicit invariant says all the longer markers were dangling from our just-taken node. Dangle them from our *new* node. */ for(j=length+1;j<MARKER_SIZE;j++) if((marker[j]>>1) == entry){ entry=marker[j]; marker[j]=marker[j-1]<<1; }else break;
+ show +
215
216
217
218
219
220
221
222
223
224
} } } // following sanity check copied from libvorbis /* sanity check the huffman tree; an underpopulated tree must be rejected. The only exception is the one-node pseudo-nil tree, which appears to be underpopulated because the tree doesn't really exist; there's only one possible 'codeword' or zero bits, but the above tree-gen code doesn't mark that. */

[CVE-2017-0814_1.diff] codebook.c #10
- long num=oggpack_read(opb,_ilog(s->entries-i)); - if(num<0)goto _eofout; - for(j=0;j<num && i<s->entries;j++,i++) - lengthlist[i]=(char)length; - s->dec_maxlength=length; - length++; + long num=oggpack_read(opb,_ilog(s->entries-i)); + if(num<0)goto _eofout; + for(j=0;j<num && i<s->entries;j++,i++) + lengthlist[i]=(char)length; + s->dec_maxlength=length; + length++;
/media/esteban/ACOS/ResurrectionX/external/tremolo/Tremolo/codebook.c
467
468
469
470
471
472
473
474
475
476
case 1: /* ordered */ { long length=oggpack_read(opb,5)+1; s->used_entries=s->entries; lengthlist=(char *)calloc(s->entries, sizeof(*lengthlist)); if (!lengthlist) goto _eofout; for(i=0;i<s->entries;){
+ show +
477
478
479
480
481
482
long num=oggpack_read(opb,_ilog(s->entries-i)); if(num<0)goto _eofout; for(j=0;j<num && i<s->entries;j++,i++) lengthlist[i]=(char)length; s->dec_maxlength=length; length++;
+ show +
483
484
485
486
487
488
489
490
491
492
} } break; default: /* EOF */ goto _eofout; } /* Do we have a mapping to unpack? */

[CVE-2017-0814_1.diff] codebook.c #15
- int bit=(lok>>i)&1; - int next=t[chase+bit]; - if(next&0x80){ - chase= (next<<8) | t[chase+bit+1+(!bit || t[chase]&0x80)]; - break; - } - chase=next; + int bit=(lok>>i)&1; + int next=t[chase+bit]; + if(next&0x80){ + chase= (next<<8) | t[chase+bit+1+(!bit || t[chase]&0x80)]; + break; + } + chase=next;
/media/esteban/ACOS/ResurrectionX/external/tremolo/Tremolo/codebook.c
681
682
683
684
685
686
687
688
689
690
} chase&=0x7fUL; break; } case 1: { /* book->dec_nodeb==1, book->dec_leafw!=1 */ /* 8/16 - Used by infile2 */ unsigned char *t=(unsigned char *)book->dec_table; for(i=0;i<read;i++){
+ show +
691
692
693
694
695
696
697
int bit=(lok>>i)&1; int next=t[chase+bit]; if(next&0x80){ chase= (next<<8) | t[chase+bit+1+(!bit || t[chase]&0x80)]; break; } chase=next;
+ show +
698
699
700
701
702
703
704
705
706
707
} //chase&=0x7fffUL; chase&=~0x8000UL; break; } case 2: { /* book->dec_nodeb==2, book->dec_leafw==1 */ /* 16/16 - Used */ for(i=0;i<read;i++){

[CVE-2017-0814_1.diff] codebook.c #17
- int bit=(lok>>i)&1; - int next=t[chase+bit]; - if(next&0x8000){ - chase= (next<<16) | t[chase+bit+1+(!bit || t[chase]&0x8000)]; - break; - } - chase=next; + int bit=(lok>>i)&1; + int next=t[chase+bit]; + if(next&0x8000){ + chase= (next<<16) | t[chase+bit+1+(!bit || t[chase]&0x8000)]; + break; + } + chase=next;
/media/esteban/ACOS/ResurrectionX/external/tremolo/Tremolo/codebook.c
711
712
713
714
715
716
717
718
719
720
//chase&=0x7fffUL; chase&=~0x8000UL; break; } case 3: { /* book->dec_nodeb==2, book->dec_leafw!=1 */ /* 16/32 - Used by infile2 */ ogg_uint16_t *t=(ogg_uint16_t *)book->dec_table; for(i=0;i<read;i++){
+ show +
721
722
723
724
725
726
727
int bit=(lok>>i)&1; int next=t[chase+bit]; if(next&0x8000){ chase= (next<<16) | t[chase+bit+1+(!bit || t[chase]&0x8000)]; break; } chase=next;
+ show +
728
729
730
731
732
733
734
735
736
737
} //chase&=0x7fffffffUL; chase&=~0x80000000UL; break; } case 4: { //Output("32/32"); for(i=0;i<read;i++){ chase=((ogg_uint32_t *)(book->dec_table))[chase*2+((lok>>i)&1)];

[CVE-2021-1002_1.diff] eas_wtengine.c #3
+ EAS_I32 nextSamplePhaseInc; + - acc0 = phaseFrac >> NUM_PHASE_FRAC_BITS; + nextSamplePhaseInc = phaseFrac >> NUM_PHASE_FRAC_BITS; - if (acc0 > 0) { - + if (nextSamplePhaseInc > 0) { - pSamples += acc0; - phaseFrac = (EAS_I32)((EAS_U32)phaseFrac & PHASE_FRAC_MASK); + pSamples += nextSamplePhaseInc; + phaseFrac = phaseFrac & PHASE_FRAC_MASK; - /* check for loop end */ - acc0 = (EAS_I32) (pSamples - loopEnd); - if (acc0 >= 0) - pSamples = (const EAS_SAMPLE*) pWTVoice->loopStart + acc0; + /* decrementing pSamples by entire buffer length until second pSample is within */ + /* loopEnd */ + while (&pSamples[1] >= loopEnd) { + pSamples -= (loopEnd - (const EAS_SAMPLE*)pWTVoice->loopStart); + }
/media/esteban/ACOS/ResurrectionX/external/sonivox/arm-wt-22k/lib_src/eas_wtengine.c
222
223
224
225
226
227
228
229
230
231
/*lint -e{704} <avoid divide>*/ acc0 = samp1 + (acc0 >> NUM_PHASE_FRAC_BITS); /* save new output sample in buffer */ /*lint -e{704} <avoid divide>*/ *pOutputBuffer++ = (EAS_I16)(acc0 >> 2); /* increment phase */ phaseFrac += phaseInc; /*lint -e{704} <avoid divide>*/
+ show +
232
233
234
235
236
237
238
239
240
241
242
243
244
acc0 = phaseFrac >> NUM_PHASE_FRAC_BITS; /* next sample */ if (acc0 > 0) { /* advance sample pointer */ pSamples += acc0; phaseFrac = (EAS_I32)((EAS_U32)phaseFrac & PHASE_FRAC_MASK); /* check for loop end */ acc0 = (EAS_I32) (pSamples - loopEnd); if (acc0 >= 0) pSamples = (const EAS_SAMPLE*) pWTVoice->loopStart + acc0;
+ show +
245
246
247
248
249
250
251
252
253
254
/* fetch new samples */ #if defined(_8_BIT_SAMPLES) /*lint -e{701} <avoid multiply for performance>*/ samp1 = pSamples[0] << 8; /*lint -e{701} <avoid multiply for performance>*/ samp2 = pSamples[1] << 8; #else samp1 = pSamples[0]; samp2 = pSamples[1];

[CVE-2018-9472_1.diff] xmlsave.c #1
- if ((cur->type == XML_ELEMENT_NODE) && - (cur->parent != NULL) && - (cur->parent->parent == (xmlNodePtr) cur->doc) && - xmlStrEqual(cur->name, BAD_CAST"head") && - xmlStrEqual(cur->parent->name, BAD_CAST"html")) { + if ((cur->type == XML_ELEMENT_NODE) && + (cur->parent != NULL) && + (cur->parent->parent == (xmlNodePtr) cur->doc) && + xmlStrEqual(cur->name, BAD_CAST"head") && + xmlStrEqual(cur->parent->name, BAD_CAST"html")) { - tmp = cur->children; - while (tmp != NULL) { - if (xmlStrEqual(tmp->name, BAD_CAST"meta")) { - xmlChar *httpequiv; + tmp = cur->children; + while (tmp != NULL) { + if (xmlStrEqual(tmp->name, BAD_CAST"meta")) { + xmlChar *httpequiv; - httpequiv = xmlGetProp(tmp, BAD_CAST"http-equiv"); - if (httpequiv != NULL) { - if (xmlStrcasecmp(httpequiv, BAD_CAST"Content-Type") == 0) { - xmlFree(httpequiv); - break; - } - xmlFree(httpequiv); - } - } - tmp = tmp->next; - } - if (tmp == NULL) - addmeta = 1; - } + httpequiv = xmlGetProp(tmp, BAD_CAST"http-equiv"); + if (httpequiv != NULL) { + if (xmlStrcasecmp(httpequiv, BAD_CAST"Content-Type") == 0) { + xmlFree(httpequiv); + break; + } + xmlFree(httpequiv); + } + } + tmp = tmp->next; + } + if (tmp == NULL) + addmeta = 1; + }
/media/esteban/ACOS/ResurrectionX/external/libxml2/xmlsave.c
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
(cur->ns == NULL) && (cur->nsDef == NULL))) { /* * 3.1.1. Strictly Conforming Documents A.3.1.1 3/ */ xmlOutputBufferWriteString(buf, " xmlns=\"http://www.w3.org/1999/xhtml\""); } if (cur->properties != NULL) xhtmlAttrListDumpOutput(ctxt, cur->properties);
+ show +
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
if ((cur->type == XML_ELEMENT_NODE) && (cur->parent != NULL) && (cur->parent->parent == (xmlNodePtr) cur->doc) && xmlStrEqual(cur->name, BAD_CAST"head") && xmlStrEqual(cur->parent->name, BAD_CAST"html")) { tmp = cur->children; while (tmp != NULL) { if (xmlStrEqual(tmp->name, BAD_CAST"meta")) { xmlChar *httpequiv; httpequiv = xmlGetProp(tmp, BAD_CAST"http-equiv"); if (httpequiv != NULL) { if (xmlStrcasecmp(httpequiv, BAD_CAST"Content-Type") == 0) { xmlFree(httpequiv); break; } xmlFree(httpequiv); } } tmp = tmp->next; } if (tmp == NULL) addmeta = 1;
+ show +
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
} if ((cur->type == XML_ELEMENT_NODE) && (cur->children == NULL)) { if (((cur->ns == NULL) || (cur->ns->prefix == NULL)) && ((xhtmlIsEmpty(cur) == 1) && (addmeta == 0))) { /* * C.2. Empty Elements */ xmlOutputBufferWrite(buf, 3, " />"); } else {

[CVE-2018-9466_1.diff] xmlsave.c #1
- if ((cur->type == XML_ELEMENT_NODE) && - (cur->parent != NULL) && - (cur->parent->parent == (xmlNodePtr) cur->doc) && - xmlStrEqual(cur->name, BAD_CAST"head") && - xmlStrEqual(cur->parent->name, BAD_CAST"html")) { + if ((cur->type == XML_ELEMENT_NODE) && + (cur->parent != NULL) && + (cur->parent->parent == (xmlNodePtr) cur->doc) && + xmlStrEqual(cur->name, BAD_CAST"head") && + xmlStrEqual(cur->parent->name, BAD_CAST"html")) { - tmp = cur->children; - while (tmp != NULL) { - if (xmlStrEqual(tmp->name, BAD_CAST"meta")) { - xmlChar *httpequiv; + tmp = cur->children; + while (tmp != NULL) { + if (xmlStrEqual(tmp->name, BAD_CAST"meta")) { + xmlChar *httpequiv; - httpequiv = xmlGetProp(tmp, BAD_CAST"http-equiv"); - if (httpequiv != NULL) { - if (xmlStrcasecmp(httpequiv, BAD_CAST"Content-Type") == 0) { - xmlFree(httpequiv); - break; - } - xmlFree(httpequiv); - } - } - tmp = tmp->next; - } - if (tmp == NULL) - addmeta = 1; - } + httpequiv = xmlGetProp(tmp, BAD_CAST"http-equiv"); + if (httpequiv != NULL) { + if (xmlStrcasecmp(httpequiv, BAD_CAST"Content-Type") == 0) { + xmlFree(httpequiv); + break; + } + xmlFree(httpequiv); + } + } + tmp = tmp->next; + } + if (tmp == NULL) + addmeta = 1; + }
/media/esteban/ACOS/ResurrectionX/external/libxml2/xmlsave.c
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
(cur->ns == NULL) && (cur->nsDef == NULL))) { /* * 3.1.1. Strictly Conforming Documents A.3.1.1 3/ */ xmlOutputBufferWriteString(buf, " xmlns=\"http://www.w3.org/1999/xhtml\""); } if (cur->properties != NULL) xhtmlAttrListDumpOutput(ctxt, cur->properties);
+ show +
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
if ((cur->type == XML_ELEMENT_NODE) && (cur->parent != NULL) && (cur->parent->parent == (xmlNodePtr) cur->doc) && xmlStrEqual(cur->name, BAD_CAST"head") && xmlStrEqual(cur->parent->name, BAD_CAST"html")) { tmp = cur->children; while (tmp != NULL) { if (xmlStrEqual(tmp->name, BAD_CAST"meta")) { xmlChar *httpequiv; httpequiv = xmlGetProp(tmp, BAD_CAST"http-equiv"); if (httpequiv != NULL) { if (xmlStrcasecmp(httpequiv, BAD_CAST"Content-Type") == 0) { xmlFree(httpequiv); break; } xmlFree(httpequiv); } } tmp = tmp->next; } if (tmp == NULL) addmeta = 1;
+ show +
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
} if ((cur->type == XML_ELEMENT_NODE) && (cur->children == NULL)) { if (((cur->ns == NULL) || (cur->ns->prefix == NULL)) && ((xhtmlIsEmpty(cur) == 1) && (addmeta == 0))) { /* * C.2. Empty Elements */ xmlOutputBufferWrite(buf, 3, " />"); } else {

[CVE-2022-40303_1.diff] parser.c #14
+ int maxLength = (ctxt->options & XML_PARSE_HUGE) ? + XML_MAX_TEXT_LENGTH : + XML_MAX_NAME_LENGTH; - if ((len > XML_MAX_NAME_LENGTH) && - ((ctxt->options & XML_PARSE_HUGE) == 0)) { - xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName"); - xmlFree(buffer); - return(NULL); - }
/media/esteban/ACOS/ResurrectionX/external/libxml2/parser.c
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
buffer = (xmlChar *) xmlMallocAtomic(max * sizeof(xmlChar)); if (buffer == NULL) { xmlErrMemory(ctxt, NULL); return(NULL); } memcpy(buffer, buf, len); while (xmlIsNameChar(ctxt, c)) { if (len + 10 > max) { xmlChar *tmp;
+ show +
3550
3551
3552
3553
3554
if ((len > XML_MAX_NAME_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName"); xmlFree(buffer); return(NULL);
+ show +
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
} max *= 2; tmp = (xmlChar *) xmlRealloc(buffer, max * sizeof(xmlChar)); if (tmp == NULL) { xmlErrMemory(ctxt, NULL); xmlFree(buffer); return(NULL); } buffer = tmp;

[CVE-2022-40303_1.diff] parser.c #17
+ int maxLength = (ctxt->options & XML_PARSE_HUGE) ? + XML_MAX_TEXT_LENGTH : + XML_MAX_NAME_LENGTH; - if ((max > XML_MAX_NAME_LENGTH) && - ((ctxt->options & XML_PARSE_HUGE) == 0)) { - xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NmToken"); - xmlFree(buffer); - return(NULL); - }
/media/esteban/ACOS/ResurrectionX/external/libxml2/parser.c
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
count = 0; GROW; if (ctxt->instate == XML_PARSER_EOF) { xmlFree(buffer); return(NULL); } } if (len + 10 > max) { xmlChar *tmp;
+ show +
3654
3655
3656
3657
3658
if ((max > XML_MAX_NAME_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NmToken"); xmlFree(buffer); return(NULL);
+ show +
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
} max *= 2; tmp = (xmlChar *) xmlRealloc(buffer, max * sizeof(xmlChar)); if (tmp == NULL) { xmlErrMemory(ctxt, NULL); xmlFree(buffer); return(NULL); } buffer = tmp;

[CVE-2022-40303_1.diff] parser.c #23
+ int maxLength = (ctxt->options & XML_PARSE_HUGE) ? + XML_MAX_HUGE_LENGTH : + XML_MAX_TEXT_LENGTH; + + if (len > maxLength) { + xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_NOT_FINISHED, + "entity value too long\n"); + goto error; + } + size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ? + XML_MAX_HUGE_LENGTH : + XML_MAX_TEXT_LENGTH; - /* - * Impose a reasonable limit on attribute size, unless XML_PARSE_HUGE - * special option is given - */ - if ((len > XML_MAX_TEXT_LENGTH) && - ((ctxt->options & XML_PARSE_HUGE) == 0)) { - xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED, - "AttValue length too long\n"); - goto mem_error; - }
/media/esteban/ACOS/ResurrectionX/external/libxml2/parser.c
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
* OK loop until we reach one of the ending char or a size limit. */ c = CUR_CHAR(l); while (((NXT(0) != limit) && /* checked */ (IS_CHAR(c)) && (c != '<')) && (ctxt->instate != XML_PARSER_EOF)) { /* * Impose a reasonable limit on attribute size, unless XML_PARSE_HUGE * special option is given */
+ show +
3888
3889
3890
3891
3892
if ((len > XML_MAX_TEXT_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED, "AttValue length too long\n"); goto mem_error;
+ show +
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
} if (c == 0) break; if (c == '&') { in_space = 0; if (NXT(1) == '#') { int val = xmlParseCharRef(ctxt); if (val == '&') { if (ctxt->replaceEntities) { if (len + 10 > buf_size) {

[CVE-2022-40303_1.diff] parser.c #25
+ if (len > maxLength) { + xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED, + "AttValue length too long\n"); + goto mem_error; + } - /* - * There we potentially risk an overflow, don't allow attribute value of - * length more than INT_MAX it is a very reasonable assumption ! - */ - if (len >= INT_MAX) { - xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED, - "AttValue length too long\n"); - goto mem_error; - } -
/media/esteban/ACOS/ResurrectionX/external/libxml2/parser.c
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED, "AttValue: ' expected\n"); } } else NEXT; /* * There we potentially risk an overflow, don't allow attribute value of * length more than INT_MAX it is a very reasonnable assumption ! */
+ show +
4064
4065
4066
4067
if (len >= INT_MAX) { xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED, "AttValue length too long\n"); goto mem_error;
+ show +
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
} if (attlen != NULL) *attlen = (int) len; return(buf); mem_error: xmlErrMemory(ctxt, NULL); error: if (buf != NULL) xmlFree(buf);

[CVE-2022-40303_1.diff] parser.c #27
+ int maxLength = (ctxt->options & XML_PARSE_HUGE) ? + XML_MAX_TEXT_LENGTH : + XML_MAX_NAME_LENGTH; - if ((size > XML_MAX_NAME_LENGTH) && - ((ctxt->options & XML_PARSE_HUGE) == 0)) { - xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "SystemLiteral"); - xmlFree(buf); - ctxt->instate = (xmlParserInputState) state; - return(NULL); - }
/media/esteban/ACOS/ResurrectionX/external/libxml2/parser.c
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
if (buf == NULL) { xmlErrMemory(ctxt, NULL); return(NULL); } ctxt->instate = XML_PARSER_SYSTEM_LITERAL; cur = CUR_CHAR(l); while ((IS_CHAR(cur)) && (cur != stop)) { /* checked */ if (len + 5 >= size) { xmlChar *tmp;
+ show +
4167
4168
4169
4170
4171
4172
if ((size > XML_MAX_NAME_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "SystemLiteral"); xmlFree(buf); ctxt->instate = (xmlParserInputState) state; return(NULL);
+ show +
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
} size *= 2; tmp = (xmlChar *) xmlRealloc(buf, size * sizeof(xmlChar)); if (tmp == NULL) { xmlFree(buf); xmlErrMemory(ctxt, NULL); ctxt->instate = (xmlParserInputState) state; return(NULL); } buf = tmp;

[CVE-2022-40303_1.diff] parser.c #30
+ if (len > maxLength) { + xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "SystemLiteral"); + xmlFree(buf); + ctxt->instate = (xmlParserInputState) state; + return(NULL); + } + int maxLength = (ctxt->options & XML_PARSE_HUGE) ? + XML_MAX_TEXT_LENGTH : + XML_MAX_NAME_LENGTH; - if ((size > XML_MAX_NAME_LENGTH) && - ((ctxt->options & XML_PARSE_HUGE) == 0)) { - xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Public ID"); - xmlFree(buf); - return(NULL); - }
/media/esteban/ACOS/ResurrectionX/external/libxml2/parser.c
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
if (buf == NULL) { xmlErrMemory(ctxt, NULL); return(NULL); } ctxt->instate = XML_PARSER_PUBLIC_LITERAL; cur = CUR; while ((IS_PUBIDCHAR_CH(cur)) && (cur != stop)) { /* checked */ if (len + 1 >= size) { xmlChar *tmp;
+ show +
4255
4256
4257
4258
4259
if ((size > XML_MAX_NAME_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Public ID"); xmlFree(buf); return(NULL);
+ show +
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
} size *= 2; tmp = (xmlChar *) xmlRealloc(buf, size * sizeof(xmlChar)); if (tmp == NULL) { xmlErrMemory(ctxt, NULL); xmlFree(buf); return(NULL); } buf = tmp; }

[CVE-2022-40303_1.diff] parser.c #33
+ if (len > maxLength) { + xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Public ID"); + xmlFree(buf); + return(NULL); + } + size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ? + XML_MAX_HUGE_LENGTH : + XML_MAX_TEXT_LENGTH; - if ((len > XML_MAX_TEXT_LENGTH) && - ((ctxt->options & XML_PARSE_HUGE) == 0)) { - xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED, - "Comment too big found", NULL); - xmlFree (buf); - return; - }
/media/esteban/ACOS/ResurrectionX/external/libxml2/parser.c
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
NEXTL(rl); cur = CUR_CHAR(l); if (cur == 0) goto not_terminated; while (IS_CHAR(cur) && /* checked */ ((cur != '>') || (r != '-') || (q != '-'))) { if ((r == '-') && (q == '-')) { xmlFatalErr(ctxt, XML_ERR_HYPHEN_IN_COMMENT, NULL); }
+ show +
4729
4730
4731
4732
4733
4734
if ((len > XML_MAX_TEXT_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED, "Comment too big found", NULL); xmlFree (buf); return;
+ show +
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
} if (len + 5 >= size) { xmlChar *new_buf; size_t new_size; new_size = size * 2; new_buf = (xmlChar *) xmlRealloc(buf, new_size); if (new_buf == NULL) { xmlFree (buf); xmlErrMemory(ctxt, NULL);
/media/esteban/ACOS/ResurrectionX/external/libxml2/parser.c
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
ctxt->instate = state; return; } buf = new_buf; } memcpy(&buf[len], ctxt->input->cur, nbchar); len += nbchar; buf[len] = 0; } }
+ show +
4899
4900
4901
4902
4903
4904
if ((len > XML_MAX_TEXT_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED, "Comment too big found", NULL); xmlFree (buf); return;
+ show +
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
} ctxt->input->cur = in; if (*in == 0xA) { in++; ctxt->input->line++; ctxt->input->col = 1; } if (*in == 0xD) { in++; if (*in == 0xA) { ctxt->input->cur = in;

[CVE-2022-40303_1.diff] parser.c #38
+ size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ? + XML_MAX_HUGE_LENGTH : + XML_MAX_TEXT_LENGTH; - if ((len > XML_MAX_TEXT_LENGTH) && - ((ctxt->options & XML_PARSE_HUGE) == 0)) { - xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED, - "PI %s too big found", target); - xmlFree(buf); - ctxt->instate = state; - return; - }
/media/esteban/ACOS/ResurrectionX/external/libxml2/parser.c
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
size = new_size; } count++; if (count > 50) { GROW; if (ctxt->instate == XML_PARSER_EOF) { xmlFree(buf); return; } count = 0;
+ show +
5170
5171
5172
5173
5174
5175
5176
if ((len > XML_MAX_TEXT_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED, "PI %s too big found", target); xmlFree(buf); ctxt->instate = state; return;
+ show +
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
} } COPY_BUF(l,buf,len,cur); NEXTL(l); cur = CUR_CHAR(l); if (cur == 0) { SHRINK; GROW; cur = CUR_CHAR(l); }
/media/esteban/ACOS/ResurrectionX/external/libxml2/parser.c
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
} COPY_BUF(l,buf,len,cur); NEXTL(l); cur = CUR_CHAR(l); if (cur == 0) { SHRINK; GROW; cur = CUR_CHAR(l); } }
+ show +
5188
5189
5190
5191
5192
5193
5194
if ((len > XML_MAX_TEXT_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED, "PI %s too big found", target); xmlFree(buf); ctxt->instate = state; return;
+ show +
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
} buf[len] = 0; if (cur != '?') { xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED, "ParsePI: PI %s never end ...\n", target); } else { if (inputid != ctxt->input->id) { xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, "PI declaration doesn't start and stop in" " the same entity\n");

[CVE-2022-40303_1.diff] parser.c #39
+ if (len > maxLength) { + xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED, + "PI %s too big found", target); + xmlFree(buf); + ctxt->instate = state; + return; + } - if ((len > XML_MAX_TEXT_LENGTH) && - ((ctxt->options & XML_PARSE_HUGE) == 0)) { - xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED, - "PI %s too big found", target); - xmlFree(buf); - ctxt->instate = state; - return; - }
/media/esteban/ACOS/ResurrectionX/external/libxml2/parser.c
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
size = new_size; } count++; if (count > 50) { GROW; if (ctxt->instate == XML_PARSER_EOF) { xmlFree(buf); return; } count = 0;
+ show +
5170
5171
5172
5173
5174
5175
5176
if ((len > XML_MAX_TEXT_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED, "PI %s too big found", target); xmlFree(buf); ctxt->instate = state; return;
+ show +
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
} } COPY_BUF(l,buf,len,cur); NEXTL(l); cur = CUR_CHAR(l); if (cur == 0) { SHRINK; GROW; cur = CUR_CHAR(l); }
/media/esteban/ACOS/ResurrectionX/external/libxml2/parser.c
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
} COPY_BUF(l,buf,len,cur); NEXTL(l); cur = CUR_CHAR(l); if (cur == 0) { SHRINK; GROW; cur = CUR_CHAR(l); } }
+ show +
5188
5189
5190
5191
5192
5193
5194
if ((len > XML_MAX_TEXT_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED, "PI %s too big found", target); xmlFree(buf); ctxt->instate = state; return;
+ show +
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
} buf[len] = 0; if (cur != '?') { xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED, "ParsePI: PI %s never end ...\n", target); } else { if (inputid != ctxt->input->id) { xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, "PI declaration doesn't start and stop in" " the same entity\n");

[CVE-2022-40303_1.diff] parser.c #47
+ int maxLength = (ctxt->options & XML_PARSE_HUGE) ? + XML_MAX_HUGE_LENGTH : + XML_MAX_TEXT_LENGTH; - if ((size > XML_MAX_TEXT_LENGTH) && - ((ctxt->options & XML_PARSE_HUGE) == 0)) { - xmlFatalErrMsgStr(ctxt, XML_ERR_CDATA_NOT_FINISHED, - "CData section too big found", NULL); - xmlFree (buf); - return; - }
/media/esteban/ACOS/ResurrectionX/external/libxml2/parser.c
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
buf = (xmlChar *) xmlMallocAtomic(size * sizeof(xmlChar)); if (buf == NULL) { xmlErrMemory(ctxt, NULL); return; } while (IS_CHAR(cur) && ((r != ']') || (s != ']') || (cur != '>'))) { if (len + 5 >= size) { xmlChar *tmp;
+ show +
9744
9745
9746
9747
9748
9749
if ((size > XML_MAX_TEXT_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErrMsgStr(ctxt, XML_ERR_CDATA_NOT_FINISHED, "CData section too big found", NULL); xmlFree (buf); return;
+ show +
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
} tmp = (xmlChar *) xmlRealloc(buf, size * 2 * sizeof(xmlChar)); if (tmp == NULL) { xmlFree(buf); xmlErrMemory(ctxt, NULL); return; } buf = tmp; size *= 2; }

[CVE-2018-9472_1.diff] parser.c #26
- if (c == 0) { - count = 0; - GROW; - if (ctxt->instate == XML_PARSER_EOF) - return(NULL); - c = CUR_CHAR(l); - }
/media/esteban/ACOS/ResurrectionX/external/libxml2/parser.c
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
c = CUR_CHAR(l); while (xmlIsNameChar(ctxt, c)) { if (count++ > XML_PARSER_CHUNK_SIZE) { count = 0; GROW; } COPY_BUF(l,buf,len,c); NEXTL(l); c = CUR_CHAR(l);
+ show +
3621
3622
3623
3624
3625
3626
if (c == 0) { count = 0; GROW; if (ctxt->instate == XML_PARSER_EOF) return(NULL); c = CUR_CHAR(l);
+ show +
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
} if (len >= XML_MAX_NAMELEN) { /* * Okay someone managed to make a huge token, so he's ready to pay * for the processing speed. */ xmlChar *buffer; int max = len * 2; buffer = (xmlChar *) xmlMallocAtomic(max * sizeof(xmlChar));

[CVE-2018-9472_1.diff] parser.c #79
- xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY, - "PEReference: %%%s; not found\n", - name, NULL); - ctxt->valid = 0; + if ((ctxt->validate) && (ctxt->vctxt.error != NULL)) { + xmlValidityError(ctxt, XML_WAR_UNDECLARED_ENTITY, + "PEReference: %%%s; not found\n", + name, NULL); + } else + xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY, + "PEReference: %%%s; not found\n", + name, NULL); + ctxt->valid = 0;
/media/esteban/ACOS/ResurrectionX/external/libxml2/parser.c
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
* In a document with an external subset or external * parameter entities with "standalone='no'", ... * ... The declaration of a parameter entity must * precede any reference to it... */ if ((ctxt->validate) && (ctxt->vctxt.error != NULL)) { xmlValidityError(ctxt, XML_WAR_UNDECLARED_ENTITY, "PEReference: %%%s; not found\n", name, NULL); } else
+ show +
7894
7895
7896
7897
xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY, "PEReference: %%%s; not found\n", name, NULL); ctxt->valid = 0;
+ show +
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
} xmlParserEntityCheck(ctxt, 0, NULL, 0); } else { /* * Internal checking in case the entity quest barfed */ if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) && (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) { xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY, "Internal: %%%s; is not a parameter entity\n",
/media/esteban/ACOS/ResurrectionX/external/libxml2/parser.c
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY, "PEReference: %%%s; not found\n", name); } else { /* * [ VC: Entity Declared ] * In a document with an external subset or external * parameter entities with "standalone='no'", ... * ... The declaration of a parameter entity must * precede any reference to it... */
+ show +
8156
8157
8158
8159
xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY, "PEReference: %%%s; not found\n", name, NULL); ctxt->valid = 0;
+ show +
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
} xmlParserEntityCheck(ctxt, 0, NULL, 0); } else { /* * Internal checking in case the entity quest barfed */ if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) && (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) { xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY, "%%%s; is not a parameter entity\n",

[CVE-2018-9466_1.diff] parser.c #26
- if (c == 0) { - count = 0; - GROW; - if (ctxt->instate == XML_PARSER_EOF) - return(NULL); - c = CUR_CHAR(l); - }
/media/esteban/ACOS/ResurrectionX/external/libxml2/parser.c
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
c = CUR_CHAR(l); while (xmlIsNameChar(ctxt, c)) { if (count++ > XML_PARSER_CHUNK_SIZE) { count = 0; GROW; } COPY_BUF(l,buf,len,c); NEXTL(l); c = CUR_CHAR(l);
+ show +
3621
3622
3623
3624
3625
3626
if (c == 0) { count = 0; GROW; if (ctxt->instate == XML_PARSER_EOF) return(NULL); c = CUR_CHAR(l);
+ show +
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
} if (len >= XML_MAX_NAMELEN) { /* * Okay someone managed to make a huge token, so he's ready to pay * for the processing speed. */ xmlChar *buffer; int max = len * 2; buffer = (xmlChar *) xmlMallocAtomic(max * sizeof(xmlChar));

[CVE-2018-9466_1.diff] parser.c #79
- xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY, - "PEReference: %%%s; not found\n", - name, NULL); - ctxt->valid = 0; + if ((ctxt->validate) && (ctxt->vctxt.error != NULL)) { + xmlValidityError(ctxt, XML_WAR_UNDECLARED_ENTITY, + "PEReference: %%%s; not found\n", + name, NULL); + } else + xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY, + "PEReference: %%%s; not found\n", + name, NULL); + ctxt->valid = 0;
/media/esteban/ACOS/ResurrectionX/external/libxml2/parser.c
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
* In a document with an external subset or external * parameter entities with "standalone='no'", ... * ... The declaration of a parameter entity must * precede any reference to it... */ if ((ctxt->validate) && (ctxt->vctxt.error != NULL)) { xmlValidityError(ctxt, XML_WAR_UNDECLARED_ENTITY, "PEReference: %%%s; not found\n", name, NULL); } else
+ show +
7894
7895
7896
7897
xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY, "PEReference: %%%s; not found\n", name, NULL); ctxt->valid = 0;
+ show +
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
} xmlParserEntityCheck(ctxt, 0, NULL, 0); } else { /* * Internal checking in case the entity quest barfed */ if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) && (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) { xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY, "Internal: %%%s; is not a parameter entity\n",
/media/esteban/ACOS/ResurrectionX/external/libxml2/parser.c
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY, "PEReference: %%%s; not found\n", name); } else { /* * [ VC: Entity Declared ] * In a document with an external subset or external * parameter entities with "standalone='no'", ... * ... The declaration of a parameter entity must * precede any reference to it... */
+ show +
8156
8157
8158
8159
xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY, "PEReference: %%%s; not found\n", name, NULL); ctxt->valid = 0;
+ show +
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
} xmlParserEntityCheck(ctxt, 0, NULL, 0); } else { /* * Internal checking in case the entity quest barfed */ if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) && (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) { xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY, "%%%s; is not a parameter entity\n",

[CVE-2018-9472_1.diff] xpath.c #12
- fprintf(output, "Compiled Expression : %d elements\n", - comp->nbStep); - i = comp->last; - xmlXPathDebugDumpStepOp(output, comp, &comp->steps[i], depth + 1); +#ifdef XPATH_STREAMING + if (comp->stream) { + fprintf(output, "Streaming Expression\n"); + } else +#endif + { + fprintf(output, "Compiled Expression : %d elements\n", + comp->nbStep); + i = comp->last; + xmlXPathDebugDumpStepOp(output, comp, &comp->steps[i], depth + 1); + }
/media/esteban/ACOS/ResurrectionX/external/libxml2/xpath.c
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
shift[2 * i] = shift[2 * i + 1] = 0; fprintf(output, "%s", shift); #ifdef XPATH_STREAMING if (comp->stream) { fprintf(output, "Streaming Expression\n"); } else #endif {
+ show +
1671
1672
1673
1674
fprintf(output, "Compiled Expression : %d elements\n", comp->nbStep); i = comp->last; xmlXPathDebugDumpStepOp(output, comp, &comp->steps[i], depth + 1);
+ show +
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
} } #ifdef XP_DEBUG_OBJ_USAGE /* * XPath object usage related debugging variables. */ static int xmlXPathDebugObjCounterUndefined = 0; static int xmlXPathDebugObjCounterNodeset = 0;

[CVE-2018-9466_1.diff] xpath.c #12
- fprintf(output, "Compiled Expression : %d elements\n", - comp->nbStep); - i = comp->last; - xmlXPathDebugDumpStepOp(output, comp, &comp->steps[i], depth + 1); +#ifdef XPATH_STREAMING + if (comp->stream) { + fprintf(output, "Streaming Expression\n"); + } else +#endif + { + fprintf(output, "Compiled Expression : %d elements\n", + comp->nbStep); + i = comp->last; + xmlXPathDebugDumpStepOp(output, comp, &comp->steps[i], depth + 1); + }
/media/esteban/ACOS/ResurrectionX/external/libxml2/xpath.c
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
shift[2 * i] = shift[2 * i + 1] = 0; fprintf(output, "%s", shift); #ifdef XPATH_STREAMING if (comp->stream) { fprintf(output, "Streaming Expression\n"); } else #endif {
+ show +
1671
1672
1673
1674
fprintf(output, "Compiled Expression : %d elements\n", comp->nbStep); i = comp->last; xmlXPathDebugDumpStepOp(output, comp, &comp->steps[i], depth + 1);
+ show +
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
} } #ifdef XP_DEBUG_OBJ_USAGE /* * XPath object usage related debugging variables. */ static int xmlXPathDebugObjCounterUndefined = 0; static int xmlXPathDebugObjCounterNodeset = 0;

[CVE-2018-9472_1.diff] runtest.c #13
-static const char *catalog = "test/threads/complex.xml"; -static const char *testfiles[] = { - "test/threads/abc.xml", - "test/threads/acb.xml", - "test/threads/bac.xml", - "test/threads/bca.xml", - "test/threads/cab.xml", - "test/threads/cba.xml", - "test/threads/invalid.xml", -}; +typedef struct { + const char *filename; + int okay; +} xmlThreadParams; -static const char *Okay = "OK"; -static const char *Failed = "Failed"; +static const char *catalog = "test/threads/complex.xml"; +static xmlThreadParams threadParams[] = { + { "test/threads/abc.xml", 0 }, + { "test/threads/acb.xml", 0 }, + { "test/threads/bac.xml", 0 }, + { "test/threads/bca.xml", 0 }, + { "test/threads/cab.xml", 0 }, + { "test/threads/cba.xml", 0 }, + { "test/threads/invalid.xml", 0 } +}; +static const unsigned int num_threads = sizeof(threadParams) / + sizeof(threadParams[0]);
/media/esteban/ACOS/ResurrectionX/external/libxml2/testThreads.c
19
20
21
22
23
24
25
26
27
28
#endif #include <assert.h> #define MAX_ARGC 20 #ifdef HAVE_PTHREAD_H static pthread_t tid[MAX_ARGC]; #elif defined HAVE_BEOS_THREADS static thread_id tid[MAX_ARGC]; #endif
+ show +
29
30
31
32
33
34
35
36
37
38
39
40
41
static const char *catalog = "test/threads/complex.xml"; static const char *testfiles[] = { "test/threads/abc.xml", "test/threads/acb.xml", "test/threads/bac.xml", "test/threads/bca.xml", "test/threads/cab.xml", "test/threads/cba.xml", "test/threads/invalid.xml", }; static const char *Okay = "OK"; static const char *Failed = "Failed";
+ show +
42
43
44
45
46
47
48
49
50
51
#ifndef xmlDoValidityCheckingDefaultValue #error xmlDoValidityCheckingDefaultValue is not a macro #endif #ifndef xmlGenericErrorContext #error xmlGenericErrorContext is not a macro #endif static void * thread_specific_data(void *private_data)

[CVE-2018-9466_1.diff] runtest.c #13
-static const char *catalog = "test/threads/complex.xml"; -static const char *testfiles[] = { - "test/threads/abc.xml", - "test/threads/acb.xml", - "test/threads/bac.xml", - "test/threads/bca.xml", - "test/threads/cab.xml", - "test/threads/cba.xml", - "test/threads/invalid.xml", -}; +typedef struct { + const char *filename; + int okay; +} xmlThreadParams; -static const char *Okay = "OK"; -static const char *Failed = "Failed"; +static const char *catalog = "test/threads/complex.xml"; +static xmlThreadParams threadParams[] = { + { "test/threads/abc.xml", 0 }, + { "test/threads/acb.xml", 0 }, + { "test/threads/bac.xml", 0 }, + { "test/threads/bca.xml", 0 }, + { "test/threads/cab.xml", 0 }, + { "test/threads/cba.xml", 0 }, + { "test/threads/invalid.xml", 0 } +}; +static const unsigned int num_threads = sizeof(threadParams) / + sizeof(threadParams[0]);
/media/esteban/ACOS/ResurrectionX/external/libxml2/testThreads.c
19
20
21
22
23
24
25
26
27
28
#endif #include <assert.h> #define MAX_ARGC 20 #ifdef HAVE_PTHREAD_H static pthread_t tid[MAX_ARGC]; #elif defined HAVE_BEOS_THREADS static thread_id tid[MAX_ARGC]; #endif
+ show +
29
30
31
32
33
34
35
36
37
38
39
40
41
static const char *catalog = "test/threads/complex.xml"; static const char *testfiles[] = { "test/threads/abc.xml", "test/threads/acb.xml", "test/threads/bac.xml", "test/threads/bca.xml", "test/threads/cab.xml", "test/threads/cba.xml", "test/threads/invalid.xml", }; static const char *Okay = "OK"; static const char *Failed = "Failed";
+ show +
42
43
44
45
46
47
48
49
50
51
#ifndef xmlDoValidityCheckingDefaultValue #error xmlDoValidityCheckingDefaultValue is not a macro #endif #ifndef xmlGenericErrorContext #error xmlGenericErrorContext is not a macro #endif static void * thread_specific_data(void *private_data)

[CVE-2015-6607_1.diff] sqlite3.c #19
-SQLITE_API int sqlite3_initialize(void); -SQLITE_API int sqlite3_shutdown(void); -SQLITE_API int sqlite3_os_init(void); -SQLITE_API int sqlite3_os_end(void); +SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void); +SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void); +SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void); +SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void);
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.c
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
** implementations for sqlite3_os_init() and sqlite3_os_end() ** are built into SQLite when it is compiled for Unix, Windows, or OS/2. ** When [custom builds | built for other platforms] ** (using the [SQLITE_OS_OTHER=1] compile-time ** option) the application must supply a suitable implementation for ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied ** implementation of sqlite3_os_init() or sqlite3_os_end() ** must return [SQLITE_OK] on success and some other [error code] upon ** failure. */
+ show +
2581
2582
2583
2584
SQLITE_API int sqlite3_initialize(void); SQLITE_API int sqlite3_shutdown(void); SQLITE_API int sqlite3_os_init(void); SQLITE_API int sqlite3_os_end(void);
+ show +
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
/* ** CAPI3REF: Configuring The SQLite Library ** ** The sqlite3_config() interface is used to make global configuration ** changes to SQLite in order to tune SQLite to the specific needs of ** the application. The default configuration is recommended for most ** applications and so this routine is usually not necessary. It is ** provided to support rare applications with unusual needs. **
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.h
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
** implementations for sqlite3_os_init() and sqlite3_os_end() ** are built into SQLite when it is compiled for Unix, Windows, or OS/2. ** When [custom builds | built for other platforms] ** (using the [SQLITE_OS_OTHER=1] compile-time ** option) the application must supply a suitable implementation for ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied ** implementation of sqlite3_os_init() or sqlite3_os_end() ** must return [SQLITE_OK] on success and some other [error code] upon ** failure. */
+ show +
1542
1543
1544
1545
SQLITE_API int sqlite3_initialize(void); SQLITE_API int sqlite3_shutdown(void); SQLITE_API int sqlite3_os_init(void); SQLITE_API int sqlite3_os_end(void);
+ show +
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
/* ** CAPI3REF: Configuring The SQLite Library ** ** The sqlite3_config() interface is used to make global configuration ** changes to SQLite in order to tune SQLite to the specific needs of ** the application. The default configuration is recommended for most ** applications and so this routine is usually not necessary. It is ** provided to support rare applications with unusual needs. **
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.c
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
** implementations for sqlite3_os_init() and sqlite3_os_end() ** are built into SQLite when it is compiled for Unix, Windows, or OS/2. ** When [custom builds | built for other platforms] ** (using the [SQLITE_OS_OTHER=1] compile-time ** option) the application must supply a suitable implementation for ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied ** implementation of sqlite3_os_init() or sqlite3_os_end() ** must return [SQLITE_OK] on success and some other [error code] upon ** failure. */
+ show +
2581
2582
2583
2584
SQLITE_API int sqlite3_initialize(void); SQLITE_API int sqlite3_shutdown(void); SQLITE_API int sqlite3_os_init(void); SQLITE_API int sqlite3_os_end(void);
+ show +
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
/* ** CAPI3REF: Configuring The SQLite Library ** ** The sqlite3_config() interface is used to make global configuration ** changes to SQLite in order to tune SQLite to the specific needs of ** the application. The default configuration is recommended for most ** applications and so this routine is usually not necessary. It is ** provided to support rare applications with unusual needs. **
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.h
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
** implementations for sqlite3_os_init() and sqlite3_os_end() ** are built into SQLite when it is compiled for Unix, Windows, or OS/2. ** When [custom builds | built for other platforms] ** (using the [SQLITE_OS_OTHER=1] compile-time ** option) the application must supply a suitable implementation for ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied ** implementation of sqlite3_os_init() or sqlite3_os_end() ** must return [SQLITE_OK] on success and some other [error code] upon ** failure. */
+ show +
1542
1543
1544
1545
SQLITE_API int sqlite3_initialize(void); SQLITE_API int sqlite3_shutdown(void); SQLITE_API int sqlite3_os_init(void); SQLITE_API int sqlite3_os_end(void);
+ show +
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
/* ** CAPI3REF: Configuring The SQLite Library ** ** The sqlite3_config() interface is used to make global configuration ** changes to SQLite in order to tune SQLite to the specific needs of ** the application. The default configuration is recommended for most ** applications and so this routine is usually not necessary. It is ** provided to support rare applications with unusual needs. **

[CVE-2015-6607_1.diff] sqlite3.c #43
+** ^(The "%w" formatting option is like "%q" except that it expects to +** be contained within double-quotes instead of single quotes, and it +** escapes the double-quote character instead of the single-quote +** character.)^ The "%w" formatting option is intended for safely inserting +** table and column names into a constructed SQL statement. +** -SQLITE_API char *sqlite3_mprintf(const char*,...); -SQLITE_API char *sqlite3_vmprintf(const char*, va_list); -SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); -SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list); +SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...); +SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list); +SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...); +SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list);
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.c
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
** ^As long as the buffer size is greater than zero, sqlite3_snprintf() ** guarantees that the buffer is always zero-terminated. ^The first ** parameter "n" is the total size of the buffer, including space for ** the zero terminator. So the longest string that can be completely ** written will be n-1 characters. ** ** ^The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf(). ** ** See also: [built-in printf()], [printf() SQL function] */
+ show +
3843
3844
3845
3846
SQLITE_API char *sqlite3_mprintf(const char*,...); SQLITE_API char *sqlite3_vmprintf(const char*, va_list); SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
+ show +
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
/* ** CAPI3REF: Memory Allocation Subsystem ** ** The SQLite core uses these three routines for all of its own ** internal memory allocation needs. "Core" in the previous sentence ** does not include operating-system specific [VFS] implementation. The ** Windows VFS uses native malloc() and free() for some operations. ** ** ^The sqlite3_malloc() routine returns a pointer to a block
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.h
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
** ^As long as the buffer size is greater than zero, sqlite3_snprintf() ** guarantees that the buffer is always zero-terminated. ^The first ** parameter "n" is the total size of the buffer, including space for ** the zero terminator. So the longest string that can be completely ** written will be n-1 characters. ** ** ^The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf(). ** ** See also: [built-in printf()], [printf() SQL function] */
+ show +
2804
2805
2806
2807
SQLITE_API char *sqlite3_mprintf(const char*,...); SQLITE_API char *sqlite3_vmprintf(const char*, va_list); SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
+ show +
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
/* ** CAPI3REF: Memory Allocation Subsystem ** ** The SQLite core uses these three routines for all of its own ** internal memory allocation needs. "Core" in the previous sentence ** does not include operating-system specific [VFS] implementation. The ** Windows VFS uses native malloc() and free() for some operations. ** ** ^The sqlite3_malloc() routine returns a pointer to a block
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.c
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
** ^As long as the buffer size is greater than zero, sqlite3_snprintf() ** guarantees that the buffer is always zero-terminated. ^The first ** parameter "n" is the total size of the buffer, including space for ** the zero terminator. So the longest string that can be completely ** written will be n-1 characters. ** ** ^The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf(). ** ** See also: [built-in printf()], [printf() SQL function] */
+ show +
3843
3844
3845
3846
SQLITE_API char *sqlite3_mprintf(const char*,...); SQLITE_API char *sqlite3_vmprintf(const char*, va_list); SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
+ show +
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
/* ** CAPI3REF: Memory Allocation Subsystem ** ** The SQLite core uses these three routines for all of its own ** internal memory allocation needs. "Core" in the previous sentence ** does not include operating-system specific [VFS] implementation. The ** Windows VFS uses native malloc() and free() for some operations. ** ** ^The sqlite3_malloc() routine returns a pointer to a block
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.h
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
** ^As long as the buffer size is greater than zero, sqlite3_snprintf() ** guarantees that the buffer is always zero-terminated. ^The first ** parameter "n" is the total size of the buffer, including space for ** the zero terminator. So the longest string that can be completely ** written will be n-1 characters. ** ** ^The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf(). ** ** See also: [built-in printf()], [printf() SQL function] */
+ show +
2804
2805
2806
2807
SQLITE_API char *sqlite3_mprintf(const char*,...); SQLITE_API char *sqlite3_vmprintf(const char*, va_list); SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
+ show +
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
/* ** CAPI3REF: Memory Allocation Subsystem ** ** The SQLite core uses these three routines for all of its own ** internal memory allocation needs. "Core" in the previous sentence ** does not include operating-system specific [VFS] implementation. The ** Windows VFS uses native malloc() and free() for some operations. ** ** ^The sqlite3_malloc() routine returns a pointer to a block

[CVE-2015-6607_1.diff] sqlite3.c #57
-SQLITE_API int sqlite3_errcode(sqlite3 *db); -SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); -SQLITE_API const char *sqlite3_errmsg(sqlite3*); -SQLITE_API const void *sqlite3_errmsg16(sqlite3*); -SQLITE_API const char *sqlite3_errstr(int); +SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db); +SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db); +SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*); +SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*); +SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int);
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.c
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
** interfaces always report the most recent result. To avoid ** this, each thread can obtain exclusive use of the [database connection] D ** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning ** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after ** all calls to the interfaces listed here are completed. ** ** If an interface fails with SQLITE_MISUSE, that means the interface ** was invoked incorrectly by the application. In that case, the ** error code and message may or may not be set. */
+ show +
4803
4804
4805
4806
4807
SQLITE_API int sqlite3_errcode(sqlite3 *db); SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); SQLITE_API const char *sqlite3_errmsg(sqlite3*); SQLITE_API const void *sqlite3_errmsg16(sqlite3*); SQLITE_API const char *sqlite3_errstr(int);
+ show +
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
/* ** CAPI3REF: Prepared Statement Object ** KEYWORDS: {prepared statement} {prepared statements} ** ** An instance of this object represents a single SQL statement that ** has been compiled into binary form and is ready to be evaluated. ** ** Think of each SQL statement as a separate computer program. The ** original SQL text is source code. A prepared statement object
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.h
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
** interfaces always report the most recent result. To avoid ** this, each thread can obtain exclusive use of the [database connection] D ** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning ** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after ** all calls to the interfaces listed here are completed. ** ** If an interface fails with SQLITE_MISUSE, that means the interface ** was invoked incorrectly by the application. In that case, the ** error code and message may or may not be set. */
+ show +
3764
3765
3766
3767
3768
SQLITE_API int sqlite3_errcode(sqlite3 *db); SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); SQLITE_API const char *sqlite3_errmsg(sqlite3*); SQLITE_API const void *sqlite3_errmsg16(sqlite3*); SQLITE_API const char *sqlite3_errstr(int);
+ show +
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
/* ** CAPI3REF: Prepared Statement Object ** KEYWORDS: {prepared statement} {prepared statements} ** ** An instance of this object represents a single SQL statement that ** has been compiled into binary form and is ready to be evaluated. ** ** Think of each SQL statement as a separate computer program. The ** original SQL text is source code. A prepared statement object
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.c
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
** interfaces always report the most recent result. To avoid ** this, each thread can obtain exclusive use of the [database connection] D ** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning ** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after ** all calls to the interfaces listed here are completed. ** ** If an interface fails with SQLITE_MISUSE, that means the interface ** was invoked incorrectly by the application. In that case, the ** error code and message may or may not be set. */
+ show +
4803
4804
4805
4806
4807
SQLITE_API int sqlite3_errcode(sqlite3 *db); SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); SQLITE_API const char *sqlite3_errmsg(sqlite3*); SQLITE_API const void *sqlite3_errmsg16(sqlite3*); SQLITE_API const char *sqlite3_errstr(int);
+ show +
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
/* ** CAPI3REF: Prepared Statement Object ** KEYWORDS: {prepared statement} {prepared statements} ** ** An instance of this object represents a single SQL statement that ** has been compiled into binary form and is ready to be evaluated. ** ** Think of each SQL statement as a separate computer program. The ** original SQL text is source code. A prepared statement object
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.h
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
** interfaces always report the most recent result. To avoid ** this, each thread can obtain exclusive use of the [database connection] D ** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning ** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after ** all calls to the interfaces listed here are completed. ** ** If an interface fails with SQLITE_MISUSE, that means the interface ** was invoked incorrectly by the application. In that case, the ** error code and message may or may not be set. */
+ show +
3764
3765
3766
3767
3768
SQLITE_API int sqlite3_errcode(sqlite3 *db); SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); SQLITE_API const char *sqlite3_errmsg(sqlite3*); SQLITE_API const void *sqlite3_errmsg16(sqlite3*); SQLITE_API const char *sqlite3_errstr(int);
+ show +
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
/* ** CAPI3REF: Prepared Statement Object ** KEYWORDS: {prepared statement} {prepared statements} ** ** An instance of this object represents a single SQL statement that ** has been compiled into binary form and is ready to be evaluated. ** ** Think of each SQL statement as a separate computer program. The ** original SQL text is source code. A prepared statement object

[CVE-2015-6607_1.diff] sqlite3.c #75
-SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); -SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); -SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); -SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); -SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); -SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int); +SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int); +SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int); +SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int); +SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int); +SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int); +SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.c
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
** UTF-16 encoded strings and the other functions return UTF-8. ** ** ^These APIs are only available if the library was compiled with the ** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol. ** ** If two or more threads call one or more ** [sqlite3_column_database_name | column metadata interfaces] ** for the same [prepared statement] and result column ** at the same time then the results are undefined. */
+ show +
5614
5615
5616
5617
5618
5619
SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
+ show +
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
/* ** CAPI3REF: Declared Datatype Of A Query Result ** METHOD: sqlite3_stmt ** ** ^(The first parameter is a [prepared statement]. ** If this statement is a [SELECT] statement and the Nth column of the ** returned result set of that [SELECT] is a table column (not an ** expression or subquery) then the declared type of the table ** column is returned.)^ ^If the Nth column of the result set is an
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.h
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
** UTF-16 encoded strings and the other functions return UTF-8. ** ** ^These APIs are only available if the library was compiled with the ** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol. ** ** If two or more threads call one or more ** [sqlite3_column_database_name | column metadata interfaces] ** for the same [prepared statement] and result column ** at the same time then the results are undefined. */
+ show +
4575
4576
4577
4578
4579
4580
SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
+ show +
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
/* ** CAPI3REF: Declared Datatype Of A Query Result ** METHOD: sqlite3_stmt ** ** ^(The first parameter is a [prepared statement]. ** If this statement is a [SELECT] statement and the Nth column of the ** returned result set of that [SELECT] is a table column (not an ** expression or subquery) then the declared type of the table ** column is returned.)^ ^If the Nth column of the result set is an
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.c
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
** UTF-16 encoded strings and the other functions return UTF-8. ** ** ^These APIs are only available if the library was compiled with the ** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol. ** ** If two or more threads call one or more ** [sqlite3_column_database_name | column metadata interfaces] ** for the same [prepared statement] and result column ** at the same time then the results are undefined. */
+ show +
5614
5615
5616
5617
5618
5619
SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
+ show +
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
/* ** CAPI3REF: Declared Datatype Of A Query Result ** METHOD: sqlite3_stmt ** ** ^(The first parameter is a [prepared statement]. ** If this statement is a [SELECT] statement and the Nth column of the ** returned result set of that [SELECT] is a table column (not an ** expression or subquery) then the declared type of the table ** column is returned.)^ ^If the Nth column of the result set is an
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.h
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
** UTF-16 encoded strings and the other functions return UTF-8. ** ** ^These APIs are only available if the library was compiled with the ** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol. ** ** If two or more threads call one or more ** [sqlite3_column_database_name | column metadata interfaces] ** for the same [prepared statement] and result column ** at the same time then the results are undefined. */
+ show +
4575
4576
4577
4578
4579
4580
SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
+ show +
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
/* ** CAPI3REF: Declared Datatype Of A Query Result ** METHOD: sqlite3_stmt ** ** ^(The first parameter is a [prepared statement]. ** If this statement is a [SELECT] statement and the Nth column of the ** returned result set of that [SELECT] is a table column (not an ** expression or subquery) then the declared type of the table ** column is returned.)^ ^If the Nth column of the result set is an

[CVE-2015-6607_1.diff] sqlite3.c #139
-SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); -SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); -SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); -SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); -SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*); +SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int); +SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*); +SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*); +SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*); +SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*);
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.c
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
** previously entered by the same thread. The behavior ** is undefined if the mutex is not currently entered by the ** calling thread or is not currently allocated. ** ** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or ** sqlite3_mutex_leave() is a NULL pointer, then all three routines ** behave as no-ops. ** ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. */
+ show +
8490
8491
8492
8493
8494
SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
+ show +
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
/* ** CAPI3REF: Mutex Methods Object ** ** An instance of this structure defines the low-level routines ** used to allocate and use mutexes. ** ** Usually, the default mutex implementations provided by SQLite are ** sufficient, however the application has the option of substituting a custom ** implementation for specialized deployments or systems for which SQLite
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.h
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
** previously entered by the same thread. The behavior ** is undefined if the mutex is not currently entered by the ** calling thread or is not currently allocated. ** ** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or ** sqlite3_mutex_leave() is a NULL pointer, then all three routines ** behave as no-ops. ** ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. */
+ show +
7451
7452
7453
7454
7455
SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
+ show +
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
/* ** CAPI3REF: Mutex Methods Object ** ** An instance of this structure defines the low-level routines ** used to allocate and use mutexes. ** ** Usually, the default mutex implementations provided by SQLite are ** sufficient, however the application has the option of substituting a custom ** implementation for specialized deployments or systems for which SQLite
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.c
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
** previously entered by the same thread. The behavior ** is undefined if the mutex is not currently entered by the ** calling thread or is not currently allocated. ** ** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or ** sqlite3_mutex_leave() is a NULL pointer, then all three routines ** behave as no-ops. ** ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. */
+ show +
8490
8491
8492
8493
8494
SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
+ show +
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
/* ** CAPI3REF: Mutex Methods Object ** ** An instance of this structure defines the low-level routines ** used to allocate and use mutexes. ** ** Usually, the default mutex implementations provided by SQLite are ** sufficient, however the application has the option of substituting a custom ** implementation for specialized deployments or systems for which SQLite
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.h
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
** previously entered by the same thread. The behavior ** is undefined if the mutex is not currently entered by the ** calling thread or is not currently allocated. ** ** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or ** sqlite3_mutex_leave() is a NULL pointer, then all three routines ** behave as no-ops. ** ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. */
+ show +
7451
7452
7453
7454
7455
SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
+ show +
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
/* ** CAPI3REF: Mutex Methods Object ** ** An instance of this structure defines the low-level routines ** used to allocate and use mutexes. ** ** Usually, the default mutex implementations provided by SQLite are ** sufficient, however the application has the option of substituting a custom ** implementation for specialized deployments or systems for which SQLite

[CVE-2015-6607_1.diff] sqlite3.h #15
-SQLITE_API int sqlite3_initialize(void); -SQLITE_API int sqlite3_shutdown(void); -SQLITE_API int sqlite3_os_init(void); -SQLITE_API int sqlite3_os_end(void); +SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void); +SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void); +SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void); +SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void);
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.c
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
** implementations for sqlite3_os_init() and sqlite3_os_end() ** are built into SQLite when it is compiled for Unix, Windows, or OS/2. ** When [custom builds | built for other platforms] ** (using the [SQLITE_OS_OTHER=1] compile-time ** option) the application must supply a suitable implementation for ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied ** implementation of sqlite3_os_init() or sqlite3_os_end() ** must return [SQLITE_OK] on success and some other [error code] upon ** failure. */
+ show +
2581
2582
2583
2584
SQLITE_API int sqlite3_initialize(void); SQLITE_API int sqlite3_shutdown(void); SQLITE_API int sqlite3_os_init(void); SQLITE_API int sqlite3_os_end(void);
+ show +
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
/* ** CAPI3REF: Configuring The SQLite Library ** ** The sqlite3_config() interface is used to make global configuration ** changes to SQLite in order to tune SQLite to the specific needs of ** the application. The default configuration is recommended for most ** applications and so this routine is usually not necessary. It is ** provided to support rare applications with unusual needs. **
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.h
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
** implementations for sqlite3_os_init() and sqlite3_os_end() ** are built into SQLite when it is compiled for Unix, Windows, or OS/2. ** When [custom builds | built for other platforms] ** (using the [SQLITE_OS_OTHER=1] compile-time ** option) the application must supply a suitable implementation for ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied ** implementation of sqlite3_os_init() or sqlite3_os_end() ** must return [SQLITE_OK] on success and some other [error code] upon ** failure. */
+ show +
1542
1543
1544
1545
SQLITE_API int sqlite3_initialize(void); SQLITE_API int sqlite3_shutdown(void); SQLITE_API int sqlite3_os_init(void); SQLITE_API int sqlite3_os_end(void);
+ show +
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
/* ** CAPI3REF: Configuring The SQLite Library ** ** The sqlite3_config() interface is used to make global configuration ** changes to SQLite in order to tune SQLite to the specific needs of ** the application. The default configuration is recommended for most ** applications and so this routine is usually not necessary. It is ** provided to support rare applications with unusual needs. **
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.c
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
** implementations for sqlite3_os_init() and sqlite3_os_end() ** are built into SQLite when it is compiled for Unix, Windows, or OS/2. ** When [custom builds | built for other platforms] ** (using the [SQLITE_OS_OTHER=1] compile-time ** option) the application must supply a suitable implementation for ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied ** implementation of sqlite3_os_init() or sqlite3_os_end() ** must return [SQLITE_OK] on success and some other [error code] upon ** failure. */
+ show +
2581
2582
2583
2584
SQLITE_API int sqlite3_initialize(void); SQLITE_API int sqlite3_shutdown(void); SQLITE_API int sqlite3_os_init(void); SQLITE_API int sqlite3_os_end(void);
+ show +
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
/* ** CAPI3REF: Configuring The SQLite Library ** ** The sqlite3_config() interface is used to make global configuration ** changes to SQLite in order to tune SQLite to the specific needs of ** the application. The default configuration is recommended for most ** applications and so this routine is usually not necessary. It is ** provided to support rare applications with unusual needs. **
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.h
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
** implementations for sqlite3_os_init() and sqlite3_os_end() ** are built into SQLite when it is compiled for Unix, Windows, or OS/2. ** When [custom builds | built for other platforms] ** (using the [SQLITE_OS_OTHER=1] compile-time ** option) the application must supply a suitable implementation for ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied ** implementation of sqlite3_os_init() or sqlite3_os_end() ** must return [SQLITE_OK] on success and some other [error code] upon ** failure. */
+ show +
1542
1543
1544
1545
SQLITE_API int sqlite3_initialize(void); SQLITE_API int sqlite3_shutdown(void); SQLITE_API int sqlite3_os_init(void); SQLITE_API int sqlite3_os_end(void);
+ show +
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
/* ** CAPI3REF: Configuring The SQLite Library ** ** The sqlite3_config() interface is used to make global configuration ** changes to SQLite in order to tune SQLite to the specific needs of ** the application. The default configuration is recommended for most ** applications and so this routine is usually not necessary. It is ** provided to support rare applications with unusual needs. **

[CVE-2015-6607_1.diff] sqlite3.h #39
+** ^(The "%w" formatting option is like "%q" except that it expects to +** be contained within double-quotes instead of single quotes, and it +** escapes the double-quote character instead of the single-quote +** character.)^ The "%w" formatting option is intended for safely inserting +** table and column names into a constructed SQL statement. +** -SQLITE_API char *sqlite3_mprintf(const char*,...); -SQLITE_API char *sqlite3_vmprintf(const char*, va_list); -SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); -SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list); +SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...); +SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list); +SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...); +SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list);
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.c
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
** ^As long as the buffer size is greater than zero, sqlite3_snprintf() ** guarantees that the buffer is always zero-terminated. ^The first ** parameter "n" is the total size of the buffer, including space for ** the zero terminator. So the longest string that can be completely ** written will be n-1 characters. ** ** ^The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf(). ** ** See also: [built-in printf()], [printf() SQL function] */
+ show +
3843
3844
3845
3846
SQLITE_API char *sqlite3_mprintf(const char*,...); SQLITE_API char *sqlite3_vmprintf(const char*, va_list); SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
+ show +
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
/* ** CAPI3REF: Memory Allocation Subsystem ** ** The SQLite core uses these three routines for all of its own ** internal memory allocation needs. "Core" in the previous sentence ** does not include operating-system specific [VFS] implementation. The ** Windows VFS uses native malloc() and free() for some operations. ** ** ^The sqlite3_malloc() routine returns a pointer to a block
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.h
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
** ^As long as the buffer size is greater than zero, sqlite3_snprintf() ** guarantees that the buffer is always zero-terminated. ^The first ** parameter "n" is the total size of the buffer, including space for ** the zero terminator. So the longest string that can be completely ** written will be n-1 characters. ** ** ^The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf(). ** ** See also: [built-in printf()], [printf() SQL function] */
+ show +
2804
2805
2806
2807
SQLITE_API char *sqlite3_mprintf(const char*,...); SQLITE_API char *sqlite3_vmprintf(const char*, va_list); SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
+ show +
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
/* ** CAPI3REF: Memory Allocation Subsystem ** ** The SQLite core uses these three routines for all of its own ** internal memory allocation needs. "Core" in the previous sentence ** does not include operating-system specific [VFS] implementation. The ** Windows VFS uses native malloc() and free() for some operations. ** ** ^The sqlite3_malloc() routine returns a pointer to a block
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.c
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
** ^As long as the buffer size is greater than zero, sqlite3_snprintf() ** guarantees that the buffer is always zero-terminated. ^The first ** parameter "n" is the total size of the buffer, including space for ** the zero terminator. So the longest string that can be completely ** written will be n-1 characters. ** ** ^The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf(). ** ** See also: [built-in printf()], [printf() SQL function] */
+ show +
3843
3844
3845
3846
SQLITE_API char *sqlite3_mprintf(const char*,...); SQLITE_API char *sqlite3_vmprintf(const char*, va_list); SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
+ show +
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
/* ** CAPI3REF: Memory Allocation Subsystem ** ** The SQLite core uses these three routines for all of its own ** internal memory allocation needs. "Core" in the previous sentence ** does not include operating-system specific [VFS] implementation. The ** Windows VFS uses native malloc() and free() for some operations. ** ** ^The sqlite3_malloc() routine returns a pointer to a block
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.h
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
** ^As long as the buffer size is greater than zero, sqlite3_snprintf() ** guarantees that the buffer is always zero-terminated. ^The first ** parameter "n" is the total size of the buffer, including space for ** the zero terminator. So the longest string that can be completely ** written will be n-1 characters. ** ** ^The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf(). ** ** See also: [built-in printf()], [printf() SQL function] */
+ show +
2804
2805
2806
2807
SQLITE_API char *sqlite3_mprintf(const char*,...); SQLITE_API char *sqlite3_vmprintf(const char*, va_list); SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
+ show +
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
/* ** CAPI3REF: Memory Allocation Subsystem ** ** The SQLite core uses these three routines for all of its own ** internal memory allocation needs. "Core" in the previous sentence ** does not include operating-system specific [VFS] implementation. The ** Windows VFS uses native malloc() and free() for some operations. ** ** ^The sqlite3_malloc() routine returns a pointer to a block

[CVE-2015-6607_1.diff] sqlite3.h #53
-SQLITE_API int sqlite3_errcode(sqlite3 *db); -SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); -SQLITE_API const char *sqlite3_errmsg(sqlite3*); -SQLITE_API const void *sqlite3_errmsg16(sqlite3*); -SQLITE_API const char *sqlite3_errstr(int); +SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db); +SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db); +SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*); +SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*); +SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int);
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.c
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
** interfaces always report the most recent result. To avoid ** this, each thread can obtain exclusive use of the [database connection] D ** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning ** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after ** all calls to the interfaces listed here are completed. ** ** If an interface fails with SQLITE_MISUSE, that means the interface ** was invoked incorrectly by the application. In that case, the ** error code and message may or may not be set. */
+ show +
4803
4804
4805
4806
4807
SQLITE_API int sqlite3_errcode(sqlite3 *db); SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); SQLITE_API const char *sqlite3_errmsg(sqlite3*); SQLITE_API const void *sqlite3_errmsg16(sqlite3*); SQLITE_API const char *sqlite3_errstr(int);
+ show +
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
/* ** CAPI3REF: Prepared Statement Object ** KEYWORDS: {prepared statement} {prepared statements} ** ** An instance of this object represents a single SQL statement that ** has been compiled into binary form and is ready to be evaluated. ** ** Think of each SQL statement as a separate computer program. The ** original SQL text is source code. A prepared statement object
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.h
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
** interfaces always report the most recent result. To avoid ** this, each thread can obtain exclusive use of the [database connection] D ** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning ** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after ** all calls to the interfaces listed here are completed. ** ** If an interface fails with SQLITE_MISUSE, that means the interface ** was invoked incorrectly by the application. In that case, the ** error code and message may or may not be set. */
+ show +
3764
3765
3766
3767
3768
SQLITE_API int sqlite3_errcode(sqlite3 *db); SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); SQLITE_API const char *sqlite3_errmsg(sqlite3*); SQLITE_API const void *sqlite3_errmsg16(sqlite3*); SQLITE_API const char *sqlite3_errstr(int);
+ show +
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
/* ** CAPI3REF: Prepared Statement Object ** KEYWORDS: {prepared statement} {prepared statements} ** ** An instance of this object represents a single SQL statement that ** has been compiled into binary form and is ready to be evaluated. ** ** Think of each SQL statement as a separate computer program. The ** original SQL text is source code. A prepared statement object
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.c
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
** interfaces always report the most recent result. To avoid ** this, each thread can obtain exclusive use of the [database connection] D ** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning ** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after ** all calls to the interfaces listed here are completed. ** ** If an interface fails with SQLITE_MISUSE, that means the interface ** was invoked incorrectly by the application. In that case, the ** error code and message may or may not be set. */
+ show +
4803
4804
4805
4806
4807
SQLITE_API int sqlite3_errcode(sqlite3 *db); SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); SQLITE_API const char *sqlite3_errmsg(sqlite3*); SQLITE_API const void *sqlite3_errmsg16(sqlite3*); SQLITE_API const char *sqlite3_errstr(int);
+ show +
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
/* ** CAPI3REF: Prepared Statement Object ** KEYWORDS: {prepared statement} {prepared statements} ** ** An instance of this object represents a single SQL statement that ** has been compiled into binary form and is ready to be evaluated. ** ** Think of each SQL statement as a separate computer program. The ** original SQL text is source code. A prepared statement object
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.h
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
** interfaces always report the most recent result. To avoid ** this, each thread can obtain exclusive use of the [database connection] D ** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning ** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after ** all calls to the interfaces listed here are completed. ** ** If an interface fails with SQLITE_MISUSE, that means the interface ** was invoked incorrectly by the application. In that case, the ** error code and message may or may not be set. */
+ show +
3764
3765
3766
3767
3768
SQLITE_API int sqlite3_errcode(sqlite3 *db); SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); SQLITE_API const char *sqlite3_errmsg(sqlite3*); SQLITE_API const void *sqlite3_errmsg16(sqlite3*); SQLITE_API const char *sqlite3_errstr(int);
+ show +
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
/* ** CAPI3REF: Prepared Statement Object ** KEYWORDS: {prepared statement} {prepared statements} ** ** An instance of this object represents a single SQL statement that ** has been compiled into binary form and is ready to be evaluated. ** ** Think of each SQL statement as a separate computer program. The ** original SQL text is source code. A prepared statement object

[CVE-2015-6607_1.diff] sqlite3.h #71
-SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); -SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); -SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); -SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); -SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); -SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int); +SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int); +SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int); +SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int); +SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int); +SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int); +SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.c
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
** UTF-16 encoded strings and the other functions return UTF-8. ** ** ^These APIs are only available if the library was compiled with the ** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol. ** ** If two or more threads call one or more ** [sqlite3_column_database_name | column metadata interfaces] ** for the same [prepared statement] and result column ** at the same time then the results are undefined. */
+ show +
5614
5615
5616
5617
5618
5619
SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
+ show +
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
/* ** CAPI3REF: Declared Datatype Of A Query Result ** METHOD: sqlite3_stmt ** ** ^(The first parameter is a [prepared statement]. ** If this statement is a [SELECT] statement and the Nth column of the ** returned result set of that [SELECT] is a table column (not an ** expression or subquery) then the declared type of the table ** column is returned.)^ ^If the Nth column of the result set is an
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.h
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
** UTF-16 encoded strings and the other functions return UTF-8. ** ** ^These APIs are only available if the library was compiled with the ** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol. ** ** If two or more threads call one or more ** [sqlite3_column_database_name | column metadata interfaces] ** for the same [prepared statement] and result column ** at the same time then the results are undefined. */
+ show +
4575
4576
4577
4578
4579
4580
SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
+ show +
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
/* ** CAPI3REF: Declared Datatype Of A Query Result ** METHOD: sqlite3_stmt ** ** ^(The first parameter is a [prepared statement]. ** If this statement is a [SELECT] statement and the Nth column of the ** returned result set of that [SELECT] is a table column (not an ** expression or subquery) then the declared type of the table ** column is returned.)^ ^If the Nth column of the result set is an
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.c
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
** UTF-16 encoded strings and the other functions return UTF-8. ** ** ^These APIs are only available if the library was compiled with the ** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol. ** ** If two or more threads call one or more ** [sqlite3_column_database_name | column metadata interfaces] ** for the same [prepared statement] and result column ** at the same time then the results are undefined. */
+ show +
5614
5615
5616
5617
5618
5619
SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
+ show +
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
/* ** CAPI3REF: Declared Datatype Of A Query Result ** METHOD: sqlite3_stmt ** ** ^(The first parameter is a [prepared statement]. ** If this statement is a [SELECT] statement and the Nth column of the ** returned result set of that [SELECT] is a table column (not an ** expression or subquery) then the declared type of the table ** column is returned.)^ ^If the Nth column of the result set is an
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.h
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
** UTF-16 encoded strings and the other functions return UTF-8. ** ** ^These APIs are only available if the library was compiled with the ** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol. ** ** If two or more threads call one or more ** [sqlite3_column_database_name | column metadata interfaces] ** for the same [prepared statement] and result column ** at the same time then the results are undefined. */
+ show +
4575
4576
4577
4578
4579
4580
SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
+ show +
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
/* ** CAPI3REF: Declared Datatype Of A Query Result ** METHOD: sqlite3_stmt ** ** ^(The first parameter is a [prepared statement]. ** If this statement is a [SELECT] statement and the Nth column of the ** returned result set of that [SELECT] is a table column (not an ** expression or subquery) then the declared type of the table ** column is returned.)^ ^If the Nth column of the result set is an

[CVE-2015-6607_1.diff] sqlite3.h #135
-SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); -SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); -SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); -SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); -SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*); +SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int); +SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*); +SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*); +SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*); +SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*);
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.c
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
** previously entered by the same thread. The behavior ** is undefined if the mutex is not currently entered by the ** calling thread or is not currently allocated. ** ** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or ** sqlite3_mutex_leave() is a NULL pointer, then all three routines ** behave as no-ops. ** ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. */
+ show +
8490
8491
8492
8493
8494
SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
+ show +
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
/* ** CAPI3REF: Mutex Methods Object ** ** An instance of this structure defines the low-level routines ** used to allocate and use mutexes. ** ** Usually, the default mutex implementations provided by SQLite are ** sufficient, however the application has the option of substituting a custom ** implementation for specialized deployments or systems for which SQLite
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.h
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
** previously entered by the same thread. The behavior ** is undefined if the mutex is not currently entered by the ** calling thread or is not currently allocated. ** ** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or ** sqlite3_mutex_leave() is a NULL pointer, then all three routines ** behave as no-ops. ** ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. */
+ show +
7451
7452
7453
7454
7455
SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
+ show +
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
/* ** CAPI3REF: Mutex Methods Object ** ** An instance of this structure defines the low-level routines ** used to allocate and use mutexes. ** ** Usually, the default mutex implementations provided by SQLite are ** sufficient, however the application has the option of substituting a custom ** implementation for specialized deployments or systems for which SQLite
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.c
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
** previously entered by the same thread. The behavior ** is undefined if the mutex is not currently entered by the ** calling thread or is not currently allocated. ** ** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or ** sqlite3_mutex_leave() is a NULL pointer, then all three routines ** behave as no-ops. ** ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. */
+ show +
8490
8491
8492
8493
8494
SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
+ show +
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
/* ** CAPI3REF: Mutex Methods Object ** ** An instance of this structure defines the low-level routines ** used to allocate and use mutexes. ** ** Usually, the default mutex implementations provided by SQLite are ** sufficient, however the application has the option of substituting a custom ** implementation for specialized deployments or systems for which SQLite
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.h
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
** previously entered by the same thread. The behavior ** is undefined if the mutex is not currently entered by the ** calling thread or is not currently allocated. ** ** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or ** sqlite3_mutex_leave() is a NULL pointer, then all three routines ** behave as no-ops. ** ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. */
+ show +
7451
7452
7453
7454
7455
SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
+ show +
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
/* ** CAPI3REF: Mutex Methods Object ** ** An instance of this structure defines the low-level routines ** used to allocate and use mutexes. ** ** Usually, the default mutex implementations provided by SQLite are ** sufficient, however the application has the option of substituting a custom ** implementation for specialized deployments or systems for which SQLite

[CVE-2015-6607_1.diff] sqlite3.c #19
-SQLITE_API int sqlite3_initialize(void); -SQLITE_API int sqlite3_shutdown(void); -SQLITE_API int sqlite3_os_init(void); -SQLITE_API int sqlite3_os_end(void); +SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void); +SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void); +SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void); +SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void);
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.c
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
** implementations for sqlite3_os_init() and sqlite3_os_end() ** are built into SQLite when it is compiled for Unix, Windows, or OS/2. ** When [custom builds | built for other platforms] ** (using the [SQLITE_OS_OTHER=1] compile-time ** option) the application must supply a suitable implementation for ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied ** implementation of sqlite3_os_init() or sqlite3_os_end() ** must return [SQLITE_OK] on success and some other [error code] upon ** failure. */
+ show +
2581
2582
2583
2584
SQLITE_API int sqlite3_initialize(void); SQLITE_API int sqlite3_shutdown(void); SQLITE_API int sqlite3_os_init(void); SQLITE_API int sqlite3_os_end(void);
+ show +
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
/* ** CAPI3REF: Configuring The SQLite Library ** ** The sqlite3_config() interface is used to make global configuration ** changes to SQLite in order to tune SQLite to the specific needs of ** the application. The default configuration is recommended for most ** applications and so this routine is usually not necessary. It is ** provided to support rare applications with unusual needs. **
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.h
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
** implementations for sqlite3_os_init() and sqlite3_os_end() ** are built into SQLite when it is compiled for Unix, Windows, or OS/2. ** When [custom builds | built for other platforms] ** (using the [SQLITE_OS_OTHER=1] compile-time ** option) the application must supply a suitable implementation for ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied ** implementation of sqlite3_os_init() or sqlite3_os_end() ** must return [SQLITE_OK] on success and some other [error code] upon ** failure. */
+ show +
1542
1543
1544
1545
SQLITE_API int sqlite3_initialize(void); SQLITE_API int sqlite3_shutdown(void); SQLITE_API int sqlite3_os_init(void); SQLITE_API int sqlite3_os_end(void);
+ show +
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
/* ** CAPI3REF: Configuring The SQLite Library ** ** The sqlite3_config() interface is used to make global configuration ** changes to SQLite in order to tune SQLite to the specific needs of ** the application. The default configuration is recommended for most ** applications and so this routine is usually not necessary. It is ** provided to support rare applications with unusual needs. **
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.c
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
** implementations for sqlite3_os_init() and sqlite3_os_end() ** are built into SQLite when it is compiled for Unix, Windows, or OS/2. ** When [custom builds | built for other platforms] ** (using the [SQLITE_OS_OTHER=1] compile-time ** option) the application must supply a suitable implementation for ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied ** implementation of sqlite3_os_init() or sqlite3_os_end() ** must return [SQLITE_OK] on success and some other [error code] upon ** failure. */
+ show +
2581
2582
2583
2584
SQLITE_API int sqlite3_initialize(void); SQLITE_API int sqlite3_shutdown(void); SQLITE_API int sqlite3_os_init(void); SQLITE_API int sqlite3_os_end(void);
+ show +
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
/* ** CAPI3REF: Configuring The SQLite Library ** ** The sqlite3_config() interface is used to make global configuration ** changes to SQLite in order to tune SQLite to the specific needs of ** the application. The default configuration is recommended for most ** applications and so this routine is usually not necessary. It is ** provided to support rare applications with unusual needs. **
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.h
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
** implementations for sqlite3_os_init() and sqlite3_os_end() ** are built into SQLite when it is compiled for Unix, Windows, or OS/2. ** When [custom builds | built for other platforms] ** (using the [SQLITE_OS_OTHER=1] compile-time ** option) the application must supply a suitable implementation for ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied ** implementation of sqlite3_os_init() or sqlite3_os_end() ** must return [SQLITE_OK] on success and some other [error code] upon ** failure. */
+ show +
1542
1543
1544
1545
SQLITE_API int sqlite3_initialize(void); SQLITE_API int sqlite3_shutdown(void); SQLITE_API int sqlite3_os_init(void); SQLITE_API int sqlite3_os_end(void);
+ show +
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
/* ** CAPI3REF: Configuring The SQLite Library ** ** The sqlite3_config() interface is used to make global configuration ** changes to SQLite in order to tune SQLite to the specific needs of ** the application. The default configuration is recommended for most ** applications and so this routine is usually not necessary. It is ** provided to support rare applications with unusual needs. **

[CVE-2015-6607_1.diff] sqlite3.c #43
+** ^(The "%w" formatting option is like "%q" except that it expects to +** be contained within double-quotes instead of single quotes, and it +** escapes the double-quote character instead of the single-quote +** character.)^ The "%w" formatting option is intended for safely inserting +** table and column names into a constructed SQL statement. +** -SQLITE_API char *sqlite3_mprintf(const char*,...); -SQLITE_API char *sqlite3_vmprintf(const char*, va_list); -SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); -SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list); +SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...); +SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list); +SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...); +SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list);
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.c
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
** ^As long as the buffer size is greater than zero, sqlite3_snprintf() ** guarantees that the buffer is always zero-terminated. ^The first ** parameter "n" is the total size of the buffer, including space for ** the zero terminator. So the longest string that can be completely ** written will be n-1 characters. ** ** ^The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf(). ** ** See also: [built-in printf()], [printf() SQL function] */
+ show +
3843
3844
3845
3846
SQLITE_API char *sqlite3_mprintf(const char*,...); SQLITE_API char *sqlite3_vmprintf(const char*, va_list); SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
+ show +
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
/* ** CAPI3REF: Memory Allocation Subsystem ** ** The SQLite core uses these three routines for all of its own ** internal memory allocation needs. "Core" in the previous sentence ** does not include operating-system specific [VFS] implementation. The ** Windows VFS uses native malloc() and free() for some operations. ** ** ^The sqlite3_malloc() routine returns a pointer to a block
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.h
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
** ^As long as the buffer size is greater than zero, sqlite3_snprintf() ** guarantees that the buffer is always zero-terminated. ^The first ** parameter "n" is the total size of the buffer, including space for ** the zero terminator. So the longest string that can be completely ** written will be n-1 characters. ** ** ^The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf(). ** ** See also: [built-in printf()], [printf() SQL function] */
+ show +
2804
2805
2806
2807
SQLITE_API char *sqlite3_mprintf(const char*,...); SQLITE_API char *sqlite3_vmprintf(const char*, va_list); SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
+ show +
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
/* ** CAPI3REF: Memory Allocation Subsystem ** ** The SQLite core uses these three routines for all of its own ** internal memory allocation needs. "Core" in the previous sentence ** does not include operating-system specific [VFS] implementation. The ** Windows VFS uses native malloc() and free() for some operations. ** ** ^The sqlite3_malloc() routine returns a pointer to a block
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.c
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
** ^As long as the buffer size is greater than zero, sqlite3_snprintf() ** guarantees that the buffer is always zero-terminated. ^The first ** parameter "n" is the total size of the buffer, including space for ** the zero terminator. So the longest string that can be completely ** written will be n-1 characters. ** ** ^The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf(). ** ** See also: [built-in printf()], [printf() SQL function] */
+ show +
3843
3844
3845
3846
SQLITE_API char *sqlite3_mprintf(const char*,...); SQLITE_API char *sqlite3_vmprintf(const char*, va_list); SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
+ show +
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
/* ** CAPI3REF: Memory Allocation Subsystem ** ** The SQLite core uses these three routines for all of its own ** internal memory allocation needs. "Core" in the previous sentence ** does not include operating-system specific [VFS] implementation. The ** Windows VFS uses native malloc() and free() for some operations. ** ** ^The sqlite3_malloc() routine returns a pointer to a block
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.h
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
** ^As long as the buffer size is greater than zero, sqlite3_snprintf() ** guarantees that the buffer is always zero-terminated. ^The first ** parameter "n" is the total size of the buffer, including space for ** the zero terminator. So the longest string that can be completely ** written will be n-1 characters. ** ** ^The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf(). ** ** See also: [built-in printf()], [printf() SQL function] */
+ show +
2804
2805
2806
2807
SQLITE_API char *sqlite3_mprintf(const char*,...); SQLITE_API char *sqlite3_vmprintf(const char*, va_list); SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
+ show +
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
/* ** CAPI3REF: Memory Allocation Subsystem ** ** The SQLite core uses these three routines for all of its own ** internal memory allocation needs. "Core" in the previous sentence ** does not include operating-system specific [VFS] implementation. The ** Windows VFS uses native malloc() and free() for some operations. ** ** ^The sqlite3_malloc() routine returns a pointer to a block

[CVE-2015-6607_1.diff] sqlite3.c #57
-SQLITE_API int sqlite3_errcode(sqlite3 *db); -SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); -SQLITE_API const char *sqlite3_errmsg(sqlite3*); -SQLITE_API const void *sqlite3_errmsg16(sqlite3*); -SQLITE_API const char *sqlite3_errstr(int); +SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db); +SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db); +SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*); +SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*); +SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int);
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.c
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
** interfaces always report the most recent result. To avoid ** this, each thread can obtain exclusive use of the [database connection] D ** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning ** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after ** all calls to the interfaces listed here are completed. ** ** If an interface fails with SQLITE_MISUSE, that means the interface ** was invoked incorrectly by the application. In that case, the ** error code and message may or may not be set. */
+ show +
4803
4804
4805
4806
4807
SQLITE_API int sqlite3_errcode(sqlite3 *db); SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); SQLITE_API const char *sqlite3_errmsg(sqlite3*); SQLITE_API const void *sqlite3_errmsg16(sqlite3*); SQLITE_API const char *sqlite3_errstr(int);
+ show +
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
/* ** CAPI3REF: Prepared Statement Object ** KEYWORDS: {prepared statement} {prepared statements} ** ** An instance of this object represents a single SQL statement that ** has been compiled into binary form and is ready to be evaluated. ** ** Think of each SQL statement as a separate computer program. The ** original SQL text is source code. A prepared statement object
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.h
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
** interfaces always report the most recent result. To avoid ** this, each thread can obtain exclusive use of the [database connection] D ** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning ** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after ** all calls to the interfaces listed here are completed. ** ** If an interface fails with SQLITE_MISUSE, that means the interface ** was invoked incorrectly by the application. In that case, the ** error code and message may or may not be set. */
+ show +
3764
3765
3766
3767
3768
SQLITE_API int sqlite3_errcode(sqlite3 *db); SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); SQLITE_API const char *sqlite3_errmsg(sqlite3*); SQLITE_API const void *sqlite3_errmsg16(sqlite3*); SQLITE_API const char *sqlite3_errstr(int);
+ show +
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
/* ** CAPI3REF: Prepared Statement Object ** KEYWORDS: {prepared statement} {prepared statements} ** ** An instance of this object represents a single SQL statement that ** has been compiled into binary form and is ready to be evaluated. ** ** Think of each SQL statement as a separate computer program. The ** original SQL text is source code. A prepared statement object
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.c
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
** interfaces always report the most recent result. To avoid ** this, each thread can obtain exclusive use of the [database connection] D ** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning ** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after ** all calls to the interfaces listed here are completed. ** ** If an interface fails with SQLITE_MISUSE, that means the interface ** was invoked incorrectly by the application. In that case, the ** error code and message may or may not be set. */
+ show +
4803
4804
4805
4806
4807
SQLITE_API int sqlite3_errcode(sqlite3 *db); SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); SQLITE_API const char *sqlite3_errmsg(sqlite3*); SQLITE_API const void *sqlite3_errmsg16(sqlite3*); SQLITE_API const char *sqlite3_errstr(int);
+ show +
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
/* ** CAPI3REF: Prepared Statement Object ** KEYWORDS: {prepared statement} {prepared statements} ** ** An instance of this object represents a single SQL statement that ** has been compiled into binary form and is ready to be evaluated. ** ** Think of each SQL statement as a separate computer program. The ** original SQL text is source code. A prepared statement object
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.h
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
** interfaces always report the most recent result. To avoid ** this, each thread can obtain exclusive use of the [database connection] D ** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning ** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after ** all calls to the interfaces listed here are completed. ** ** If an interface fails with SQLITE_MISUSE, that means the interface ** was invoked incorrectly by the application. In that case, the ** error code and message may or may not be set. */
+ show +
3764
3765
3766
3767
3768
SQLITE_API int sqlite3_errcode(sqlite3 *db); SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); SQLITE_API const char *sqlite3_errmsg(sqlite3*); SQLITE_API const void *sqlite3_errmsg16(sqlite3*); SQLITE_API const char *sqlite3_errstr(int);
+ show +
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
/* ** CAPI3REF: Prepared Statement Object ** KEYWORDS: {prepared statement} {prepared statements} ** ** An instance of this object represents a single SQL statement that ** has been compiled into binary form and is ready to be evaluated. ** ** Think of each SQL statement as a separate computer program. The ** original SQL text is source code. A prepared statement object

[CVE-2015-6607_1.diff] sqlite3.c #75
-SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); -SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); -SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); -SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); -SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); -SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int); +SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int); +SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int); +SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int); +SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int); +SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int); +SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.c
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
** UTF-16 encoded strings and the other functions return UTF-8. ** ** ^These APIs are only available if the library was compiled with the ** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol. ** ** If two or more threads call one or more ** [sqlite3_column_database_name | column metadata interfaces] ** for the same [prepared statement] and result column ** at the same time then the results are undefined. */
+ show +
5614
5615
5616
5617
5618
5619
SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
+ show +
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
/* ** CAPI3REF: Declared Datatype Of A Query Result ** METHOD: sqlite3_stmt ** ** ^(The first parameter is a [prepared statement]. ** If this statement is a [SELECT] statement and the Nth column of the ** returned result set of that [SELECT] is a table column (not an ** expression or subquery) then the declared type of the table ** column is returned.)^ ^If the Nth column of the result set is an
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.h
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
** UTF-16 encoded strings and the other functions return UTF-8. ** ** ^These APIs are only available if the library was compiled with the ** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol. ** ** If two or more threads call one or more ** [sqlite3_column_database_name | column metadata interfaces] ** for the same [prepared statement] and result column ** at the same time then the results are undefined. */
+ show +
4575
4576
4577
4578
4579
4580
SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
+ show +
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
/* ** CAPI3REF: Declared Datatype Of A Query Result ** METHOD: sqlite3_stmt ** ** ^(The first parameter is a [prepared statement]. ** If this statement is a [SELECT] statement and the Nth column of the ** returned result set of that [SELECT] is a table column (not an ** expression or subquery) then the declared type of the table ** column is returned.)^ ^If the Nth column of the result set is an
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.c
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
** UTF-16 encoded strings and the other functions return UTF-8. ** ** ^These APIs are only available if the library was compiled with the ** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol. ** ** If two or more threads call one or more ** [sqlite3_column_database_name | column metadata interfaces] ** for the same [prepared statement] and result column ** at the same time then the results are undefined. */
+ show +
5614
5615
5616
5617
5618
5619
SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
+ show +
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
/* ** CAPI3REF: Declared Datatype Of A Query Result ** METHOD: sqlite3_stmt ** ** ^(The first parameter is a [prepared statement]. ** If this statement is a [SELECT] statement and the Nth column of the ** returned result set of that [SELECT] is a table column (not an ** expression or subquery) then the declared type of the table ** column is returned.)^ ^If the Nth column of the result set is an
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.h
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
** UTF-16 encoded strings and the other functions return UTF-8. ** ** ^These APIs are only available if the library was compiled with the ** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol. ** ** If two or more threads call one or more ** [sqlite3_column_database_name | column metadata interfaces] ** for the same [prepared statement] and result column ** at the same time then the results are undefined. */
+ show +
4575
4576
4577
4578
4579
4580
SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
+ show +
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
/* ** CAPI3REF: Declared Datatype Of A Query Result ** METHOD: sqlite3_stmt ** ** ^(The first parameter is a [prepared statement]. ** If this statement is a [SELECT] statement and the Nth column of the ** returned result set of that [SELECT] is a table column (not an ** expression or subquery) then the declared type of the table ** column is returned.)^ ^If the Nth column of the result set is an

[CVE-2015-6607_1.diff] sqlite3.c #139
-SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); -SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); -SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); -SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); -SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*); +SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int); +SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*); +SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*); +SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*); +SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*);
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.c
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
** previously entered by the same thread. The behavior ** is undefined if the mutex is not currently entered by the ** calling thread or is not currently allocated. ** ** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or ** sqlite3_mutex_leave() is a NULL pointer, then all three routines ** behave as no-ops. ** ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. */
+ show +
8490
8491
8492
8493
8494
SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
+ show +
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
/* ** CAPI3REF: Mutex Methods Object ** ** An instance of this structure defines the low-level routines ** used to allocate and use mutexes. ** ** Usually, the default mutex implementations provided by SQLite are ** sufficient, however the application has the option of substituting a custom ** implementation for specialized deployments or systems for which SQLite
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.h
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
** previously entered by the same thread. The behavior ** is undefined if the mutex is not currently entered by the ** calling thread or is not currently allocated. ** ** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or ** sqlite3_mutex_leave() is a NULL pointer, then all three routines ** behave as no-ops. ** ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. */
+ show +
7451
7452
7453
7454
7455
SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
+ show +
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
/* ** CAPI3REF: Mutex Methods Object ** ** An instance of this structure defines the low-level routines ** used to allocate and use mutexes. ** ** Usually, the default mutex implementations provided by SQLite are ** sufficient, however the application has the option of substituting a custom ** implementation for specialized deployments or systems for which SQLite
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.c
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
** previously entered by the same thread. The behavior ** is undefined if the mutex is not currently entered by the ** calling thread or is not currently allocated. ** ** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or ** sqlite3_mutex_leave() is a NULL pointer, then all three routines ** behave as no-ops. ** ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. */
+ show +
8490
8491
8492
8493
8494
SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
+ show +
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
/* ** CAPI3REF: Mutex Methods Object ** ** An instance of this structure defines the low-level routines ** used to allocate and use mutexes. ** ** Usually, the default mutex implementations provided by SQLite are ** sufficient, however the application has the option of substituting a custom ** implementation for specialized deployments or systems for which SQLite
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.h
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
** previously entered by the same thread. The behavior ** is undefined if the mutex is not currently entered by the ** calling thread or is not currently allocated. ** ** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or ** sqlite3_mutex_leave() is a NULL pointer, then all three routines ** behave as no-ops. ** ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. */
+ show +
7451
7452
7453
7454
7455
SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
+ show +
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
/* ** CAPI3REF: Mutex Methods Object ** ** An instance of this structure defines the low-level routines ** used to allocate and use mutexes. ** ** Usually, the default mutex implementations provided by SQLite are ** sufficient, however the application has the option of substituting a custom ** implementation for specialized deployments or systems for which SQLite

[CVE-2015-6607_1.diff] sqlite3.h #15
-SQLITE_API int sqlite3_initialize(void); -SQLITE_API int sqlite3_shutdown(void); -SQLITE_API int sqlite3_os_init(void); -SQLITE_API int sqlite3_os_end(void); +SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void); +SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void); +SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void); +SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void);
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.c
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
** implementations for sqlite3_os_init() and sqlite3_os_end() ** are built into SQLite when it is compiled for Unix, Windows, or OS/2. ** When [custom builds | built for other platforms] ** (using the [SQLITE_OS_OTHER=1] compile-time ** option) the application must supply a suitable implementation for ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied ** implementation of sqlite3_os_init() or sqlite3_os_end() ** must return [SQLITE_OK] on success and some other [error code] upon ** failure. */
+ show +
2581
2582
2583
2584
SQLITE_API int sqlite3_initialize(void); SQLITE_API int sqlite3_shutdown(void); SQLITE_API int sqlite3_os_init(void); SQLITE_API int sqlite3_os_end(void);
+ show +
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
/* ** CAPI3REF: Configuring The SQLite Library ** ** The sqlite3_config() interface is used to make global configuration ** changes to SQLite in order to tune SQLite to the specific needs of ** the application. The default configuration is recommended for most ** applications and so this routine is usually not necessary. It is ** provided to support rare applications with unusual needs. **
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.h
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
** implementations for sqlite3_os_init() and sqlite3_os_end() ** are built into SQLite when it is compiled for Unix, Windows, or OS/2. ** When [custom builds | built for other platforms] ** (using the [SQLITE_OS_OTHER=1] compile-time ** option) the application must supply a suitable implementation for ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied ** implementation of sqlite3_os_init() or sqlite3_os_end() ** must return [SQLITE_OK] on success and some other [error code] upon ** failure. */
+ show +
1542
1543
1544
1545
SQLITE_API int sqlite3_initialize(void); SQLITE_API int sqlite3_shutdown(void); SQLITE_API int sqlite3_os_init(void); SQLITE_API int sqlite3_os_end(void);
+ show +
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
/* ** CAPI3REF: Configuring The SQLite Library ** ** The sqlite3_config() interface is used to make global configuration ** changes to SQLite in order to tune SQLite to the specific needs of ** the application. The default configuration is recommended for most ** applications and so this routine is usually not necessary. It is ** provided to support rare applications with unusual needs. **
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.c
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
** implementations for sqlite3_os_init() and sqlite3_os_end() ** are built into SQLite when it is compiled for Unix, Windows, or OS/2. ** When [custom builds | built for other platforms] ** (using the [SQLITE_OS_OTHER=1] compile-time ** option) the application must supply a suitable implementation for ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied ** implementation of sqlite3_os_init() or sqlite3_os_end() ** must return [SQLITE_OK] on success and some other [error code] upon ** failure. */
+ show +
2581
2582
2583
2584
SQLITE_API int sqlite3_initialize(void); SQLITE_API int sqlite3_shutdown(void); SQLITE_API int sqlite3_os_init(void); SQLITE_API int sqlite3_os_end(void);
+ show +
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
/* ** CAPI3REF: Configuring The SQLite Library ** ** The sqlite3_config() interface is used to make global configuration ** changes to SQLite in order to tune SQLite to the specific needs of ** the application. The default configuration is recommended for most ** applications and so this routine is usually not necessary. It is ** provided to support rare applications with unusual needs. **
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.h
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
** implementations for sqlite3_os_init() and sqlite3_os_end() ** are built into SQLite when it is compiled for Unix, Windows, or OS/2. ** When [custom builds | built for other platforms] ** (using the [SQLITE_OS_OTHER=1] compile-time ** option) the application must supply a suitable implementation for ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied ** implementation of sqlite3_os_init() or sqlite3_os_end() ** must return [SQLITE_OK] on success and some other [error code] upon ** failure. */
+ show +
1542
1543
1544
1545
SQLITE_API int sqlite3_initialize(void); SQLITE_API int sqlite3_shutdown(void); SQLITE_API int sqlite3_os_init(void); SQLITE_API int sqlite3_os_end(void);
+ show +
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
/* ** CAPI3REF: Configuring The SQLite Library ** ** The sqlite3_config() interface is used to make global configuration ** changes to SQLite in order to tune SQLite to the specific needs of ** the application. The default configuration is recommended for most ** applications and so this routine is usually not necessary. It is ** provided to support rare applications with unusual needs. **

[CVE-2015-6607_1.diff] sqlite3.h #39
+** ^(The "%w" formatting option is like "%q" except that it expects to +** be contained within double-quotes instead of single quotes, and it +** escapes the double-quote character instead of the single-quote +** character.)^ The "%w" formatting option is intended for safely inserting +** table and column names into a constructed SQL statement. +** -SQLITE_API char *sqlite3_mprintf(const char*,...); -SQLITE_API char *sqlite3_vmprintf(const char*, va_list); -SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); -SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list); +SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...); +SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list); +SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...); +SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list);
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.c
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
** ^As long as the buffer size is greater than zero, sqlite3_snprintf() ** guarantees that the buffer is always zero-terminated. ^The first ** parameter "n" is the total size of the buffer, including space for ** the zero terminator. So the longest string that can be completely ** written will be n-1 characters. ** ** ^The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf(). ** ** See also: [built-in printf()], [printf() SQL function] */
+ show +
3843
3844
3845
3846
SQLITE_API char *sqlite3_mprintf(const char*,...); SQLITE_API char *sqlite3_vmprintf(const char*, va_list); SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
+ show +
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
/* ** CAPI3REF: Memory Allocation Subsystem ** ** The SQLite core uses these three routines for all of its own ** internal memory allocation needs. "Core" in the previous sentence ** does not include operating-system specific [VFS] implementation. The ** Windows VFS uses native malloc() and free() for some operations. ** ** ^The sqlite3_malloc() routine returns a pointer to a block
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.h
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
** ^As long as the buffer size is greater than zero, sqlite3_snprintf() ** guarantees that the buffer is always zero-terminated. ^The first ** parameter "n" is the total size of the buffer, including space for ** the zero terminator. So the longest string that can be completely ** written will be n-1 characters. ** ** ^The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf(). ** ** See also: [built-in printf()], [printf() SQL function] */
+ show +
2804
2805
2806
2807
SQLITE_API char *sqlite3_mprintf(const char*,...); SQLITE_API char *sqlite3_vmprintf(const char*, va_list); SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
+ show +
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
/* ** CAPI3REF: Memory Allocation Subsystem ** ** The SQLite core uses these three routines for all of its own ** internal memory allocation needs. "Core" in the previous sentence ** does not include operating-system specific [VFS] implementation. The ** Windows VFS uses native malloc() and free() for some operations. ** ** ^The sqlite3_malloc() routine returns a pointer to a block
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.c
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
** ^As long as the buffer size is greater than zero, sqlite3_snprintf() ** guarantees that the buffer is always zero-terminated. ^The first ** parameter "n" is the total size of the buffer, including space for ** the zero terminator. So the longest string that can be completely ** written will be n-1 characters. ** ** ^The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf(). ** ** See also: [built-in printf()], [printf() SQL function] */
+ show +
3843
3844
3845
3846
SQLITE_API char *sqlite3_mprintf(const char*,...); SQLITE_API char *sqlite3_vmprintf(const char*, va_list); SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
+ show +
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
/* ** CAPI3REF: Memory Allocation Subsystem ** ** The SQLite core uses these three routines for all of its own ** internal memory allocation needs. "Core" in the previous sentence ** does not include operating-system specific [VFS] implementation. The ** Windows VFS uses native malloc() and free() for some operations. ** ** ^The sqlite3_malloc() routine returns a pointer to a block
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.h
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
** ^As long as the buffer size is greater than zero, sqlite3_snprintf() ** guarantees that the buffer is always zero-terminated. ^The first ** parameter "n" is the total size of the buffer, including space for ** the zero terminator. So the longest string that can be completely ** written will be n-1 characters. ** ** ^The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf(). ** ** See also: [built-in printf()], [printf() SQL function] */
+ show +
2804
2805
2806
2807
SQLITE_API char *sqlite3_mprintf(const char*,...); SQLITE_API char *sqlite3_vmprintf(const char*, va_list); SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
+ show +
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
/* ** CAPI3REF: Memory Allocation Subsystem ** ** The SQLite core uses these three routines for all of its own ** internal memory allocation needs. "Core" in the previous sentence ** does not include operating-system specific [VFS] implementation. The ** Windows VFS uses native malloc() and free() for some operations. ** ** ^The sqlite3_malloc() routine returns a pointer to a block

[CVE-2015-6607_1.diff] sqlite3.h #53
-SQLITE_API int sqlite3_errcode(sqlite3 *db); -SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); -SQLITE_API const char *sqlite3_errmsg(sqlite3*); -SQLITE_API const void *sqlite3_errmsg16(sqlite3*); -SQLITE_API const char *sqlite3_errstr(int); +SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db); +SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db); +SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*); +SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*); +SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int);
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.c
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
** interfaces always report the most recent result. To avoid ** this, each thread can obtain exclusive use of the [database connection] D ** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning ** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after ** all calls to the interfaces listed here are completed. ** ** If an interface fails with SQLITE_MISUSE, that means the interface ** was invoked incorrectly by the application. In that case, the ** error code and message may or may not be set. */
+ show +
4803
4804
4805
4806
4807
SQLITE_API int sqlite3_errcode(sqlite3 *db); SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); SQLITE_API const char *sqlite3_errmsg(sqlite3*); SQLITE_API const void *sqlite3_errmsg16(sqlite3*); SQLITE_API const char *sqlite3_errstr(int);
+ show +
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
/* ** CAPI3REF: Prepared Statement Object ** KEYWORDS: {prepared statement} {prepared statements} ** ** An instance of this object represents a single SQL statement that ** has been compiled into binary form and is ready to be evaluated. ** ** Think of each SQL statement as a separate computer program. The ** original SQL text is source code. A prepared statement object
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.h
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
** interfaces always report the most recent result. To avoid ** this, each thread can obtain exclusive use of the [database connection] D ** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning ** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after ** all calls to the interfaces listed here are completed. ** ** If an interface fails with SQLITE_MISUSE, that means the interface ** was invoked incorrectly by the application. In that case, the ** error code and message may or may not be set. */
+ show +
3764
3765
3766
3767
3768
SQLITE_API int sqlite3_errcode(sqlite3 *db); SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); SQLITE_API const char *sqlite3_errmsg(sqlite3*); SQLITE_API const void *sqlite3_errmsg16(sqlite3*); SQLITE_API const char *sqlite3_errstr(int);
+ show +
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
/* ** CAPI3REF: Prepared Statement Object ** KEYWORDS: {prepared statement} {prepared statements} ** ** An instance of this object represents a single SQL statement that ** has been compiled into binary form and is ready to be evaluated. ** ** Think of each SQL statement as a separate computer program. The ** original SQL text is source code. A prepared statement object
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.c
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
** interfaces always report the most recent result. To avoid ** this, each thread can obtain exclusive use of the [database connection] D ** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning ** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after ** all calls to the interfaces listed here are completed. ** ** If an interface fails with SQLITE_MISUSE, that means the interface ** was invoked incorrectly by the application. In that case, the ** error code and message may or may not be set. */
+ show +
4803
4804
4805
4806
4807
SQLITE_API int sqlite3_errcode(sqlite3 *db); SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); SQLITE_API const char *sqlite3_errmsg(sqlite3*); SQLITE_API const void *sqlite3_errmsg16(sqlite3*); SQLITE_API const char *sqlite3_errstr(int);
+ show +
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
/* ** CAPI3REF: Prepared Statement Object ** KEYWORDS: {prepared statement} {prepared statements} ** ** An instance of this object represents a single SQL statement that ** has been compiled into binary form and is ready to be evaluated. ** ** Think of each SQL statement as a separate computer program. The ** original SQL text is source code. A prepared statement object
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.h
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
** interfaces always report the most recent result. To avoid ** this, each thread can obtain exclusive use of the [database connection] D ** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning ** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after ** all calls to the interfaces listed here are completed. ** ** If an interface fails with SQLITE_MISUSE, that means the interface ** was invoked incorrectly by the application. In that case, the ** error code and message may or may not be set. */
+ show +
3764
3765
3766
3767
3768
SQLITE_API int sqlite3_errcode(sqlite3 *db); SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); SQLITE_API const char *sqlite3_errmsg(sqlite3*); SQLITE_API const void *sqlite3_errmsg16(sqlite3*); SQLITE_API const char *sqlite3_errstr(int);
+ show +
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
/* ** CAPI3REF: Prepared Statement Object ** KEYWORDS: {prepared statement} {prepared statements} ** ** An instance of this object represents a single SQL statement that ** has been compiled into binary form and is ready to be evaluated. ** ** Think of each SQL statement as a separate computer program. The ** original SQL text is source code. A prepared statement object

[CVE-2015-6607_1.diff] sqlite3.h #71
-SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); -SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); -SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); -SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); -SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); -SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int); +SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int); +SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int); +SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int); +SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int); +SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int); +SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.c
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
** UTF-16 encoded strings and the other functions return UTF-8. ** ** ^These APIs are only available if the library was compiled with the ** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol. ** ** If two or more threads call one or more ** [sqlite3_column_database_name | column metadata interfaces] ** for the same [prepared statement] and result column ** at the same time then the results are undefined. */
+ show +
5614
5615
5616
5617
5618
5619
SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
+ show +
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
/* ** CAPI3REF: Declared Datatype Of A Query Result ** METHOD: sqlite3_stmt ** ** ^(The first parameter is a [prepared statement]. ** If this statement is a [SELECT] statement and the Nth column of the ** returned result set of that [SELECT] is a table column (not an ** expression or subquery) then the declared type of the table ** column is returned.)^ ^If the Nth column of the result set is an
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.h
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
** UTF-16 encoded strings and the other functions return UTF-8. ** ** ^These APIs are only available if the library was compiled with the ** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol. ** ** If two or more threads call one or more ** [sqlite3_column_database_name | column metadata interfaces] ** for the same [prepared statement] and result column ** at the same time then the results are undefined. */
+ show +
4575
4576
4577
4578
4579
4580
SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
+ show +
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
/* ** CAPI3REF: Declared Datatype Of A Query Result ** METHOD: sqlite3_stmt ** ** ^(The first parameter is a [prepared statement]. ** If this statement is a [SELECT] statement and the Nth column of the ** returned result set of that [SELECT] is a table column (not an ** expression or subquery) then the declared type of the table ** column is returned.)^ ^If the Nth column of the result set is an
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.c
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
** UTF-16 encoded strings and the other functions return UTF-8. ** ** ^These APIs are only available if the library was compiled with the ** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol. ** ** If two or more threads call one or more ** [sqlite3_column_database_name | column metadata interfaces] ** for the same [prepared statement] and result column ** at the same time then the results are undefined. */
+ show +
5614
5615
5616
5617
5618
5619
SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
+ show +
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
/* ** CAPI3REF: Declared Datatype Of A Query Result ** METHOD: sqlite3_stmt ** ** ^(The first parameter is a [prepared statement]. ** If this statement is a [SELECT] statement and the Nth column of the ** returned result set of that [SELECT] is a table column (not an ** expression or subquery) then the declared type of the table ** column is returned.)^ ^If the Nth column of the result set is an
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.h
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
** UTF-16 encoded strings and the other functions return UTF-8. ** ** ^These APIs are only available if the library was compiled with the ** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol. ** ** If two or more threads call one or more ** [sqlite3_column_database_name | column metadata interfaces] ** for the same [prepared statement] and result column ** at the same time then the results are undefined. */
+ show +
4575
4576
4577
4578
4579
4580
SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
+ show +
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
/* ** CAPI3REF: Declared Datatype Of A Query Result ** METHOD: sqlite3_stmt ** ** ^(The first parameter is a [prepared statement]. ** If this statement is a [SELECT] statement and the Nth column of the ** returned result set of that [SELECT] is a table column (not an ** expression or subquery) then the declared type of the table ** column is returned.)^ ^If the Nth column of the result set is an

[CVE-2015-6607_1.diff] sqlite3.h #135
-SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); -SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); -SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); -SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); -SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*); +SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int); +SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*); +SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*); +SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*); +SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*);
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.c
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
** previously entered by the same thread. The behavior ** is undefined if the mutex is not currently entered by the ** calling thread or is not currently allocated. ** ** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or ** sqlite3_mutex_leave() is a NULL pointer, then all three routines ** behave as no-ops. ** ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. */
+ show +
8490
8491
8492
8493
8494
SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
+ show +
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
/* ** CAPI3REF: Mutex Methods Object ** ** An instance of this structure defines the low-level routines ** used to allocate and use mutexes. ** ** Usually, the default mutex implementations provided by SQLite are ** sufficient, however the application has the option of substituting a custom ** implementation for specialized deployments or systems for which SQLite
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.h
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
** previously entered by the same thread. The behavior ** is undefined if the mutex is not currently entered by the ** calling thread or is not currently allocated. ** ** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or ** sqlite3_mutex_leave() is a NULL pointer, then all three routines ** behave as no-ops. ** ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. */
+ show +
7451
7452
7453
7454
7455
SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
+ show +
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
/* ** CAPI3REF: Mutex Methods Object ** ** An instance of this structure defines the low-level routines ** used to allocate and use mutexes. ** ** Usually, the default mutex implementations provided by SQLite are ** sufficient, however the application has the option of substituting a custom ** implementation for specialized deployments or systems for which SQLite
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.c
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
** previously entered by the same thread. The behavior ** is undefined if the mutex is not currently entered by the ** calling thread or is not currently allocated. ** ** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or ** sqlite3_mutex_leave() is a NULL pointer, then all three routines ** behave as no-ops. ** ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. */
+ show +
8490
8491
8492
8493
8494
SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
+ show +
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
/* ** CAPI3REF: Mutex Methods Object ** ** An instance of this structure defines the low-level routines ** used to allocate and use mutexes. ** ** Usually, the default mutex implementations provided by SQLite are ** sufficient, however the application has the option of substituting a custom ** implementation for specialized deployments or systems for which SQLite
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.h
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
** previously entered by the same thread. The behavior ** is undefined if the mutex is not currently entered by the ** calling thread or is not currently allocated. ** ** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or ** sqlite3_mutex_leave() is a NULL pointer, then all three routines ** behave as no-ops. ** ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. */
+ show +
7451
7452
7453
7454
7455
SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
+ show +
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
/* ** CAPI3REF: Mutex Methods Object ** ** An instance of this structure defines the low-level routines ** used to allocate and use mutexes. ** ** Usually, the default mutex implementations provided by SQLite are ** sufficient, however the application has the option of substituting a custom ** implementation for specialized deployments or systems for which SQLite

[CVE-2015-6607_1.diff] sqlite3.c #1397
+/* +** Error message for when two or more terms of a compound select have different +** size result sets. +*/ +static void selectWrongNumTermsError(Parse *pParse, Select *p){ + if( p->selFlags & SF_Values ){ + sqlite3ErrorMsg(pParse, "all VALUES must have the same number of terms"); + }else{ + sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s" + " do not have the same number of result columns", selectOpName(p->op)); + } +} + +/* +** Handle the special case of a compound-select that originates from a +** VALUES clause. By handling this as a special case, we avoid deep +** recursion, and thus do not need to enforce the SQLITE_LIMIT_COMPOUND_SELECT +** on a VALUES clause. +** +** Because the Select object originates from a VALUES clause: +** (1) It has no LIMIT or OFFSET +** (2) All terms are UNION ALL +** (3) There is no ORDER BY clause +*/ +static int multiSelectValues( + Parse *pParse, /* Parsing context */ + Select *p, /* The right-most of SELECTs to be coded */ + SelectDest *pDest /* What to do with query results */ +){ + Select *pPrior; + int nExpr = p->pEList->nExpr; + int nRow = 1; + int rc = 0; + assert( p->pNext==0 ); + assert( p->selFlags & SF_AllValues ); + do{ + assert( p->selFlags & SF_Values ); + assert( p->op==TK_ALL || (p->op==TK_SELECT && p->pPrior==0) ); + assert( p->pLimit==0 ); + assert( p->pOffset==0 ); + if( p->pEList->nExpr!=nExpr ){ + selectWrongNumTermsError(pParse, p); + return 1; + } + if( p->pPrior==0 ) break; + assert( p->pPrior->pNext==p ); + p = p->pPrior; + nRow++; + }while(1); + while( p ){ + pPrior = p->pPrior; + p->pPrior = 0; + rc = sqlite3Select(pParse, p, pDest); + p->pPrior = pPrior; + if( rc ) break; + p->nSelectRow = nRow; + p = p->pNext; + } + return rc; +} + /* Special handling for a compound-select that originates as a VALUES clause. + */ + if( p->selFlags & SF_AllValues ){ + rc = multiSelectValues(pParse, p, &dest); + goto multi_select_end; + } + - if( p->selFlags & SF_Values ){ - sqlite3ErrorMsg(pParse, "all VALUES must have the same number of terms"); - }else{ - sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s" - " do not have the same number of result columns", selectOpName(p->op)); - } + selectWrongNumTermsError(pParse, p);
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.c
131859
131860
131861
131862
131863
131864
131865
131866
131867
131868
sqlite3SelectDelete(db, pDelete); return rc; } #endif /* SQLITE_OMIT_COMPOUND_SELECT */ /* ** Error message for when two or more terms of a compound select have different ** size result sets. */ SQLITE_PRIVATE void sqlite3SelectWrongNumTermsError(Parse *pParse, Select *p){
+ show +
131869
131870
131871
131872
131873
if( p->selFlags & SF_Values ){ sqlite3ErrorMsg(pParse, "all VALUES must have the same number of terms"); }else{ sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s" " do not have the same number of result columns", selectOpName(p->op));
+ show +
131874
131875
131876
131877
131878
131879
131880
131881
131882
131883
} } /* ** Code an output subroutine for a coroutine implementation of a ** SELECT statment. ** ** The data to be output is contained in pIn->iSdst. There are ** pIn->nSdst columns to be output. pDest is where the output should ** be sent.
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.c
131843
131844
131845
131846
131847
131848
131849
131850
131851
131852
sqlite3SelectDelete(db, pDelete); return rc; } #endif /* SQLITE_OMIT_COMPOUND_SELECT */ /* ** Error message for when two or more terms of a compound select have different ** size result sets. */ SQLITE_PRIVATE void sqlite3SelectWrongNumTermsError(Parse *pParse, Select *p){
+ show +
131853
131854
131855
131856
131857
if( p->selFlags & SF_Values ){ sqlite3ErrorMsg(pParse, "all VALUES must have the same number of terms"); }else{ sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s" " do not have the same number of result columns", selectOpName(p->op));
+ show +
131858
131859
131860
131861
131862
131863
131864
131865
131866
131867
} } /* ** Code an output subroutine for a coroutine implementation of a ** SELECT statment. ** ** The data to be output is contained in pIn->iSdst. There are ** pIn->nSdst columns to be output. pDest is where the output should ** be sent.

[CVE-2015-6607_1.diff] sqlite3.c #1397
+/* +** Error message for when two or more terms of a compound select have different +** size result sets. +*/ +static void selectWrongNumTermsError(Parse *pParse, Select *p){ + if( p->selFlags & SF_Values ){ + sqlite3ErrorMsg(pParse, "all VALUES must have the same number of terms"); + }else{ + sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s" + " do not have the same number of result columns", selectOpName(p->op)); + } +} + +/* +** Handle the special case of a compound-select that originates from a +** VALUES clause. By handling this as a special case, we avoid deep +** recursion, and thus do not need to enforce the SQLITE_LIMIT_COMPOUND_SELECT +** on a VALUES clause. +** +** Because the Select object originates from a VALUES clause: +** (1) It has no LIMIT or OFFSET +** (2) All terms are UNION ALL +** (3) There is no ORDER BY clause +*/ +static int multiSelectValues( + Parse *pParse, /* Parsing context */ + Select *p, /* The right-most of SELECTs to be coded */ + SelectDest *pDest /* What to do with query results */ +){ + Select *pPrior; + int nExpr = p->pEList->nExpr; + int nRow = 1; + int rc = 0; + assert( p->pNext==0 ); + assert( p->selFlags & SF_AllValues ); + do{ + assert( p->selFlags & SF_Values ); + assert( p->op==TK_ALL || (p->op==TK_SELECT && p->pPrior==0) ); + assert( p->pLimit==0 ); + assert( p->pOffset==0 ); + if( p->pEList->nExpr!=nExpr ){ + selectWrongNumTermsError(pParse, p); + return 1; + } + if( p->pPrior==0 ) break; + assert( p->pPrior->pNext==p ); + p = p->pPrior; + nRow++; + }while(1); + while( p ){ + pPrior = p->pPrior; + p->pPrior = 0; + rc = sqlite3Select(pParse, p, pDest); + p->pPrior = pPrior; + if( rc ) break; + p->nSelectRow = nRow; + p = p->pNext; + } + return rc; +} + /* Special handling for a compound-select that originates as a VALUES clause. + */ + if( p->selFlags & SF_AllValues ){ + rc = multiSelectValues(pParse, p, &dest); + goto multi_select_end; + } + - if( p->selFlags & SF_Values ){ - sqlite3ErrorMsg(pParse, "all VALUES must have the same number of terms"); - }else{ - sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s" - " do not have the same number of result columns", selectOpName(p->op)); - } + selectWrongNumTermsError(pParse, p);
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/sqlite3.c
131859
131860
131861
131862
131863
131864
131865
131866
131867
131868
sqlite3SelectDelete(db, pDelete); return rc; } #endif /* SQLITE_OMIT_COMPOUND_SELECT */ /* ** Error message for when two or more terms of a compound select have different ** size result sets. */ SQLITE_PRIVATE void sqlite3SelectWrongNumTermsError(Parse *pParse, Select *p){
+ show +
131869
131870
131871
131872
131873
if( p->selFlags & SF_Values ){ sqlite3ErrorMsg(pParse, "all VALUES must have the same number of terms"); }else{ sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s" " do not have the same number of result columns", selectOpName(p->op));
+ show +
131874
131875
131876
131877
131878
131879
131880
131881
131882
131883
} } /* ** Code an output subroutine for a coroutine implementation of a ** SELECT statment. ** ** The data to be output is contained in pIn->iSdst. There are ** pIn->nSdst columns to be output. pDest is where the output should ** be sent.
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/sqlite3.c
131843
131844
131845
131846
131847
131848
131849
131850
131851
131852
sqlite3SelectDelete(db, pDelete); return rc; } #endif /* SQLITE_OMIT_COMPOUND_SELECT */ /* ** Error message for when two or more terms of a compound select have different ** size result sets. */ SQLITE_PRIVATE void sqlite3SelectWrongNumTermsError(Parse *pParse, Select *p){
+ show +
131853
131854
131855
131856
131857
if( p->selFlags & SF_Values ){ sqlite3ErrorMsg(pParse, "all VALUES must have the same number of terms"); }else{ sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s" " do not have the same number of result columns", selectOpName(p->op));
+ show +
131858
131859
131860
131861
131862
131863
131864
131865
131866
131867
} } /* ** Code an output subroutine for a coroutine implementation of a ** SELECT statment. ** ** The data to be output is contained in pIn->iSdst. There are ** pIn->nSdst columns to be output. pDest is where the output should ** be sent.

[CVE-2015-6607_1.diff] shell.c #106
+ }else if( strcmp(z,"-scratch")==0 ){ + int n, sz; + sz = (int)integerValue(cmdline_option_value(argc,argv,++i)); + if( sz>400000 ) sz = 400000; + if( sz<2500 ) sz = 2500; + n = (int)integerValue(cmdline_option_value(argc,argv,++i)); + if( n>10 ) n = 10; + if( n<1 ) n = 1; + sqlite3_config(SQLITE_CONFIG_SCRATCH, malloc(n*sz+1), sz, n); + data.shellFlgs |= SHFLG_Scratch; + }else if( strcmp(z,"-pagecache")==0 ){ + int n, sz; + sz = (int)integerValue(cmdline_option_value(argc,argv,++i)); + if( sz>70000 ) sz = 70000; + if( sz<800 ) sz = 800; + n = (int)integerValue(cmdline_option_value(argc,argv,++i)); + if( n<10 ) n = 10; + sqlite3_config(SQLITE_CONFIG_PAGECACHE, malloc(n*sz+1), sz, n); + data.shellFlgs |= SHFLG_Pagecache; + }else if( strcmp(z,"-lookaside")==0 ){ + int n, sz; + sz = (int)integerValue(cmdline_option_value(argc,argv,++i)); + if( sz<0 ) sz = 0; + n = (int)integerValue(cmdline_option_value(argc,argv,++i)); + if( n<0 ) n = 0; + sqlite3_config(SQLITE_CONFIG_LOOKASIDE, sz, n); + if( sz*n==0 ) data.shellFlgs &= ~SHFLG_Lookaside; -#ifdef SQLITE_SHELL_DBNAME_PROC - { extern void SQLITE_SHELL_DBNAME_PROC(const char**); - SQLITE_SHELL_DBNAME_PROC(&data.zDbFilename); - warnInmemoryDb = 0; } -#endif
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/shell.c
19136
19137
19138
19139
19140
19141
19142
19143
19144
19145
/* Make sure we have a valid signal handler early, before anything ** else is done. */ #ifdef SIGINT signal(SIGINT, interrupt_handler); #elif (defined(_WIN32) || defined(WIN32)) && !defined(_WIN32_WCE) SetConsoleCtrlHandler(ConsoleCtrlHandler, TRUE); #endif
+ show +
19146
19147
19148
19149
19150
19151
19152
19153
19154
19155
19156
#ifdef SQLITE_SHELL_DBNAME_PROC { /* If the SQLITE_SHELL_DBNAME_PROC macro is defined, then it is the name ** of a C-function that will provide the name of the database file. Use ** this compile-time option to embed this shell program in larger ** applications. */ extern void SQLITE_SHELL_DBNAME_PROC(const char**); SQLITE_SHELL_DBNAME_PROC(&data.zDbFilename); warnInmemoryDb = 0; } #endif
+ show +
19157
19158
19159
19160
19161
19162
19163
19164
19165
19166
/* Do an initial pass through the command-line argument to locate ** the name of the database file, the name of the initialization file, ** the size of the alternative malloc heap, ** and the first command to execute. */ verify_uninitialized(); for(i=1; i<argc; i++){ char *z; z = argv[i];
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/shell.c
19113
19114
19115
19116
19117
19118
19119
19120
19121
19122
/* Make sure we have a valid signal handler early, before anything ** else is done. */ #ifdef SIGINT signal(SIGINT, interrupt_handler); #elif (defined(_WIN32) || defined(WIN32)) && !defined(_WIN32_WCE) SetConsoleCtrlHandler(ConsoleCtrlHandler, TRUE); #endif
+ show +
19123
19124
19125
19126
19127
19128
19129
19130
19131
19132
19133
#ifdef SQLITE_SHELL_DBNAME_PROC { /* If the SQLITE_SHELL_DBNAME_PROC macro is defined, then it is the name ** of a C-function that will provide the name of the database file. Use ** this compile-time option to embed this shell program in larger ** applications. */ extern void SQLITE_SHELL_DBNAME_PROC(const char**); SQLITE_SHELL_DBNAME_PROC(&data.zDbFilename); warnInmemoryDb = 0; } #endif
+ show +
19134
19135
19136
19137
19138
19139
19140
19141
19142
19143
/* Do an initial pass through the command-line argument to locate ** the name of the database file, the name of the initialization file, ** the size of the alternative malloc heap, ** and the first command to execute. */ verify_uninitialized(); for(i=1; i<argc; i++){ char *z; z = argv[i];

[CVE-2015-6607_1.diff] shell.c #106
+ }else if( strcmp(z,"-scratch")==0 ){ + int n, sz; + sz = (int)integerValue(cmdline_option_value(argc,argv,++i)); + if( sz>400000 ) sz = 400000; + if( sz<2500 ) sz = 2500; + n = (int)integerValue(cmdline_option_value(argc,argv,++i)); + if( n>10 ) n = 10; + if( n<1 ) n = 1; + sqlite3_config(SQLITE_CONFIG_SCRATCH, malloc(n*sz+1), sz, n); + data.shellFlgs |= SHFLG_Scratch; + }else if( strcmp(z,"-pagecache")==0 ){ + int n, sz; + sz = (int)integerValue(cmdline_option_value(argc,argv,++i)); + if( sz>70000 ) sz = 70000; + if( sz<800 ) sz = 800; + n = (int)integerValue(cmdline_option_value(argc,argv,++i)); + if( n<10 ) n = 10; + sqlite3_config(SQLITE_CONFIG_PAGECACHE, malloc(n*sz+1), sz, n); + data.shellFlgs |= SHFLG_Pagecache; + }else if( strcmp(z,"-lookaside")==0 ){ + int n, sz; + sz = (int)integerValue(cmdline_option_value(argc,argv,++i)); + if( sz<0 ) sz = 0; + n = (int)integerValue(cmdline_option_value(argc,argv,++i)); + if( n<0 ) n = 0; + sqlite3_config(SQLITE_CONFIG_LOOKASIDE, sz, n); + if( sz*n==0 ) data.shellFlgs &= ~SHFLG_Lookaside; -#ifdef SQLITE_SHELL_DBNAME_PROC - { extern void SQLITE_SHELL_DBNAME_PROC(const char**); - SQLITE_SHELL_DBNAME_PROC(&data.zDbFilename); - warnInmemoryDb = 0; } -#endif
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/shell.c
19136
19137
19138
19139
19140
19141
19142
19143
19144
19145
/* Make sure we have a valid signal handler early, before anything ** else is done. */ #ifdef SIGINT signal(SIGINT, interrupt_handler); #elif (defined(_WIN32) || defined(WIN32)) && !defined(_WIN32_WCE) SetConsoleCtrlHandler(ConsoleCtrlHandler, TRUE); #endif
+ show +
19146
19147
19148
19149
19150
19151
19152
19153
19154
19155
19156
#ifdef SQLITE_SHELL_DBNAME_PROC { /* If the SQLITE_SHELL_DBNAME_PROC macro is defined, then it is the name ** of a C-function that will provide the name of the database file. Use ** this compile-time option to embed this shell program in larger ** applications. */ extern void SQLITE_SHELL_DBNAME_PROC(const char**); SQLITE_SHELL_DBNAME_PROC(&data.zDbFilename); warnInmemoryDb = 0; } #endif
+ show +
19157
19158
19159
19160
19161
19162
19163
19164
19165
19166
/* Do an initial pass through the command-line argument to locate ** the name of the database file, the name of the initialization file, ** the size of the alternative malloc heap, ** and the first command to execute. */ verify_uninitialized(); for(i=1; i<argc; i++){ char *z; z = argv[i];
/media/esteban/ACOS/ResurrectionX/external/sqlite/dist/orig/shell.c
19113
19114
19115
19116
19117
19118
19119
19120
19121
19122
/* Make sure we have a valid signal handler early, before anything ** else is done. */ #ifdef SIGINT signal(SIGINT, interrupt_handler); #elif (defined(_WIN32) || defined(WIN32)) && !defined(_WIN32_WCE) SetConsoleCtrlHandler(ConsoleCtrlHandler, TRUE); #endif
+ show +
19123
19124
19125
19126
19127
19128
19129
19130
19131
19132
19133
#ifdef SQLITE_SHELL_DBNAME_PROC { /* If the SQLITE_SHELL_DBNAME_PROC macro is defined, then it is the name ** of a C-function that will provide the name of the database file. Use ** this compile-time option to embed this shell program in larger ** applications. */ extern void SQLITE_SHELL_DBNAME_PROC(const char**); SQLITE_SHELL_DBNAME_PROC(&data.zDbFilename); warnInmemoryDb = 0; } #endif
+ show +
19134
19135
19136
19137
19138
19139
19140
19141
19142
19143
/* Do an initial pass through the command-line argument to locate ** the name of the database file, the name of the initialization file, ** the size of the alternative malloc heap, ** and the first command to execute. */ verify_uninitialized(); for(i=1; i<argc; i++){ char *z; z = argv[i];

[CVE-2014-9675_1.diff] aflatin.c #15
- - FT_TRACE5(( " reference %d: %d scaled to %.2f%s\n" - " overshoot %d: %d scaled to %.2f%s\n", - nn, - blue->ref.org, - blue->ref.fit / 64.0, - blue->flags & AF_LATIN_BLUE_ACTIVE ? "" - : " (inactive)", - nn, - blue->shoot.org, - blue->shoot.fit / 64.0, - blue->flags & AF_LATIN_BLUE_ACTIVE ? "" - : " (inactive)" )); + + /* use sub-top blue zone only if it doesn't overlap with */ + /* another (non-sup-top) blue zone; otherwise, the */ + /* effect would be similar to a neutral blue zone, which */ + /* is not desired here */ + for ( nn = 0; nn < axis->blue_count; nn++ ) + { + AF_LatinBlue blue = &axis->blues[nn]; + FT_UInt i; + + + if ( !( blue->flags & AF_LATIN_BLUE_SUB_TOP ) ) + continue; + if ( !( blue->flags & AF_LATIN_BLUE_ACTIVE ) ) + continue; + + for ( i = 0; i < axis->blue_count; i++ ) + { + AF_LatinBlue b = &axis->blues[i]; + + + if ( b->flags & AF_LATIN_BLUE_SUB_TOP ) + continue; + if ( !( b->flags & AF_LATIN_BLUE_ACTIVE ) ) + continue; + + if ( b->ref.fit <= blue->shoot.fit && + b->shoot.fit >= blue->ref.fit ) + { + blue->flags &= ~AF_LATIN_BLUE_ACTIVE; + break; + } + } + } + +#ifdef FT_DEBUG_LEVEL_TRACE + for ( nn = 0; nn < axis->blue_count; nn++ ) + { + AF_LatinBlue blue = &axis->blues[nn]; + + + FT_TRACE5(( " reference %d: %d scaled to %.2f%s\n" + " overshoot %d: %d scaled to %.2f%s\n", + nn, + blue->ref.org, + blue->ref.fit / 64.0, + blue->flags & AF_LATIN_BLUE_ACTIVE ? "" + : " (inactive)", + nn, + blue->shoot.org, + blue->shoot.fit / 64.0, + blue->flags & AF_LATIN_BLUE_ACTIVE ? "" + : " (inactive)" )); + } +#endif
/media/esteban/ACOS/ResurrectionX/external/freetype/src/autofit/aflatin.c
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
} } } #ifdef FT_DEBUG_LEVEL_TRACE for ( nn = 0; nn < axis->blue_count; nn++ ) { AF_LatinBlue blue = &axis->blues[nn];
+ show +
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
FT_TRACE5(( " reference %d: %d scaled to %.2f%s\n" " overshoot %d: %d scaled to %.2f%s\n", nn, blue->ref.org, blue->ref.fit / 64.0, blue->flags & AF_LATIN_BLUE_ACTIVE ? "" : " (inactive)", nn, blue->shoot.org, blue->shoot.fit / 64.0, blue->flags & AF_LATIN_BLUE_ACTIVE ? "" : " (inactive)" ));
+ show +
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
} #endif } } /* Scale global values in both directions. */ FT_LOCAL_DEF( void ) af_latin_metrics_scale( AF_LatinMetrics metrics,

[CVE-2014-9675_1.diff] aflatin.c #17
+ /* Extract standard_width from writing system/script specific */ + /* metrics class. */ + + FT_LOCAL_DEF( void ) + af_latin_get_standard_widths( AF_LatinMetrics metrics, + FT_Pos* stdHW, + FT_Pos* stdVW ) + { + if ( stdHW ) + *stdHW = metrics->axis[AF_DIMENSION_VERT].standard_width; + + if ( stdVW ) + *stdVW = metrics->axis[AF_DIMENSION_HORZ].standard_width; + } + + - AF_AxisHints axis = &hints->axis[dim]; - FT_Memory memory = hints->memory; - FT_Error error = FT_Err_Ok; - AF_Segment segment = NULL; - AF_SegmentRec seg0; - AF_Point* contour = hints->contours; - AF_Point* contour_limit = contour + hints->num_contours; - AF_Direction major_dir, segment_dir; + AF_LatinMetrics metrics = (AF_LatinMetrics)hints->metrics; + AF_AxisHints axis = &hints->axis[dim]; + FT_Memory memory = hints->memory; + FT_Error error = FT_Err_Ok; + AF_Segment segment = NULL; + AF_SegmentRec seg0; + AF_Point* contour = hints->contours; + AF_Point* contour_limit = contour + hints->num_contours; + AF_Direction major_dir, segment_dir; + + FT_Pos flat_threshold = FLAT_THRESHOLD( metrics->units_per_em );
/media/esteban/ACOS/ResurrectionX/external/freetype/src/autofit/aflatin.c
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
/*************************************************************************/ /* Walk over all contours and compute its segments. */ FT_LOCAL_DEF( FT_Error ) af_latin_hints_compute_segments( AF_GlyphHints hints, AF_Dimension dim ) { AF_LatinMetrics metrics = (AF_LatinMetrics)hints->metrics;
+ show +
1506
1507
1508
1509
1510
1511
1512
1513
AF_AxisHints axis = &hints->axis[dim]; FT_Memory memory = hints->memory; FT_Error error = FT_Err_Ok; AF_Segment segment = NULL; AF_SegmentRec seg0; AF_Point* contour = hints->contours; AF_Point* contour_limit = contour + hints->num_contours; AF_Direction major_dir, segment_dir;
+ show +
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
FT_Pos flat_threshold = FLAT_THRESHOLD( metrics->units_per_em ); FT_ZERO( &seg0 ); seg0.score = 32000; seg0.flags = AF_EDGE_NORMAL; major_dir = (AF_Direction)FT_ABS( axis->major_dir ); segment_dir = major_dir;
/media/esteban/ACOS/ResurrectionX/external/freetype/src/autofit/aflatin2.c
724
725
726
727
728
729
730
731
732
733
/***** *****/ /*************************************************************************/ /*************************************************************************/ #define SORT_SEGMENTS FT_LOCAL_DEF( FT_Error ) af_latin2_hints_compute_segments( AF_GlyphHints hints, AF_Dimension dim ) {
+ show +
734
735
736
737
738
739
740
741
AF_AxisHints axis = &hints->axis[dim]; FT_Memory memory = hints->memory; FT_Error error = FT_Err_Ok; AF_Segment segment = NULL; AF_SegmentRec seg0; AF_Point* contour = hints->contours; AF_Point* contour_limit = contour + hints->num_contours; AF_Direction major_dir, segment_dir;
+ show +
742
743
744
745
746
747
748
749
750
751
FT_ZERO( &seg0 ); seg0.score = 32000; seg0.flags = AF_EDGE_NORMAL; major_dir = (AF_Direction)FT_ABS( axis->major_dir ); segment_dir = major_dir; axis->num_segments = 0;

[CVE-2014-9675_1.diff] aflatin.c #18
- AF_Point point = contour[0]; - AF_Point last = point->prev; - int on_edge = 0; - FT_Pos min_pos = 32000; /* minimum segment pos != min_coord */ - FT_Pos max_pos = -32000; /* maximum segment pos != max_coord */ + AF_Point point = contour[0]; + AF_Point last = point->prev; + int on_edge = 0; + FT_Pos min_pos = 32000; /* minimum segment pos != min_coord */ + FT_Pos max_pos = -32000; /* maximum segment pos != max_coord */ + FT_Pos min_on_pos = 32000; + FT_Pos max_on_pos = -32000;
/media/esteban/ACOS/ResurrectionX/external/freetype/src/autofit/aflatin.c
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
for ( ; point < limit; point++ ) { point->u = point->fy; point->v = point->fx; } } /* do each contour separately */ for ( ; contour < contour_limit; contour++ ) {
+ show +
1556
1557
1558
1559
1560
1561
1562
1563
1564
AF_Point point = contour[0]; AF_Point last = point->prev; int on_edge = 0; /* we call values measured along a segment (point->v) */ /* `coordinates', and values orthogonal to it (point->u) */ /* `positions' */ FT_Pos min_pos = 32000; FT_Pos max_pos = -32000;
+ show +
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
FT_Pos min_coord = 32000; FT_Pos max_coord = -32000; FT_UShort min_flags = AF_FLAG_NONE; FT_UShort max_flags = AF_FLAG_NONE; FT_Pos min_on_coord = 32000; FT_Pos max_on_coord = -32000; FT_Bool passed; AF_Segment prev_segment = NULL;

[CVE-2020-0478_1.diff] av1_rtcd.h #8
+void cdef_copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); +void cdef_copy_rect8_16bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); +void cdef_copy_rect8_16bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); +#define cdef_copy_rect8_16bit_to_16bit cdef_copy_rect8_16bit_to_16bit_ssse3 + +void cdef_copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); +void cdef_copy_rect8_8bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); +void cdef_copy_rect8_8bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); +#define cdef_copy_rect8_8bit_to_16bit cdef_copy_rect8_8bit_to_16bit_ssse3 + -void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); -void copy_rect8_16bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); -void copy_rect8_16bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); -#define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_ssse3 +cfl_predict_hbd_fn cfl_get_predict_hbd_fn_c(TX_SIZE tx_size); +cfl_predict_hbd_fn cfl_get_predict_hbd_fn_ssse3(TX_SIZE tx_size); +#define cfl_get_predict_hbd_fn cfl_get_predict_hbd_fn_ssse3 -void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); -void copy_rect8_8bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); -void copy_rect8_8bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); -#define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_ssse3 +cfl_predict_lbd_fn cfl_get_predict_lbd_fn_c(TX_SIZE tx_size); +cfl_predict_lbd_fn cfl_get_predict_lbd_fn_ssse3(TX_SIZE tx_size); +#define cfl_get_predict_lbd_fn cfl_get_predict_lbd_fn_ssse3 -cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); -cfl_predict_hbd_fn get_predict_hbd_fn_ssse3(TX_SIZE tx_size); -#define get_predict_hbd_fn get_predict_hbd_fn_ssse3 - -cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); -cfl_predict_lbd_fn get_predict_lbd_fn_ssse3(TX_SIZE tx_size); -#define get_predict_lbd_fn get_predict_lbd_fn_ssse3 - -cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); -cfl_subtract_average_fn get_subtract_average_fn_sse2(TX_SIZE tx_size); -#define get_subtract_average_fn get_subtract_average_fn_sse2 +cfl_subtract_average_fn cfl_get_subtract_average_fn_c(TX_SIZE tx_size); +cfl_subtract_average_fn cfl_get_subtract_average_fn_sse2(TX_SIZE tx_size); +#define cfl_get_subtract_average_fn cfl_get_subtract_average_fn_sse2
/media/esteban/ACOS/ResurrectionX/external/libaom/config/x86_64/config/av1_rtcd.h
327
328
329
330
331
332
333
334
335
336
#define cfl_get_luma_subsampling_422_lbd cfl_get_luma_subsampling_422_lbd_ssse3 cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_c(TX_SIZE tx_size); cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_ssse3(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_hbd cfl_get_luma_subsampling_444_hbd_ssse3 cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_c(TX_SIZE tx_size); cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_ssse3(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_lbd cfl_get_luma_subsampling_444_lbd_ssse3
+ show +
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); #define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_ssse3 void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); #define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_ssse3 cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); cfl_predict_hbd_fn get_predict_hbd_fn_ssse3(TX_SIZE tx_size); #define get_predict_hbd_fn get_predict_hbd_fn_ssse3 cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); cfl_predict_lbd_fn get_predict_lbd_fn_ssse3(TX_SIZE tx_size); #define get_predict_lbd_fn get_predict_lbd_fn_ssse3 cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); cfl_subtract_average_fn get_subtract_average_fn_sse2(TX_SIZE tx_size); #define get_subtract_average_fn get_subtract_average_fn_sse2
+ show +
358
359
360
361
362
363
364
365
366
367
void av1_rtcd(void); #ifdef RTCD_C #include "aom_ports/x86.h" static void setup_rtcd_internal(void) { int flags = x86_simd_caps(); (void)flags;
/media/esteban/ACOS/ResurrectionX/external/libaom/config/x86/config/av1_rtcd.h
324
325
326
327
328
329
330
331
332
333
#define cfl_get_luma_subsampling_422_lbd cfl_get_luma_subsampling_422_lbd_ssse3 cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_c(TX_SIZE tx_size); cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_ssse3(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_hbd cfl_get_luma_subsampling_444_hbd_ssse3 cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_c(TX_SIZE tx_size); cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_ssse3(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_lbd cfl_get_luma_subsampling_444_lbd_ssse3
+ show +
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); #define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_ssse3 void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); #define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_ssse3 cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); cfl_predict_hbd_fn get_predict_hbd_fn_ssse3(TX_SIZE tx_size); #define get_predict_hbd_fn get_predict_hbd_fn_ssse3 cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); cfl_predict_lbd_fn get_predict_lbd_fn_ssse3(TX_SIZE tx_size); #define get_predict_lbd_fn get_predict_lbd_fn_ssse3 cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); cfl_subtract_average_fn get_subtract_average_fn_sse2(TX_SIZE tx_size); #define get_subtract_average_fn get_subtract_average_fn_sse2
+ show +
355
356
357
358
359
360
361
362
363
364
void av1_rtcd(void); #ifdef RTCD_C #include "aom_ports/x86.h" static void setup_rtcd_internal(void) { int flags = x86_simd_caps(); (void)flags;

[CVE-2020-0478_1.diff] av1_rtcd.h #8
+void cdef_copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); +void cdef_copy_rect8_16bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); +void cdef_copy_rect8_16bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); +#define cdef_copy_rect8_16bit_to_16bit cdef_copy_rect8_16bit_to_16bit_ssse3 + +void cdef_copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); +void cdef_copy_rect8_8bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); +void cdef_copy_rect8_8bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); +#define cdef_copy_rect8_8bit_to_16bit cdef_copy_rect8_8bit_to_16bit_ssse3 + -void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); -void copy_rect8_16bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); -void copy_rect8_16bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); -#define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_ssse3 +cfl_predict_hbd_fn cfl_get_predict_hbd_fn_c(TX_SIZE tx_size); +cfl_predict_hbd_fn cfl_get_predict_hbd_fn_ssse3(TX_SIZE tx_size); +#define cfl_get_predict_hbd_fn cfl_get_predict_hbd_fn_ssse3 -void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); -void copy_rect8_8bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); -void copy_rect8_8bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); -#define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_ssse3 +cfl_predict_lbd_fn cfl_get_predict_lbd_fn_c(TX_SIZE tx_size); +cfl_predict_lbd_fn cfl_get_predict_lbd_fn_ssse3(TX_SIZE tx_size); +#define cfl_get_predict_lbd_fn cfl_get_predict_lbd_fn_ssse3 -cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); -cfl_predict_hbd_fn get_predict_hbd_fn_ssse3(TX_SIZE tx_size); -#define get_predict_hbd_fn get_predict_hbd_fn_ssse3 - -cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); -cfl_predict_lbd_fn get_predict_lbd_fn_ssse3(TX_SIZE tx_size); -#define get_predict_lbd_fn get_predict_lbd_fn_ssse3 - -cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); -cfl_subtract_average_fn get_subtract_average_fn_sse2(TX_SIZE tx_size); -#define get_subtract_average_fn get_subtract_average_fn_sse2 +cfl_subtract_average_fn cfl_get_subtract_average_fn_c(TX_SIZE tx_size); +cfl_subtract_average_fn cfl_get_subtract_average_fn_sse2(TX_SIZE tx_size); +#define cfl_get_subtract_average_fn cfl_get_subtract_average_fn_sse2
/media/esteban/ACOS/ResurrectionX/external/libaom/config/x86_64/config/av1_rtcd.h
327
328
329
330
331
332
333
334
335
336
#define cfl_get_luma_subsampling_422_lbd cfl_get_luma_subsampling_422_lbd_ssse3 cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_c(TX_SIZE tx_size); cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_ssse3(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_hbd cfl_get_luma_subsampling_444_hbd_ssse3 cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_c(TX_SIZE tx_size); cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_ssse3(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_lbd cfl_get_luma_subsampling_444_lbd_ssse3
+ show +
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); #define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_ssse3 void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); #define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_ssse3 cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); cfl_predict_hbd_fn get_predict_hbd_fn_ssse3(TX_SIZE tx_size); #define get_predict_hbd_fn get_predict_hbd_fn_ssse3 cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); cfl_predict_lbd_fn get_predict_lbd_fn_ssse3(TX_SIZE tx_size); #define get_predict_lbd_fn get_predict_lbd_fn_ssse3 cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); cfl_subtract_average_fn get_subtract_average_fn_sse2(TX_SIZE tx_size); #define get_subtract_average_fn get_subtract_average_fn_sse2
+ show +
358
359
360
361
362
363
364
365
366
367
void av1_rtcd(void); #ifdef RTCD_C #include "aom_ports/x86.h" static void setup_rtcd_internal(void) { int flags = x86_simd_caps(); (void)flags;
/media/esteban/ACOS/ResurrectionX/external/libaom/config/x86/config/av1_rtcd.h
324
325
326
327
328
329
330
331
332
333
#define cfl_get_luma_subsampling_422_lbd cfl_get_luma_subsampling_422_lbd_ssse3 cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_c(TX_SIZE tx_size); cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_ssse3(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_hbd cfl_get_luma_subsampling_444_hbd_ssse3 cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_c(TX_SIZE tx_size); cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_ssse3(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_lbd cfl_get_luma_subsampling_444_lbd_ssse3
+ show +
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); #define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_ssse3 void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); #define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_ssse3 cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); cfl_predict_hbd_fn get_predict_hbd_fn_ssse3(TX_SIZE tx_size); #define get_predict_hbd_fn get_predict_hbd_fn_ssse3 cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); cfl_predict_lbd_fn get_predict_lbd_fn_ssse3(TX_SIZE tx_size); #define get_predict_lbd_fn get_predict_lbd_fn_ssse3 cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); cfl_subtract_average_fn get_subtract_average_fn_sse2(TX_SIZE tx_size); #define get_subtract_average_fn get_subtract_average_fn_sse2
+ show +
355
356
357
358
359
360
361
362
363
364
void av1_rtcd(void); #ifdef RTCD_C #include "aom_ports/x86.h" static void setup_rtcd_internal(void) { int flags = x86_simd_caps(); (void)flags;

[CVE-2020-0470_1.diff] av1_rtcd.h #8
+void cdef_copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); +void cdef_copy_rect8_16bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); +void cdef_copy_rect8_16bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); +#define cdef_copy_rect8_16bit_to_16bit cdef_copy_rect8_16bit_to_16bit_ssse3 + +void cdef_copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); +void cdef_copy_rect8_8bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); +void cdef_copy_rect8_8bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); +#define cdef_copy_rect8_8bit_to_16bit cdef_copy_rect8_8bit_to_16bit_ssse3 + -void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); -void copy_rect8_16bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); -void copy_rect8_16bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); -#define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_ssse3 +cfl_predict_hbd_fn cfl_get_predict_hbd_fn_c(TX_SIZE tx_size); +cfl_predict_hbd_fn cfl_get_predict_hbd_fn_ssse3(TX_SIZE tx_size); +#define cfl_get_predict_hbd_fn cfl_get_predict_hbd_fn_ssse3 -void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); -void copy_rect8_8bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); -void copy_rect8_8bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); -#define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_ssse3 +cfl_predict_lbd_fn cfl_get_predict_lbd_fn_c(TX_SIZE tx_size); +cfl_predict_lbd_fn cfl_get_predict_lbd_fn_ssse3(TX_SIZE tx_size); +#define cfl_get_predict_lbd_fn cfl_get_predict_lbd_fn_ssse3 -cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); -cfl_predict_hbd_fn get_predict_hbd_fn_ssse3(TX_SIZE tx_size); -#define get_predict_hbd_fn get_predict_hbd_fn_ssse3 - -cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); -cfl_predict_lbd_fn get_predict_lbd_fn_ssse3(TX_SIZE tx_size); -#define get_predict_lbd_fn get_predict_lbd_fn_ssse3 - -cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); -cfl_subtract_average_fn get_subtract_average_fn_sse2(TX_SIZE tx_size); -#define get_subtract_average_fn get_subtract_average_fn_sse2 +cfl_subtract_average_fn cfl_get_subtract_average_fn_c(TX_SIZE tx_size); +cfl_subtract_average_fn cfl_get_subtract_average_fn_sse2(TX_SIZE tx_size); +#define cfl_get_subtract_average_fn cfl_get_subtract_average_fn_sse2
/media/esteban/ACOS/ResurrectionX/external/libaom/config/x86_64/config/av1_rtcd.h
327
328
329
330
331
332
333
334
335
336
#define cfl_get_luma_subsampling_422_lbd cfl_get_luma_subsampling_422_lbd_ssse3 cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_c(TX_SIZE tx_size); cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_ssse3(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_hbd cfl_get_luma_subsampling_444_hbd_ssse3 cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_c(TX_SIZE tx_size); cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_ssse3(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_lbd cfl_get_luma_subsampling_444_lbd_ssse3
+ show +
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); #define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_ssse3 void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); #define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_ssse3 cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); cfl_predict_hbd_fn get_predict_hbd_fn_ssse3(TX_SIZE tx_size); #define get_predict_hbd_fn get_predict_hbd_fn_ssse3 cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); cfl_predict_lbd_fn get_predict_lbd_fn_ssse3(TX_SIZE tx_size); #define get_predict_lbd_fn get_predict_lbd_fn_ssse3 cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); cfl_subtract_average_fn get_subtract_average_fn_sse2(TX_SIZE tx_size); #define get_subtract_average_fn get_subtract_average_fn_sse2
+ show +
358
359
360
361
362
363
364
365
366
367
void av1_rtcd(void); #ifdef RTCD_C #include "aom_ports/x86.h" static void setup_rtcd_internal(void) { int flags = x86_simd_caps(); (void)flags;
/media/esteban/ACOS/ResurrectionX/external/libaom/config/x86/config/av1_rtcd.h
324
325
326
327
328
329
330
331
332
333
#define cfl_get_luma_subsampling_422_lbd cfl_get_luma_subsampling_422_lbd_ssse3 cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_c(TX_SIZE tx_size); cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_ssse3(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_hbd cfl_get_luma_subsampling_444_hbd_ssse3 cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_c(TX_SIZE tx_size); cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_ssse3(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_lbd cfl_get_luma_subsampling_444_lbd_ssse3
+ show +
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); #define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_ssse3 void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); #define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_ssse3 cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); cfl_predict_hbd_fn get_predict_hbd_fn_ssse3(TX_SIZE tx_size); #define get_predict_hbd_fn get_predict_hbd_fn_ssse3 cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); cfl_predict_lbd_fn get_predict_lbd_fn_ssse3(TX_SIZE tx_size); #define get_predict_lbd_fn get_predict_lbd_fn_ssse3 cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); cfl_subtract_average_fn get_subtract_average_fn_sse2(TX_SIZE tx_size); #define get_subtract_average_fn get_subtract_average_fn_sse2
+ show +
355
356
357
358
359
360
361
362
363
364
void av1_rtcd(void); #ifdef RTCD_C #include "aom_ports/x86.h" static void setup_rtcd_internal(void) { int flags = x86_simd_caps(); (void)flags;

[CVE-2020-0470_1.diff] av1_rtcd.h #8
+void cdef_copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); +void cdef_copy_rect8_16bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); +void cdef_copy_rect8_16bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); +#define cdef_copy_rect8_16bit_to_16bit cdef_copy_rect8_16bit_to_16bit_ssse3 + +void cdef_copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); +void cdef_copy_rect8_8bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); +void cdef_copy_rect8_8bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); +#define cdef_copy_rect8_8bit_to_16bit cdef_copy_rect8_8bit_to_16bit_ssse3 + -void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); -void copy_rect8_16bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); -void copy_rect8_16bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); -#define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_ssse3 +cfl_predict_hbd_fn cfl_get_predict_hbd_fn_c(TX_SIZE tx_size); +cfl_predict_hbd_fn cfl_get_predict_hbd_fn_ssse3(TX_SIZE tx_size); +#define cfl_get_predict_hbd_fn cfl_get_predict_hbd_fn_ssse3 -void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); -void copy_rect8_8bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); -void copy_rect8_8bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); -#define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_ssse3 +cfl_predict_lbd_fn cfl_get_predict_lbd_fn_c(TX_SIZE tx_size); +cfl_predict_lbd_fn cfl_get_predict_lbd_fn_ssse3(TX_SIZE tx_size); +#define cfl_get_predict_lbd_fn cfl_get_predict_lbd_fn_ssse3 -cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); -cfl_predict_hbd_fn get_predict_hbd_fn_ssse3(TX_SIZE tx_size); -#define get_predict_hbd_fn get_predict_hbd_fn_ssse3 - -cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); -cfl_predict_lbd_fn get_predict_lbd_fn_ssse3(TX_SIZE tx_size); -#define get_predict_lbd_fn get_predict_lbd_fn_ssse3 - -cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); -cfl_subtract_average_fn get_subtract_average_fn_sse2(TX_SIZE tx_size); -#define get_subtract_average_fn get_subtract_average_fn_sse2 +cfl_subtract_average_fn cfl_get_subtract_average_fn_c(TX_SIZE tx_size); +cfl_subtract_average_fn cfl_get_subtract_average_fn_sse2(TX_SIZE tx_size); +#define cfl_get_subtract_average_fn cfl_get_subtract_average_fn_sse2
/media/esteban/ACOS/ResurrectionX/external/libaom/config/x86_64/config/av1_rtcd.h
327
328
329
330
331
332
333
334
335
336
#define cfl_get_luma_subsampling_422_lbd cfl_get_luma_subsampling_422_lbd_ssse3 cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_c(TX_SIZE tx_size); cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_ssse3(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_hbd cfl_get_luma_subsampling_444_hbd_ssse3 cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_c(TX_SIZE tx_size); cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_ssse3(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_lbd cfl_get_luma_subsampling_444_lbd_ssse3
+ show +
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); #define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_ssse3 void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); #define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_ssse3 cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); cfl_predict_hbd_fn get_predict_hbd_fn_ssse3(TX_SIZE tx_size); #define get_predict_hbd_fn get_predict_hbd_fn_ssse3 cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); cfl_predict_lbd_fn get_predict_lbd_fn_ssse3(TX_SIZE tx_size); #define get_predict_lbd_fn get_predict_lbd_fn_ssse3 cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); cfl_subtract_average_fn get_subtract_average_fn_sse2(TX_SIZE tx_size); #define get_subtract_average_fn get_subtract_average_fn_sse2
+ show +
358
359
360
361
362
363
364
365
366
367
void av1_rtcd(void); #ifdef RTCD_C #include "aom_ports/x86.h" static void setup_rtcd_internal(void) { int flags = x86_simd_caps(); (void)flags;
/media/esteban/ACOS/ResurrectionX/external/libaom/config/x86/config/av1_rtcd.h
324
325
326
327
328
329
330
331
332
333
#define cfl_get_luma_subsampling_422_lbd cfl_get_luma_subsampling_422_lbd_ssse3 cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_c(TX_SIZE tx_size); cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_ssse3(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_hbd cfl_get_luma_subsampling_444_hbd_ssse3 cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_c(TX_SIZE tx_size); cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_ssse3(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_lbd cfl_get_luma_subsampling_444_lbd_ssse3
+ show +
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); #define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_ssse3 void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_sse2(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_ssse3(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); #define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_ssse3 cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); cfl_predict_hbd_fn get_predict_hbd_fn_ssse3(TX_SIZE tx_size); #define get_predict_hbd_fn get_predict_hbd_fn_ssse3 cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); cfl_predict_lbd_fn get_predict_lbd_fn_ssse3(TX_SIZE tx_size); #define get_predict_lbd_fn get_predict_lbd_fn_ssse3 cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); cfl_subtract_average_fn get_subtract_average_fn_sse2(TX_SIZE tx_size); #define get_subtract_average_fn get_subtract_average_fn_sse2
+ show +
355
356
357
358
359
360
361
362
363
364
void av1_rtcd(void); #ifdef RTCD_C #include "aom_ports/x86.h" static void setup_rtcd_internal(void) { int flags = x86_simd_caps(); (void)flags;

[CVE-2020-0478_1.diff] av1_rtcd.h #9
+void cdef_copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); +void cdef_copy_rect8_16bit_to_16bit_neon(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); +#define cdef_copy_rect8_16bit_to_16bit cdef_copy_rect8_16bit_to_16bit_neon + +void cdef_copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); +void cdef_copy_rect8_8bit_to_16bit_neon(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); +#define cdef_copy_rect8_8bit_to_16bit cdef_copy_rect8_8bit_to_16bit_neon + -void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); -void copy_rect8_16bit_to_16bit_neon(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); -#define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_neon +cfl_predict_hbd_fn cfl_get_predict_hbd_fn_c(TX_SIZE tx_size); +cfl_predict_hbd_fn cfl_get_predict_hbd_fn_neon(TX_SIZE tx_size); +#define cfl_get_predict_hbd_fn cfl_get_predict_hbd_fn_neon -void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); -void copy_rect8_8bit_to_16bit_neon(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); -#define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_neon +cfl_predict_lbd_fn cfl_get_predict_lbd_fn_c(TX_SIZE tx_size); +cfl_predict_lbd_fn cfl_get_predict_lbd_fn_neon(TX_SIZE tx_size); +#define cfl_get_predict_lbd_fn cfl_get_predict_lbd_fn_neon -cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); -cfl_predict_hbd_fn get_predict_hbd_fn_neon(TX_SIZE tx_size); -#define get_predict_hbd_fn get_predict_hbd_fn_neon - -cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); -cfl_predict_lbd_fn get_predict_lbd_fn_neon(TX_SIZE tx_size); -#define get_predict_lbd_fn get_predict_lbd_fn_neon - -cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); -cfl_subtract_average_fn get_subtract_average_fn_neon(TX_SIZE tx_size); -#define get_subtract_average_fn get_subtract_average_fn_neon +cfl_subtract_average_fn cfl_get_subtract_average_fn_c(TX_SIZE tx_size); +cfl_subtract_average_fn cfl_get_subtract_average_fn_neon(TX_SIZE tx_size); +#define cfl_get_subtract_average_fn cfl_get_subtract_average_fn_neon
/media/esteban/ACOS/ResurrectionX/external/libaom/config/arm/config/av1_rtcd.h
322
323
324
325
326
327
328
329
330
331
#define cfl_get_luma_subsampling_422_lbd cfl_get_luma_subsampling_422_lbd_neon cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_c(TX_SIZE tx_size); cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_neon(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_hbd cfl_get_luma_subsampling_444_hbd_neon cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_c(TX_SIZE tx_size); cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_neon(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_lbd cfl_get_luma_subsampling_444_lbd_neon
+ show +
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_neon(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); #define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_neon void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_neon(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); #define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_neon cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); cfl_predict_hbd_fn get_predict_hbd_fn_neon(TX_SIZE tx_size); #define get_predict_hbd_fn get_predict_hbd_fn_neon cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); cfl_predict_lbd_fn get_predict_lbd_fn_neon(TX_SIZE tx_size); #define get_predict_lbd_fn get_predict_lbd_fn_neon cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); cfl_subtract_average_fn get_subtract_average_fn_neon(TX_SIZE tx_size); #define get_subtract_average_fn get_subtract_average_fn_neon
+ show +
351
352
353
354
355
356
357
358
359
360
void av1_rtcd(void); #include "config/aom_config.h" #ifdef RTCD_C #include "aom_ports/arm.h" static void setup_rtcd_internal(void) { int flags = aom_arm_cpu_caps();
/media/esteban/ACOS/ResurrectionX/external/libaom/config/arm64/config/av1_rtcd.h
322
323
324
325
326
327
328
329
330
331
#define cfl_get_luma_subsampling_422_lbd cfl_get_luma_subsampling_422_lbd_neon cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_c(TX_SIZE tx_size); cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_neon(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_hbd cfl_get_luma_subsampling_444_hbd_neon cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_c(TX_SIZE tx_size); cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_neon(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_lbd cfl_get_luma_subsampling_444_lbd_neon
+ show +
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_neon(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); #define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_neon void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_neon(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); #define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_neon cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); cfl_predict_hbd_fn get_predict_hbd_fn_neon(TX_SIZE tx_size); #define get_predict_hbd_fn get_predict_hbd_fn_neon cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); cfl_predict_lbd_fn get_predict_lbd_fn_neon(TX_SIZE tx_size); #define get_predict_lbd_fn get_predict_lbd_fn_neon cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); cfl_subtract_average_fn get_subtract_average_fn_neon(TX_SIZE tx_size); #define get_subtract_average_fn get_subtract_average_fn_neon
+ show +
351
352
353
354
355
356
357
358
359
360
void av1_rtcd(void); #include "config/aom_config.h" #ifdef RTCD_C #include "aom_ports/arm.h" static void setup_rtcd_internal(void) { int flags = aom_arm_cpu_caps();

[CVE-2020-0478_1.diff] av1_rtcd.h #9
+void cdef_copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); +void cdef_copy_rect8_16bit_to_16bit_neon(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); +#define cdef_copy_rect8_16bit_to_16bit cdef_copy_rect8_16bit_to_16bit_neon + +void cdef_copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); +void cdef_copy_rect8_8bit_to_16bit_neon(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); +#define cdef_copy_rect8_8bit_to_16bit cdef_copy_rect8_8bit_to_16bit_neon + -void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); -void copy_rect8_16bit_to_16bit_neon(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); -#define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_neon +cfl_predict_hbd_fn cfl_get_predict_hbd_fn_c(TX_SIZE tx_size); +cfl_predict_hbd_fn cfl_get_predict_hbd_fn_neon(TX_SIZE tx_size); +#define cfl_get_predict_hbd_fn cfl_get_predict_hbd_fn_neon -void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); -void copy_rect8_8bit_to_16bit_neon(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); -#define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_neon +cfl_predict_lbd_fn cfl_get_predict_lbd_fn_c(TX_SIZE tx_size); +cfl_predict_lbd_fn cfl_get_predict_lbd_fn_neon(TX_SIZE tx_size); +#define cfl_get_predict_lbd_fn cfl_get_predict_lbd_fn_neon -cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); -cfl_predict_hbd_fn get_predict_hbd_fn_neon(TX_SIZE tx_size); -#define get_predict_hbd_fn get_predict_hbd_fn_neon - -cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); -cfl_predict_lbd_fn get_predict_lbd_fn_neon(TX_SIZE tx_size); -#define get_predict_lbd_fn get_predict_lbd_fn_neon - -cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); -cfl_subtract_average_fn get_subtract_average_fn_neon(TX_SIZE tx_size); -#define get_subtract_average_fn get_subtract_average_fn_neon +cfl_subtract_average_fn cfl_get_subtract_average_fn_c(TX_SIZE tx_size); +cfl_subtract_average_fn cfl_get_subtract_average_fn_neon(TX_SIZE tx_size); +#define cfl_get_subtract_average_fn cfl_get_subtract_average_fn_neon
/media/esteban/ACOS/ResurrectionX/external/libaom/config/arm/config/av1_rtcd.h
322
323
324
325
326
327
328
329
330
331
#define cfl_get_luma_subsampling_422_lbd cfl_get_luma_subsampling_422_lbd_neon cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_c(TX_SIZE tx_size); cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_neon(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_hbd cfl_get_luma_subsampling_444_hbd_neon cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_c(TX_SIZE tx_size); cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_neon(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_lbd cfl_get_luma_subsampling_444_lbd_neon
+ show +
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_neon(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); #define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_neon void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_neon(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); #define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_neon cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); cfl_predict_hbd_fn get_predict_hbd_fn_neon(TX_SIZE tx_size); #define get_predict_hbd_fn get_predict_hbd_fn_neon cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); cfl_predict_lbd_fn get_predict_lbd_fn_neon(TX_SIZE tx_size); #define get_predict_lbd_fn get_predict_lbd_fn_neon cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); cfl_subtract_average_fn get_subtract_average_fn_neon(TX_SIZE tx_size); #define get_subtract_average_fn get_subtract_average_fn_neon
+ show +
351
352
353
354
355
356
357
358
359
360
void av1_rtcd(void); #include "config/aom_config.h" #ifdef RTCD_C #include "aom_ports/arm.h" static void setup_rtcd_internal(void) { int flags = aom_arm_cpu_caps();
/media/esteban/ACOS/ResurrectionX/external/libaom/config/arm64/config/av1_rtcd.h
322
323
324
325
326
327
328
329
330
331
#define cfl_get_luma_subsampling_422_lbd cfl_get_luma_subsampling_422_lbd_neon cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_c(TX_SIZE tx_size); cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_neon(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_hbd cfl_get_luma_subsampling_444_hbd_neon cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_c(TX_SIZE tx_size); cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_neon(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_lbd cfl_get_luma_subsampling_444_lbd_neon
+ show +
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_neon(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); #define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_neon void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_neon(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); #define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_neon cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); cfl_predict_hbd_fn get_predict_hbd_fn_neon(TX_SIZE tx_size); #define get_predict_hbd_fn get_predict_hbd_fn_neon cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); cfl_predict_lbd_fn get_predict_lbd_fn_neon(TX_SIZE tx_size); #define get_predict_lbd_fn get_predict_lbd_fn_neon cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); cfl_subtract_average_fn get_subtract_average_fn_neon(TX_SIZE tx_size); #define get_subtract_average_fn get_subtract_average_fn_neon
+ show +
351
352
353
354
355
356
357
358
359
360
void av1_rtcd(void); #include "config/aom_config.h" #ifdef RTCD_C #include "aom_ports/arm.h" static void setup_rtcd_internal(void) { int flags = aom_arm_cpu_caps();

[CVE-2020-0470_1.diff] av1_rtcd.h #9
+void cdef_copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); +void cdef_copy_rect8_16bit_to_16bit_neon(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); +#define cdef_copy_rect8_16bit_to_16bit cdef_copy_rect8_16bit_to_16bit_neon + +void cdef_copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); +void cdef_copy_rect8_8bit_to_16bit_neon(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); +#define cdef_copy_rect8_8bit_to_16bit cdef_copy_rect8_8bit_to_16bit_neon + -void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); -void copy_rect8_16bit_to_16bit_neon(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); -#define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_neon +cfl_predict_hbd_fn cfl_get_predict_hbd_fn_c(TX_SIZE tx_size); +cfl_predict_hbd_fn cfl_get_predict_hbd_fn_neon(TX_SIZE tx_size); +#define cfl_get_predict_hbd_fn cfl_get_predict_hbd_fn_neon -void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); -void copy_rect8_8bit_to_16bit_neon(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); -#define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_neon +cfl_predict_lbd_fn cfl_get_predict_lbd_fn_c(TX_SIZE tx_size); +cfl_predict_lbd_fn cfl_get_predict_lbd_fn_neon(TX_SIZE tx_size); +#define cfl_get_predict_lbd_fn cfl_get_predict_lbd_fn_neon -cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); -cfl_predict_hbd_fn get_predict_hbd_fn_neon(TX_SIZE tx_size); -#define get_predict_hbd_fn get_predict_hbd_fn_neon - -cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); -cfl_predict_lbd_fn get_predict_lbd_fn_neon(TX_SIZE tx_size); -#define get_predict_lbd_fn get_predict_lbd_fn_neon - -cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); -cfl_subtract_average_fn get_subtract_average_fn_neon(TX_SIZE tx_size); -#define get_subtract_average_fn get_subtract_average_fn_neon +cfl_subtract_average_fn cfl_get_subtract_average_fn_c(TX_SIZE tx_size); +cfl_subtract_average_fn cfl_get_subtract_average_fn_neon(TX_SIZE tx_size); +#define cfl_get_subtract_average_fn cfl_get_subtract_average_fn_neon
/media/esteban/ACOS/ResurrectionX/external/libaom/config/arm/config/av1_rtcd.h
322
323
324
325
326
327
328
329
330
331
#define cfl_get_luma_subsampling_422_lbd cfl_get_luma_subsampling_422_lbd_neon cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_c(TX_SIZE tx_size); cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_neon(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_hbd cfl_get_luma_subsampling_444_hbd_neon cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_c(TX_SIZE tx_size); cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_neon(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_lbd cfl_get_luma_subsampling_444_lbd_neon
+ show +
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_neon(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); #define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_neon void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_neon(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); #define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_neon cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); cfl_predict_hbd_fn get_predict_hbd_fn_neon(TX_SIZE tx_size); #define get_predict_hbd_fn get_predict_hbd_fn_neon cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); cfl_predict_lbd_fn get_predict_lbd_fn_neon(TX_SIZE tx_size); #define get_predict_lbd_fn get_predict_lbd_fn_neon cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); cfl_subtract_average_fn get_subtract_average_fn_neon(TX_SIZE tx_size); #define get_subtract_average_fn get_subtract_average_fn_neon
+ show +
351
352
353
354
355
356
357
358
359
360
void av1_rtcd(void); #include "config/aom_config.h" #ifdef RTCD_C #include "aom_ports/arm.h" static void setup_rtcd_internal(void) { int flags = aom_arm_cpu_caps();
/media/esteban/ACOS/ResurrectionX/external/libaom/config/arm64/config/av1_rtcd.h
322
323
324
325
326
327
328
329
330
331
#define cfl_get_luma_subsampling_422_lbd cfl_get_luma_subsampling_422_lbd_neon cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_c(TX_SIZE tx_size); cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_neon(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_hbd cfl_get_luma_subsampling_444_hbd_neon cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_c(TX_SIZE tx_size); cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_neon(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_lbd cfl_get_luma_subsampling_444_lbd_neon
+ show +
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_neon(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); #define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_neon void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_neon(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); #define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_neon cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); cfl_predict_hbd_fn get_predict_hbd_fn_neon(TX_SIZE tx_size); #define get_predict_hbd_fn get_predict_hbd_fn_neon cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); cfl_predict_lbd_fn get_predict_lbd_fn_neon(TX_SIZE tx_size); #define get_predict_lbd_fn get_predict_lbd_fn_neon cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); cfl_subtract_average_fn get_subtract_average_fn_neon(TX_SIZE tx_size); #define get_subtract_average_fn get_subtract_average_fn_neon
+ show +
351
352
353
354
355
356
357
358
359
360
void av1_rtcd(void); #include "config/aom_config.h" #ifdef RTCD_C #include "aom_ports/arm.h" static void setup_rtcd_internal(void) { int flags = aom_arm_cpu_caps();

[CVE-2020-0470_1.diff] av1_rtcd.h #9
+void cdef_copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); +void cdef_copy_rect8_16bit_to_16bit_neon(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); +#define cdef_copy_rect8_16bit_to_16bit cdef_copy_rect8_16bit_to_16bit_neon + +void cdef_copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); +void cdef_copy_rect8_8bit_to_16bit_neon(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); +#define cdef_copy_rect8_8bit_to_16bit cdef_copy_rect8_8bit_to_16bit_neon + -void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); -void copy_rect8_16bit_to_16bit_neon(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); -#define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_neon +cfl_predict_hbd_fn cfl_get_predict_hbd_fn_c(TX_SIZE tx_size); +cfl_predict_hbd_fn cfl_get_predict_hbd_fn_neon(TX_SIZE tx_size); +#define cfl_get_predict_hbd_fn cfl_get_predict_hbd_fn_neon -void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); -void copy_rect8_8bit_to_16bit_neon(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); -#define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_neon +cfl_predict_lbd_fn cfl_get_predict_lbd_fn_c(TX_SIZE tx_size); +cfl_predict_lbd_fn cfl_get_predict_lbd_fn_neon(TX_SIZE tx_size); +#define cfl_get_predict_lbd_fn cfl_get_predict_lbd_fn_neon -cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); -cfl_predict_hbd_fn get_predict_hbd_fn_neon(TX_SIZE tx_size); -#define get_predict_hbd_fn get_predict_hbd_fn_neon - -cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); -cfl_predict_lbd_fn get_predict_lbd_fn_neon(TX_SIZE tx_size); -#define get_predict_lbd_fn get_predict_lbd_fn_neon - -cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); -cfl_subtract_average_fn get_subtract_average_fn_neon(TX_SIZE tx_size); -#define get_subtract_average_fn get_subtract_average_fn_neon +cfl_subtract_average_fn cfl_get_subtract_average_fn_c(TX_SIZE tx_size); +cfl_subtract_average_fn cfl_get_subtract_average_fn_neon(TX_SIZE tx_size); +#define cfl_get_subtract_average_fn cfl_get_subtract_average_fn_neon
/media/esteban/ACOS/ResurrectionX/external/libaom/config/arm/config/av1_rtcd.h
322
323
324
325
326
327
328
329
330
331
#define cfl_get_luma_subsampling_422_lbd cfl_get_luma_subsampling_422_lbd_neon cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_c(TX_SIZE tx_size); cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_neon(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_hbd cfl_get_luma_subsampling_444_hbd_neon cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_c(TX_SIZE tx_size); cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_neon(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_lbd cfl_get_luma_subsampling_444_lbd_neon
+ show +
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_neon(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); #define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_neon void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_neon(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); #define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_neon cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); cfl_predict_hbd_fn get_predict_hbd_fn_neon(TX_SIZE tx_size); #define get_predict_hbd_fn get_predict_hbd_fn_neon cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); cfl_predict_lbd_fn get_predict_lbd_fn_neon(TX_SIZE tx_size); #define get_predict_lbd_fn get_predict_lbd_fn_neon cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); cfl_subtract_average_fn get_subtract_average_fn_neon(TX_SIZE tx_size); #define get_subtract_average_fn get_subtract_average_fn_neon
+ show +
351
352
353
354
355
356
357
358
359
360
void av1_rtcd(void); #include "config/aom_config.h" #ifdef RTCD_C #include "aom_ports/arm.h" static void setup_rtcd_internal(void) { int flags = aom_arm_cpu_caps();
/media/esteban/ACOS/ResurrectionX/external/libaom/config/arm64/config/av1_rtcd.h
322
323
324
325
326
327
328
329
330
331
#define cfl_get_luma_subsampling_422_lbd cfl_get_luma_subsampling_422_lbd_neon cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_c(TX_SIZE tx_size); cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_neon(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_hbd cfl_get_luma_subsampling_444_hbd_neon cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_c(TX_SIZE tx_size); cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_neon(TX_SIZE tx_size); #define cfl_get_luma_subsampling_444_lbd cfl_get_luma_subsampling_444_lbd_neon
+ show +
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
void copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); void copy_rect8_16bit_to_16bit_neon(uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h); #define copy_rect8_16bit_to_16bit copy_rect8_16bit_to_16bit_neon void copy_rect8_8bit_to_16bit_c(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); void copy_rect8_8bit_to_16bit_neon(uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h); #define copy_rect8_8bit_to_16bit copy_rect8_8bit_to_16bit_neon cfl_predict_hbd_fn get_predict_hbd_fn_c(TX_SIZE tx_size); cfl_predict_hbd_fn get_predict_hbd_fn_neon(TX_SIZE tx_size); #define get_predict_hbd_fn get_predict_hbd_fn_neon cfl_predict_lbd_fn get_predict_lbd_fn_c(TX_SIZE tx_size); cfl_predict_lbd_fn get_predict_lbd_fn_neon(TX_SIZE tx_size); #define get_predict_lbd_fn get_predict_lbd_fn_neon cfl_subtract_average_fn get_subtract_average_fn_c(TX_SIZE tx_size); cfl_subtract_average_fn get_subtract_average_fn_neon(TX_SIZE tx_size); #define get_subtract_average_fn get_subtract_average_fn_neon
+ show +
351
352
353
354
355
356
357
358
359
360
void av1_rtcd(void); #include "config/aom_config.h" #ifdef RTCD_C #include "aom_ports/arm.h" static void setup_rtcd_internal(void) { int flags = aom_arm_cpu_caps();

[CVE-2020-0478_1.diff] CMakeLists.txt #12
+ + if(CONFIG_TUNE_VMAF) + find_library(VMAF libvmaf.a vmaf) + if(NOT VMAF) + message(FATAL_ERROR "VMAF library not found.") + endif() + message("-- Found VMAF library: " ${VMAF}) + set_target_properties(aom PROPERTIES LINKER_LANGUAGE CXX) + if(BUILD_SHARED_LIBS) + set_target_properties(aom_static PROPERTIES LINKER_LANGUAGE CXX) + endif() + target_link_libraries(aom PRIVATE ${VMAF}) + endif() - "${AOM_ROOT}/tools/dump_obu.cc" - "${AOM_ROOT}/tools/obu_parser.cc" - "${AOM_ROOT}/tools/obu_parser.h" - $<TARGET_OBJECTS:aom_common_app_util> - $<TARGET_OBJECTS:aom_decoder_app_util>) + "${AOM_ROOT}/tools/dump_obu.cc" + "${AOM_ROOT}/tools/obu_parser.cc" + "${AOM_ROOT}/tools/obu_parser.h" + $<TARGET_OBJECTS:aom_common_app_util> + $<TARGET_OBJECTS:aom_decoder_app_util>)
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/CMakeLists.txt
378
379
380
381
382
383
384
385
386
387
# Maintain a separate variable listing only the examples to facilitate # installation of example programs into an examples sub directory of # $AOM_DIST_DIR/bin when building the dist target. list(APPEND AOM_EXAMPLE_TARGETS ${AOM_DECODER_EXAMPLE_TARGETS} ${AOM_ENCODER_EXAMPLE_TARGETS}) endif() if(ENABLE_TOOLS) if(CONFIG_AV1_DECODER) add_executable(dump_obu "${AOM_GEN_SRC_DIR}/usage_exit.cc"
+ show +
388
389
390
391
392
"${AOM_ROOT}/tools/dump_obu.cc" "${AOM_ROOT}/tools/obu_parser.cc" "${AOM_ROOT}/tools/obu_parser.h" $<TARGET_OBJECTS:aom_common_app_util> $<TARGET_OBJECTS:aom_decoder_app_util>)
+ show +
393
394
395
396
397
398
399
400
401
402
list(APPEND AOM_TOOL_TARGETS dump_obu) list(APPEND AOM_APP_TARGETS dump_obu) # Maintain a separate variable listing only the examples to facilitate # installation of example programs into an tools sub directory of # $AOM_DIST_DIR/bin when building the dist target. list(APPEND AOM_TOOL_TARGETS ${AOM_DECODER_TOOL_TARGETS} ${AOM_ENCODER_TOOL_TARGETS}) endif()

[CVE-2020-0470_1.diff] CMakeLists.txt #12
+ + if(CONFIG_TUNE_VMAF) + find_library(VMAF libvmaf.a vmaf) + if(NOT VMAF) + message(FATAL_ERROR "VMAF library not found.") + endif() + message("-- Found VMAF library: " ${VMAF}) + set_target_properties(aom PROPERTIES LINKER_LANGUAGE CXX) + if(BUILD_SHARED_LIBS) + set_target_properties(aom_static PROPERTIES LINKER_LANGUAGE CXX) + endif() + target_link_libraries(aom PRIVATE ${VMAF}) + endif() - "${AOM_ROOT}/tools/dump_obu.cc" - "${AOM_ROOT}/tools/obu_parser.cc" - "${AOM_ROOT}/tools/obu_parser.h" - $<TARGET_OBJECTS:aom_common_app_util> - $<TARGET_OBJECTS:aom_decoder_app_util>) + "${AOM_ROOT}/tools/dump_obu.cc" + "${AOM_ROOT}/tools/obu_parser.cc" + "${AOM_ROOT}/tools/obu_parser.h" + $<TARGET_OBJECTS:aom_common_app_util> + $<TARGET_OBJECTS:aom_decoder_app_util>)
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/CMakeLists.txt
378
379
380
381
382
383
384
385
386
387
# Maintain a separate variable listing only the examples to facilitate # installation of example programs into an examples sub directory of # $AOM_DIST_DIR/bin when building the dist target. list(APPEND AOM_EXAMPLE_TARGETS ${AOM_DECODER_EXAMPLE_TARGETS} ${AOM_ENCODER_EXAMPLE_TARGETS}) endif() if(ENABLE_TOOLS) if(CONFIG_AV1_DECODER) add_executable(dump_obu "${AOM_GEN_SRC_DIR}/usage_exit.cc"
+ show +
388
389
390
391
392
"${AOM_ROOT}/tools/dump_obu.cc" "${AOM_ROOT}/tools/obu_parser.cc" "${AOM_ROOT}/tools/obu_parser.h" $<TARGET_OBJECTS:aom_common_app_util> $<TARGET_OBJECTS:aom_decoder_app_util>)
+ show +
393
394
395
396
397
398
399
400
401
402
list(APPEND AOM_TOOL_TARGETS dump_obu) list(APPEND AOM_APP_TARGETS dump_obu) # Maintain a separate variable listing only the examples to facilitate # installation of example programs into an tools sub directory of # $AOM_DIST_DIR/bin when building the dist target. list(APPEND AOM_TOOL_TARGETS ${AOM_DECODER_TOOL_TARGETS} ${AOM_ENCODER_TOOL_TARGETS}) endif()

[CVE-2020-0478_1.diff] aomdec.c #2
- &help, &codecarg, &use_yv12, &use_i420, - &flipuvarg, &rawvideo, &noblitarg, &progressarg, - &limitarg, &skiparg, &postprocarg, &summaryarg, - &outputfile, &threadsarg, &verbosearg, &scalearg, - &fb_arg, &md5arg, &framestatsarg, &continuearg, - &outbitdeptharg, &isannexb, &oppointarg, &outallarg, - &skipfilmgrain, NULL + &help, &codecarg, &use_yv12, &use_i420, &flipuvarg, + &rawvideo, &noblitarg, &progressarg, &limitarg, &skiparg, + &summaryarg, &outputfile, &threadsarg, &verbosearg, &scalearg, + &fb_arg, &md5arg, &framestatsarg, &continuearg, &outbitdeptharg, + &isannexb, &oppointarg, &outallarg, &skipfilmgrain, NULL
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/apps/aomdec.c
101
102
103
104
105
106
107
108
109
110
static const arg_def_t isannexb = ARG_DEF(NULL, "annexb", 0, "Bitstream is in Annex-B format"); static const arg_def_t oppointarg = ARG_DEF( NULL, "oppoint", 1, "Select an operating point of a scalable bitstream"); static const arg_def_t outallarg = ARG_DEF( NULL, "all-layers", 0, "Output all decoded frames of a scalable bitstream"); static const arg_def_t skipfilmgrain = ARG_DEF(NULL, "skip-film-grain", 0, "Skip film grain application"); static const arg_def_t *all_args[] = {
+ show +
111
112
113
114
115
116
117
&help, &codecarg, &use_yv12, &use_i420, &flipuvarg, &rawvideo, &noblitarg, &progressarg, &limitarg, &skiparg, &postprocarg, &summaryarg, &outputfile, &threadsarg, &verbosearg, &scalearg, &fb_arg, &md5arg, &framestatsarg, &continuearg, &outbitdeptharg, &isannexb, &oppointarg, &outallarg, &skipfilmgrain, NULL
+ show +
118
119
120
121
122
123
124
125
126
127
}; #if CONFIG_LIBYUV static INLINE int libyuv_scale(aom_image_t *src, aom_image_t *dst, FilterModeEnum mode) { if (src->fmt == AOM_IMG_FMT_I42016) { assert(dst->fmt == AOM_IMG_FMT_I42016); return I420Scale_16( (uint16_t *)src->planes[AOM_PLANE_Y], src->stride[AOM_PLANE_Y] / 2, (uint16_t *)src->planes[AOM_PLANE_U], src->stride[AOM_PLANE_U] / 2,

[CVE-2020-0470_1.diff] aomdec.c #2
- &help, &codecarg, &use_yv12, &use_i420, - &flipuvarg, &rawvideo, &noblitarg, &progressarg, - &limitarg, &skiparg, &postprocarg, &summaryarg, - &outputfile, &threadsarg, &verbosearg, &scalearg, - &fb_arg, &md5arg, &framestatsarg, &continuearg, - &outbitdeptharg, &isannexb, &oppointarg, &outallarg, - &skipfilmgrain, NULL + &help, &codecarg, &use_yv12, &use_i420, &flipuvarg, + &rawvideo, &noblitarg, &progressarg, &limitarg, &skiparg, + &summaryarg, &outputfile, &threadsarg, &verbosearg, &scalearg, + &fb_arg, &md5arg, &framestatsarg, &continuearg, &outbitdeptharg, + &isannexb, &oppointarg, &outallarg, &skipfilmgrain, NULL
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/apps/aomdec.c
101
102
103
104
105
106
107
108
109
110
static const arg_def_t isannexb = ARG_DEF(NULL, "annexb", 0, "Bitstream is in Annex-B format"); static const arg_def_t oppointarg = ARG_DEF( NULL, "oppoint", 1, "Select an operating point of a scalable bitstream"); static const arg_def_t outallarg = ARG_DEF( NULL, "all-layers", 0, "Output all decoded frames of a scalable bitstream"); static const arg_def_t skipfilmgrain = ARG_DEF(NULL, "skip-film-grain", 0, "Skip film grain application"); static const arg_def_t *all_args[] = {
+ show +
111
112
113
114
115
116
117
&help, &codecarg, &use_yv12, &use_i420, &flipuvarg, &rawvideo, &noblitarg, &progressarg, &limitarg, &skiparg, &postprocarg, &summaryarg, &outputfile, &threadsarg, &verbosearg, &scalearg, &fb_arg, &md5arg, &framestatsarg, &continuearg, &outbitdeptharg, &isannexb, &oppointarg, &outallarg, &skipfilmgrain, NULL
+ show +
118
119
120
121
122
123
124
125
126
127
}; #if CONFIG_LIBYUV static INLINE int libyuv_scale(aom_image_t *src, aom_image_t *dst, FilterModeEnum mode) { if (src->fmt == AOM_IMG_FMT_I42016) { assert(dst->fmt == AOM_IMG_FMT_I42016); return I420Scale_16( (uint16_t *)src->planes[AOM_PLANE_Y], src->stride[AOM_PLANE_Y] / 2, (uint16_t *)src->planes[AOM_PLANE_U], src->stride[AOM_PLANE_U] / 2,

[CVE-2020-0478_1.diff] aomenc.c #4
-#ifdef CONFIG_DIST_8X8 - { "cdef-dist", AOM_TUNE_CDEF_DIST }, - { "daala-dist", AOM_TUNE_DAALA_DIST }, -#endif + { "vmaf_with_preprocessing", AOM_TUNE_VMAF_WITH_PREPROCESSING }, + { "vmaf_without_preprocessing", AOM_TUNE_VMAF_WITHOUT_PREPROCESSING }, + { "vmaf", AOM_TUNE_VMAF_MAX_GAIN },
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/apps/aomenc.c
389
390
391
392
393
394
395
396
397
398
ARG_DEF(NULL, "static-thresh", 1, "Motion detection threshold"); static const arg_def_t auto_altref = ARG_DEF(NULL, "auto-alt-ref", 1, "Enable automatic alt reference frames"); static const arg_def_t arnr_maxframes = ARG_DEF(NULL, "arnr-maxframes", 1, "AltRef max frames (0..15)"); static const arg_def_t arnr_strength = ARG_DEF(NULL, "arnr-strength", 1, "AltRef filter strength (0..6)"); static const struct arg_enum_list tuning_enum[] = { { "psnr", AOM_TUNE_PSNR }, { "ssim", AOM_TUNE_SSIM },
+ show +
399
400
401
402
#ifdef CONFIG_DIST_8X8 { "cdef-dist", AOM_TUNE_CDEF_DIST }, { "daala-dist", AOM_TUNE_DAALA_DIST }, #endif
+ show +
403
404
405
406
407
408
409
410
411
412
{ NULL, 0 } }; static const arg_def_t tune_metric = ARG_DEF_ENUM(NULL, "tune", 1, "Distortion metric tuned with", tuning_enum); static const arg_def_t cq_level = ARG_DEF(NULL, "cq-level", 1, "Constant/Constrained Quality level"); static const arg_def_t max_intra_rate_pct = ARG_DEF(NULL, "max-intra-rate", 1, "Max I-frame bitrate (pct)"); #if CONFIG_AV1_ENCODER

[CVE-2020-0478_1.diff] aomenc.c #7
-static const arg_def_t enable_restoration = - ARG_DEF(NULL, "enable-restoration", 1, - "Enable the loop restoration filter (0: false, " - "1: true (default))"); +static const arg_def_t enable_restoration = ARG_DEF( + NULL, "enable-restoration", 1, + "Enable the loop restoration filter (0: false (default in Realtime mode), " + "1: true (default in Non-realtime mode))");
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/apps/aomenc.c
425
426
427
428
429
430
431
432
433
434
static const arg_def_t tile_width = ARG_DEF(NULL, "tile-width", 1, "Tile widths (comma separated)"); static const arg_def_t tile_height = ARG_DEF(NULL, "tile-height", 1, "Tile heights (command separated)"); static const arg_def_t lossless = ARG_DEF(NULL, "lossless", 1, "Lossless mode (0: false (default), 1: true)"); static const arg_def_t enable_cdef = ARG_DEF(NULL, "enable-cdef", 1, "Enable the constrained directional enhancement filter (0: false, " "1: true (default))");
+ show +
435
436
437
438
static const arg_def_t enable_restoration = ARG_DEF(NULL, "enable-restoration", 1, "Enable the loop restoration filter (0: false, " "1: true (default))");
+ show +
439
440
441
442
443
444
445
446
447
448
static const arg_def_t enable_rect_partitions = ARG_DEF(NULL, "enable-rect-partitions", 1, "Enable rectangular partitions " "(0: false, 1: true (default))"); static const arg_def_t enable_ab_partitions = ARG_DEF(NULL, "enable-ab-partitions", 1, "Enable ab partitions (0: false, 1: true (default))"); static const arg_def_t enable_1to4_partitions = ARG_DEF(NULL, "enable-1to4-partitions", 1, "Enable 1:4 and 4:1 partitions "

[CVE-2020-0478_1.diff] aomenc.c #10
+static const arg_def_t enable_chroma_deltaq = + ARG_DEF(NULL, "enable-chroma-deltaq", 1, + "Enable chroma delta quant " + "(0: false (default), 1: true)"); -static const arg_def_t tx_size_search_method = - ARG_DEF(NULL, "tx-size-search-method", 0, - "Set transform block size search method " - "(0: Full RD (default), 1: Fast RD, 2: use largest allowed)");
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/apps/aomenc.c
463
464
465
466
467
468
469
470
471
472
ARG_DEF(NULL, "enable-intra-edge-filter", 1, "Enable intra edge filtering " "(0: false, 1: true (default))"); static const arg_def_t enable_order_hint = ARG_DEF(NULL, "enable-order-hint", 1, "Enable order hint " "(0: false, 1: true (default))"); static const arg_def_t enable_tx64 = ARG_DEF(NULL, "enable-tx64", 1, "Enable 64-pt transform (0: false, 1: true (default))");
+ show +
473
474
475
476
static const arg_def_t tx_size_search_method = ARG_DEF(NULL, "tx-size-search-method", 0, "Set transform block size search method " "(0: Full RD (default), 1: Fast RD, 2: use largest allowed)");
+ show +
477
478
479
480
481
482
483
484
485
486
static const arg_def_t enable_flip_idtx = ARG_DEF(NULL, "enable-flip-idtx", 1, "Enable extended transform type (0: false, 1: true (default)) " "including FLIPADST_DCT, DCT_FLIPADST, FLIPADST_FLIPADST, " "ADST_FLIPADST, FLIPADST_ADST, IDTX, V_DCT, H_DCT, V_ADST, " "H_ADST, V_FLIPADST, H_FLIPADST"); static const arg_def_t enable_dist_wtd_comp = ARG_DEF(NULL, "enable-dist-wtd-comp", 1, "Enable distance-weighted compound " "(0: false, 1: true (default))");

[CVE-2020-0478_1.diff] aomenc.c #13
-#if CONFIG_DIST_8X8 -static const arg_def_t enable_dist_8x8 = - ARG_DEF(NULL, "enable-dist-8x8", 1, - "Enable dist-8x8 (0: false (default), 1: true)"); -#endif // CONFIG_DIST_8X8 +static const arg_def_t mv_cost_upd_freq = + ARG_DEF(NULL, "mv-cost-upd-freq", 1, + "Update freq for mv costs" + "0: SB, 1: SB Row per Tile, 2: Tile, 3: Off");
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/apps/aomenc.c
570
571
572
573
574
575
576
577
578
579
static const arg_def_t quant_b_adapt = ARG_DEF(NULL, "quant-b-adapt", 1, "Use adaptive quantize_b"); static const arg_def_t coeff_cost_upd_freq = ARG_DEF(NULL, "coeff-cost-upd-freq", 1, "Update freq for coeff costs" "0: SB, 1: SB Row per Tile, 2: Tile"); static const arg_def_t mode_cost_upd_freq = ARG_DEF(NULL, "mode-cost-upd-freq", 1, "Update freq for mode costs" "0: SB, 1: SB Row per Tile, 2: Tile");
+ show +
580
581
582
583
584
#if CONFIG_DIST_8X8 static const arg_def_t enable_dist_8x8 = ARG_DEF(NULL, "enable-dist-8x8", 1, "Enable dist-8x8 (0: false (default), 1: true)"); #endif // CONFIG_DIST_8X8
+ show +
585
586
587
588
589
590
591
592
593
594
static const arg_def_t num_tg = ARG_DEF( NULL, "num-tile-groups", 1, "Maximum number of tile groups, default is 1"); static const arg_def_t mtu_size = ARG_DEF(NULL, "mtu-size", 1, "MTU size for a tile group, default is 0 (no MTU targeting), " "overrides maximum number of tile groups"); static const struct arg_enum_list timing_info_enum[] = { { "unspecified", AOM_TIMING_UNSPECIFIED }, { "constant", AOM_TIMING_EQUAL }, { "model", AOM_TIMING_DEC_MODEL },

[CVE-2020-0470_1.diff] aomenc.c #4
-#ifdef CONFIG_DIST_8X8 - { "cdef-dist", AOM_TUNE_CDEF_DIST }, - { "daala-dist", AOM_TUNE_DAALA_DIST }, -#endif + { "vmaf_with_preprocessing", AOM_TUNE_VMAF_WITH_PREPROCESSING }, + { "vmaf_without_preprocessing", AOM_TUNE_VMAF_WITHOUT_PREPROCESSING }, + { "vmaf", AOM_TUNE_VMAF_MAX_GAIN },
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/apps/aomenc.c
389
390
391
392
393
394
395
396
397
398
ARG_DEF(NULL, "static-thresh", 1, "Motion detection threshold"); static const arg_def_t auto_altref = ARG_DEF(NULL, "auto-alt-ref", 1, "Enable automatic alt reference frames"); static const arg_def_t arnr_maxframes = ARG_DEF(NULL, "arnr-maxframes", 1, "AltRef max frames (0..15)"); static const arg_def_t arnr_strength = ARG_DEF(NULL, "arnr-strength", 1, "AltRef filter strength (0..6)"); static const struct arg_enum_list tuning_enum[] = { { "psnr", AOM_TUNE_PSNR }, { "ssim", AOM_TUNE_SSIM },
+ show +
399
400
401
402
#ifdef CONFIG_DIST_8X8 { "cdef-dist", AOM_TUNE_CDEF_DIST }, { "daala-dist", AOM_TUNE_DAALA_DIST }, #endif
+ show +
403
404
405
406
407
408
409
410
411
412
{ NULL, 0 } }; static const arg_def_t tune_metric = ARG_DEF_ENUM(NULL, "tune", 1, "Distortion metric tuned with", tuning_enum); static const arg_def_t cq_level = ARG_DEF(NULL, "cq-level", 1, "Constant/Constrained Quality level"); static const arg_def_t max_intra_rate_pct = ARG_DEF(NULL, "max-intra-rate", 1, "Max I-frame bitrate (pct)"); #if CONFIG_AV1_ENCODER

[CVE-2020-0470_1.diff] aomenc.c #7
-static const arg_def_t enable_restoration = - ARG_DEF(NULL, "enable-restoration", 1, - "Enable the loop restoration filter (0: false, " - "1: true (default))"); +static const arg_def_t enable_restoration = ARG_DEF( + NULL, "enable-restoration", 1, + "Enable the loop restoration filter (0: false (default in Realtime mode), " + "1: true (default in Non-realtime mode))");
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/apps/aomenc.c
425
426
427
428
429
430
431
432
433
434
static const arg_def_t tile_width = ARG_DEF(NULL, "tile-width", 1, "Tile widths (comma separated)"); static const arg_def_t tile_height = ARG_DEF(NULL, "tile-height", 1, "Tile heights (command separated)"); static const arg_def_t lossless = ARG_DEF(NULL, "lossless", 1, "Lossless mode (0: false (default), 1: true)"); static const arg_def_t enable_cdef = ARG_DEF(NULL, "enable-cdef", 1, "Enable the constrained directional enhancement filter (0: false, " "1: true (default))");
+ show +
435
436
437
438
static const arg_def_t enable_restoration = ARG_DEF(NULL, "enable-restoration", 1, "Enable the loop restoration filter (0: false, " "1: true (default))");
+ show +
439
440
441
442
443
444
445
446
447
448
static const arg_def_t enable_rect_partitions = ARG_DEF(NULL, "enable-rect-partitions", 1, "Enable rectangular partitions " "(0: false, 1: true (default))"); static const arg_def_t enable_ab_partitions = ARG_DEF(NULL, "enable-ab-partitions", 1, "Enable ab partitions (0: false, 1: true (default))"); static const arg_def_t enable_1to4_partitions = ARG_DEF(NULL, "enable-1to4-partitions", 1, "Enable 1:4 and 4:1 partitions "

[CVE-2020-0470_1.diff] aomenc.c #10
+static const arg_def_t enable_chroma_deltaq = + ARG_DEF(NULL, "enable-chroma-deltaq", 1, + "Enable chroma delta quant " + "(0: false (default), 1: true)"); -static const arg_def_t tx_size_search_method = - ARG_DEF(NULL, "tx-size-search-method", 0, - "Set transform block size search method " - "(0: Full RD (default), 1: Fast RD, 2: use largest allowed)");
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/apps/aomenc.c
463
464
465
466
467
468
469
470
471
472
ARG_DEF(NULL, "enable-intra-edge-filter", 1, "Enable intra edge filtering " "(0: false, 1: true (default))"); static const arg_def_t enable_order_hint = ARG_DEF(NULL, "enable-order-hint", 1, "Enable order hint " "(0: false, 1: true (default))"); static const arg_def_t enable_tx64 = ARG_DEF(NULL, "enable-tx64", 1, "Enable 64-pt transform (0: false, 1: true (default))");
+ show +
473
474
475
476
static const arg_def_t tx_size_search_method = ARG_DEF(NULL, "tx-size-search-method", 0, "Set transform block size search method " "(0: Full RD (default), 1: Fast RD, 2: use largest allowed)");
+ show +
477
478
479
480
481
482
483
484
485
486
static const arg_def_t enable_flip_idtx = ARG_DEF(NULL, "enable-flip-idtx", 1, "Enable extended transform type (0: false, 1: true (default)) " "including FLIPADST_DCT, DCT_FLIPADST, FLIPADST_FLIPADST, " "ADST_FLIPADST, FLIPADST_ADST, IDTX, V_DCT, H_DCT, V_ADST, " "H_ADST, V_FLIPADST, H_FLIPADST"); static const arg_def_t enable_dist_wtd_comp = ARG_DEF(NULL, "enable-dist-wtd-comp", 1, "Enable distance-weighted compound " "(0: false, 1: true (default))");

[CVE-2020-0470_1.diff] aomenc.c #13
-#if CONFIG_DIST_8X8 -static const arg_def_t enable_dist_8x8 = - ARG_DEF(NULL, "enable-dist-8x8", 1, - "Enable dist-8x8 (0: false (default), 1: true)"); -#endif // CONFIG_DIST_8X8 +static const arg_def_t mv_cost_upd_freq = + ARG_DEF(NULL, "mv-cost-upd-freq", 1, + "Update freq for mv costs" + "0: SB, 1: SB Row per Tile, 2: Tile, 3: Off");
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/apps/aomenc.c
570
571
572
573
574
575
576
577
578
579
static const arg_def_t quant_b_adapt = ARG_DEF(NULL, "quant-b-adapt", 1, "Use adaptive quantize_b"); static const arg_def_t coeff_cost_upd_freq = ARG_DEF(NULL, "coeff-cost-upd-freq", 1, "Update freq for coeff costs" "0: SB, 1: SB Row per Tile, 2: Tile"); static const arg_def_t mode_cost_upd_freq = ARG_DEF(NULL, "mode-cost-upd-freq", 1, "Update freq for mode costs" "0: SB, 1: SB Row per Tile, 2: Tile");
+ show +
580
581
582
583
584
#if CONFIG_DIST_8X8 static const arg_def_t enable_dist_8x8 = ARG_DEF(NULL, "enable-dist-8x8", 1, "Enable dist-8x8 (0: false (default), 1: true)"); #endif // CONFIG_DIST_8X8
+ show +
585
586
587
588
589
590
591
592
593
594
static const arg_def_t num_tg = ARG_DEF( NULL, "num-tile-groups", 1, "Maximum number of tile groups, default is 1"); static const arg_def_t mtu_size = ARG_DEF(NULL, "mtu-size", 1, "MTU size for a tile group, default is 0 (no MTU targeting), " "overrides maximum number of tile groups"); static const struct arg_enum_list timing_info_enum[] = { { "unspecified", AOM_TIMING_UNSPECIFIED }, { "constant", AOM_TIMING_EQUAL }, { "model", AOM_TIMING_DEC_MODEL },

[CVE-2020-0478_1.diff] debug_util.h #1
-void bitstream_queue_set_frame_write(int frame_idx); -int bitstream_queue_get_frame_write(void); -void bitstream_queue_set_frame_read(int frame_idx); -int bitstream_queue_get_frame_read(void); +void aom_bitstream_queue_set_frame_write(int frame_idx); +int aom_bitstream_queue_get_frame_writee(void); +void aom_bitstream_queue_set_frame_read(int frame_idx); +int aom_bitstream_queue_get_frame_read(void);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_util/debug_util.h
13
14
15
16
17
18
19
20
21
22
#define AOM_AOM_UTIL_DEBUG_UTIL_H_ #include "config/aom_config.h" #include "aom_dsp/prob.h" #ifdef __cplusplus extern "C" { #endif
+ show +
23
24
25
26
void bitstream_queue_set_frame_write(int frame_idx); int bitstream_queue_get_frame_write(void); void bitstream_queue_set_frame_read(int frame_idx); int bitstream_queue_get_frame_read(void);
+ show +
27
28
29
30
31
32
33
34
35
36
#if CONFIG_BITSTREAM_DEBUG /* This is a debug tool used to detect bitstream error. On encoder side, it * pushes each bit and probability into a queue before the bit is written into * the Arithmetic coder. On decoder side, whenever a bit is read out from the * Arithmetic coder, it pops out the reference bit and probability from the * queue as well. If the two results do not match, this debug tool will report * an error. This tool can be used to pin down the bitstream error precisely. * By combining gdb's backtrace method, we can detect which module causes the * bitstream error. */

[CVE-2020-0470_1.diff] debug_util.h #1
-void bitstream_queue_set_frame_write(int frame_idx); -int bitstream_queue_get_frame_write(void); -void bitstream_queue_set_frame_read(int frame_idx); -int bitstream_queue_get_frame_read(void); +void aom_bitstream_queue_set_frame_write(int frame_idx); +int aom_bitstream_queue_get_frame_writee(void); +void aom_bitstream_queue_set_frame_read(int frame_idx); +int aom_bitstream_queue_get_frame_read(void);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_util/debug_util.h
13
14
15
16
17
18
19
20
21
22
#define AOM_AOM_UTIL_DEBUG_UTIL_H_ #include "config/aom_config.h" #include "aom_dsp/prob.h" #ifdef __cplusplus extern "C" { #endif
+ show +
23
24
25
26
void bitstream_queue_set_frame_write(int frame_idx); int bitstream_queue_get_frame_write(void); void bitstream_queue_set_frame_read(int frame_idx); int bitstream_queue_get_frame_read(void);
+ show +
27
28
29
30
31
32
33
34
35
36
#if CONFIG_BITSTREAM_DEBUG /* This is a debug tool used to detect bitstream error. On encoder side, it * pushes each bit and probability into a queue before the bit is written into * the Arithmetic coder. On decoder side, whenever a bit is read out from the * Arithmetic coder, it pops out the reference bit and probability from the * queue as well. If the two results do not match, this debug tool will report * an error. This tool can be used to pin down the bitstream error precisely. * By combining gdb's backtrace method, we can detect which module causes the * bitstream error. */

[CVE-2020-0478_1.diff] debug_util.c #1
+ if(BUILD_SHARED_LIBS) + target_sources(aom_static PRIVATE $<TARGET_OBJECTS:aom_util>) + endif() -void bitstream_queue_set_frame_write(int frame_idx) { frame_idx_w = frame_idx; } +void aom_bitstream_queue_set_frame_write(int frame_idx) { + frame_idx_w = frame_idx; +} -int bitstream_queue_get_frame_write(void) { return frame_idx_w; } +int aom_bitstream_queue_get_frame_writee(void) { return frame_idx_w; } -void bitstream_queue_set_frame_read(int frame_idx) { frame_idx_r = frame_idx; } +void aom_bitstream_queue_set_frame_read(int frame_idx) { + frame_idx_r = frame_idx; +} -int bitstream_queue_get_frame_read(void) { return frame_idx_r; } +int aom_bitstream_queue_get_frame_read(void) { return frame_idx_r; }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_util/debug_util.c
11
12
13
14
15
16
17
18
19
20
#include <assert.h> #include <stdio.h> #include <string.h> #include "aom_util/debug_util.h" static int frame_idx_w = 0; static int frame_idx_r = 0;
+ show +
21
22
23
24
25
26
27
void bitstream_queue_set_frame_write(int frame_idx) { frame_idx_w = frame_idx; } int bitstream_queue_get_frame_write(void) { return frame_idx_w; } void bitstream_queue_set_frame_read(int frame_idx) { frame_idx_r = frame_idx; } int bitstream_queue_get_frame_read(void) { return frame_idx_r; }
+ show +
28
29
30
31
32
33
34
35
36
37
#if CONFIG_BITSTREAM_DEBUG #define QUEUE_MAX_SIZE 2000000 static int result_queue[QUEUE_MAX_SIZE]; static int nsymbs_queue[QUEUE_MAX_SIZE]; static aom_cdf_prob cdf_queue[QUEUE_MAX_SIZE][16]; static int queue_r = 0; static int queue_w = 0; static int queue_prev_w = -1;

[CVE-2020-0470_1.diff] debug_util.c #1
+ if(BUILD_SHARED_LIBS) + target_sources(aom_static PRIVATE $<TARGET_OBJECTS:aom_util>) + endif() -void bitstream_queue_set_frame_write(int frame_idx) { frame_idx_w = frame_idx; } +void aom_bitstream_queue_set_frame_write(int frame_idx) { + frame_idx_w = frame_idx; +} -int bitstream_queue_get_frame_write(void) { return frame_idx_w; } +int aom_bitstream_queue_get_frame_writee(void) { return frame_idx_w; } -void bitstream_queue_set_frame_read(int frame_idx) { frame_idx_r = frame_idx; } +void aom_bitstream_queue_set_frame_read(int frame_idx) { + frame_idx_r = frame_idx; +} -int bitstream_queue_get_frame_read(void) { return frame_idx_r; } +int aom_bitstream_queue_get_frame_read(void) { return frame_idx_r; }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_util/debug_util.c
11
12
13
14
15
16
17
18
19
20
#include <assert.h> #include <stdio.h> #include <string.h> #include "aom_util/debug_util.h" static int frame_idx_w = 0; static int frame_idx_r = 0;
+ show +
21
22
23
24
25
26
27
void bitstream_queue_set_frame_write(int frame_idx) { frame_idx_w = frame_idx; } int bitstream_queue_get_frame_write(void) { return frame_idx_w; } void bitstream_queue_set_frame_read(int frame_idx) { frame_idx_r = frame_idx; } int bitstream_queue_get_frame_read(void) { return frame_idx_r; }
+ show +
28
29
30
31
32
33
34
35
36
37
#if CONFIG_BITSTREAM_DEBUG #define QUEUE_MAX_SIZE 2000000 static int result_queue[QUEUE_MAX_SIZE]; static int nsymbs_queue[QUEUE_MAX_SIZE]; static aom_cdf_prob cdf_queue[QUEUE_MAX_SIZE][16]; static int queue_r = 0; static int queue_w = 0; static int queue_prev_w = -1;

[CVE-2020-0478_1.diff] generate_aom_config_templates.cmake #2
-" - ) -set( - h_file_header_block - "/* +") +set(h_file_header_block "/*
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/build/cmake/generate_aom_config_templates.cmake
16
17
18
19
20
21
22
23
24
25
"\; \; Copyright (c) ${year}, Alliance for Open Media. All rights reserved \; \; This source code is subject to the terms of the BSD 2 Clause License and \; the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License \; was not distributed with this source code in the LICENSE file, you can \; obtain it at www.aomedia.org/license/software. If the Alliance for Open \; Media Patent License 1.0 was not distributed with this source code in the \; PATENTS file, you can obtain it at www.aomedia.org/license/patent. \;
+ show +
26
27
28
29
30
" ) set( h_file_header_block "/*
+ show +
31
32
33
34
35
36
37
38
39
40
* Copyright (c) ${year}, Alliance for Open Media. All rights reserved * * This source code is subject to the terms of the BSD 2 Clause License and * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License * was not distributed with this source code in the LICENSE file, you can * obtain it at www.aomedia.org/license/software. If the Alliance for Open * Media Patent License 1.0 was not distributed with this source code in the * PATENTS file, you can obtain it at www.aomedia.org/license/patent. */ \#ifndef AOM_CONFIG_H_

[CVE-2020-0478_1.diff] generate_aom_config_templates.cmake #3
-" - ) -set( - cmake_file_header_block - "## +") +set(cmake_file_header_block "##
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/build/cmake/generate_aom_config_templates.cmake
32
33
34
35
36
37
38
39
40
41
* * This source code is subject to the terms of the BSD 2 Clause License and * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License * was not distributed with this source code in the LICENSE file, you can * obtain it at www.aomedia.org/license/software. If the Alliance for Open * Media Patent License 1.0 was not distributed with this source code in the * PATENTS file, you can obtain it at www.aomedia.org/license/patent. */ \#ifndef AOM_CONFIG_H_ \#define AOM_CONFIG_H_
+ show +
42
43
44
45
46
" ) set( cmake_file_header_block "##
+ show +
47
48
49
50
51
52
53
54
55
56
## Copyright (c) ${year}, Alliance for Open Media. All rights reserved ## ## This source code is subject to the terms of the BSD 2 Clause License and ## the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License ## was not distributed with this source code in the LICENSE file, you can ## obtain it at www.aomedia.org/license/software. If the Alliance for Open ## Media Patent License 1.0 was not distributed with this source code in the ## PATENTS file, you can obtain it at www.aomedia.org/license/patent. ## "

[CVE-2020-0470_1.diff] generate_aom_config_templates.cmake #2
-" - ) -set( - h_file_header_block - "/* +") +set(h_file_header_block "/*
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/build/cmake/generate_aom_config_templates.cmake
16
17
18
19
20
21
22
23
24
25
"\; \; Copyright (c) ${year}, Alliance for Open Media. All rights reserved \; \; This source code is subject to the terms of the BSD 2 Clause License and \; the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License \; was not distributed with this source code in the LICENSE file, you can \; obtain it at www.aomedia.org/license/software. If the Alliance for Open \; Media Patent License 1.0 was not distributed with this source code in the \; PATENTS file, you can obtain it at www.aomedia.org/license/patent. \;
+ show +
26
27
28
29
30
" ) set( h_file_header_block "/*
+ show +
31
32
33
34
35
36
37
38
39
40
* Copyright (c) ${year}, Alliance for Open Media. All rights reserved * * This source code is subject to the terms of the BSD 2 Clause License and * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License * was not distributed with this source code in the LICENSE file, you can * obtain it at www.aomedia.org/license/software. If the Alliance for Open * Media Patent License 1.0 was not distributed with this source code in the * PATENTS file, you can obtain it at www.aomedia.org/license/patent. */ \#ifndef AOM_CONFIG_H_

[CVE-2020-0470_1.diff] generate_aom_config_templates.cmake #3
-" - ) -set( - cmake_file_header_block - "## +") +set(cmake_file_header_block "##
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/build/cmake/generate_aom_config_templates.cmake
32
33
34
35
36
37
38
39
40
41
* * This source code is subject to the terms of the BSD 2 Clause License and * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License * was not distributed with this source code in the LICENSE file, you can * obtain it at www.aomedia.org/license/software. If the Alliance for Open * Media Patent License 1.0 was not distributed with this source code in the * PATENTS file, you can obtain it at www.aomedia.org/license/patent. */ \#ifndef AOM_CONFIG_H_ \#define AOM_CONFIG_H_
+ show +
42
43
44
45
46
" ) set( cmake_file_header_block "##
+ show +
47
48
49
50
51
52
53
54
55
56
## Copyright (c) ${year}, Alliance for Open Media. All rights reserved ## ## This source code is subject to the terms of the BSD 2 Clause License and ## the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License ## was not distributed with this source code in the LICENSE file, you can ## obtain it at www.aomedia.org/license/software. If the Alliance for Open ## Media Patent License 1.0 was not distributed with this source code in the ## PATENTS file, you can obtain it at www.aomedia.org/license/patent. ## "

[CVE-2020-0478_1.diff] aom_install.cmake #1
- add_custom_command(OUTPUT "${AOM_PKG_CONFIG_FILE}" - COMMAND - ${CMAKE_COMMAND} ARGS - -DAOM_CONFIG_DIR=${AOM_CONFIG_DIR} - -DAOM_ROOT=${AOM_ROOT} - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - -DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR} - -DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR} - -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} - -DCMAKE_PROJECT_NAME=${CMAKE_PROJECT_NAME} - -DCONFIG_MULTITHREAD=${CONFIG_MULTITHREAD} - -DHAVE_PTHREAD_H=${HAVE_PTHREAD_H} -P - "${AOM_ROOT}/build/cmake/pkg_config.cmake" - COMMENT "Writing aom.pc" VERBATIM) + add_custom_command( + OUTPUT "${AOM_PKG_CONFIG_FILE}" + COMMAND ${CMAKE_COMMAND} ARGS + -DAOM_CONFIG_DIR=${AOM_CONFIG_DIR} -DAOM_ROOT=${AOM_ROOT} + -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} + -DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR} + -DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR} + -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} + -DCMAKE_PROJECT_NAME=${CMAKE_PROJECT_NAME} + -DCONFIG_MULTITHREAD=${CONFIG_MULTITHREAD} + -DHAVE_PTHREAD_H=${HAVE_PTHREAD_H} -P + "${AOM_ROOT}/build/cmake/pkg_config.cmake" + COMMENT "Writing aom.pc" + VERBATIM)
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/build/cmake/aom_install.cmake
29
30
31
32
33
34
35
36
37
38
macro(setup_aom_install_targets) if(NOT (MSVC OR XCODE)) include("GNUInstallDirs") set(AOM_PKG_CONFIG_FILE "${AOM_CONFIG_DIR}/aom.pc") # Create a dummy library target for creating aom.pc. create_dummy_source_file(aom_pc c AOM_PKG_CONFIG_SOURCES) add_library(aom_pc ${AOM_PKG_CONFIG_SOURCES}) # Setup a rule to generate aom.pc.
+ show +
39
40
41
42
43
44
45
46
47
48
49
50
51
52
add_custom_command(OUTPUT "${AOM_PKG_CONFIG_FILE}" COMMAND ${CMAKE_COMMAND} ARGS -DAOM_CONFIG_DIR=${AOM_CONFIG_DIR} -DAOM_ROOT=${AOM_ROOT} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR} -DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR} -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} -DCMAKE_PROJECT_NAME=${CMAKE_PROJECT_NAME} -DCONFIG_MULTITHREAD=${CONFIG_MULTITHREAD} -DHAVE_PTHREAD_H=${HAVE_PTHREAD_H} -P "${AOM_ROOT}/build/cmake/pkg_config.cmake" COMMENT "Writing aom.pc" VERBATIM)
+ show +
53
54
55
56
57
58
59
60
61
62
# Explicitly add a dependency on the pkg-config file to ensure it's built. get_property(aom_pc_sources TARGET aom_pc PROPERTY SOURCES) set_source_files_properties(${aom_pc_sources} OBJECT_DEPENDS "${AOM_PKG_CONFIG_FILE}") # Our pkg-config file carries version information: add a dependency on the # version rule. add_dependencies(aom_pc aom_version)

[CVE-2020-0470_1.diff] aom_install.cmake #1
- add_custom_command(OUTPUT "${AOM_PKG_CONFIG_FILE}" - COMMAND - ${CMAKE_COMMAND} ARGS - -DAOM_CONFIG_DIR=${AOM_CONFIG_DIR} - -DAOM_ROOT=${AOM_ROOT} - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - -DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR} - -DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR} - -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} - -DCMAKE_PROJECT_NAME=${CMAKE_PROJECT_NAME} - -DCONFIG_MULTITHREAD=${CONFIG_MULTITHREAD} - -DHAVE_PTHREAD_H=${HAVE_PTHREAD_H} -P - "${AOM_ROOT}/build/cmake/pkg_config.cmake" - COMMENT "Writing aom.pc" VERBATIM) + add_custom_command( + OUTPUT "${AOM_PKG_CONFIG_FILE}" + COMMAND ${CMAKE_COMMAND} ARGS + -DAOM_CONFIG_DIR=${AOM_CONFIG_DIR} -DAOM_ROOT=${AOM_ROOT} + -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} + -DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR} + -DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR} + -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} + -DCMAKE_PROJECT_NAME=${CMAKE_PROJECT_NAME} + -DCONFIG_MULTITHREAD=${CONFIG_MULTITHREAD} + -DHAVE_PTHREAD_H=${HAVE_PTHREAD_H} -P + "${AOM_ROOT}/build/cmake/pkg_config.cmake" + COMMENT "Writing aom.pc" + VERBATIM)
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/build/cmake/aom_install.cmake
29
30
31
32
33
34
35
36
37
38
macro(setup_aom_install_targets) if(NOT (MSVC OR XCODE)) include("GNUInstallDirs") set(AOM_PKG_CONFIG_FILE "${AOM_CONFIG_DIR}/aom.pc") # Create a dummy library target for creating aom.pc. create_dummy_source_file(aom_pc c AOM_PKG_CONFIG_SOURCES) add_library(aom_pc ${AOM_PKG_CONFIG_SOURCES}) # Setup a rule to generate aom.pc.
+ show +
39
40
41
42
43
44
45
46
47
48
49
50
51
52
add_custom_command(OUTPUT "${AOM_PKG_CONFIG_FILE}" COMMAND ${CMAKE_COMMAND} ARGS -DAOM_CONFIG_DIR=${AOM_CONFIG_DIR} -DAOM_ROOT=${AOM_ROOT} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR} -DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR} -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} -DCMAKE_PROJECT_NAME=${CMAKE_PROJECT_NAME} -DCONFIG_MULTITHREAD=${CONFIG_MULTITHREAD} -DHAVE_PTHREAD_H=${HAVE_PTHREAD_H} -P "${AOM_ROOT}/build/cmake/pkg_config.cmake" COMMENT "Writing aom.pc" VERBATIM)
+ show +
53
54
55
56
57
58
59
60
61
62
# Explicitly add a dependency on the pkg-config file to ensure it's built. get_property(aom_pc_sources TARGET aom_pc PROPERTY SOURCES) set_source_files_properties(${aom_pc_sources} OBJECT_DEPENDS "${AOM_PKG_CONFIG_FILE}") # Our pkg-config file carries version information: add a dependency on the # version rule. add_dependencies(aom_pc aom_version)

[CVE-2020-0478_1.diff] aom_config_defaults.cmake #3
-set_aom_option_var(ENABLE_MMX - "Enables MMX optimizations on x86/x86_64 targets." ON) -set_aom_option_var(ENABLE_SSE - "Enables SSE optimizations on x86/x86_64 targets." ON) +set_aom_option_var(ENABLE_MMX "Enables MMX optimizations on x86/x86_64 targets." + ON) +set_aom_option_var(ENABLE_SSE "Enables SSE optimizations on x86/x86_64 targets." + ON)
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/build/cmake/aom_config_defaults.cmake
164
165
166
167
168
169
170
171
172
173
# MIPS assembly/intrinsics flags. set_aom_option_var(ENABLE_DSPR2 "Enables DSPR2 optimizations on MIPS targets." OFF) set_aom_option_var(ENABLE_MSA "Enables MSA optimizations on MIPS targets." OFF) # VSX intrinsics flags. set_aom_option_var(ENABLE_VSX "Enables VSX optimizations on PowerPC targets." ON) # x86/x86_64 assembly/intrinsics flags.
+ show +
174
175
176
177
set_aom_option_var(ENABLE_MMX "Enables MMX optimizations on x86/x86_64 targets." ON) set_aom_option_var(ENABLE_SSE "Enables SSE optimizations on x86/x86_64 targets." ON)
+ show +
178
179
180
181
182
183
184
185
186
187
set_aom_option_var(ENABLE_SSE2 "Enables SSE2 optimizations on x86/x86_64 targets." ON) set_aom_option_var(ENABLE_SSE3 "Enables SSE3 optimizations on x86/x86_64 targets." ON) set_aom_option_var(ENABLE_SSSE3 "Enables SSSE3 optimizations on x86/x86_64 targets." ON) set_aom_option_var(ENABLE_SSE4_1 "Enables SSE4_1 optimizations on x86/x86_64 targets." ON) set_aom_option_var(ENABLE_SSE4_2 "Enables SSE4_2 optimizations on x86/x86_64 targets." ON)

[CVE-2020-0470_1.diff] aom_config_defaults.cmake #3
-set_aom_option_var(ENABLE_MMX - "Enables MMX optimizations on x86/x86_64 targets." ON) -set_aom_option_var(ENABLE_SSE - "Enables SSE optimizations on x86/x86_64 targets." ON) +set_aom_option_var(ENABLE_MMX "Enables MMX optimizations on x86/x86_64 targets." + ON) +set_aom_option_var(ENABLE_SSE "Enables SSE optimizations on x86/x86_64 targets." + ON)
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/build/cmake/aom_config_defaults.cmake
164
165
166
167
168
169
170
171
172
173
# MIPS assembly/intrinsics flags. set_aom_option_var(ENABLE_DSPR2 "Enables DSPR2 optimizations on MIPS targets." OFF) set_aom_option_var(ENABLE_MSA "Enables MSA optimizations on MIPS targets." OFF) # VSX intrinsics flags. set_aom_option_var(ENABLE_VSX "Enables VSX optimizations on PowerPC targets." ON) # x86/x86_64 assembly/intrinsics flags.
+ show +
174
175
176
177
set_aom_option_var(ENABLE_MMX "Enables MMX optimizations on x86/x86_64 targets." ON) set_aom_option_var(ENABLE_SSE "Enables SSE optimizations on x86/x86_64 targets." ON)
+ show +
178
179
180
181
182
183
184
185
186
187
set_aom_option_var(ENABLE_SSE2 "Enables SSE2 optimizations on x86/x86_64 targets." ON) set_aom_option_var(ENABLE_SSE3 "Enables SSE3 optimizations on x86/x86_64 targets." ON) set_aom_option_var(ENABLE_SSSE3 "Enables SSSE3 optimizations on x86/x86_64 targets." ON) set_aom_option_var(ENABLE_SSE4_1 "Enables SSE4_1 optimizations on x86/x86_64 targets." ON) set_aom_option_var(ENABLE_SSE4_2 "Enables SSE4_2 optimizations on x86/x86_64 targets." ON)

[CVE-2020-0478_1.diff] aom_optimization.cmake #1
-# Note: the libaom target is always updated because OBJECT libraries have rules -# that disallow the direct addition of .o files to them as dependencies. Static -# libraries do not have this limitation. -function(add_intrinsics_object_library flag opt_name target_to_update sources - dependent_target) +# Note: this function always updates the aom, and aom_static targets because +# OBJECT libraries have rules that disallow the direct addition of .o files to +# them as dependencies. Static and shared libraries do not have this limitation. +function(add_intrinsics_object_library flag opt_name target_to_update sources)
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/build/cmake/aom_optimization.cmake
28
29
30
31
32
33
34
35
36
37
unset(${translated_flag} PARENT_SCOPE) endif() endfunction() # Adds an object library target. Terminates generation if $flag is not supported # by the current compiler. $flag is the intrinsics flag required by the current # compiler, and is added to the compile flags for all sources in $sources. # $opt_name is used to name the target. $target_to_update is made dependent upon # the created target. #
+ show +
38
39
40
41
42
# Note: the libaom target is always updated because OBJECT libraries have rules # that disallow the direct addition of .o files to them as dependencies. Static # libraries do not have this limitation. function(add_intrinsics_object_library flag opt_name target_to_update sources dependent_target)
+ show +
43
44
45
46
47
48
49
50
51
52
if("${${sources}}" STREQUAL "") return() endif() set(target_name ${target_to_update}_${opt_name}_intrinsics) add_library(${target_name} OBJECT ${${sources}}) if(MSVC) get_msvc_intrinsic_flag(${flag} "flag") endif()

[CVE-2020-0478_1.diff] aom_optimization.cmake #4
-# into $dependent_target. Generates a dummy C file with a dummy function to -# ensure that all cmake generators can determine the linker language, and that -# build tools don't complain that an object exposes no symbols. -function(add_asm_library lib_name asm_sources dependent_target) +# into the aom library target(s). Generates a dummy C file with a dummy function +# to ensure that all cmake generators can determine the linker language, and +# that build tools don't complain that an object exposes no symbols. +function(add_asm_library lib_name asm_sources)
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/build/cmake/aom_optimization.cmake
105
106
107
108
109
110
111
112
113
114
else() message(FATAL_ERROR "Unknown obj format: ${AOM_TARGET_CPU}-${AOM_TARGET_SYSTEM}") endif() set(${out_format} ${objformat} PARENT_SCOPE) endfunction() # Adds library target named $lib_name for ASM files in variable named by # $asm_sources. Builds an output directory path from $lib_name. Links $lib_name
+ show +
115
116
117
118
# into $dependent_target. Generates a dummy C file with a dummy function to # ensure that all cmake generators can determine the linker language, and that # build tools don't complain that an object exposes no symbols. function(add_asm_library lib_name asm_sources dependent_target)
+ show +
119
120
121
122
123
124
125
126
127
128
if("${${asm_sources}}" STREQUAL "") return() endif() set(asm_lib_obj_dir "${AOM_CONFIG_DIR}/asm_objects/${lib_name}") if(NOT EXISTS "${asm_lib_obj_dir}") file(MAKE_DIRECTORY "${asm_lib_obj_dir}") endif() # TODO(tomfinegan): If cmake ever allows addition of .o files to OBJECT lib # targets, make this OBJECT instead of STATIC to hide the target from

[CVE-2020-0470_1.diff] aom_optimization.cmake #1
-# Note: the libaom target is always updated because OBJECT libraries have rules -# that disallow the direct addition of .o files to them as dependencies. Static -# libraries do not have this limitation. -function(add_intrinsics_object_library flag opt_name target_to_update sources - dependent_target) +# Note: this function always updates the aom, and aom_static targets because +# OBJECT libraries have rules that disallow the direct addition of .o files to +# them as dependencies. Static and shared libraries do not have this limitation. +function(add_intrinsics_object_library flag opt_name target_to_update sources)
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/build/cmake/aom_optimization.cmake
28
29
30
31
32
33
34
35
36
37
unset(${translated_flag} PARENT_SCOPE) endif() endfunction() # Adds an object library target. Terminates generation if $flag is not supported # by the current compiler. $flag is the intrinsics flag required by the current # compiler, and is added to the compile flags for all sources in $sources. # $opt_name is used to name the target. $target_to_update is made dependent upon # the created target. #
+ show +
38
39
40
41
42
# Note: the libaom target is always updated because OBJECT libraries have rules # that disallow the direct addition of .o files to them as dependencies. Static # libraries do not have this limitation. function(add_intrinsics_object_library flag opt_name target_to_update sources dependent_target)
+ show +
43
44
45
46
47
48
49
50
51
52
if("${${sources}}" STREQUAL "") return() endif() set(target_name ${target_to_update}_${opt_name}_intrinsics) add_library(${target_name} OBJECT ${${sources}}) if(MSVC) get_msvc_intrinsic_flag(${flag} "flag") endif()

[CVE-2020-0470_1.diff] aom_optimization.cmake #4
-# into $dependent_target. Generates a dummy C file with a dummy function to -# ensure that all cmake generators can determine the linker language, and that -# build tools don't complain that an object exposes no symbols. -function(add_asm_library lib_name asm_sources dependent_target) +# into the aom library target(s). Generates a dummy C file with a dummy function +# to ensure that all cmake generators can determine the linker language, and +# that build tools don't complain that an object exposes no symbols. +function(add_asm_library lib_name asm_sources)
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/build/cmake/aom_optimization.cmake
105
106
107
108
109
110
111
112
113
114
else() message(FATAL_ERROR "Unknown obj format: ${AOM_TARGET_CPU}-${AOM_TARGET_SYSTEM}") endif() set(${out_format} ${objformat} PARENT_SCOPE) endfunction() # Adds library target named $lib_name for ASM files in variable named by # $asm_sources. Builds an output directory path from $lib_name. Links $lib_name
+ show +
115
116
117
118
# into $dependent_target. Generates a dummy C file with a dummy function to # ensure that all cmake generators can determine the linker language, and that # build tools don't complain that an object exposes no symbols. function(add_asm_library lib_name asm_sources dependent_target)
+ show +
119
120
121
122
123
124
125
126
127
128
if("${${asm_sources}}" STREQUAL "") return() endif() set(asm_lib_obj_dir "${AOM_CONFIG_DIR}/asm_objects/${lib_name}") if(NOT EXISTS "${asm_lib_obj_dir}") file(MAKE_DIRECTORY "${asm_lib_obj_dir}") endif() # TODO(tomfinegan): If cmake ever allows addition of .o files to OBJECT lib # targets, make this OBJECT instead of STATIC to hide the target from

[CVE-2020-0478_1.diff] util.cmake #1
- file( - WRITE - "${dummy_source_file}" "// Generated file. DO NOT EDIT!\n" - "// ${target_name} needs a ${extension} file to force link language, \n" - "// or to silence a harmless CMake warning: Ignore me.\n" - "void ${target_name}_dummy_function(void) {}\n") + file(WRITE "${dummy_source_file}" + "// Generated file. DO NOT EDIT!\n" + "// ${target_name} needs a ${extension} file to force link language, \n" + "// or to silence a harmless CMake warning: Ignore me.\n" + "void aom_${target_name}_dummy_function(void) {}\n")
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/build/cmake/util.cmake
14
15
16
17
18
19
20
21
22
23
set(AOM_BUILD_CMAKE_UTIL_CMAKE_ 1) # Directory where generated sources will be written. set(AOM_GEN_SRC_DIR "${AOM_CONFIG_DIR}/gen_src") # Creates dummy source file in $AOM_GEN_SRC_DIR named $basename.$extension and # returns the full path to the dummy source file via appending it to the list # variable referred to by $out_file_list_var parameter. macro(create_dummy_source_file basename extension out_file_list_var) set(dummy_source_file "${AOM_GEN_SRC_DIR}/${basename}_dummy.${extension}")
+ show +
24
25
26
27
28
29
file( WRITE "${dummy_source_file}" "// Generated file. DO NOT EDIT!\n" "// ${target_name} needs a ${extension} file to force link language, \n" "// or to silence a harmless CMake warning: Ignore me.\n" "void ${target_name}_dummy_function(void) {}\n")
+ show +
30
31
32
33
34
35
36
37
38
39
list(APPEND "${out_file_list_var}" "${dummy_source_file}") endmacro() # Convenience function for adding a dummy source file to $target_name using # $extension as the file extension. Wraps create_dummy_source_file(). function(add_dummy_source_file_to_target target_name extension) create_dummy_source_file("${target_name}" "${extension}" "dummy_source_file_list") target_sources(${target_name} PRIVATE ${dummy_source_file_list}) endfunction()

[CVE-2020-0470_1.diff] util.cmake #1
- file( - WRITE - "${dummy_source_file}" "// Generated file. DO NOT EDIT!\n" - "// ${target_name} needs a ${extension} file to force link language, \n" - "// or to silence a harmless CMake warning: Ignore me.\n" - "void ${target_name}_dummy_function(void) {}\n") + file(WRITE "${dummy_source_file}" + "// Generated file. DO NOT EDIT!\n" + "// ${target_name} needs a ${extension} file to force link language, \n" + "// or to silence a harmless CMake warning: Ignore me.\n" + "void aom_${target_name}_dummy_function(void) {}\n")
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/build/cmake/util.cmake
14
15
16
17
18
19
20
21
22
23
set(AOM_BUILD_CMAKE_UTIL_CMAKE_ 1) # Directory where generated sources will be written. set(AOM_GEN_SRC_DIR "${AOM_CONFIG_DIR}/gen_src") # Creates dummy source file in $AOM_GEN_SRC_DIR named $basename.$extension and # returns the full path to the dummy source file via appending it to the list # variable referred to by $out_file_list_var parameter. macro(create_dummy_source_file basename extension out_file_list_var) set(dummy_source_file "${AOM_GEN_SRC_DIR}/${basename}_dummy.${extension}")
+ show +
24
25
26
27
28
29
file( WRITE "${dummy_source_file}" "// Generated file. DO NOT EDIT!\n" "// ${target_name} needs a ${extension} file to force link language, \n" "// or to silence a harmless CMake warning: Ignore me.\n" "void ${target_name}_dummy_function(void) {}\n")
+ show +
30
31
32
33
34
35
36
37
38
39
list(APPEND "${out_file_list_var}" "${dummy_source_file}") endmacro() # Convenience function for adding a dummy source file to $target_name using # $extension as the file extension. Wraps create_dummy_source_file(). function(add_dummy_source_file_to_target target_name extension) create_dummy_source_file("${target_name}" "${extension}" "dummy_source_file_list") target_sources(${target_name} PRIVATE ${dummy_source_file_list}) endfunction()

[CVE-2020-0478_1.diff] aom_configure.cmake #6
- message(FATAL_ERROR - "Unable to find assembler. Install 'yasm' or 'nasm.' " - "To build without optimizations, add -DAOM_TARGET_CPU=generic to " - "your cmake command line.") + message( + FATAL_ERROR + "Unable to find assembler. Install 'yasm' or 'nasm.' " + "To build without optimizations, add -DAOM_TARGET_CPU=generic to " + "your cmake command line.")
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/build/cmake/aom_configure.cmake
117
118
119
120
121
122
123
124
125
126
find_program(AS_EXECUTABLE yasm $ENV{YASM_PATH}) if(NOT AS_EXECUTABLE OR ENABLE_NASM) unset(AS_EXECUTABLE CACHE) find_program(AS_EXECUTABLE nasm $ENV{NASM_PATH}) if(AS_EXECUTABLE) test_nasm() endif() endif() if(NOT AS_EXECUTABLE)
+ show +
127
128
129
130
message(FATAL_ERROR "Unable to find assembler. Install 'yasm' or 'nasm.' " "To build without optimizations, add -DAOM_TARGET_CPU=generic to " "your cmake command line.")
+ show +
131
132
133
134
135
136
137
138
139
140
endif() get_asm_obj_format("objformat") set(AOM_AS_FLAGS -f ${objformat} ${AOM_AS_FLAGS}) string(STRIP "${AOM_AS_FLAGS}" AOM_AS_FLAGS) elseif("${AOM_TARGET_CPU}" MATCHES "arm") if("${AOM_TARGET_SYSTEM}" STREQUAL "Darwin") set(AS_EXECUTABLE as) set(AOM_AS_FLAGS -arch ${AOM_TARGET_CPU} -isysroot ${CMAKE_OSX_SYSROOT}) elseif("${AOM_TARGET_SYSTEM}" STREQUAL "Linux") if(NOT AS_EXECUTABLE)

[CVE-2020-0478_1.diff] aom_configure.cmake #12
-execute_process(COMMAND - ${CMAKE_COMMAND} -DAOM_CONFIG_DIR=${AOM_CONFIG_DIR} - -DAOM_ROOT=${AOM_ROOT} -P - "${AOM_ROOT}/build/cmake/generate_aom_config_templates.cmake") +execute_process( + COMMAND ${CMAKE_COMMAND} + -DAOM_CONFIG_DIR=${AOM_CONFIG_DIR} -DAOM_ROOT=${AOM_ROOT} -P + "${AOM_ROOT}/build/cmake/generate_aom_config_templates.cmake")
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/build/cmake/aom_configure.cmake
310
311
312
313
314
315
316
317
318
319
if(EMSCRIPTEN) # Avoid CMake generation time errors resulting from collisions with the form # of target_link_libraries() used by Emscripten.cmake. unset(AOM_LIB_LINK_TYPE) endif() # Generate aom_config templates. set(aom_config_asm_template "${AOM_CONFIG_DIR}/config/aom_config.asm.cmake") set(aom_config_h_template "${AOM_CONFIG_DIR}/config/aom_config.h.cmake")
+ show +
320
321
322
323
execute_process(COMMAND ${CMAKE_COMMAND} -DAOM_CONFIG_DIR=${AOM_CONFIG_DIR} -DAOM_ROOT=${AOM_ROOT} -P "${AOM_ROOT}/build/cmake/generate_aom_config_templates.cmake")
+ show +
324
325
326
327
328
329
330
331
332
333
# Generate aom_config.{asm,h}. configure_file("${aom_config_asm_template}" "${AOM_CONFIG_DIR}/config/aom_config.asm") configure_file("${aom_config_h_template}" "${AOM_CONFIG_DIR}/config/aom_config.h") # Read the current git hash. find_package(Git) if(NOT GIT_FOUND)

[CVE-2020-0470_1.diff] aom_configure.cmake #6
- message(FATAL_ERROR - "Unable to find assembler. Install 'yasm' or 'nasm.' " - "To build without optimizations, add -DAOM_TARGET_CPU=generic to " - "your cmake command line.") + message( + FATAL_ERROR + "Unable to find assembler. Install 'yasm' or 'nasm.' " + "To build without optimizations, add -DAOM_TARGET_CPU=generic to " + "your cmake command line.")
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/build/cmake/aom_configure.cmake
117
118
119
120
121
122
123
124
125
126
find_program(AS_EXECUTABLE yasm $ENV{YASM_PATH}) if(NOT AS_EXECUTABLE OR ENABLE_NASM) unset(AS_EXECUTABLE CACHE) find_program(AS_EXECUTABLE nasm $ENV{NASM_PATH}) if(AS_EXECUTABLE) test_nasm() endif() endif() if(NOT AS_EXECUTABLE)
+ show +
127
128
129
130
message(FATAL_ERROR "Unable to find assembler. Install 'yasm' or 'nasm.' " "To build without optimizations, add -DAOM_TARGET_CPU=generic to " "your cmake command line.")
+ show +
131
132
133
134
135
136
137
138
139
140
endif() get_asm_obj_format("objformat") set(AOM_AS_FLAGS -f ${objformat} ${AOM_AS_FLAGS}) string(STRIP "${AOM_AS_FLAGS}" AOM_AS_FLAGS) elseif("${AOM_TARGET_CPU}" MATCHES "arm") if("${AOM_TARGET_SYSTEM}" STREQUAL "Darwin") set(AS_EXECUTABLE as) set(AOM_AS_FLAGS -arch ${AOM_TARGET_CPU} -isysroot ${CMAKE_OSX_SYSROOT}) elseif("${AOM_TARGET_SYSTEM}" STREQUAL "Linux") if(NOT AS_EXECUTABLE)

[CVE-2020-0470_1.diff] aom_configure.cmake #12
-execute_process(COMMAND - ${CMAKE_COMMAND} -DAOM_CONFIG_DIR=${AOM_CONFIG_DIR} - -DAOM_ROOT=${AOM_ROOT} -P - "${AOM_ROOT}/build/cmake/generate_aom_config_templates.cmake") +execute_process( + COMMAND ${CMAKE_COMMAND} + -DAOM_CONFIG_DIR=${AOM_CONFIG_DIR} -DAOM_ROOT=${AOM_ROOT} -P + "${AOM_ROOT}/build/cmake/generate_aom_config_templates.cmake")
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/build/cmake/aom_configure.cmake
310
311
312
313
314
315
316
317
318
319
if(EMSCRIPTEN) # Avoid CMake generation time errors resulting from collisions with the form # of target_link_libraries() used by Emscripten.cmake. unset(AOM_LIB_LINK_TYPE) endif() # Generate aom_config templates. set(aom_config_asm_template "${AOM_CONFIG_DIR}/config/aom_config.asm.cmake") set(aom_config_h_template "${AOM_CONFIG_DIR}/config/aom_config.h.cmake")
+ show +
320
321
322
323
execute_process(COMMAND ${CMAKE_COMMAND} -DAOM_CONFIG_DIR=${AOM_CONFIG_DIR} -DAOM_ROOT=${AOM_ROOT} -P "${AOM_ROOT}/build/cmake/generate_aom_config_templates.cmake")
+ show +
324
325
326
327
328
329
330
331
332
333
# Generate aom_config.{asm,h}. configure_file("${aom_config_asm_template}" "${AOM_CONFIG_DIR}/config/aom_config.asm") configure_file("${aom_config_h_template}" "${AOM_CONFIG_DIR}/config/aom_config.h") # Read the current git hash. find_package(Git) if(NOT GIT_FOUND)

[CVE-2020-0478_1.diff] version.cmake #2
- OUTPUT_VARIABLE aom_version ERROR_QUIET) - string(STRIP "${aom_version}" aom_version) + OUTPUT_VARIABLE aom_version + ERROR_QUIET + RESULT_VARIABLE version_check_result) - # Remove the leading 'v' from the version string. - string(FIND "${aom_version}" "v" v_pos) - if(${v_pos} EQUAL 0) - string(SUBSTRING "${aom_version}" 1 -1 aom_version) + if(${version_check_result} EQUAL 0) + string(STRIP "${aom_version}" aom_version) + + # Remove the leading 'v' from the version string. + string(FIND "${aom_version}" "v" v_pos) + if(${v_pos} EQUAL 0) + string(SUBSTRING "${aom_version}" 1 -1 aom_version) + endif() + else() + set(aom_version "")
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/build/cmake/version.cmake
18
19
20
21
22
23
24
25
26
27
message(FATAL_ERROR "${arg} must not be empty.") endif() endforeach() include("${AOM_ROOT}/build/cmake/util.cmake") # Generate the version string for this run. unset(aom_version) if(EXISTS "${GIT_EXECUTABLE}") execute_process(COMMAND ${GIT_EXECUTABLE} --git-dir=${AOM_ROOT}/.git describe
+ show +
28
29
30
31
32
33
34
OUTPUT_VARIABLE aom_version ERROR_QUIET) string(STRIP "${aom_version}" aom_version) # Remove the leading 'v' from the version string. string(FIND "${aom_version}" "v" v_pos) if(${v_pos} EQUAL 0) string(SUBSTRING "${aom_version}" 1 -1 aom_version)
+ show +
35
36
37
38
39
40
41
42
43
44
endif() endif() if("${aom_version}" STREQUAL "") set(aom_version "${AOM_ROOT}/CHANGELOG") endif() unset(last_aom_version) if(EXISTS "${AOM_CONFIG_DIR}/config/aom_version.h") extract_version_string("${AOM_CONFIG_DIR}/config/aom_version.h"

[CVE-2020-0470_1.diff] version.cmake #2
- OUTPUT_VARIABLE aom_version ERROR_QUIET) - string(STRIP "${aom_version}" aom_version) + OUTPUT_VARIABLE aom_version + ERROR_QUIET + RESULT_VARIABLE version_check_result) - # Remove the leading 'v' from the version string. - string(FIND "${aom_version}" "v" v_pos) - if(${v_pos} EQUAL 0) - string(SUBSTRING "${aom_version}" 1 -1 aom_version) + if(${version_check_result} EQUAL 0) + string(STRIP "${aom_version}" aom_version) + + # Remove the leading 'v' from the version string. + string(FIND "${aom_version}" "v" v_pos) + if(${v_pos} EQUAL 0) + string(SUBSTRING "${aom_version}" 1 -1 aom_version) + endif() + else() + set(aom_version "")
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/build/cmake/version.cmake
18
19
20
21
22
23
24
25
26
27
message(FATAL_ERROR "${arg} must not be empty.") endif() endforeach() include("${AOM_ROOT}/build/cmake/util.cmake") # Generate the version string for this run. unset(aom_version) if(EXISTS "${GIT_EXECUTABLE}") execute_process(COMMAND ${GIT_EXECUTABLE} --git-dir=${AOM_ROOT}/.git describe
+ show +
28
29
30
31
32
33
34
OUTPUT_VARIABLE aom_version ERROR_QUIET) string(STRIP "${aom_version}" aom_version) # Remove the leading 'v' from the version string. string(FIND "${aom_version}" "v" v_pos) if(${v_pos} EQUAL 0) string(SUBSTRING "${aom_version}" 1 -1 aom_version)
+ show +
35
36
37
38
39
40
41
42
43
44
endif() endif() if("${aom_version}" STREQUAL "") set(aom_version "${AOM_ROOT}/CHANGELOG") endif() unset(last_aom_version) if(EXISTS "${AOM_CONFIG_DIR}/config/aom_version.h") extract_version_string("${AOM_CONFIG_DIR}/config/aom_version.h"

[CVE-2020-0478_1.diff] aom_encoder.h #5
-/*!\brief Initialize multi-encoder instance +/*!\brief Get the default configuration for a usage. - * Initializes multi-encoder context using the given interface. - * Applications should call the aom_codec_enc_init_multi convenience macro - * instead of this function directly, to ensure that the ABI version number - * parameter is properly initialized. - * - * \param[in] ctx Pointer to this instance's context. - * \param[in] iface Pointer to the algorithm interface to use. - * \param[in] cfg Configuration to use, if known. - * \param[in] num_enc Total number of encoders. - * \param[in] flags Bitfield of AOM_CODEC_USE_* flags - * \param[in] dsf Pointer to down-sampling factors. - * \param[in] ver ABI version number. Must be set to - * AOM_ENCODER_ABI_VERSION - * \retval #AOM_CODEC_OK - * The decoder algorithm initialized. - * \retval #AOM_CODEC_MEM_ERROR - * Memory allocation failed. - */ -aom_codec_err_t aom_codec_enc_init_multi_ver( - aom_codec_ctx_t *ctx, aom_codec_iface_t *iface, aom_codec_enc_cfg_t *cfg, - int num_enc, aom_codec_flags_t flags, aom_rational_t *dsf, int ver); - -/*!\brief Convenience macro for aom_codec_enc_init_multi_ver() - * - * Ensures the ABI version parameter is properly set. - */ -#define aom_codec_enc_init_multi(ctx, iface, cfg, num_enc, flags, dsf) \ - aom_codec_enc_init_multi_ver(ctx, iface, cfg, num_enc, flags, dsf, \ - AOM_ENCODER_ABI_VERSION) - -/*!\brief Get a default configuration - * - * Initializes a encoder configuration structure with default values. Supports + * Initializes an encoder configuration structure with default values. Supports
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom/aom_encoder.h
777
778
779
780
781
782
783
784
785
786
* \param[in] num_enc Total number of encoders. * \param[in] flags Bitfield of AOM_CODEC_USE_* flags * \param[in] dsf Pointer to down-sampling factors. * \param[in] ver ABI version number. Must be set to * AOM_ENCODER_ABI_VERSION * \retval #AOM_CODEC_OK * The decoder algorithm initialized. * \retval #AOM_CODEC_MEM_ERROR * Memory allocation failed. */
+ show +
787
788
789
790
791
792
793
794
795
796
797
aom_codec_err_t aom_codec_enc_init_multi_ver( aom_codec_ctx_t *ctx, aom_codec_iface_t *iface, aom_codec_enc_cfg_t *cfg, int num_enc, aom_codec_flags_t flags, aom_rational_t *dsf, int ver); /*!\brief Convenience macro for aom_codec_enc_init_multi_ver() * * Ensures the ABI version parameter is properly set. */ #define aom_codec_enc_init_multi(ctx, iface, cfg, num_enc, flags, dsf) \ aom_codec_enc_init_multi_ver(ctx, iface, cfg, num_enc, flags, dsf, \ AOM_ENCODER_ABI_VERSION)
+ show +
798
799
800
801
802
803
804
805
806
807
/*!\brief Get a default configuration * * Initializes a encoder configuration structure with default values. Supports * the notion of "usages" so that an algorithm may offer different default * settings depending on the user's intended goal. This function \ref SHOULD * be called by all applications to initialize the configuration structure * before specializing the configuration with application specific values. * * \param[in] iface Pointer to the algorithm interface to use.

[CVE-2020-0470_1.diff] aom_encoder.h #5
-/*!\brief Initialize multi-encoder instance +/*!\brief Get the default configuration for a usage. - * Initializes multi-encoder context using the given interface. - * Applications should call the aom_codec_enc_init_multi convenience macro - * instead of this function directly, to ensure that the ABI version number - * parameter is properly initialized. - * - * \param[in] ctx Pointer to this instance's context. - * \param[in] iface Pointer to the algorithm interface to use. - * \param[in] cfg Configuration to use, if known. - * \param[in] num_enc Total number of encoders. - * \param[in] flags Bitfield of AOM_CODEC_USE_* flags - * \param[in] dsf Pointer to down-sampling factors. - * \param[in] ver ABI version number. Must be set to - * AOM_ENCODER_ABI_VERSION - * \retval #AOM_CODEC_OK - * The decoder algorithm initialized. - * \retval #AOM_CODEC_MEM_ERROR - * Memory allocation failed. - */ -aom_codec_err_t aom_codec_enc_init_multi_ver( - aom_codec_ctx_t *ctx, aom_codec_iface_t *iface, aom_codec_enc_cfg_t *cfg, - int num_enc, aom_codec_flags_t flags, aom_rational_t *dsf, int ver); - -/*!\brief Convenience macro for aom_codec_enc_init_multi_ver() - * - * Ensures the ABI version parameter is properly set. - */ -#define aom_codec_enc_init_multi(ctx, iface, cfg, num_enc, flags, dsf) \ - aom_codec_enc_init_multi_ver(ctx, iface, cfg, num_enc, flags, dsf, \ - AOM_ENCODER_ABI_VERSION) - -/*!\brief Get a default configuration - * - * Initializes a encoder configuration structure with default values. Supports + * Initializes an encoder configuration structure with default values. Supports
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom/aom_encoder.h
777
778
779
780
781
782
783
784
785
786
* \param[in] num_enc Total number of encoders. * \param[in] flags Bitfield of AOM_CODEC_USE_* flags * \param[in] dsf Pointer to down-sampling factors. * \param[in] ver ABI version number. Must be set to * AOM_ENCODER_ABI_VERSION * \retval #AOM_CODEC_OK * The decoder algorithm initialized. * \retval #AOM_CODEC_MEM_ERROR * Memory allocation failed. */
+ show +
787
788
789
790
791
792
793
794
795
796
797
aom_codec_err_t aom_codec_enc_init_multi_ver( aom_codec_ctx_t *ctx, aom_codec_iface_t *iface, aom_codec_enc_cfg_t *cfg, int num_enc, aom_codec_flags_t flags, aom_rational_t *dsf, int ver); /*!\brief Convenience macro for aom_codec_enc_init_multi_ver() * * Ensures the ABI version parameter is properly set. */ #define aom_codec_enc_init_multi(ctx, iface, cfg, num_enc, flags, dsf) \ aom_codec_enc_init_multi_ver(ctx, iface, cfg, num_enc, flags, dsf, \ AOM_ENCODER_ABI_VERSION)
+ show +
798
799
800
801
802
803
804
805
806
807
/*!\brief Get a default configuration * * Initializes a encoder configuration structure with default values. Supports * the notion of "usages" so that an algorithm may offer different default * settings depending on the user's intended goal. This function \ref SHOULD * be called by all applications to initialize the configuration structure * before specializing the configuration with application specific values. * * \param[in] iface Pointer to the algorithm interface to use.

[CVE-2020-0478_1.diff] aom_codec_internal.h #5
-typedef aom_codec_err_t (*aom_codec_enc_mr_get_mem_loc_fn_t)( - const aom_codec_enc_cfg_t *cfg, void **mem_loc); - -/*!\brief usage configuration mapping - * - * This structure stores the mapping between usage identifiers and - * configuration structures. Each algorithm provides a list of these - * mappings. This list is searched by the aom_codec_enc_config_default() - * wrapper function to determine which config to return. The special value - * {-1, {0}} is used to indicate end-of-list, and must be present. At least - * one mapping must be present, in addition to the end-of-list. - * - */ -typedef const struct aom_codec_enc_cfg_map { - int usage; - aom_codec_enc_cfg_t cfg; -} aom_codec_enc_cfg_map_t; -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom/internal/aom_codec_internal.h
252
253
254
255
256
257
258
259
260
261
aom_codec_alg_priv_t *ctx, aom_codec_iter_t *iter); typedef aom_codec_err_t (*aom_codec_enc_config_set_fn_t)( aom_codec_alg_priv_t *ctx, const aom_codec_enc_cfg_t *cfg); typedef aom_fixed_buf_t *(*aom_codec_get_global_headers_fn_t)( aom_codec_alg_priv_t *ctx); typedef aom_image_t *(*aom_codec_get_preview_frame_fn_t)( aom_codec_alg_priv_t *ctx);
+ show +
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
typedef aom_codec_err_t (*aom_codec_enc_mr_get_mem_loc_fn_t)( const aom_codec_enc_cfg_t *cfg, void **mem_loc); /*!\brief usage configuration mapping * * This structure stores the mapping between usage identifiers and * configuration structures. Each algorithm provides a list of these * mappings. This list is searched by the aom_codec_enc_config_default() * wrapper function to determine which config to return. The special value * {-1, {0}} is used to indicate end-of-list, and must be present. At least * one mapping must be present, in addition to the end-of-list. * */ typedef const struct aom_codec_enc_cfg_map { int usage; aom_codec_enc_cfg_t cfg; } aom_codec_enc_cfg_map_t;
+ show +
279
280
281
282
283
284
285
286
287
288
/*!\brief Decoder algorithm interface interface * * All decoders \ref MUST expose a variable of this type. */ struct aom_codec_iface { const char *name; /**< Identification String */ int abi_version; /**< Implemented ABI version */ aom_codec_caps_t caps; /**< Decoder capabilities */ aom_codec_init_fn_t init; /**< \copydoc ::aom_codec_init_fn_t */

[CVE-2020-0478_1.diff] aom_codec_internal.h #6
- int cfg_map_count; - aom_codec_enc_cfg_map_t - *cfg_maps; /**< \copydoc ::aom_codec_enc_cfg_map_t */ - aom_codec_encode_fn_t encode; /**< \copydoc ::aom_codec_encode_fn_t */ + int cfg_count; + const aom_codec_enc_cfg_t *cfgs; /**< \copydoc ::aom_codec_enc_cfg_t */ + aom_codec_encode_fn_t encode; /**< \copydoc ::aom_codec_encode_fn_t */
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom/internal/aom_codec_internal.h
290
291
292
293
294
295
296
297
298
299
aom_codec_ctrl_fn_map_t *ctrl_maps; /**< \copydoc ::aom_codec_ctrl_fn_map_t */ struct aom_codec_dec_iface { aom_codec_peek_si_fn_t peek_si; /**< \copydoc ::aom_codec_peek_si_fn_t */ aom_codec_get_si_fn_t get_si; /**< \copydoc ::aom_codec_get_si_fn_t */ aom_codec_decode_fn_t decode; /**< \copydoc ::aom_codec_decode_fn_t */ aom_codec_get_frame_fn_t get_frame; /**< \copydoc ::aom_codec_get_frame_fn_t */ aom_codec_set_fb_fn_t set_fb_fn; /**< \copydoc ::aom_codec_set_fb_fn_t */ } dec; struct aom_codec_enc_iface {
+ show +
300
301
302
303
int cfg_map_count; aom_codec_enc_cfg_map_t *cfg_maps; /**< \copydoc ::aom_codec_enc_cfg_map_t */ aom_codec_encode_fn_t encode; /**< \copydoc ::aom_codec_encode_fn_t */
+ show +
304
305
306
307
308
309
310
311
312
313
aom_codec_get_cx_data_fn_t get_cx_data; /**< \copydoc ::aom_codec_get_cx_data_fn_t */ aom_codec_enc_config_set_fn_t cfg_set; /**< \copydoc ::aom_codec_enc_config_set_fn_t */ aom_codec_get_global_headers_fn_t get_glob_hdrs; /**< \copydoc ::aom_codec_get_global_headers_fn_t */ aom_codec_get_preview_frame_fn_t get_preview; /**< \copydoc ::aom_codec_get_preview_frame_fn_t */ aom_codec_enc_mr_get_mem_loc_fn_t mr_get_mem_loc; /**< \copydoc ::aom_codec_enc_mr_get_mem_loc_fn_t */

[CVE-2020-0470_1.diff] aom_codec_internal.h #5
-typedef aom_codec_err_t (*aom_codec_enc_mr_get_mem_loc_fn_t)( - const aom_codec_enc_cfg_t *cfg, void **mem_loc); - -/*!\brief usage configuration mapping - * - * This structure stores the mapping between usage identifiers and - * configuration structures. Each algorithm provides a list of these - * mappings. This list is searched by the aom_codec_enc_config_default() - * wrapper function to determine which config to return. The special value - * {-1, {0}} is used to indicate end-of-list, and must be present. At least - * one mapping must be present, in addition to the end-of-list. - * - */ -typedef const struct aom_codec_enc_cfg_map { - int usage; - aom_codec_enc_cfg_t cfg; -} aom_codec_enc_cfg_map_t; -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom/internal/aom_codec_internal.h
252
253
254
255
256
257
258
259
260
261
aom_codec_alg_priv_t *ctx, aom_codec_iter_t *iter); typedef aom_codec_err_t (*aom_codec_enc_config_set_fn_t)( aom_codec_alg_priv_t *ctx, const aom_codec_enc_cfg_t *cfg); typedef aom_fixed_buf_t *(*aom_codec_get_global_headers_fn_t)( aom_codec_alg_priv_t *ctx); typedef aom_image_t *(*aom_codec_get_preview_frame_fn_t)( aom_codec_alg_priv_t *ctx);
+ show +
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
typedef aom_codec_err_t (*aom_codec_enc_mr_get_mem_loc_fn_t)( const aom_codec_enc_cfg_t *cfg, void **mem_loc); /*!\brief usage configuration mapping * * This structure stores the mapping between usage identifiers and * configuration structures. Each algorithm provides a list of these * mappings. This list is searched by the aom_codec_enc_config_default() * wrapper function to determine which config to return. The special value * {-1, {0}} is used to indicate end-of-list, and must be present. At least * one mapping must be present, in addition to the end-of-list. * */ typedef const struct aom_codec_enc_cfg_map { int usage; aom_codec_enc_cfg_t cfg; } aom_codec_enc_cfg_map_t;
+ show +
279
280
281
282
283
284
285
286
287
288
/*!\brief Decoder algorithm interface interface * * All decoders \ref MUST expose a variable of this type. */ struct aom_codec_iface { const char *name; /**< Identification String */ int abi_version; /**< Implemented ABI version */ aom_codec_caps_t caps; /**< Decoder capabilities */ aom_codec_init_fn_t init; /**< \copydoc ::aom_codec_init_fn_t */

[CVE-2020-0470_1.diff] aom_codec_internal.h #6
- int cfg_map_count; - aom_codec_enc_cfg_map_t - *cfg_maps; /**< \copydoc ::aom_codec_enc_cfg_map_t */ - aom_codec_encode_fn_t encode; /**< \copydoc ::aom_codec_encode_fn_t */ + int cfg_count; + const aom_codec_enc_cfg_t *cfgs; /**< \copydoc ::aom_codec_enc_cfg_t */ + aom_codec_encode_fn_t encode; /**< \copydoc ::aom_codec_encode_fn_t */
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom/internal/aom_codec_internal.h
290
291
292
293
294
295
296
297
298
299
aom_codec_ctrl_fn_map_t *ctrl_maps; /**< \copydoc ::aom_codec_ctrl_fn_map_t */ struct aom_codec_dec_iface { aom_codec_peek_si_fn_t peek_si; /**< \copydoc ::aom_codec_peek_si_fn_t */ aom_codec_get_si_fn_t get_si; /**< \copydoc ::aom_codec_get_si_fn_t */ aom_codec_decode_fn_t decode; /**< \copydoc ::aom_codec_decode_fn_t */ aom_codec_get_frame_fn_t get_frame; /**< \copydoc ::aom_codec_get_frame_fn_t */ aom_codec_set_fb_fn_t set_fb_fn; /**< \copydoc ::aom_codec_set_fb_fn_t */ } dec; struct aom_codec_enc_iface {
+ show +
300
301
302
303
int cfg_map_count; aom_codec_enc_cfg_map_t *cfg_maps; /**< \copydoc ::aom_codec_enc_cfg_map_t */ aom_codec_encode_fn_t encode; /**< \copydoc ::aom_codec_encode_fn_t */
+ show +
304
305
306
307
308
309
310
311
312
313
aom_codec_get_cx_data_fn_t get_cx_data; /**< \copydoc ::aom_codec_get_cx_data_fn_t */ aom_codec_enc_config_set_fn_t cfg_set; /**< \copydoc ::aom_codec_enc_config_set_fn_t */ aom_codec_get_global_headers_fn_t get_glob_hdrs; /**< \copydoc ::aom_codec_get_global_headers_fn_t */ aom_codec_get_preview_frame_fn_t get_preview; /**< \copydoc ::aom_codec_get_preview_frame_fn_t */ aom_codec_enc_mr_get_mem_loc_fn_t mr_get_mem_loc; /**< \copydoc ::aom_codec_enc_mr_get_mem_loc_fn_t */

[CVE-2020-0478_1.diff] av1_fwd_txfm1d_test.cc #1
- { av1_fdct4_new, av1_fadst4_new, av1_fidentity4_c }, - { av1_fdct8_new, av1_fadst8_new, av1_fidentity8_c }, - { av1_fdct16_new, av1_fadst16_new, av1_fidentity16_c }, - { av1_fdct32_new, NULL, av1_fidentity32_c }, - { av1_fdct64_new, NULL, NULL }, + { av1_fdct4, av1_fadst4, av1_fidentity4_c }, + { av1_fdct8, av1_fadst8, av1_fidentity8_c }, + { av1_fdct16, av1_fadst16, av1_fidentity16_c }, + { av1_fdct32, NULL, av1_fidentity32_c }, + { av1_fdct64, NULL, NULL },
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/av1_fwd_txfm1d_test.cc
23
24
25
26
27
28
29
30
31
32
namespace { const int txfm_type_num = 3; const TYPE_TXFM txfm_type_ls[txfm_type_num] = { TYPE_DCT, TYPE_ADST, TYPE_IDTX }; const int txfm_size_num = 5; const int txfm_size_ls[] = { 4, 8, 16, 32, 64 }; const TxfmFunc fwd_txfm_func_ls[][txfm_type_num] = {
+ show +
33
34
35
36
37
{ av1_fdct4_new, av1_fadst4_new, av1_fidentity4_c }, { av1_fdct8_new, av1_fadst8_new, av1_fidentity8_c }, { av1_fdct16_new, av1_fadst16_new, av1_fidentity16_c }, { av1_fdct32_new, NULL, av1_fidentity32_c }, { av1_fdct64_new, NULL, NULL },
+ show +
38
39
40
41
42
43
44
45
46
47
}; // the maximum stage number of fwd/inv 1d dct/adst txfm is 12 const int8_t cos_bit = 14; const int8_t range_bit[12] = { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 }; TEST(av1_fwd_txfm1d, round_shift) { EXPECT_EQ(round_shift(7, 1), 4); EXPECT_EQ(round_shift(-7, 1), -3);

[CVE-2020-0470_1.diff] av1_fwd_txfm1d_test.cc #1
- { av1_fdct4_new, av1_fadst4_new, av1_fidentity4_c }, - { av1_fdct8_new, av1_fadst8_new, av1_fidentity8_c }, - { av1_fdct16_new, av1_fadst16_new, av1_fidentity16_c }, - { av1_fdct32_new, NULL, av1_fidentity32_c }, - { av1_fdct64_new, NULL, NULL }, + { av1_fdct4, av1_fadst4, av1_fidentity4_c }, + { av1_fdct8, av1_fadst8, av1_fidentity8_c }, + { av1_fdct16, av1_fadst16, av1_fidentity16_c }, + { av1_fdct32, NULL, av1_fidentity32_c }, + { av1_fdct64, NULL, NULL },
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/av1_fwd_txfm1d_test.cc
23
24
25
26
27
28
29
30
31
32
namespace { const int txfm_type_num = 3; const TYPE_TXFM txfm_type_ls[txfm_type_num] = { TYPE_DCT, TYPE_ADST, TYPE_IDTX }; const int txfm_size_num = 5; const int txfm_size_ls[] = { 4, 8, 16, 32, 64 }; const TxfmFunc fwd_txfm_func_ls[][txfm_type_num] = {
+ show +
33
34
35
36
37
{ av1_fdct4_new, av1_fadst4_new, av1_fidentity4_c }, { av1_fdct8_new, av1_fadst8_new, av1_fidentity8_c }, { av1_fdct16_new, av1_fadst16_new, av1_fidentity16_c }, { av1_fdct32_new, NULL, av1_fidentity32_c }, { av1_fdct64_new, NULL, NULL },
+ show +
38
39
40
41
42
43
44
45
46
47
}; // the maximum stage number of fwd/inv 1d dct/adst txfm is 12 const int8_t cos_bit = 14; const int8_t range_bit[12] = { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 }; TEST(av1_fwd_txfm1d, round_shift) { EXPECT_EQ(round_shift(7, 1), 4); EXPECT_EQ(round_shift(-7, 1), -3);

[CVE-2020-0478_1.diff] simd_cmp_impl.h #1
-#define MAP(name) \ - { \ -#name, reinterpret_cast < fptr > (c_##name), \ - reinterpret_cast < fptr > (name) \ - } +#define MAP(name) \ + { #name, reinterpret_cast < fptr>(c_##name), reinterpret_cast < fptr>(name) }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/simd_cmp_impl.h
462
463
464
465
466
467
468
469
470
471
namespace { typedef void (*fptr)(); typedef struct { const char *name; fptr ref; fptr simd; } mapping;
+ show +
472
473
474
475
#define MAP(name) \ { \ #name, reinterpret_cast < fptr > (c_##name), \ reinterpret_cast < fptr > (name) \
+ show +
476
477
478
479
480
481
482
483
484
485
} const mapping m[] = { MAP(v64_sad_u8), MAP(v64_ssd_u8), MAP(v64_add_8), MAP(v64_add_16), MAP(v64_sadd_s8), MAP(v64_sadd_u8), MAP(v64_sadd_s16), MAP(v64_add_32),

[CVE-2020-0478_1.diff] simd_cmp_impl.h #5
- << Print(s1, sizeof(s1)) << ", " << Print(s2, sizeof(s2)) - << ", " << Print(s3, sizeof(s3)) << ") -> " - << Print(d, sizeof(d)) << " (simd), " - << Print(ref_d, sizeof(ref_d)) << " (ref)"; + << Print(s1, sizeof(CArg1)) << ", " + << Print(s2, sizeof(CArg2)) << ", " + << Print(s3, sizeof(CArg3)) << ") -> " + << Print(d, sizeof(CRet)) << " (simd), " + << Print(ref_d, sizeof(CRet)) << " (ref)";
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/simd_cmp_impl.h
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
reinterpret_cast<fptr>(ref_simd), ref_d, s1, s2, s3); } else { FAIL() << "Internal error: Unknown intrinsic function " << typeid(CRet).name() << " " << name << "(" << typeid(CArg1).name() << ", " << typeid(CArg2).name() << ", " << typeid(CArg3).name() << ")"; } } EXPECT_EQ(0, error) << "Error: mismatch for " << name << "("
+ show +
2069
2070
2071
2072
<< Print(s1, sizeof(s1)) << ", " << Print(s2, sizeof(s2)) << ", " << Print(s3, sizeof(s3)) << ") -> " << Print(d, sizeof(d)) << " (simd), " << Print(ref_d, sizeof(ref_d)) << " (ref)";
+ show +
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
} // Instantiations to make the functions callable from another files template void TestSimd1Arg<c_v64, uint8_t>(uint32_t, uint32_t, uint32_t, const char *); template void TestSimd1Arg<c_v64, uint16_t>(uint32_t, uint32_t, uint32_t, const char *); template void TestSimd1Arg<c_v64, uint32_t>(uint32_t, uint32_t, uint32_t, const char *); template void TestSimd1Arg<c_v64, c_v64>(uint32_t, uint32_t, uint32_t,

[CVE-2020-0470_1.diff] simd_cmp_impl.h #1
-#define MAP(name) \ - { \ -#name, reinterpret_cast < fptr > (c_##name), \ - reinterpret_cast < fptr > (name) \ - } +#define MAP(name) \ + { #name, reinterpret_cast < fptr>(c_##name), reinterpret_cast < fptr>(name) }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/simd_cmp_impl.h
462
463
464
465
466
467
468
469
470
471
namespace { typedef void (*fptr)(); typedef struct { const char *name; fptr ref; fptr simd; } mapping;
+ show +
472
473
474
475
#define MAP(name) \ { \ #name, reinterpret_cast < fptr > (c_##name), \ reinterpret_cast < fptr > (name) \
+ show +
476
477
478
479
480
481
482
483
484
485
} const mapping m[] = { MAP(v64_sad_u8), MAP(v64_ssd_u8), MAP(v64_add_8), MAP(v64_add_16), MAP(v64_sadd_s8), MAP(v64_sadd_u8), MAP(v64_sadd_s16), MAP(v64_add_32),

[CVE-2020-0470_1.diff] simd_cmp_impl.h #5
- << Print(s1, sizeof(s1)) << ", " << Print(s2, sizeof(s2)) - << ", " << Print(s3, sizeof(s3)) << ") -> " - << Print(d, sizeof(d)) << " (simd), " - << Print(ref_d, sizeof(ref_d)) << " (ref)"; + << Print(s1, sizeof(CArg1)) << ", " + << Print(s2, sizeof(CArg2)) << ", " + << Print(s3, sizeof(CArg3)) << ") -> " + << Print(d, sizeof(CRet)) << " (simd), " + << Print(ref_d, sizeof(CRet)) << " (ref)";
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/simd_cmp_impl.h
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
reinterpret_cast<fptr>(ref_simd), ref_d, s1, s2, s3); } else { FAIL() << "Internal error: Unknown intrinsic function " << typeid(CRet).name() << " " << name << "(" << typeid(CArg1).name() << ", " << typeid(CArg2).name() << ", " << typeid(CArg3).name() << ")"; } } EXPECT_EQ(0, error) << "Error: mismatch for " << name << "("
+ show +
2069
2070
2071
2072
<< Print(s1, sizeof(s1)) << ", " << Print(s2, sizeof(s2)) << ", " << Print(s3, sizeof(s3)) << ") -> " << Print(d, sizeof(d)) << " (simd), " << Print(ref_d, sizeof(ref_d)) << " (ref)";
+ show +
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
} // Instantiations to make the functions callable from another files template void TestSimd1Arg<c_v64, uint8_t>(uint32_t, uint32_t, uint32_t, const char *); template void TestSimd1Arg<c_v64, uint16_t>(uint32_t, uint32_t, uint32_t, const char *); template void TestSimd1Arg<c_v64, uint32_t>(uint32_t, uint32_t, uint32_t, const char *); template void TestSimd1Arg<c_v64, c_v64>(uint32_t, uint32_t, uint32_t,

[CVE-2020-0478_1.diff] intra_edge_test.cc #4
-INSTANTIATE_TEST_CASE_P(SSE4_1, FilterEdgeTestHB, - ::testing::Values(FilterEdgeTestFuncsHBD( - av1_filter_intra_edge_high_c, - av1_filter_intra_edge_high_sse4_1))); +INSTANTIATE_TEST_SUITE_P(SSE4_1, FilterEdgeTestHB, + ::testing::Values(FilterEdgeTestFuncsHBD( + av1_filter_intra_edge_high_c, + av1_filter_intra_edge_high_sse4_1)));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/intra_edge_test.cc
261
262
263
264
265
266
267
268
269
270
pix = rng_(hi); edge_ref_data_[i] = pix; edge_tst_data_[i] = pix; } Common(); } } #if HAVE_SSE4_1
+ show +
271
272
273
274
INSTANTIATE_TEST_CASE_P(SSE4_1, FilterEdgeTestHB, ::testing::Values(FilterEdgeTestFuncsHBD( av1_filter_intra_edge_high_c, av1_filter_intra_edge_high_sse4_1)));
+ show +
275
276
277
278
279
280
281
282
283
284
#endif // HAVE_SSE4_1 // Speed tests TEST_P(UpsampleTest8B, DISABLED_Speed) { const int test_count = 10000000; size_ = kMaxEdge; for (int i = 0; i < kOffset + size_; ++i) { edge_tst_data_[i] = rng_.Rand8(); }

[CVE-2020-0470_1.diff] intra_edge_test.cc #4
-INSTANTIATE_TEST_CASE_P(SSE4_1, FilterEdgeTestHB, - ::testing::Values(FilterEdgeTestFuncsHBD( - av1_filter_intra_edge_high_c, - av1_filter_intra_edge_high_sse4_1))); +INSTANTIATE_TEST_SUITE_P(SSE4_1, FilterEdgeTestHB, + ::testing::Values(FilterEdgeTestFuncsHBD( + av1_filter_intra_edge_high_c, + av1_filter_intra_edge_high_sse4_1)));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/intra_edge_test.cc
261
262
263
264
265
266
267
268
269
270
pix = rng_(hi); edge_ref_data_[i] = pix; edge_tst_data_[i] = pix; } Common(); } } #if HAVE_SSE4_1
+ show +
271
272
273
274
INSTANTIATE_TEST_CASE_P(SSE4_1, FilterEdgeTestHB, ::testing::Values(FilterEdgeTestFuncsHBD( av1_filter_intra_edge_high_c, av1_filter_intra_edge_high_sse4_1)));
+ show +
275
276
277
278
279
280
281
282
283
284
#endif // HAVE_SSE4_1 // Speed tests TEST_P(UpsampleTest8B, DISABLED_Speed) { const int test_count = 10000000; size_ = kMaxEdge; for (int i = 0; i < kOffset + size_; ++i) { edge_tst_data_[i] = rng_.Rand8(); }

[CVE-2020-0478_1.diff] hiprec_convolve_test_util.cc #3
- generate_kernels(&rnd_, hkernel, vkernel); + for (int kernel_type = 0; kernel_type < 3; kernel_type++) { + generate_kernels(&rnd_, hkernel, vkernel, kernel_type); + for (i = 0; i < num_iters; ++i) { + for (k = 0; k < h; ++k) + for (m = 0; m < w; ++m) input[k * w + m] = rnd_.Rand8(); + // Choose random locations within the source block + int offset_r = 3 + rnd_.PseudoUniform(h - out_h - 7); + int offset_c = 3 + rnd_.PseudoUniform(w - out_w - 7); + av1_wiener_convolve_add_src_c(input + offset_r * w + offset_c, w, output, + out_w, hkernel, 16, vkernel, 16, out_w, + out_h, &conv_params); + test_impl(input + offset_r * w + offset_c, w, output2, out_w, hkernel, 16, + vkernel, 16, out_w, out_h, &conv_params); - for (i = 0; i < h; ++i) - for (j = 0; j < w; ++j) input[i * w + j] = rnd_.Rand8(); - - for (i = 0; i < num_iters; ++i) { - // Choose random locations within the source block - int offset_r = 3 + rnd_.PseudoUniform(h - out_h - 7); - int offset_c = 3 + rnd_.PseudoUniform(w - out_w - 7); - av1_wiener_convolve_add_src_c(input + offset_r * w + offset_c, w, output, - out_w, hkernel, 16, vkernel, 16, out_w, out_h, - &conv_params); - test_impl(input + offset_r * w + offset_c, w, output2, out_w, hkernel, 16, - vkernel, 16, out_w, out_h, &conv_params); - - for (j = 0; j < out_w * out_h; ++j) - ASSERT_EQ(output[j], output2[j]) - << "Pixel mismatch at index " << j << " = (" << (j % out_w) << ", " - << (j / out_w) << ") on iteration " << i; + for (j = 0; j < out_w * out_h; ++j) + ASSERT_EQ(output[j], output2[j]) + << "Pixel mismatch at index " << j << " = (" << (j % out_w) << ", " + << (j / out_w) << ") on iteration " << i; + }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/hiprec_convolve_test_util.cc
84
85
86
87
88
89
90
91
92
93
// multiples of 16. So to avoid a buffer overflow, we may need to pad // rows to a multiple of 16. int output_n = ALIGN_POWER_OF_TWO(out_w, 4) * out_h; uint8_t *output = new uint8_t[output_n]; uint8_t *output2 = new uint8_t[output_n]; // Generate random filter kernels DECLARE_ALIGNED(16, InterpKernel, hkernel); DECLARE_ALIGNED(16, InterpKernel, vkernel);
+ show +
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
generate_kernels(&rnd_, hkernel, vkernel); for (i = 0; i < h; ++i) for (j = 0; j < w; ++j) input[i * w + j] = rnd_.Rand8(); for (i = 0; i < num_iters; ++i) { // Choose random locations within the source block int offset_r = 3 + rnd_.PseudoUniform(h - out_h - 7); int offset_c = 3 + rnd_.PseudoUniform(w - out_w - 7); av1_wiener_convolve_add_src_c(input + offset_r * w + offset_c, w, output, out_w, hkernel, 16, vkernel, 16, out_w, out_h, &conv_params); test_impl(input + offset_r * w + offset_c, w, output2, out_w, hkernel, 16, vkernel, 16, out_w, out_h, &conv_params); for (j = 0; j < out_w * out_h; ++j) ASSERT_EQ(output[j], output2[j]) << "Pixel mismatch at index " << j << " = (" << (j % out_w) << ", " << (j / out_w) << ") on iteration " << i;
+ show +
113
114
115
116
117
118
119
120
121
122
} delete[] input_; delete[] output; delete[] output2; } void AV1HiprecConvolveTest::RunSpeedTest(hiprec_convolve_func test_impl) { const int w = 128, h = 128; const int out_w = GET_PARAM(0), out_h = GET_PARAM(1); const int num_iters = GET_PARAM(2) / 500;

[CVE-2020-0470_1.diff] hiprec_convolve_test_util.cc #3
- generate_kernels(&rnd_, hkernel, vkernel); + for (int kernel_type = 0; kernel_type < 3; kernel_type++) { + generate_kernels(&rnd_, hkernel, vkernel, kernel_type); + for (i = 0; i < num_iters; ++i) { + for (k = 0; k < h; ++k) + for (m = 0; m < w; ++m) input[k * w + m] = rnd_.Rand8(); + // Choose random locations within the source block + int offset_r = 3 + rnd_.PseudoUniform(h - out_h - 7); + int offset_c = 3 + rnd_.PseudoUniform(w - out_w - 7); + av1_wiener_convolve_add_src_c(input + offset_r * w + offset_c, w, output, + out_w, hkernel, 16, vkernel, 16, out_w, + out_h, &conv_params); + test_impl(input + offset_r * w + offset_c, w, output2, out_w, hkernel, 16, + vkernel, 16, out_w, out_h, &conv_params); - for (i = 0; i < h; ++i) - for (j = 0; j < w; ++j) input[i * w + j] = rnd_.Rand8(); - - for (i = 0; i < num_iters; ++i) { - // Choose random locations within the source block - int offset_r = 3 + rnd_.PseudoUniform(h - out_h - 7); - int offset_c = 3 + rnd_.PseudoUniform(w - out_w - 7); - av1_wiener_convolve_add_src_c(input + offset_r * w + offset_c, w, output, - out_w, hkernel, 16, vkernel, 16, out_w, out_h, - &conv_params); - test_impl(input + offset_r * w + offset_c, w, output2, out_w, hkernel, 16, - vkernel, 16, out_w, out_h, &conv_params); - - for (j = 0; j < out_w * out_h; ++j) - ASSERT_EQ(output[j], output2[j]) - << "Pixel mismatch at index " << j << " = (" << (j % out_w) << ", " - << (j / out_w) << ") on iteration " << i; + for (j = 0; j < out_w * out_h; ++j) + ASSERT_EQ(output[j], output2[j]) + << "Pixel mismatch at index " << j << " = (" << (j % out_w) << ", " + << (j / out_w) << ") on iteration " << i; + }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/hiprec_convolve_test_util.cc
84
85
86
87
88
89
90
91
92
93
// multiples of 16. So to avoid a buffer overflow, we may need to pad // rows to a multiple of 16. int output_n = ALIGN_POWER_OF_TWO(out_w, 4) * out_h; uint8_t *output = new uint8_t[output_n]; uint8_t *output2 = new uint8_t[output_n]; // Generate random filter kernels DECLARE_ALIGNED(16, InterpKernel, hkernel); DECLARE_ALIGNED(16, InterpKernel, vkernel);
+ show +
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
generate_kernels(&rnd_, hkernel, vkernel); for (i = 0; i < h; ++i) for (j = 0; j < w; ++j) input[i * w + j] = rnd_.Rand8(); for (i = 0; i < num_iters; ++i) { // Choose random locations within the source block int offset_r = 3 + rnd_.PseudoUniform(h - out_h - 7); int offset_c = 3 + rnd_.PseudoUniform(w - out_w - 7); av1_wiener_convolve_add_src_c(input + offset_r * w + offset_c, w, output, out_w, hkernel, 16, vkernel, 16, out_w, out_h, &conv_params); test_impl(input + offset_r * w + offset_c, w, output2, out_w, hkernel, 16, vkernel, 16, out_w, out_h, &conv_params); for (j = 0; j < out_w * out_h; ++j) ASSERT_EQ(output[j], output2[j]) << "Pixel mismatch at index " << j << " = (" << (j % out_w) << ", " << (j / out_w) << ") on iteration " << i;
+ show +
113
114
115
116
117
118
119
120
121
122
} delete[] input_; delete[] output; delete[] output2; } void AV1HiprecConvolveTest::RunSpeedTest(hiprec_convolve_func test_impl) { const int w = 128, h = 128; const int out_w = GET_PARAM(0), out_h = GET_PARAM(1); const int num_iters = GET_PARAM(2) / 500;

[CVE-2020-0478_1.diff] noise_model_test.cc #4
-REGISTER_TYPED_TEST_CASE_P(NoiseModelUpdateTest, UpdateFailsNoFlatBlocks, - UpdateSuccessForZeroNoiseAllFlat, - UpdateFailsBlockSizeTooSmall, - UpdateSuccessForWhiteRandomNoise, - UpdateSuccessForScaledWhiteNoise, - UpdateSuccessForCorrelatedNoise, - NoiseStrengthChangeSignalsDifferentNoiseType, - NoiseCoeffsSignalsDifferentNoiseType); +REGISTER_TYPED_TEST_SUITE_P(NoiseModelUpdateTest, UpdateFailsNoFlatBlocks, + UpdateSuccessForZeroNoiseAllFlat, + UpdateFailsBlockSizeTooSmall, + UpdateSuccessForWhiteRandomNoise, + UpdateSuccessForScaledWhiteNoise, + UpdateSuccessForCorrelatedNoise, + NoiseStrengthChangeSignalsDifferentNoiseType, + NoiseCoeffsSignalsDifferentNoiseType); -INSTANTIATE_TYPED_TEST_CASE_P(NoiseModelUpdateTestInstatiation, - NoiseModelUpdateTest, AllBitDepthParams); +INSTANTIATE_TYPED_TEST_SUITE_P(NoiseModelUpdateTestInstatiation, + NoiseModelUpdateTest, AllBitDepthParams);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/noise_model_test.cc
922
923
924
925
926
927
928
929
930
931
EXPECT_EQ(AOM_NOISE_STATUS_OK, this->NoiseModelUpdate()); // Now try with the second set of AR coefficients noise_synth(&this->random_, model.params.lag, model.n, model.coords, kCoeffs[1], this->noise_ptr_[0], kWidth, kHeight); for (int i = 0; i < kWidth * kHeight; ++i) { this->data_ptr_[0][i] = (uint8_t)(128 + this->noise_ptr_[0][i]); } EXPECT_EQ(AOM_NOISE_STATUS_DIFFERENT_NOISE_TYPE, this->NoiseModelUpdate()); }
+ show +
932
933
934
935
936
937
938
939
940
941
942
REGISTER_TYPED_TEST_CASE_P(NoiseModelUpdateTest, UpdateFailsNoFlatBlocks, UpdateSuccessForZeroNoiseAllFlat, UpdateFailsBlockSizeTooSmall, UpdateSuccessForWhiteRandomNoise, UpdateSuccessForScaledWhiteNoise, UpdateSuccessForCorrelatedNoise, NoiseStrengthChangeSignalsDifferentNoiseType, NoiseCoeffsSignalsDifferentNoiseType); INSTANTIATE_TYPED_TEST_CASE_P(NoiseModelUpdateTestInstatiation, NoiseModelUpdateTest, AllBitDepthParams);
+ show +
943
944
945
946
947
948
949
950
951
952
TEST(NoiseModelGetGrainParameters, TestLagSize) { aom_film_grain_t film_grain; for (int lag = 1; lag <= 3; ++lag) { aom_noise_model_params_t params = { AOM_NOISE_SHAPE_SQUARE, lag, 8, 0 }; aom_noise_model_t model; EXPECT_TRUE(aom_noise_model_init(&model, params)); EXPECT_TRUE(aom_noise_model_get_grain_parameters(&model, &film_grain)); EXPECT_EQ(lag, film_grain.ar_coeff_lag); aom_noise_model_free(&model);

[CVE-2020-0470_1.diff] noise_model_test.cc #4
-REGISTER_TYPED_TEST_CASE_P(NoiseModelUpdateTest, UpdateFailsNoFlatBlocks, - UpdateSuccessForZeroNoiseAllFlat, - UpdateFailsBlockSizeTooSmall, - UpdateSuccessForWhiteRandomNoise, - UpdateSuccessForScaledWhiteNoise, - UpdateSuccessForCorrelatedNoise, - NoiseStrengthChangeSignalsDifferentNoiseType, - NoiseCoeffsSignalsDifferentNoiseType); +REGISTER_TYPED_TEST_SUITE_P(NoiseModelUpdateTest, UpdateFailsNoFlatBlocks, + UpdateSuccessForZeroNoiseAllFlat, + UpdateFailsBlockSizeTooSmall, + UpdateSuccessForWhiteRandomNoise, + UpdateSuccessForScaledWhiteNoise, + UpdateSuccessForCorrelatedNoise, + NoiseStrengthChangeSignalsDifferentNoiseType, + NoiseCoeffsSignalsDifferentNoiseType); -INSTANTIATE_TYPED_TEST_CASE_P(NoiseModelUpdateTestInstatiation, - NoiseModelUpdateTest, AllBitDepthParams); +INSTANTIATE_TYPED_TEST_SUITE_P(NoiseModelUpdateTestInstatiation, + NoiseModelUpdateTest, AllBitDepthParams);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/noise_model_test.cc
922
923
924
925
926
927
928
929
930
931
EXPECT_EQ(AOM_NOISE_STATUS_OK, this->NoiseModelUpdate()); // Now try with the second set of AR coefficients noise_synth(&this->random_, model.params.lag, model.n, model.coords, kCoeffs[1], this->noise_ptr_[0], kWidth, kHeight); for (int i = 0; i < kWidth * kHeight; ++i) { this->data_ptr_[0][i] = (uint8_t)(128 + this->noise_ptr_[0][i]); } EXPECT_EQ(AOM_NOISE_STATUS_DIFFERENT_NOISE_TYPE, this->NoiseModelUpdate()); }
+ show +
932
933
934
935
936
937
938
939
940
941
942
REGISTER_TYPED_TEST_CASE_P(NoiseModelUpdateTest, UpdateFailsNoFlatBlocks, UpdateSuccessForZeroNoiseAllFlat, UpdateFailsBlockSizeTooSmall, UpdateSuccessForWhiteRandomNoise, UpdateSuccessForScaledWhiteNoise, UpdateSuccessForCorrelatedNoise, NoiseStrengthChangeSignalsDifferentNoiseType, NoiseCoeffsSignalsDifferentNoiseType); INSTANTIATE_TYPED_TEST_CASE_P(NoiseModelUpdateTestInstatiation, NoiseModelUpdateTest, AllBitDepthParams);
+ show +
943
944
945
946
947
948
949
950
951
952
TEST(NoiseModelGetGrainParameters, TestLagSize) { aom_film_grain_t film_grain; for (int lag = 1; lag <= 3; ++lag) { aom_noise_model_params_t params = { AOM_NOISE_SHAPE_SQUARE, lag, 8, 0 }; aom_noise_model_t model; EXPECT_TRUE(aom_noise_model_init(&model, params)); EXPECT_TRUE(aom_noise_model_get_grain_parameters(&model, &film_grain)); EXPECT_EQ(lag, film_grain.ar_coeff_lag); aom_noise_model_free(&model);

[CVE-2020-0478_1.diff] blend_a64_mask_1d_test.cc #2
-INSTANTIATE_TEST_CASE_P(NEON, BlendA64Mask1DTest8B, - ::testing::Values(TestFuncs(blend_a64_hmask_ref, - aom_blend_a64_hmask_neon), - TestFuncs(blend_a64_vmask_ref, - aom_blend_a64_vmask_neon))); +INSTANTIATE_TEST_SUITE_P( + NEON, BlendA64Mask1DTest8B, + ::testing::Values(TestFuncs(blend_a64_hmask_ref, aom_blend_a64_hmask_neon), + TestFuncs(blend_a64_vmask_ref, + aom_blend_a64_vmask_neon))); - +#if CONFIG_AV1_HIGHBITDEPTH
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/blend_a64_mask_1d_test.cc
201
202
203
204
205
206
207
208
209
210
#if HAVE_SSE4_1 INSTANTIATE_TEST_CASE_P( SSE4_1, BlendA64Mask1DTest8B, ::testing::Values( TestFuncs(blend_a64_hmask_ref, aom_blend_a64_hmask_sse4_1), TestFuncs(blend_a64_vmask_ref, aom_blend_a64_vmask_sse4_1))); #endif // HAVE_SSE4_1 #if HAVE_NEON
+ show +
211
212
213
214
215
INSTANTIATE_TEST_CASE_P(NEON, BlendA64Mask1DTest8B, ::testing::Values(TestFuncs(blend_a64_hmask_ref, aom_blend_a64_hmask_neon), TestFuncs(blend_a64_vmask_ref, aom_blend_a64_vmask_neon)));
+ show +
216
217
218
219
220
221
222
223
224
225
#endif // HAVE_NEON ////////////////////////////////////////////////////////////////////////////// // High bit-depth version ////////////////////////////////////////////////////////////////////////////// typedef void (*FHBD)(uint8_t *dst, uint32_t dst_stride, const uint8_t *src0, uint32_t src0_stride, const uint8_t *src1, uint32_t src1_stride, const uint8_t *mask, int w, int h, int bd);

[CVE-2020-0470_1.diff] blend_a64_mask_1d_test.cc #2
-INSTANTIATE_TEST_CASE_P(NEON, BlendA64Mask1DTest8B, - ::testing::Values(TestFuncs(blend_a64_hmask_ref, - aom_blend_a64_hmask_neon), - TestFuncs(blend_a64_vmask_ref, - aom_blend_a64_vmask_neon))); +INSTANTIATE_TEST_SUITE_P( + NEON, BlendA64Mask1DTest8B, + ::testing::Values(TestFuncs(blend_a64_hmask_ref, aom_blend_a64_hmask_neon), + TestFuncs(blend_a64_vmask_ref, + aom_blend_a64_vmask_neon))); - +#if CONFIG_AV1_HIGHBITDEPTH
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/blend_a64_mask_1d_test.cc
201
202
203
204
205
206
207
208
209
210
#if HAVE_SSE4_1 INSTANTIATE_TEST_CASE_P( SSE4_1, BlendA64Mask1DTest8B, ::testing::Values( TestFuncs(blend_a64_hmask_ref, aom_blend_a64_hmask_sse4_1), TestFuncs(blend_a64_vmask_ref, aom_blend_a64_vmask_sse4_1))); #endif // HAVE_SSE4_1 #if HAVE_NEON
+ show +
211
212
213
214
215
INSTANTIATE_TEST_CASE_P(NEON, BlendA64Mask1DTest8B, ::testing::Values(TestFuncs(blend_a64_hmask_ref, aom_blend_a64_hmask_neon), TestFuncs(blend_a64_vmask_ref, aom_blend_a64_vmask_neon)));
+ show +
216
217
218
219
220
221
222
223
224
225
#endif // HAVE_NEON ////////////////////////////////////////////////////////////////////////////// // High bit-depth version ////////////////////////////////////////////////////////////////////////////// typedef void (*FHBD)(uint8_t *dst, uint32_t dst_stride, const uint8_t *src0, uint32_t src0_stride, const uint8_t *src1, uint32_t src1_stride, const uint8_t *mask, int w, int h, int bd);

[CVE-2020-0478_1.diff] warp_filter_test_util.cc #3
- *gamma = clamp(((int64_t)mat[4] * (1 << WARPEDMODEL_PREC_BITS)) / mat[2], - INT16_MIN, INT16_MAX); - *delta = - clamp(mat[5] - (((int64_t)mat[3] * mat[4] + (mat[2] / 2)) / mat[2]) - - (1 << WARPEDMODEL_PREC_BITS), - INT16_MIN, INT16_MAX); + *gamma = static_cast<int16_t>(clamp64( + (static_cast<int64_t>(mat[4]) * (1 << WARPEDMODEL_PREC_BITS)) / mat[2], + INT16_MIN, INT16_MAX)); + *delta = static_cast<int16_t>(clamp64( + mat[5] - + ((static_cast<int64_t>(mat[3]) * mat[4] + (mat[2] / 2)) / mat[2]) - + (1 << WARPEDMODEL_PREC_BITS), + INT16_MIN, INT16_MAX));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/warp_filter_test_util.cc
58
59
60
61
62
63
64
65
66
67
mat[5] = (((int64_t)mat[3] * mat[4] + (mat[2] / 2)) / mat[2]) + (1 << WARPEDMODEL_PREC_BITS); } // Calculate the derived parameters and check that they are suitable // for the warp filter. assert(mat[2] != 0); *alpha = clamp(mat[2] - (1 << WARPEDMODEL_PREC_BITS), INT16_MIN, INT16_MAX); *beta = clamp(mat[3], INT16_MIN, INT16_MAX);
+ show +
68
69
70
71
72
73
*gamma = clamp(((int64_t)mat[4] * (1 << WARPEDMODEL_PREC_BITS)) / mat[2], INT16_MIN, INT16_MAX); *delta = clamp(mat[5] - (((int64_t)mat[3] * mat[4] + (mat[2] / 2)) / mat[2]) - (1 << WARPEDMODEL_PREC_BITS), INT16_MIN, INT16_MAX);
+ show +
74
75
76
77
78
79
80
81
82
83
if ((4 * abs(*alpha) + 7 * abs(*beta) >= (1 << WARPEDMODEL_PREC_BITS)) || (4 * abs(*gamma) + 4 * abs(*delta) >= (1 << WARPEDMODEL_PREC_BITS))) continue; *alpha = ROUND_POWER_OF_TWO_SIGNED(*alpha, WARP_PARAM_REDUCE_BITS) * (1 << WARP_PARAM_REDUCE_BITS); *beta = ROUND_POWER_OF_TWO_SIGNED(*beta, WARP_PARAM_REDUCE_BITS) * (1 << WARP_PARAM_REDUCE_BITS); *gamma = ROUND_POWER_OF_TWO_SIGNED(*gamma, WARP_PARAM_REDUCE_BITS) *

[CVE-2020-0470_1.diff] warp_filter_test_util.cc #3
- *gamma = clamp(((int64_t)mat[4] * (1 << WARPEDMODEL_PREC_BITS)) / mat[2], - INT16_MIN, INT16_MAX); - *delta = - clamp(mat[5] - (((int64_t)mat[3] * mat[4] + (mat[2] / 2)) / mat[2]) - - (1 << WARPEDMODEL_PREC_BITS), - INT16_MIN, INT16_MAX); + *gamma = static_cast<int16_t>(clamp64( + (static_cast<int64_t>(mat[4]) * (1 << WARPEDMODEL_PREC_BITS)) / mat[2], + INT16_MIN, INT16_MAX)); + *delta = static_cast<int16_t>(clamp64( + mat[5] - + ((static_cast<int64_t>(mat[3]) * mat[4] + (mat[2] / 2)) / mat[2]) - + (1 << WARPEDMODEL_PREC_BITS), + INT16_MIN, INT16_MAX));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/warp_filter_test_util.cc
58
59
60
61
62
63
64
65
66
67
mat[5] = (((int64_t)mat[3] * mat[4] + (mat[2] / 2)) / mat[2]) + (1 << WARPEDMODEL_PREC_BITS); } // Calculate the derived parameters and check that they are suitable // for the warp filter. assert(mat[2] != 0); *alpha = clamp(mat[2] - (1 << WARPEDMODEL_PREC_BITS), INT16_MIN, INT16_MAX); *beta = clamp(mat[3], INT16_MIN, INT16_MAX);
+ show +
68
69
70
71
72
73
*gamma = clamp(((int64_t)mat[4] * (1 << WARPEDMODEL_PREC_BITS)) / mat[2], INT16_MIN, INT16_MAX); *delta = clamp(mat[5] - (((int64_t)mat[3] * mat[4] + (mat[2] / 2)) / mat[2]) - (1 << WARPEDMODEL_PREC_BITS), INT16_MIN, INT16_MAX);
+ show +
74
75
76
77
78
79
80
81
82
83
if ((4 * abs(*alpha) + 7 * abs(*beta) >= (1 << WARPEDMODEL_PREC_BITS)) || (4 * abs(*gamma) + 4 * abs(*delta) >= (1 << WARPEDMODEL_PREC_BITS))) continue; *alpha = ROUND_POWER_OF_TWO_SIGNED(*alpha, WARP_PARAM_REDUCE_BITS) * (1 << WARP_PARAM_REDUCE_BITS); *beta = ROUND_POWER_OF_TWO_SIGNED(*beta, WARP_PARAM_REDUCE_BITS) * (1 << WARP_PARAM_REDUCE_BITS); *gamma = ROUND_POWER_OF_TWO_SIGNED(*gamma, WARP_PARAM_REDUCE_BITS) *

[CVE-2020-0478_1.diff] cfl_test.cc #4
- CFLTest::init(::testing::get<0>(this->GetParam())); - fun_420 = ::testing::get<1>(this->GetParam())(this->tx_size); - fun_422 = ::testing::get<2>(this->GetParam())(this->tx_size); - fun_444 = ::testing::get<3>(this->GetParam())(this->tx_size); + CFLTest::init(std::get<0>(this->GetParam())); + fun_420 = std::get<1>(this->GetParam())(this->tx_size); + fun_422 = std::get<2>(this->GetParam())(this->tx_size); + fun_444 = std::get<3>(this->GetParam())(this->tx_size);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/cfl_test.cc
202
203
204
205
206
207
208
209
210
211
int elapsed_time = (int)aom_usec_timer_elapsed(&timer); printSpeed(ref_elapsed_time, elapsed_time, width, height); assertFaster(ref_elapsed_time, elapsed_time); } template <typename S, typename T, typename I> class CFLSubsampleTest : public ::testing::TestWithParam<S>, public CFLTestWithData<I> { public: virtual void SetUp() {
+ show +
212
213
214
215
CFLTest::init(::testing::get<0>(this->GetParam())); fun_420 = ::testing::get<1>(this->GetParam())(this->tx_size); fun_422 = ::testing::get<2>(this->GetParam())(this->tx_size); fun_444 = ::testing::get<3>(this->GetParam())(this->tx_size);
+ show +
216
217
218
219
220
221
222
223
224
225
} protected: T fun_420; T fun_422; T fun_444; T fun_420_ref; T fun_422_ref; T fun_444_ref;

[CVE-2020-0470_1.diff] cfl_test.cc #4
- CFLTest::init(::testing::get<0>(this->GetParam())); - fun_420 = ::testing::get<1>(this->GetParam())(this->tx_size); - fun_422 = ::testing::get<2>(this->GetParam())(this->tx_size); - fun_444 = ::testing::get<3>(this->GetParam())(this->tx_size); + CFLTest::init(std::get<0>(this->GetParam())); + fun_420 = std::get<1>(this->GetParam())(this->tx_size); + fun_422 = std::get<2>(this->GetParam())(this->tx_size); + fun_444 = std::get<3>(this->GetParam())(this->tx_size);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/cfl_test.cc
202
203
204
205
206
207
208
209
210
211
int elapsed_time = (int)aom_usec_timer_elapsed(&timer); printSpeed(ref_elapsed_time, elapsed_time, width, height); assertFaster(ref_elapsed_time, elapsed_time); } template <typename S, typename T, typename I> class CFLSubsampleTest : public ::testing::TestWithParam<S>, public CFLTestWithData<I> { public: virtual void SetUp() {
+ show +
212
213
214
215
CFLTest::init(::testing::get<0>(this->GetParam())); fun_420 = ::testing::get<1>(this->GetParam())(this->tx_size); fun_422 = ::testing::get<2>(this->GetParam())(this->tx_size); fun_444 = ::testing::get<3>(this->GetParam())(this->tx_size);
+ show +
216
217
218
219
220
221
222
223
224
225
} protected: T fun_420; T fun_422; T fun_444; T fun_420_ref; T fun_422_ref; T fun_444_ref;

[CVE-2020-0478_1.diff] edge_detect_test.cc #8
-INSTANTIATE_TEST_CASE_P(ImageBrightnessTests, EdgeDetectBrightnessTest, - ::testing::Combine( - // Brightness - ::testing::Values(0, 1, 2, 127, 128, 129, 254, 255, - 256, 511, 512, 1023, 1024, 2048, - 4095), - // Width - ::testing::Values(8, 16, 32), - // Height - ::testing::Values(4, 8, 12, 32), - // High bit depth representation - ::testing::Bool(), - // Bit depth - ::testing::Values(8, 10, 12))); +#if CONFIG_AV1_HIGHBITDEPTH +INSTANTIATE_TEST_SUITE_P(ImageBrightnessTests, EdgeDetectBrightnessTest, + ::testing::Combine( + // Brightness + ::testing::Values(0, 1, 2, 127, 128, 129, 254, 255, + 256, 511, 512, 1023, 1024, 2048, + 4095), + // Width + ::testing::Values(8, 16, 32), + // Height + ::testing::Values(4, 8, 12, 32), + // High bit depth representation + ::testing::Bool(), + // Bit depth + ::testing::Values(8, 10, 12))); +#else +INSTANTIATE_TEST_SUITE_P(ImageBrightnessTests, EdgeDetectBrightnessTest, + ::testing::Combine( + // Brightness + ::testing::Values(0, 1, 2, 127, 128, 129, 254, 255, + 256, 511, 512, 1023, 1024, 2048, + 4095), + // Width + ::testing::Values(8, 16, 32), + // Height + ::testing::Values(4, 8, 12, 32), + // High bit depth representation + ::testing::Values(false), + // Bit depth + ::testing::Values(8))); +#endif
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/edge_detect_test.cc
183
184
185
186
187
188
189
190
191
192
const int width = GET_PARAM(1); const int height = GET_PARAM(2); const bool high_bd = GET_PARAM(3); const int bd = GET_PARAM(4); ASSERT_EQ( 0, av1_edge_exists(input_, stride_8tap(width), width, height, high_bd, bd) .magnitude); }
+ show +
193
194
195
196
197
198
199
200
201
202
203
204
205
206
INSTANTIATE_TEST_CASE_P(ImageBrightnessTests, EdgeDetectBrightnessTest, ::testing::Combine( // Brightness ::testing::Values(0, 1, 2, 127, 128, 129, 254, 255, 256, 511, 512, 1023, 1024, 2048, 4095), // Width ::testing::Values(8, 16, 32), // Height ::testing::Values(4, 8, 12, 32), // High bit depth representation ::testing::Bool(), // Bit depth ::testing::Values(8, 10, 12)));
+ show +
207
208
209
210
211
212
213
214
215
216
class EdgeDetectImageTest : // Parameters are (width, height, high bit depth representation, bit depth). public ::testing::TestWithParam<tuple<int, int, bool, int> > { protected: // Skip the tests where bit depth is greater than 8, but high bit depth // representation is not set (limitation of testing framework). bool should_skip() const { const bool high_bd = GET_PARAM(2); const int bd = GET_PARAM(3);

[CVE-2020-0478_1.diff] edge_detect_test.cc #10
- uint8_t *padded = pad_8tap_convolve(orig, width, height, high_bd); - free(orig); - // Value should be between 556 and 560. - ASSERT_LE(556, av1_edge_exists(padded, stride_8tap(width), width, height, - high_bd, bd) - .magnitude); - ASSERT_GE(560, av1_edge_exists(padded, stride_8tap(width), width, height, - high_bd, bd) - .magnitude); - free_pad_8tap(padded, width, high_bd); + std::unique_ptr<uint8_t[], Pad8TapConvolveDeleter> padded( + pad_8tap_convolve(orig.get(), width, height, high_bd), + Pad8TapConvolveDeleter(width, high_bd)); + ASSERT_NE(padded, nullptr); + // Value should be between 556 and 560. + ASSERT_LE(556, av1_edge_exists(padded.get(), stride_8tap(width), width, + height, high_bd, bd) + .magnitude); + ASSERT_GE(560, av1_edge_exists(padded.get(), stride_8tap(width), width, + height, high_bd, bd) + .magnitude);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/edge_detect_test.cc
235
236
237
238
239
240
241
242
243
244
int *orig = (int *)malloc(width * height * sizeof(int)); for (int j = 0; j < height; ++j) { for (int i = 0; i < width; ++i) { if (i < width / 2) { orig[i + j * width] = 0; } else { orig[i + j * width] = white; } } }
+ show +
245
246
247
248
249
250
251
252
253
254
255
uint8_t *padded = pad_8tap_convolve(orig, width, height, high_bd); free(orig); // Value should be between 556 and 560. ASSERT_LE(556, av1_edge_exists(padded, stride_8tap(width), width, height, high_bd, bd) .magnitude); ASSERT_GE(560, av1_edge_exists(padded, stride_8tap(width), width, height, high_bd, bd) .magnitude); free_pad_8tap(padded, width, high_bd);
+ show +
256
257
258
259
260
261
262
263
264
265
} // Hardcoded blur tests. static const int luma[32] = { 241, 147, 7, 90, 184, 103, 28, 186, 2, 248, 49, 242, 114, 146, 127, 22, 121, 228, 167, 108, 158, 174, 41, 168, 214, 99, 184, 109, 114, 247, 117, 119 }; static const uint8_t expected[] = { 161, 138, 119, 118, 123, 118, 113, 122, 143, 140, 134, 133, 134, 126, 116, 114, 147, 149, 145, 142, 143, 138, 126, 118,

[CVE-2020-0470_1.diff] edge_detect_test.cc #8
-INSTANTIATE_TEST_CASE_P(ImageBrightnessTests, EdgeDetectBrightnessTest, - ::testing::Combine( - // Brightness - ::testing::Values(0, 1, 2, 127, 128, 129, 254, 255, - 256, 511, 512, 1023, 1024, 2048, - 4095), - // Width - ::testing::Values(8, 16, 32), - // Height - ::testing::Values(4, 8, 12, 32), - // High bit depth representation - ::testing::Bool(), - // Bit depth - ::testing::Values(8, 10, 12))); +#if CONFIG_AV1_HIGHBITDEPTH +INSTANTIATE_TEST_SUITE_P(ImageBrightnessTests, EdgeDetectBrightnessTest, + ::testing::Combine( + // Brightness + ::testing::Values(0, 1, 2, 127, 128, 129, 254, 255, + 256, 511, 512, 1023, 1024, 2048, + 4095), + // Width + ::testing::Values(8, 16, 32), + // Height + ::testing::Values(4, 8, 12, 32), + // High bit depth representation + ::testing::Bool(), + // Bit depth + ::testing::Values(8, 10, 12))); +#else +INSTANTIATE_TEST_SUITE_P(ImageBrightnessTests, EdgeDetectBrightnessTest, + ::testing::Combine( + // Brightness + ::testing::Values(0, 1, 2, 127, 128, 129, 254, 255, + 256, 511, 512, 1023, 1024, 2048, + 4095), + // Width + ::testing::Values(8, 16, 32), + // Height + ::testing::Values(4, 8, 12, 32), + // High bit depth representation + ::testing::Values(false), + // Bit depth + ::testing::Values(8))); +#endif
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/edge_detect_test.cc
183
184
185
186
187
188
189
190
191
192
const int width = GET_PARAM(1); const int height = GET_PARAM(2); const bool high_bd = GET_PARAM(3); const int bd = GET_PARAM(4); ASSERT_EQ( 0, av1_edge_exists(input_, stride_8tap(width), width, height, high_bd, bd) .magnitude); }
+ show +
193
194
195
196
197
198
199
200
201
202
203
204
205
206
INSTANTIATE_TEST_CASE_P(ImageBrightnessTests, EdgeDetectBrightnessTest, ::testing::Combine( // Brightness ::testing::Values(0, 1, 2, 127, 128, 129, 254, 255, 256, 511, 512, 1023, 1024, 2048, 4095), // Width ::testing::Values(8, 16, 32), // Height ::testing::Values(4, 8, 12, 32), // High bit depth representation ::testing::Bool(), // Bit depth ::testing::Values(8, 10, 12)));
+ show +
207
208
209
210
211
212
213
214
215
216
class EdgeDetectImageTest : // Parameters are (width, height, high bit depth representation, bit depth). public ::testing::TestWithParam<tuple<int, int, bool, int> > { protected: // Skip the tests where bit depth is greater than 8, but high bit depth // representation is not set (limitation of testing framework). bool should_skip() const { const bool high_bd = GET_PARAM(2); const int bd = GET_PARAM(3);

[CVE-2020-0470_1.diff] edge_detect_test.cc #10
- uint8_t *padded = pad_8tap_convolve(orig, width, height, high_bd); - free(orig); - // Value should be between 556 and 560. - ASSERT_LE(556, av1_edge_exists(padded, stride_8tap(width), width, height, - high_bd, bd) - .magnitude); - ASSERT_GE(560, av1_edge_exists(padded, stride_8tap(width), width, height, - high_bd, bd) - .magnitude); - free_pad_8tap(padded, width, high_bd); + std::unique_ptr<uint8_t[], Pad8TapConvolveDeleter> padded( + pad_8tap_convolve(orig.get(), width, height, high_bd), + Pad8TapConvolveDeleter(width, high_bd)); + ASSERT_NE(padded, nullptr); + // Value should be between 556 and 560. + ASSERT_LE(556, av1_edge_exists(padded.get(), stride_8tap(width), width, + height, high_bd, bd) + .magnitude); + ASSERT_GE(560, av1_edge_exists(padded.get(), stride_8tap(width), width, + height, high_bd, bd) + .magnitude);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/edge_detect_test.cc
235
236
237
238
239
240
241
242
243
244
int *orig = (int *)malloc(width * height * sizeof(int)); for (int j = 0; j < height; ++j) { for (int i = 0; i < width; ++i) { if (i < width / 2) { orig[i + j * width] = 0; } else { orig[i + j * width] = white; } } }
+ show +
245
246
247
248
249
250
251
252
253
254
255
uint8_t *padded = pad_8tap_convolve(orig, width, height, high_bd); free(orig); // Value should be between 556 and 560. ASSERT_LE(556, av1_edge_exists(padded, stride_8tap(width), width, height, high_bd, bd) .magnitude); ASSERT_GE(560, av1_edge_exists(padded, stride_8tap(width), width, height, high_bd, bd) .magnitude); free_pad_8tap(padded, width, high_bd);
+ show +
256
257
258
259
260
261
262
263
264
265
} // Hardcoded blur tests. static const int luma[32] = { 241, 147, 7, 90, 184, 103, 28, 186, 2, 248, 49, 242, 114, 146, 127, 22, 121, 228, 167, 108, 158, 174, 41, 168, 214, 99, 184, 109, 114, 247, 117, 119 }; static const uint8_t expected[] = { 161, 138, 119, 118, 123, 118, 113, 122, 143, 140, 134, 133, 134, 126, 116, 114, 147, 149, 145, 142, 143, 138, 126, 118,

[CVE-2020-0478_1.diff] variance_test.cc #34
-INSTANTIATE_TEST_CASE_P(MSA, SumOfSquaresTest, - ::testing::Values(aom_get_mb_ss_msa)); +INSTANTIATE_TEST_SUITE_P(MSA, SumOfSquaresTest, + ::testing::Values(aom_get_mb_ss_msa)); -INSTANTIATE_TEST_CASE_P(MSA, AvxSseTest, - ::testing::Values(SseParams(2, 2, - &aom_get4x4sse_cs_msa))); +INSTANTIATE_TEST_SUITE_P(MSA, AvxSseTest, + ::testing::Values(SseParams(2, 2, + &aom_get4x4sse_cs_msa))); -INSTANTIATE_TEST_CASE_P(MSA, AvxMseTest, - ::testing::Values(MseParams(4, 4, &aom_mse16x16_msa), - MseParams(4, 3, &aom_mse16x8_msa), - MseParams(3, 4, &aom_mse8x16_msa), - MseParams(3, 3, &aom_mse8x8_msa))); +INSTANTIATE_TEST_SUITE_P(MSA, AvxMseTest, + ::testing::Values(MseParams(4, 4, &aom_mse16x16_msa), + MseParams(4, 3, &aom_mse16x8_msa), + MseParams(3, 4, &aom_mse8x16_msa), + MseParams(3, 3, &aom_mse8x8_msa))); -INSTANTIATE_TEST_CASE_P( +INSTANTIATE_TEST_SUITE_P(
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/variance_test.cc
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
INSTANTIATE_TEST_CASE_P( NEON, AvxSubpelVarianceTest, ::testing::Values( SubpelVarianceParams(6, 6, &aom_sub_pixel_variance64x64_neon, 0), SubpelVarianceParams(5, 5, &aom_sub_pixel_variance32x32_neon, 0), SubpelVarianceParams(4, 4, &aom_sub_pixel_variance16x16_neon, 0), SubpelVarianceParams(3, 3, &aom_sub_pixel_variance8x8_neon, 0))); #endif // HAVE_NEON #if HAVE_MSA
+ show +
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
INSTANTIATE_TEST_CASE_P(MSA, SumOfSquaresTest, ::testing::Values(aom_get_mb_ss_msa)); INSTANTIATE_TEST_CASE_P(MSA, AvxSseTest, ::testing::Values(SseParams(2, 2, &aom_get4x4sse_cs_msa))); INSTANTIATE_TEST_CASE_P(MSA, AvxMseTest, ::testing::Values(MseParams(4, 4, &aom_mse16x16_msa), MseParams(4, 3, &aom_mse16x8_msa), MseParams(3, 4, &aom_mse8x16_msa), MseParams(3, 3, &aom_mse8x8_msa))); INSTANTIATE_TEST_CASE_P(
+ show +
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
MSA, AvxVarianceTest, ::testing::Values(VarianceParams(6, 6, &aom_variance64x64_msa), VarianceParams(6, 5, &aom_variance64x32_msa), VarianceParams(5, 6, &aom_variance32x64_msa), VarianceParams(5, 5, &aom_variance32x32_msa), VarianceParams(5, 4, &aom_variance32x16_msa), VarianceParams(4, 5, &aom_variance16x32_msa), VarianceParams(4, 4, &aom_variance16x16_msa), VarianceParams(4, 3, &aom_variance16x8_msa), VarianceParams(3, 4, &aom_variance8x16_msa),

[CVE-2020-0470_1.diff] variance_test.cc #34
-INSTANTIATE_TEST_CASE_P(MSA, SumOfSquaresTest, - ::testing::Values(aom_get_mb_ss_msa)); +INSTANTIATE_TEST_SUITE_P(MSA, SumOfSquaresTest, + ::testing::Values(aom_get_mb_ss_msa)); -INSTANTIATE_TEST_CASE_P(MSA, AvxSseTest, - ::testing::Values(SseParams(2, 2, - &aom_get4x4sse_cs_msa))); +INSTANTIATE_TEST_SUITE_P(MSA, AvxSseTest, + ::testing::Values(SseParams(2, 2, + &aom_get4x4sse_cs_msa))); -INSTANTIATE_TEST_CASE_P(MSA, AvxMseTest, - ::testing::Values(MseParams(4, 4, &aom_mse16x16_msa), - MseParams(4, 3, &aom_mse16x8_msa), - MseParams(3, 4, &aom_mse8x16_msa), - MseParams(3, 3, &aom_mse8x8_msa))); +INSTANTIATE_TEST_SUITE_P(MSA, AvxMseTest, + ::testing::Values(MseParams(4, 4, &aom_mse16x16_msa), + MseParams(4, 3, &aom_mse16x8_msa), + MseParams(3, 4, &aom_mse8x16_msa), + MseParams(3, 3, &aom_mse8x8_msa))); -INSTANTIATE_TEST_CASE_P( +INSTANTIATE_TEST_SUITE_P(
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/variance_test.cc
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
INSTANTIATE_TEST_CASE_P( NEON, AvxSubpelVarianceTest, ::testing::Values( SubpelVarianceParams(6, 6, &aom_sub_pixel_variance64x64_neon, 0), SubpelVarianceParams(5, 5, &aom_sub_pixel_variance32x32_neon, 0), SubpelVarianceParams(4, 4, &aom_sub_pixel_variance16x16_neon, 0), SubpelVarianceParams(3, 3, &aom_sub_pixel_variance8x8_neon, 0))); #endif // HAVE_NEON #if HAVE_MSA
+ show +
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
INSTANTIATE_TEST_CASE_P(MSA, SumOfSquaresTest, ::testing::Values(aom_get_mb_ss_msa)); INSTANTIATE_TEST_CASE_P(MSA, AvxSseTest, ::testing::Values(SseParams(2, 2, &aom_get4x4sse_cs_msa))); INSTANTIATE_TEST_CASE_P(MSA, AvxMseTest, ::testing::Values(MseParams(4, 4, &aom_mse16x16_msa), MseParams(4, 3, &aom_mse16x8_msa), MseParams(3, 4, &aom_mse8x16_msa), MseParams(3, 3, &aom_mse8x8_msa))); INSTANTIATE_TEST_CASE_P(
+ show +
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
MSA, AvxVarianceTest, ::testing::Values(VarianceParams(6, 6, &aom_variance64x64_msa), VarianceParams(6, 5, &aom_variance64x32_msa), VarianceParams(5, 6, &aom_variance32x64_msa), VarianceParams(5, 5, &aom_variance32x32_msa), VarianceParams(5, 4, &aom_variance32x16_msa), VarianceParams(4, 5, &aom_variance16x32_msa), VarianceParams(4, 4, &aom_variance16x16_msa), VarianceParams(4, 3, &aom_variance16x8_msa), VarianceParams(3, 4, &aom_variance8x16_msa),

[CVE-2020-0478_1.diff] test.cmake #12
- message(FATAL_ERROR - "--- Unit tests require Python, rerun cmake with " - "-DENABLE_TESTS=0 to avoid this error, or install Python and " - "make sure it's in your PATH.") + message( + FATAL_ERROR "--- Unit tests require Python, rerun cmake with " + "-DENABLE_TESTS=0 to avoid this error, or install Python and " + "make sure it's in your PATH.")
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/test.cmake
225
226
227
228
229
230
231
232
233
234
if(HAVE_SSE4_2) list(APPEND AOM_UNIT_TEST_ENCODER_SOURCES "${AOM_ROOT}/test/hash_test.cc") endif() endif() if(ENABLE_TESTS) find_package(PythonInterp) if(NOT PYTHONINTERP_FOUND)
+ show +
235
236
237
238
message(FATAL_ERROR "--- Unit tests require Python, rerun cmake with " "-DENABLE_TESTS=0 to avoid this error, or install Python and " "make sure it's in your PATH.")
+ show +
239
240
241
242
243
244
245
246
247
248
endif() if(BUILD_SHARED_LIBS AND APPLE) # Silence an RPATH warning. set(CMAKE_MACOSX_RPATH 1) endif() include_directories( "${AOM_ROOT}/third_party/googletest/src/googletest/include") include_directories("${AOM_ROOT}/third_party/googletest/src/googletest")

[CVE-2020-0478_1.diff] test.cmake #16
- add_custom_target(testdata_${test_index} - COMMAND - ${CMAKE_COMMAND} -DAOM_CONFIG_DIR="${AOM_CONFIG_DIR}" - -DAOM_ROOT="${AOM_ROOT}" - -DAOM_TEST_FILE="${test_file}" - -DAOM_TEST_CHECKSUM=${test_file_checksum} -P - "${AOM_ROOT}/test/test_data_download_worker.cmake") + add_custom_target( + testdata_${test_index} + COMMAND ${CMAKE_COMMAND} + -DAOM_CONFIG_DIR="${AOM_CONFIG_DIR}" -DAOM_ROOT="${AOM_ROOT}" + -DAOM_TEST_FILE="${test_file}" + -DAOM_TEST_CHECKSUM=${test_file_checksum} -P + "${AOM_ROOT}/test/test_data_download_worker.cmake")
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/test.cmake
349
350
351
352
353
354
355
356
357
358
if(ENABLE_TESTDATA) make_test_data_lists("${AOM_UNIT_TEST_DATA_LIST_FILE}" test_files test_file_checksums) list(LENGTH test_files num_test_files) list(LENGTH test_file_checksums num_test_file_checksums) math(EXPR max_file_index "${num_test_files} - 1") foreach(test_index RANGE ${max_file_index}) list(GET test_files ${test_index} test_file) list(GET test_file_checksums ${test_index} test_file_checksum)
+ show +
359
360
361
362
363
364
365
add_custom_target(testdata_${test_index} COMMAND ${CMAKE_COMMAND} -DAOM_CONFIG_DIR="${AOM_CONFIG_DIR}" -DAOM_ROOT="${AOM_ROOT}" -DAOM_TEST_FILE="${test_file}" -DAOM_TEST_CHECKSUM=${test_file_checksum} -P "${AOM_ROOT}/test/test_data_download_worker.cmake")
+ show +
366
367
368
369
370
371
372
373
374
375
list(APPEND testdata_targets testdata_${test_index}) endforeach() # Create a custom build target for running each test data download target. add_custom_target(testdata) add_dependencies(testdata ${testdata_targets}) # Skip creation of test run targets when generating for Visual Studio and # Xcode unless the user explicitly requests IDE test hosting. This is done # to make build cycles in the IDE tolerable when the IDE command for build

[CVE-2020-0470_1.diff] test.cmake #12
- message(FATAL_ERROR - "--- Unit tests require Python, rerun cmake with " - "-DENABLE_TESTS=0 to avoid this error, or install Python and " - "make sure it's in your PATH.") + message( + FATAL_ERROR "--- Unit tests require Python, rerun cmake with " + "-DENABLE_TESTS=0 to avoid this error, or install Python and " + "make sure it's in your PATH.")
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/test.cmake
225
226
227
228
229
230
231
232
233
234
if(HAVE_SSE4_2) list(APPEND AOM_UNIT_TEST_ENCODER_SOURCES "${AOM_ROOT}/test/hash_test.cc") endif() endif() if(ENABLE_TESTS) find_package(PythonInterp) if(NOT PYTHONINTERP_FOUND)
+ show +
235
236
237
238
message(FATAL_ERROR "--- Unit tests require Python, rerun cmake with " "-DENABLE_TESTS=0 to avoid this error, or install Python and " "make sure it's in your PATH.")
+ show +
239
240
241
242
243
244
245
246
247
248
endif() if(BUILD_SHARED_LIBS AND APPLE) # Silence an RPATH warning. set(CMAKE_MACOSX_RPATH 1) endif() include_directories( "${AOM_ROOT}/third_party/googletest/src/googletest/include") include_directories("${AOM_ROOT}/third_party/googletest/src/googletest")

[CVE-2020-0470_1.diff] test.cmake #16
- add_custom_target(testdata_${test_index} - COMMAND - ${CMAKE_COMMAND} -DAOM_CONFIG_DIR="${AOM_CONFIG_DIR}" - -DAOM_ROOT="${AOM_ROOT}" - -DAOM_TEST_FILE="${test_file}" - -DAOM_TEST_CHECKSUM=${test_file_checksum} -P - "${AOM_ROOT}/test/test_data_download_worker.cmake") + add_custom_target( + testdata_${test_index} + COMMAND ${CMAKE_COMMAND} + -DAOM_CONFIG_DIR="${AOM_CONFIG_DIR}" -DAOM_ROOT="${AOM_ROOT}" + -DAOM_TEST_FILE="${test_file}" + -DAOM_TEST_CHECKSUM=${test_file_checksum} -P + "${AOM_ROOT}/test/test_data_download_worker.cmake")
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/test.cmake
349
350
351
352
353
354
355
356
357
358
if(ENABLE_TESTDATA) make_test_data_lists("${AOM_UNIT_TEST_DATA_LIST_FILE}" test_files test_file_checksums) list(LENGTH test_files num_test_files) list(LENGTH test_file_checksums num_test_file_checksums) math(EXPR max_file_index "${num_test_files} - 1") foreach(test_index RANGE ${max_file_index}) list(GET test_files ${test_index} test_file) list(GET test_file_checksums ${test_index} test_file_checksum)
+ show +
359
360
361
362
363
364
365
add_custom_target(testdata_${test_index} COMMAND ${CMAKE_COMMAND} -DAOM_CONFIG_DIR="${AOM_CONFIG_DIR}" -DAOM_ROOT="${AOM_ROOT}" -DAOM_TEST_FILE="${test_file}" -DAOM_TEST_CHECKSUM=${test_file_checksum} -P "${AOM_ROOT}/test/test_data_download_worker.cmake")
+ show +
366
367
368
369
370
371
372
373
374
375
list(APPEND testdata_targets testdata_${test_index}) endforeach() # Create a custom build target for running each test data download target. add_custom_target(testdata) add_dependencies(testdata ${testdata_targets}) # Skip creation of test run targets when generating for Visual Studio and # Xcode unless the user explicitly requests IDE test hosting. This is done # to make build cycles in the IDE tolerable when the IDE command for build

[CVE-2020-0478_1.diff] datarate_test.cc #3
-} -// Check basic rate targeting for CBR. -TEST_P(DatarateTestLarge, BasicRateTargeting444) { - ::libaom_test::Y4mVideoSource video("rush_hour_444.y4m", 0, 140); + virtual void BasicRateTargetingCBRPeriodicKeyFrameTest() { + cfg_.rc_buf_initial_sz = 500; + cfg_.rc_buf_optimal_sz = 500; + cfg_.rc_buf_sz = 1000; + cfg_.rc_dropframe_thresh = 1; + cfg_.rc_min_quantizer = 0; + cfg_.rc_max_quantizer = 63; + cfg_.rc_end_usage = AOM_CBR; + cfg_.g_lag_in_frames = 0; + // Periodic keyframe + cfg_.kf_max_dist = 50; - cfg_.g_profile = 1; - cfg_.g_timebase = video.timebase(); + ::libaom_test::I420VideoSource video("pixel_capture_w320h240.yuv", 320, 240, + 30, 1, 0, 310); + const int bitrate_array[2] = { 150, 550 }; + cfg_.rc_target_bitrate = bitrate_array[GET_PARAM(4)]; + ResetModel(); + ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); + ASSERT_GE(effective_datarate_, cfg_.rc_target_bitrate * 0.85) + << " The datarate for the file is lower than target by too much!"; + ASSERT_LE(effective_datarate_, cfg_.rc_target_bitrate * 1.15) + << " The datarate for the file is greater than target by too much!"; + } - cfg_.rc_buf_initial_sz = 500; - cfg_.rc_buf_optimal_sz = 500; - cfg_.rc_buf_sz = 1000; - cfg_.rc_dropframe_thresh = 1; - cfg_.rc_min_quantizer = 0; - cfg_.rc_max_quantizer = 63; - cfg_.rc_end_usage = AOM_CBR; + virtual void BasicRateTargetingAQModeOnOffCBRTest() { + if (GET_PARAM(4) > 0) return; + cfg_.rc_buf_initial_sz = 500; + cfg_.rc_buf_optimal_sz = 500; + cfg_.rc_buf_sz = 1000; + cfg_.rc_dropframe_thresh = 0; + cfg_.rc_min_quantizer = 2; + cfg_.rc_max_quantizer = 63; + cfg_.rc_end_usage = AOM_CBR; + cfg_.g_lag_in_frames = 0; + cfg_.g_error_resilient = 0; + cfg_.g_pass = AOM_RC_ONE_PASS; + cfg_.g_usage = AOM_USAGE_REALTIME; + cfg_.kf_mode = AOM_KF_DISABLED; - for (int i = 250; i < 900; i += 400) { - cfg_.rc_target_bitrate = i; + ::libaom_test::I420VideoSource video("pixel_capture_w320h240.yuv", 320, 240, + 30, 1, 0, 310); + const int bitrate_array[1] = { 60 }; + cfg_.rc_target_bitrate = bitrate_array[GET_PARAM(4)]; + ResetModel(); + ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); + ASSERT_GE(effective_datarate_, cfg_.rc_target_bitrate * 0.85) + << " The datarate for the file is lower than target by too much!"; + ASSERT_LE(effective_datarate_, cfg_.rc_target_bitrate * 1.15) + << " The datarate for the file is greater than target by too much!"; + } + + virtual void BasicRateTargeting444CBRTest() { + ::libaom_test::Y4mVideoSource video("rush_hour_444.y4m", 0, 140); + + cfg_.g_profile = 1; + cfg_.g_timebase = video.timebase(); + + cfg_.rc_buf_initial_sz = 500; + cfg_.rc_buf_optimal_sz = 500; + cfg_.rc_buf_sz = 1000; + cfg_.rc_dropframe_thresh = 1; + cfg_.rc_min_quantizer = 0; + cfg_.rc_max_quantizer = 63; + cfg_.rc_end_usage = AOM_CBR; + + const int bitrate_array[2] = { 250, 650 }; + cfg_.rc_target_bitrate = bitrate_array[GET_PARAM(4)];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/datarate_test.cc
165
166
167
168
169
170
171
172
173
174
ResetModel(); ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); ASSERT_GE(effective_datarate_, cfg_.rc_target_bitrate * 0.85) << " The datarate for the file is lower than target by too much!"; ASSERT_LE(effective_datarate_, cfg_.rc_target_bitrate * 1.15) << " The datarate for the file is greater than target by too much!"; } } // Check basic rate targeting for CBR.
+ show +
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
TEST_P(DatarateTestLarge, BasicRateTargeting444) { ::libaom_test::Y4mVideoSource video("rush_hour_444.y4m", 0, 140); cfg_.g_profile = 1; cfg_.g_timebase = video.timebase(); cfg_.rc_buf_initial_sz = 500; cfg_.rc_buf_optimal_sz = 500; cfg_.rc_buf_sz = 1000; cfg_.rc_dropframe_thresh = 1; cfg_.rc_min_quantizer = 0; cfg_.rc_max_quantizer = 63; cfg_.rc_end_usage = AOM_CBR; for (int i = 250; i < 900; i += 400) { cfg_.rc_target_bitrate = i;
+ show +
191
192
193
194
195
196
197
198
199
200
ResetModel(); ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); ASSERT_GE(static_cast<double>(cfg_.rc_target_bitrate), effective_datarate_ * 0.85) << " The datarate for the file exceeds the target by too much!"; ASSERT_LE(static_cast<double>(cfg_.rc_target_bitrate), effective_datarate_ * 1.15) << " The datarate for the file missed the target!" << cfg_.rc_target_bitrate << " " << effective_datarate_; }

[CVE-2020-0470_1.diff] datarate_test.cc #3
-} -// Check basic rate targeting for CBR. -TEST_P(DatarateTestLarge, BasicRateTargeting444) { - ::libaom_test::Y4mVideoSource video("rush_hour_444.y4m", 0, 140); + virtual void BasicRateTargetingCBRPeriodicKeyFrameTest() { + cfg_.rc_buf_initial_sz = 500; + cfg_.rc_buf_optimal_sz = 500; + cfg_.rc_buf_sz = 1000; + cfg_.rc_dropframe_thresh = 1; + cfg_.rc_min_quantizer = 0; + cfg_.rc_max_quantizer = 63; + cfg_.rc_end_usage = AOM_CBR; + cfg_.g_lag_in_frames = 0; + // Periodic keyframe + cfg_.kf_max_dist = 50; - cfg_.g_profile = 1; - cfg_.g_timebase = video.timebase(); + ::libaom_test::I420VideoSource video("pixel_capture_w320h240.yuv", 320, 240, + 30, 1, 0, 310); + const int bitrate_array[2] = { 150, 550 }; + cfg_.rc_target_bitrate = bitrate_array[GET_PARAM(4)]; + ResetModel(); + ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); + ASSERT_GE(effective_datarate_, cfg_.rc_target_bitrate * 0.85) + << " The datarate for the file is lower than target by too much!"; + ASSERT_LE(effective_datarate_, cfg_.rc_target_bitrate * 1.15) + << " The datarate for the file is greater than target by too much!"; + } - cfg_.rc_buf_initial_sz = 500; - cfg_.rc_buf_optimal_sz = 500; - cfg_.rc_buf_sz = 1000; - cfg_.rc_dropframe_thresh = 1; - cfg_.rc_min_quantizer = 0; - cfg_.rc_max_quantizer = 63; - cfg_.rc_end_usage = AOM_CBR; + virtual void BasicRateTargetingAQModeOnOffCBRTest() { + if (GET_PARAM(4) > 0) return; + cfg_.rc_buf_initial_sz = 500; + cfg_.rc_buf_optimal_sz = 500; + cfg_.rc_buf_sz = 1000; + cfg_.rc_dropframe_thresh = 0; + cfg_.rc_min_quantizer = 2; + cfg_.rc_max_quantizer = 63; + cfg_.rc_end_usage = AOM_CBR; + cfg_.g_lag_in_frames = 0; + cfg_.g_error_resilient = 0; + cfg_.g_pass = AOM_RC_ONE_PASS; + cfg_.g_usage = AOM_USAGE_REALTIME; + cfg_.kf_mode = AOM_KF_DISABLED; - for (int i = 250; i < 900; i += 400) { - cfg_.rc_target_bitrate = i; + ::libaom_test::I420VideoSource video("pixel_capture_w320h240.yuv", 320, 240, + 30, 1, 0, 310); + const int bitrate_array[1] = { 60 }; + cfg_.rc_target_bitrate = bitrate_array[GET_PARAM(4)]; + ResetModel(); + ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); + ASSERT_GE(effective_datarate_, cfg_.rc_target_bitrate * 0.85) + << " The datarate for the file is lower than target by too much!"; + ASSERT_LE(effective_datarate_, cfg_.rc_target_bitrate * 1.15) + << " The datarate for the file is greater than target by too much!"; + } + + virtual void BasicRateTargeting444CBRTest() { + ::libaom_test::Y4mVideoSource video("rush_hour_444.y4m", 0, 140); + + cfg_.g_profile = 1; + cfg_.g_timebase = video.timebase(); + + cfg_.rc_buf_initial_sz = 500; + cfg_.rc_buf_optimal_sz = 500; + cfg_.rc_buf_sz = 1000; + cfg_.rc_dropframe_thresh = 1; + cfg_.rc_min_quantizer = 0; + cfg_.rc_max_quantizer = 63; + cfg_.rc_end_usage = AOM_CBR; + + const int bitrate_array[2] = { 250, 650 }; + cfg_.rc_target_bitrate = bitrate_array[GET_PARAM(4)];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/datarate_test.cc
165
166
167
168
169
170
171
172
173
174
ResetModel(); ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); ASSERT_GE(effective_datarate_, cfg_.rc_target_bitrate * 0.85) << " The datarate for the file is lower than target by too much!"; ASSERT_LE(effective_datarate_, cfg_.rc_target_bitrate * 1.15) << " The datarate for the file is greater than target by too much!"; } } // Check basic rate targeting for CBR.
+ show +
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
TEST_P(DatarateTestLarge, BasicRateTargeting444) { ::libaom_test::Y4mVideoSource video("rush_hour_444.y4m", 0, 140); cfg_.g_profile = 1; cfg_.g_timebase = video.timebase(); cfg_.rc_buf_initial_sz = 500; cfg_.rc_buf_optimal_sz = 500; cfg_.rc_buf_sz = 1000; cfg_.rc_dropframe_thresh = 1; cfg_.rc_min_quantizer = 0; cfg_.rc_max_quantizer = 63; cfg_.rc_end_usage = AOM_CBR; for (int i = 250; i < 900; i += 400) { cfg_.rc_target_bitrate = i;
+ show +
191
192
193
194
195
196
197
198
199
200
ResetModel(); ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); ASSERT_GE(static_cast<double>(cfg_.rc_target_bitrate), effective_datarate_ * 0.85) << " The datarate for the file exceeds the target by too much!"; ASSERT_LE(static_cast<double>(cfg_.rc_target_bitrate), effective_datarate_ * 1.15) << " The datarate for the file missed the target!" << cfg_.rc_target_bitrate << " " << effective_datarate_; }

[CVE-2020-0478_1.diff] transform_test_base.h #3
- tran_low_t *output_ref_block = reinterpret_cast<tran_low_t *>( - aom_memalign(16, sizeof(tran_low_t) * num_coeffs_)); - tran_low_t *output_block = reinterpret_cast<tran_low_t *>( - aom_memalign(16, sizeof(tran_low_t) * num_coeffs_)); + OutType *output_ref_block = reinterpret_cast<OutType *>( + aom_memalign(16, sizeof(output_ref_block[0]) * num_coeffs_)); + OutType *output_block = reinterpret_cast<OutType *>( + aom_memalign(16, sizeof(output_block[0]) * num_coeffs_));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/transform_test_base.h
116
117
118
119
120
121
122
123
124
125
void RunCoeffCheck() { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 5000; // Use a stride value which is not the width of any transform, to catch // cases where the transforms use the stride incorrectly. int stride = 96; int16_t *input_block = reinterpret_cast<int16_t *>( aom_memalign(16, sizeof(int16_t) * stride * height_));
+ show +
126
127
128
129
tran_low_t *output_ref_block = reinterpret_cast<tran_low_t *>( aom_memalign(16, sizeof(tran_low_t) * num_coeffs_)); tran_low_t *output_block = reinterpret_cast<tran_low_t *>( aom_memalign(16, sizeof(tran_low_t) * num_coeffs_));
+ show +
130
131
132
133
134
135
136
137
138
139
for (int i = 0; i < count_test_block; ++i) { int j, k; for (j = 0; j < height_; ++j) { for (k = 0; k < pitch_; ++k) { int in_idx = j * stride + k; int out_idx = j * pitch_ + k; input_block[in_idx] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_); if (bit_depth_ == AOM_BITS_8) { output_block[out_idx] = output_ref_block[out_idx] = rnd.Rand8();
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/transform_test_base.h
211
212
213
214
215
216
217
218
219
220
aom_free(output_ref_block); aom_free(output_block); } void RunMemCheck() { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 5000; int16_t *input_extreme_block = reinterpret_cast<int16_t *>( aom_memalign(16, sizeof(int16_t) * num_coeffs_));
+ show +
221
222
223
224
tran_low_t *output_ref_block = reinterpret_cast<tran_low_t *>( aom_memalign(16, sizeof(tran_low_t) * num_coeffs_)); tran_low_t *output_block = reinterpret_cast<tran_low_t *>( aom_memalign(16, sizeof(tran_low_t) * num_coeffs_));
+ show +
225
226
227
228
229
230
231
232
233
234
for (int i = 0; i < count_test_block; ++i) { // Initialize a test block with input range [-mask_, mask_]. for (int j = 0; j < num_coeffs_; ++j) { input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_; } if (i == 0) { for (int j = 0; j < num_coeffs_; ++j) input_extreme_block[j] = mask_; } else if (i == 1) { for (int j = 0; j < num_coeffs_; ++j) input_extreme_block[j] = -mask_;

[CVE-2020-0478_1.diff] transform_test_base.h #5
- tran_low_t *output_ref_block = reinterpret_cast<tran_low_t *>( - aom_memalign(16, sizeof(tran_low_t) * num_coeffs_)); - tran_low_t *output_block = reinterpret_cast<tran_low_t *>( - aom_memalign(16, sizeof(tran_low_t) * num_coeffs_)); + OutType *output_ref_block = reinterpret_cast<OutType *>( + aom_memalign(16, sizeof(output_ref_block[0]) * num_coeffs_)); + OutType *output_block = reinterpret_cast<OutType *>( + aom_memalign(16, sizeof(output_block[0]) * num_coeffs_));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/transform_test_base.h
116
117
118
119
120
121
122
123
124
125
void RunCoeffCheck() { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 5000; // Use a stride value which is not the width of any transform, to catch // cases where the transforms use the stride incorrectly. int stride = 96; int16_t *input_block = reinterpret_cast<int16_t *>( aom_memalign(16, sizeof(int16_t) * stride * height_));
+ show +
126
127
128
129
tran_low_t *output_ref_block = reinterpret_cast<tran_low_t *>( aom_memalign(16, sizeof(tran_low_t) * num_coeffs_)); tran_low_t *output_block = reinterpret_cast<tran_low_t *>( aom_memalign(16, sizeof(tran_low_t) * num_coeffs_));
+ show +
130
131
132
133
134
135
136
137
138
139
for (int i = 0; i < count_test_block; ++i) { int j, k; for (j = 0; j < height_; ++j) { for (k = 0; k < pitch_; ++k) { int in_idx = j * stride + k; int out_idx = j * pitch_ + k; input_block[in_idx] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_); if (bit_depth_ == AOM_BITS_8) { output_block[out_idx] = output_ref_block[out_idx] = rnd.Rand8();
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/transform_test_base.h
211
212
213
214
215
216
217
218
219
220
aom_free(output_ref_block); aom_free(output_block); } void RunMemCheck() { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 5000; int16_t *input_extreme_block = reinterpret_cast<int16_t *>( aom_memalign(16, sizeof(int16_t) * num_coeffs_));
+ show +
221
222
223
224
tran_low_t *output_ref_block = reinterpret_cast<tran_low_t *>( aom_memalign(16, sizeof(tran_low_t) * num_coeffs_)); tran_low_t *output_block = reinterpret_cast<tran_low_t *>( aom_memalign(16, sizeof(tran_low_t) * num_coeffs_));
+ show +
225
226
227
228
229
230
231
232
233
234
for (int i = 0; i < count_test_block; ++i) { // Initialize a test block with input range [-mask_, mask_]. for (int j = 0; j < num_coeffs_; ++j) { input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_; } if (i == 0) { for (int j = 0; j < num_coeffs_; ++j) input_extreme_block[j] = mask_; } else if (i == 1) { for (int j = 0; j < num_coeffs_; ++j) input_extreme_block[j] = -mask_;

[CVE-2020-0470_1.diff] transform_test_base.h #3
- tran_low_t *output_ref_block = reinterpret_cast<tran_low_t *>( - aom_memalign(16, sizeof(tran_low_t) * num_coeffs_)); - tran_low_t *output_block = reinterpret_cast<tran_low_t *>( - aom_memalign(16, sizeof(tran_low_t) * num_coeffs_)); + OutType *output_ref_block = reinterpret_cast<OutType *>( + aom_memalign(16, sizeof(output_ref_block[0]) * num_coeffs_)); + OutType *output_block = reinterpret_cast<OutType *>( + aom_memalign(16, sizeof(output_block[0]) * num_coeffs_));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/transform_test_base.h
116
117
118
119
120
121
122
123
124
125
void RunCoeffCheck() { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 5000; // Use a stride value which is not the width of any transform, to catch // cases where the transforms use the stride incorrectly. int stride = 96; int16_t *input_block = reinterpret_cast<int16_t *>( aom_memalign(16, sizeof(int16_t) * stride * height_));
+ show +
126
127
128
129
tran_low_t *output_ref_block = reinterpret_cast<tran_low_t *>( aom_memalign(16, sizeof(tran_low_t) * num_coeffs_)); tran_low_t *output_block = reinterpret_cast<tran_low_t *>( aom_memalign(16, sizeof(tran_low_t) * num_coeffs_));
+ show +
130
131
132
133
134
135
136
137
138
139
for (int i = 0; i < count_test_block; ++i) { int j, k; for (j = 0; j < height_; ++j) { for (k = 0; k < pitch_; ++k) { int in_idx = j * stride + k; int out_idx = j * pitch_ + k; input_block[in_idx] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_); if (bit_depth_ == AOM_BITS_8) { output_block[out_idx] = output_ref_block[out_idx] = rnd.Rand8();
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/transform_test_base.h
211
212
213
214
215
216
217
218
219
220
aom_free(output_ref_block); aom_free(output_block); } void RunMemCheck() { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 5000; int16_t *input_extreme_block = reinterpret_cast<int16_t *>( aom_memalign(16, sizeof(int16_t) * num_coeffs_));
+ show +
221
222
223
224
tran_low_t *output_ref_block = reinterpret_cast<tran_low_t *>( aom_memalign(16, sizeof(tran_low_t) * num_coeffs_)); tran_low_t *output_block = reinterpret_cast<tran_low_t *>( aom_memalign(16, sizeof(tran_low_t) * num_coeffs_));
+ show +
225
226
227
228
229
230
231
232
233
234
for (int i = 0; i < count_test_block; ++i) { // Initialize a test block with input range [-mask_, mask_]. for (int j = 0; j < num_coeffs_; ++j) { input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_; } if (i == 0) { for (int j = 0; j < num_coeffs_; ++j) input_extreme_block[j] = mask_; } else if (i == 1) { for (int j = 0; j < num_coeffs_; ++j) input_extreme_block[j] = -mask_;

[CVE-2020-0470_1.diff] transform_test_base.h #5
- tran_low_t *output_ref_block = reinterpret_cast<tran_low_t *>( - aom_memalign(16, sizeof(tran_low_t) * num_coeffs_)); - tran_low_t *output_block = reinterpret_cast<tran_low_t *>( - aom_memalign(16, sizeof(tran_low_t) * num_coeffs_)); + OutType *output_ref_block = reinterpret_cast<OutType *>( + aom_memalign(16, sizeof(output_ref_block[0]) * num_coeffs_)); + OutType *output_block = reinterpret_cast<OutType *>( + aom_memalign(16, sizeof(output_block[0]) * num_coeffs_));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/transform_test_base.h
116
117
118
119
120
121
122
123
124
125
void RunCoeffCheck() { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 5000; // Use a stride value which is not the width of any transform, to catch // cases where the transforms use the stride incorrectly. int stride = 96; int16_t *input_block = reinterpret_cast<int16_t *>( aom_memalign(16, sizeof(int16_t) * stride * height_));
+ show +
126
127
128
129
tran_low_t *output_ref_block = reinterpret_cast<tran_low_t *>( aom_memalign(16, sizeof(tran_low_t) * num_coeffs_)); tran_low_t *output_block = reinterpret_cast<tran_low_t *>( aom_memalign(16, sizeof(tran_low_t) * num_coeffs_));
+ show +
130
131
132
133
134
135
136
137
138
139
for (int i = 0; i < count_test_block; ++i) { int j, k; for (j = 0; j < height_; ++j) { for (k = 0; k < pitch_; ++k) { int in_idx = j * stride + k; int out_idx = j * pitch_ + k; input_block[in_idx] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_); if (bit_depth_ == AOM_BITS_8) { output_block[out_idx] = output_ref_block[out_idx] = rnd.Rand8();
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/test/transform_test_base.h
211
212
213
214
215
216
217
218
219
220
aom_free(output_ref_block); aom_free(output_block); } void RunMemCheck() { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 5000; int16_t *input_extreme_block = reinterpret_cast<int16_t *>( aom_memalign(16, sizeof(int16_t) * num_coeffs_));
+ show +
221
222
223
224
tran_low_t *output_ref_block = reinterpret_cast<tran_low_t *>( aom_memalign(16, sizeof(tran_low_t) * num_coeffs_)); tran_low_t *output_block = reinterpret_cast<tran_low_t *>( aom_memalign(16, sizeof(tran_low_t) * num_coeffs_));
+ show +
225
226
227
228
229
230
231
232
233
234
for (int i = 0; i < count_test_block; ++i) { // Initialize a test block with input range [-mask_, mask_]. for (int j = 0; j < num_coeffs_; ++j) { input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_; } if (i == 0) { for (int j = 0; j < num_coeffs_; ++j) input_extreme_block[j] = mask_; } else if (i == 1) { for (int j = 0; j < num_coeffs_; ++j) input_extreme_block[j] = -mask_;

[CVE-2020-0478_1.diff] yv12config.h #3
+ aom_metadata_array_t *metadata; -int aom_realloc_lookahead_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height, - int ss_x, int ss_y, int use_highbitdepth, - int border, int byte_alignment, - aom_codec_frame_buffer_t *fb, - aom_get_frame_buffer_cb_fn_t cb, - void *cb_priv); - +/*!\brief Removes metadata from YUV_BUFFER_CONFIG struct. + * + * Frees metadata in frame buffer. + * Frame buffer metadata pointer will be set to NULL. + * + * \param[in] ybf Frame buffer struct pointer + */ +void aom_remove_metadata_from_frame_buffer(YV12_BUFFER_CONFIG *ybf); + +/*!\brief Copy metadata to YUV_BUFFER_CONFIG struct. + * + * Copies metadata in frame buffer. + * Frame buffer will clear any previous metadata and will reallocate the + * metadata array to the new metadata size. Then, it will copy the new metadata + * array into it. + * Returns 0 on success or -1 on failure. + * + * \param[in] ybf Frame buffer struct pointer + * \param[in] arr Metadata array struct pointer + */ +int aom_copy_metadata_to_frame_buffer(YV12_BUFFER_CONFIG *ybf, + const aom_metadata_array_t *arr); +
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_scale/yv12config.h
119
120
121
122
123
124
125
126
127
128
// If cb is not NULL, libaom will call cb with minimum size in bytes needed // to decode the current frame. If cb is NULL, libaom will allocate memory // internally to decode the current frame. Returns 0 on success. Returns < 0 // on failure. int aom_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height, int ss_x, int ss_y, int use_highbitdepth, int border, int byte_alignment, aom_codec_frame_buffer_t *fb, aom_get_frame_buffer_cb_fn_t cb, void *cb_priv);
+ show +
129
130
131
132
133
134
int aom_realloc_lookahead_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height, int ss_x, int ss_y, int use_highbitdepth, int border, int byte_alignment, aom_codec_frame_buffer_t *fb, aom_get_frame_buffer_cb_fn_t cb, void *cb_priv);
+ show +
135
136
137
138
139
140
141
142
int aom_free_frame_buffer(YV12_BUFFER_CONFIG *ybf); #ifdef __cplusplus } #endif #endif // AOM_AOM_SCALE_YV12CONFIG_H_

[CVE-2020-0470_1.diff] yv12config.h #3
+ aom_metadata_array_t *metadata; -int aom_realloc_lookahead_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height, - int ss_x, int ss_y, int use_highbitdepth, - int border, int byte_alignment, - aom_codec_frame_buffer_t *fb, - aom_get_frame_buffer_cb_fn_t cb, - void *cb_priv); - +/*!\brief Removes metadata from YUV_BUFFER_CONFIG struct. + * + * Frees metadata in frame buffer. + * Frame buffer metadata pointer will be set to NULL. + * + * \param[in] ybf Frame buffer struct pointer + */ +void aom_remove_metadata_from_frame_buffer(YV12_BUFFER_CONFIG *ybf); + +/*!\brief Copy metadata to YUV_BUFFER_CONFIG struct. + * + * Copies metadata in frame buffer. + * Frame buffer will clear any previous metadata and will reallocate the + * metadata array to the new metadata size. Then, it will copy the new metadata + * array into it. + * Returns 0 on success or -1 on failure. + * + * \param[in] ybf Frame buffer struct pointer + * \param[in] arr Metadata array struct pointer + */ +int aom_copy_metadata_to_frame_buffer(YV12_BUFFER_CONFIG *ybf, + const aom_metadata_array_t *arr); +
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_scale/yv12config.h
119
120
121
122
123
124
125
126
127
128
// If cb is not NULL, libaom will call cb with minimum size in bytes needed // to decode the current frame. If cb is NULL, libaom will allocate memory // internally to decode the current frame. Returns 0 on success. Returns < 0 // on failure. int aom_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height, int ss_x, int ss_y, int use_highbitdepth, int border, int byte_alignment, aom_codec_frame_buffer_t *fb, aom_get_frame_buffer_cb_fn_t cb, void *cb_priv);
+ show +
129
130
131
132
133
134
int aom_realloc_lookahead_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height, int ss_x, int ss_y, int use_highbitdepth, int border, int byte_alignment, aom_codec_frame_buffer_t *fb, aom_get_frame_buffer_cb_fn_t cb, void *cb_priv);
+ show +
135
136
137
138
139
140
141
142
int aom_free_frame_buffer(YV12_BUFFER_CONFIG *ybf); #ifdef __cplusplus } #endif #endif // AOM_AOM_SCALE_YV12CONFIG_H_

[CVE-2020-0478_1.diff] loopfilter.c #7
-void aom_highbd_lpf_horizontal_14_c(uint16_t *s, int p, const uint8_t *blimit, - const uint8_t *limit, const uint8_t *thresh, - int bd) { - highbd_mb_lpf_horizontal_edge_w(s, p, blimit, limit, thresh, 1, bd); +void aom_highbd_lpf_horizontal_14_c(uint16_t *s, int pitch, + const uint8_t *blimit, const uint8_t *limit, + const uint8_t *thresh, int bd) { + highbd_mb_lpf_horizontal_edge_w(s, pitch, blimit, limit, thresh, 1, bd);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/loopfilter.c
858
859
860
861
862
863
864
865
866
867
highbd_flat_mask4(1, s[-7 * p], s[-6 * p], s[-5 * p], p0, q0, s[4 * p], s[5 * p], s[6 * p], bd); highbd_filter14(mask, *thresh, flat, flat2, s - 7 * p, s - 6 * p, s - 5 * p, s - 4 * p, s - 3 * p, s - 2 * p, s - 1 * p, s, s + 1 * p, s + 2 * p, s + 3 * p, s + 4 * p, s + 5 * p, s + 6 * p, bd); ++s; } }
+ show +
868
869
870
871
void aom_highbd_lpf_horizontal_14_c(uint16_t *s, int p, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int bd) { highbd_mb_lpf_horizontal_edge_w(s, p, blimit, limit, thresh, 1, bd);
+ show +
872
873
874
875
876
877
878
879
880
881
} void aom_highbd_lpf_horizontal_14_dual_c( uint16_t *s, int p, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1, int bd) { highbd_mb_lpf_horizontal_edge_w(s, p, blimit0, limit0, thresh0, 1, bd); highbd_mb_lpf_horizontal_edge_w(s + 4, p, blimit1, limit1, thresh1, 1, bd); }

[CVE-2020-0470_1.diff] loopfilter.c #7
-void aom_highbd_lpf_horizontal_14_c(uint16_t *s, int p, const uint8_t *blimit, - const uint8_t *limit, const uint8_t *thresh, - int bd) { - highbd_mb_lpf_horizontal_edge_w(s, p, blimit, limit, thresh, 1, bd); +void aom_highbd_lpf_horizontal_14_c(uint16_t *s, int pitch, + const uint8_t *blimit, const uint8_t *limit, + const uint8_t *thresh, int bd) { + highbd_mb_lpf_horizontal_edge_w(s, pitch, blimit, limit, thresh, 1, bd);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/loopfilter.c
858
859
860
861
862
863
864
865
866
867
highbd_flat_mask4(1, s[-7 * p], s[-6 * p], s[-5 * p], p0, q0, s[4 * p], s[5 * p], s[6 * p], bd); highbd_filter14(mask, *thresh, flat, flat2, s - 7 * p, s - 6 * p, s - 5 * p, s - 4 * p, s - 3 * p, s - 2 * p, s - 1 * p, s, s + 1 * p, s + 2 * p, s + 3 * p, s + 4 * p, s + 5 * p, s + 6 * p, bd); ++s; } }
+ show +
868
869
870
871
void aom_highbd_lpf_horizontal_14_c(uint16_t *s, int p, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int bd) { highbd_mb_lpf_horizontal_edge_w(s, p, blimit, limit, thresh, 1, bd);
+ show +
872
873
874
875
876
877
878
879
880
881
} void aom_highbd_lpf_horizontal_14_dual_c( uint16_t *s, int p, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1, int bd) { highbd_mb_lpf_horizontal_edge_w(s, p, blimit0, limit0, thresh0, 1, bd); highbd_mb_lpf_horizontal_edge_w(s + 4, p, blimit1, limit1, thresh1, 1, bd); }

[CVE-2020-0478_1.diff] bitreader.h #2
-typedef struct daala_reader aom_reader; +struct aom_reader { + const uint8_t *buffer; + const uint8_t *buffer_end; + od_ec_dec ec; +#if CONFIG_ACCOUNTING + Accounting *accounting; +#endif + uint8_t allow_update_cdf; +}; -static INLINE int aom_reader_init(aom_reader *r, const uint8_t *buffer, - size_t size) { - return aom_daala_reader_init(r, buffer, (int)size); -} +typedef struct aom_reader aom_reader; -static INLINE const uint8_t *aom_reader_find_begin(aom_reader *r) { - return aom_daala_reader_find_begin(r); -} +int aom_reader_init(aom_reader *r, const uint8_t *buffer, size_t size); -static INLINE const uint8_t *aom_reader_find_end(aom_reader *r) { - return aom_daala_reader_find_end(r); -} +const uint8_t *aom_reader_find_begin(aom_reader *r); + +const uint8_t *aom_reader_find_end(aom_reader *r); -static INLINE int aom_reader_has_overflowed(const aom_reader *r) { - return aom_daala_reader_has_overflowed(r); -} +int aom_reader_has_overflowed(const aom_reader *r); -static INLINE uint32_t aom_reader_tell(const aom_reader *r) { - return aom_daala_reader_tell(r); -} +uint32_t aom_reader_tell(const aom_reader *r); -static INLINE uint32_t aom_reader_tell_frac(const aom_reader *r) { - return aom_daala_reader_tell_frac(r); -} +uint32_t aom_reader_tell_frac(const aom_reader *r);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/bitreader.h
43
44
45
46
47
48
49
50
51
52
aom_read_literal_(r, bits ACCT_STR_ARG(ACCT_STR_NAME)) #define aom_read_cdf(r, cdf, nsymbs, ACCT_STR_NAME) \ aom_read_cdf_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME)) #define aom_read_symbol(r, cdf, nsymbs, ACCT_STR_NAME) \ aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME)) #ifdef __cplusplus extern "C" { #endif
+ show +
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
typedef struct daala_reader aom_reader; static INLINE int aom_reader_init(aom_reader *r, const uint8_t *buffer, size_t size) { return aom_daala_reader_init(r, buffer, (int)size); } static INLINE const uint8_t *aom_reader_find_begin(aom_reader *r) { return aom_daala_reader_find_begin(r); } static INLINE const uint8_t *aom_reader_find_end(aom_reader *r) { return aom_daala_reader_find_end(r); } // Returns true if the bit reader has tried to decode more data from the buffer // than was actually provided. static INLINE int aom_reader_has_overflowed(const aom_reader *r) { return aom_daala_reader_has_overflowed(r); } // Returns the position in the bit reader in bits. static INLINE uint32_t aom_reader_tell(const aom_reader *r) { return aom_daala_reader_tell(r); } // Returns the position in the bit reader in 1/8th bits. static INLINE uint32_t aom_reader_tell_frac(const aom_reader *r) { return aom_daala_reader_tell_frac(r);
+ show +
82
83
84
85
86
87
88
89
90
91
} #if CONFIG_ACCOUNTING static INLINE void aom_process_accounting(const aom_reader *r ACCT_STR_PARAM) { if (r->accounting != NULL) { uint32_t tell_frac; tell_frac = aom_reader_tell_frac(r); aom_accounting_record(r->accounting, ACCT_STR_NAME, tell_frac - r->accounting->last_tell_frac); r->accounting->last_tell_frac = tell_frac;

[CVE-2020-0470_1.diff] bitreader.h #2
-typedef struct daala_reader aom_reader; +struct aom_reader { + const uint8_t *buffer; + const uint8_t *buffer_end; + od_ec_dec ec; +#if CONFIG_ACCOUNTING + Accounting *accounting; +#endif + uint8_t allow_update_cdf; +}; -static INLINE int aom_reader_init(aom_reader *r, const uint8_t *buffer, - size_t size) { - return aom_daala_reader_init(r, buffer, (int)size); -} +typedef struct aom_reader aom_reader; -static INLINE const uint8_t *aom_reader_find_begin(aom_reader *r) { - return aom_daala_reader_find_begin(r); -} +int aom_reader_init(aom_reader *r, const uint8_t *buffer, size_t size); -static INLINE const uint8_t *aom_reader_find_end(aom_reader *r) { - return aom_daala_reader_find_end(r); -} +const uint8_t *aom_reader_find_begin(aom_reader *r); + +const uint8_t *aom_reader_find_end(aom_reader *r); -static INLINE int aom_reader_has_overflowed(const aom_reader *r) { - return aom_daala_reader_has_overflowed(r); -} +int aom_reader_has_overflowed(const aom_reader *r); -static INLINE uint32_t aom_reader_tell(const aom_reader *r) { - return aom_daala_reader_tell(r); -} +uint32_t aom_reader_tell(const aom_reader *r); -static INLINE uint32_t aom_reader_tell_frac(const aom_reader *r) { - return aom_daala_reader_tell_frac(r); -} +uint32_t aom_reader_tell_frac(const aom_reader *r);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/bitreader.h
43
44
45
46
47
48
49
50
51
52
aom_read_literal_(r, bits ACCT_STR_ARG(ACCT_STR_NAME)) #define aom_read_cdf(r, cdf, nsymbs, ACCT_STR_NAME) \ aom_read_cdf_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME)) #define aom_read_symbol(r, cdf, nsymbs, ACCT_STR_NAME) \ aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME)) #ifdef __cplusplus extern "C" { #endif
+ show +
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
typedef struct daala_reader aom_reader; static INLINE int aom_reader_init(aom_reader *r, const uint8_t *buffer, size_t size) { return aom_daala_reader_init(r, buffer, (int)size); } static INLINE const uint8_t *aom_reader_find_begin(aom_reader *r) { return aom_daala_reader_find_begin(r); } static INLINE const uint8_t *aom_reader_find_end(aom_reader *r) { return aom_daala_reader_find_end(r); } // Returns true if the bit reader has tried to decode more data from the buffer // than was actually provided. static INLINE int aom_reader_has_overflowed(const aom_reader *r) { return aom_daala_reader_has_overflowed(r); } // Returns the position in the bit reader in bits. static INLINE uint32_t aom_reader_tell(const aom_reader *r) { return aom_daala_reader_tell(r); } // Returns the position in the bit reader in 1/8th bits. static INLINE uint32_t aom_reader_tell_frac(const aom_reader *r) { return aom_daala_reader_tell_frac(r);
+ show +
82
83
84
85
86
87
88
89
90
91
} #if CONFIG_ACCOUNTING static INLINE void aom_process_accounting(const aom_reader *r ACCT_STR_PARAM) { if (r->accounting != NULL) { uint32_t tell_frac; tell_frac = aom_reader_tell_frac(r); aom_accounting_record(r->accounting, ACCT_STR_NAME, tell_frac - r->accounting->last_tell_frac); r->accounting->last_tell_frac = tell_frac;

[CVE-2020-0478_1.diff] quantize.c #3
-void quantize_b_helper_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, - const int16_t *zbin_ptr, const int16_t *round_ptr, - const int16_t *quant_ptr, - const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, - tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, - uint16_t *eob_ptr, const int16_t *scan, - const int16_t *iscan, const qm_val_t *qm_ptr, - const qm_val_t *iqm_ptr, const int log_scale) { +void aom_quantize_b_helper_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, + const int16_t *zbin_ptr, const int16_t *round_ptr, + const int16_t *quant_ptr, + const int16_t *quant_shift_ptr, + tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, + const int16_t *dequant_ptr, uint16_t *eob_ptr, + const int16_t *scan, const int16_t *iscan, + const qm_val_t *qm_ptr, const qm_val_t *iqm_ptr, + const int log_scale) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/quantize.c
97
98
99
100
101
102
103
104
105
106
qcoeff_ptr[rc] = 0; dqcoeff_ptr[rc] = 0; eob = -1; } } } #endif // SKIP_EOB_FACTOR_ADJUST *eob_ptr = eob + 1; }
+ show +
107
108
109
110
111
112
113
114
void quantize_b_helper_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan, const qm_val_t *qm_ptr, const qm_val_t *iqm_ptr, const int log_scale) {
+ show +
115
116
117
118
119
120
121
122
123
124
const int zbins[2] = { ROUND_POWER_OF_TWO(zbin_ptr[0], log_scale), ROUND_POWER_OF_TWO(zbin_ptr[1], log_scale) }; const int nzbins[2] = { zbins[0] * -1, zbins[1] * -1 }; int i, non_zero_count = (int)n_coeffs, eob = -1; (void)iscan; memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr)); // Pre-scan pass

[CVE-2020-0478_1.diff] quantize.c #10
+#endif // CONFIG_AV1_HIGHBITDEPTH - quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, - quant_ptr, quant_shift_ptr, qcoeff_ptr, - dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, - NULL, NULL, 0); + aom_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, + quant_ptr, quant_shift_ptr, qcoeff_ptr, + dqcoeff_ptr, dequant_ptr, eob_ptr, scan, + iscan, NULL, NULL, 0);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/quantize.c
314
315
316
317
318
319
320
321
322
323
/* These functions should only be called when quantisation matrices are not used. */ void aom_quantize_b_adaptive_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) {
+ show +
324
325
326
327
quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr, dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, NULL, NULL, 0);
+ show +
328
329
330
331
332
333
334
335
336
337
} void aom_quantize_b_32x32_adaptive_c( const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) { quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr,

[CVE-2020-0478_1.diff] quantize.c #11
- quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, - quant_ptr, quant_shift_ptr, qcoeff_ptr, - dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, - NULL, NULL, 1); + aom_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, + quant_ptr, quant_shift_ptr, qcoeff_ptr, + dqcoeff_ptr, dequant_ptr, eob_ptr, scan, + iscan, NULL, NULL, 1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/quantize.c
326
327
328
329
330
331
332
333
334
335
dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, NULL, NULL, 0); } void aom_quantize_b_32x32_adaptive_c( const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) {
+ show +
336
337
338
339
quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr, dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, NULL, NULL, 1);
+ show +
340
341
342
343
344
345
346
347
348
349
} void aom_quantize_b_64x64_adaptive_c( const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) { quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr,

[CVE-2020-0478_1.diff] quantize.c #13
- highbd_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, - quant_ptr, quant_shift_ptr, qcoeff_ptr, - dqcoeff_ptr, dequant_ptr, eob_ptr, scan, - iscan, NULL, NULL, 1); + aom_highbd_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, + round_ptr, quant_ptr, quant_shift_ptr, + qcoeff_ptr, dqcoeff_ptr, dequant_ptr, + eob_ptr, scan, iscan, NULL, NULL, 1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/quantize.c
362
363
364
365
366
367
368
369
370
371
dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, NULL, NULL, 0); } void aom_highbd_quantize_b_32x32_adaptive_c( const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) {
+ show +
372
373
374
375
highbd_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr, dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, NULL, NULL, 1);
+ show +
376
377
378
379
380
381
382
383
384
385
} void aom_highbd_quantize_b_64x64_adaptive_c( const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) { highbd_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr,

[CVE-2020-0478_1.diff] quantize.c #14
- highbd_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, - quant_ptr, quant_shift_ptr, qcoeff_ptr, - dqcoeff_ptr, dequant_ptr, eob_ptr, scan, - iscan, NULL, NULL, 2); + aom_highbd_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, + round_ptr, quant_ptr, quant_shift_ptr, + qcoeff_ptr, dqcoeff_ptr, dequant_ptr, + eob_ptr, scan, iscan, NULL, NULL, 2); +#endif // CONFIG_AV1_HIGHBITDEPTH
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/quantize.c
374
375
376
377
378
379
380
381
382
383
dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, NULL, NULL, 1); } void aom_highbd_quantize_b_64x64_adaptive_c( const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) {
+ show +
384
385
386
387
highbd_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr, dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, NULL, NULL, 2);
+ show +
388
389
390
391
392
393
394
395
396
397
} void aom_quantize_b_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) { quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr, dqcoeff_ptr, dequant_ptr,

[CVE-2020-0478_1.diff] quantize.c #18
- highbd_quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, - quant_ptr, quant_shift_ptr, qcoeff_ptr, - dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, - NULL, NULL, 0); + aom_highbd_quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, + quant_ptr, quant_shift_ptr, qcoeff_ptr, + dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, + NULL, NULL, 0);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/quantize.c
422
423
424
425
426
427
428
429
430
431
eob_ptr, scan, iscan, NULL, NULL, 2); } void aom_highbd_quantize_b_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) {
+ show +
432
433
434
435
highbd_quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr, dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, NULL, NULL, 0);
+ show +
436
437
438
439
440
441
442
443
444
445
} void aom_highbd_quantize_b_32x32_c( const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) { highbd_quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr,

[CVE-2020-0478_1.diff] quantize.c #19
- highbd_quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, - quant_ptr, quant_shift_ptr, qcoeff_ptr, - dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, - NULL, NULL, 1); + aom_highbd_quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, + quant_ptr, quant_shift_ptr, qcoeff_ptr, + dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, + NULL, NULL, 1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/quantize.c
434
435
436
437
438
439
440
441
442
443
dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, NULL, NULL, 0); } void aom_highbd_quantize_b_32x32_c( const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) {
+ show +
444
445
446
447
highbd_quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr, dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, NULL, NULL, 1);
+ show +
448
449
450
451
452
453
454
455
456
457
} void aom_highbd_quantize_b_64x64_c( const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) { highbd_quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr,

[CVE-2020-0470_1.diff] quantize.c #3
-void quantize_b_helper_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, - const int16_t *zbin_ptr, const int16_t *round_ptr, - const int16_t *quant_ptr, - const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, - tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, - uint16_t *eob_ptr, const int16_t *scan, - const int16_t *iscan, const qm_val_t *qm_ptr, - const qm_val_t *iqm_ptr, const int log_scale) { +void aom_quantize_b_helper_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, + const int16_t *zbin_ptr, const int16_t *round_ptr, + const int16_t *quant_ptr, + const int16_t *quant_shift_ptr, + tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, + const int16_t *dequant_ptr, uint16_t *eob_ptr, + const int16_t *scan, const int16_t *iscan, + const qm_val_t *qm_ptr, const qm_val_t *iqm_ptr, + const int log_scale) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/quantize.c
97
98
99
100
101
102
103
104
105
106
qcoeff_ptr[rc] = 0; dqcoeff_ptr[rc] = 0; eob = -1; } } } #endif // SKIP_EOB_FACTOR_ADJUST *eob_ptr = eob + 1; }
+ show +
107
108
109
110
111
112
113
114
void quantize_b_helper_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan, const qm_val_t *qm_ptr, const qm_val_t *iqm_ptr, const int log_scale) {
+ show +
115
116
117
118
119
120
121
122
123
124
const int zbins[2] = { ROUND_POWER_OF_TWO(zbin_ptr[0], log_scale), ROUND_POWER_OF_TWO(zbin_ptr[1], log_scale) }; const int nzbins[2] = { zbins[0] * -1, zbins[1] * -1 }; int i, non_zero_count = (int)n_coeffs, eob = -1; (void)iscan; memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr)); // Pre-scan pass

[CVE-2020-0470_1.diff] quantize.c #10
+#endif // CONFIG_AV1_HIGHBITDEPTH - quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, - quant_ptr, quant_shift_ptr, qcoeff_ptr, - dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, - NULL, NULL, 0); + aom_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, + quant_ptr, quant_shift_ptr, qcoeff_ptr, + dqcoeff_ptr, dequant_ptr, eob_ptr, scan, + iscan, NULL, NULL, 0);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/quantize.c
314
315
316
317
318
319
320
321
322
323
/* These functions should only be called when quantisation matrices are not used. */ void aom_quantize_b_adaptive_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) {
+ show +
324
325
326
327
quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr, dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, NULL, NULL, 0);
+ show +
328
329
330
331
332
333
334
335
336
337
} void aom_quantize_b_32x32_adaptive_c( const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) { quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr,

[CVE-2020-0470_1.diff] quantize.c #11
- quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, - quant_ptr, quant_shift_ptr, qcoeff_ptr, - dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, - NULL, NULL, 1); + aom_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, + quant_ptr, quant_shift_ptr, qcoeff_ptr, + dqcoeff_ptr, dequant_ptr, eob_ptr, scan, + iscan, NULL, NULL, 1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/quantize.c
326
327
328
329
330
331
332
333
334
335
dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, NULL, NULL, 0); } void aom_quantize_b_32x32_adaptive_c( const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) {
+ show +
336
337
338
339
quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr, dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, NULL, NULL, 1);
+ show +
340
341
342
343
344
345
346
347
348
349
} void aom_quantize_b_64x64_adaptive_c( const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) { quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr,

[CVE-2020-0470_1.diff] quantize.c #13
- highbd_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, - quant_ptr, quant_shift_ptr, qcoeff_ptr, - dqcoeff_ptr, dequant_ptr, eob_ptr, scan, - iscan, NULL, NULL, 1); + aom_highbd_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, + round_ptr, quant_ptr, quant_shift_ptr, + qcoeff_ptr, dqcoeff_ptr, dequant_ptr, + eob_ptr, scan, iscan, NULL, NULL, 1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/quantize.c
362
363
364
365
366
367
368
369
370
371
dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, NULL, NULL, 0); } void aom_highbd_quantize_b_32x32_adaptive_c( const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) {
+ show +
372
373
374
375
highbd_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr, dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, NULL, NULL, 1);
+ show +
376
377
378
379
380
381
382
383
384
385
} void aom_highbd_quantize_b_64x64_adaptive_c( const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) { highbd_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr,

[CVE-2020-0470_1.diff] quantize.c #14
- highbd_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, - quant_ptr, quant_shift_ptr, qcoeff_ptr, - dqcoeff_ptr, dequant_ptr, eob_ptr, scan, - iscan, NULL, NULL, 2); + aom_highbd_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, + round_ptr, quant_ptr, quant_shift_ptr, + qcoeff_ptr, dqcoeff_ptr, dequant_ptr, + eob_ptr, scan, iscan, NULL, NULL, 2); +#endif // CONFIG_AV1_HIGHBITDEPTH
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/quantize.c
374
375
376
377
378
379
380
381
382
383
dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, NULL, NULL, 1); } void aom_highbd_quantize_b_64x64_adaptive_c( const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) {
+ show +
384
385
386
387
highbd_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr, dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, NULL, NULL, 2);
+ show +
388
389
390
391
392
393
394
395
396
397
} void aom_quantize_b_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) { quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr, dqcoeff_ptr, dequant_ptr,

[CVE-2020-0470_1.diff] quantize.c #18
- highbd_quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, - quant_ptr, quant_shift_ptr, qcoeff_ptr, - dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, - NULL, NULL, 0); + aom_highbd_quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, + quant_ptr, quant_shift_ptr, qcoeff_ptr, + dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, + NULL, NULL, 0);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/quantize.c
422
423
424
425
426
427
428
429
430
431
eob_ptr, scan, iscan, NULL, NULL, 2); } void aom_highbd_quantize_b_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) {
+ show +
432
433
434
435
highbd_quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr, dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, NULL, NULL, 0);
+ show +
436
437
438
439
440
441
442
443
444
445
} void aom_highbd_quantize_b_32x32_c( const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) { highbd_quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr,

[CVE-2020-0470_1.diff] quantize.c #19
- highbd_quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, - quant_ptr, quant_shift_ptr, qcoeff_ptr, - dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, - NULL, NULL, 1); + aom_highbd_quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, + quant_ptr, quant_shift_ptr, qcoeff_ptr, + dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, + NULL, NULL, 1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/quantize.c
434
435
436
437
438
439
440
441
442
443
dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, NULL, NULL, 0); } void aom_highbd_quantize_b_32x32_c( const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) {
+ show +
444
445
446
447
highbd_quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr, dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan, NULL, NULL, 1);
+ show +
448
449
450
451
452
453
454
455
456
457
} void aom_highbd_quantize_b_64x64_c( const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) { highbd_quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, qcoeff_ptr,

[CVE-2020-0478_1.diff] quantize.h #3
+#endif // CONFIG_AV1_HIGHBITDEPTH -void quantize_b_helper_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, - const int16_t *zbin_ptr, const int16_t *round_ptr, - const int16_t *quant_ptr, - const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, - tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, - uint16_t *eob_ptr, const int16_t *scan, - const int16_t *iscan, const qm_val_t *qm_ptr, - const qm_val_t *iqm_ptr, const int log_scale); +void aom_quantize_b_helper_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, + const int16_t *zbin_ptr, const int16_t *round_ptr, + const int16_t *quant_ptr, + const int16_t *quant_shift_ptr, + tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, + const int16_t *dequant_ptr, uint16_t *eob_ptr, + const int16_t *scan, const int16_t *iscan, + const qm_val_t *qm_ptr, const qm_val_t *iqm_ptr, + const int log_scale);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/quantize.h
73
74
75
76
77
78
79
80
81
82
tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); void aom_highbd_quantize_b_64x64_adaptive_c( const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan);
+ show +
83
84
85
86
87
88
89
90
void quantize_b_helper_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan, const qm_val_t *qm_ptr, const qm_val_t *iqm_ptr, const int log_scale);
+ show +
91
92
93
94
95
96
97
98
99
100
void aom_quantize_b_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); void highbd_quantize_b_helper_c( const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr,

[CVE-2020-0470_1.diff] quantize.h #3
+#endif // CONFIG_AV1_HIGHBITDEPTH -void quantize_b_helper_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, - const int16_t *zbin_ptr, const int16_t *round_ptr, - const int16_t *quant_ptr, - const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, - tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, - uint16_t *eob_ptr, const int16_t *scan, - const int16_t *iscan, const qm_val_t *qm_ptr, - const qm_val_t *iqm_ptr, const int log_scale); +void aom_quantize_b_helper_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, + const int16_t *zbin_ptr, const int16_t *round_ptr, + const int16_t *quant_ptr, + const int16_t *quant_shift_ptr, + tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, + const int16_t *dequant_ptr, uint16_t *eob_ptr, + const int16_t *scan, const int16_t *iscan, + const qm_val_t *qm_ptr, const qm_val_t *iqm_ptr, + const int log_scale);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/quantize.h
73
74
75
76
77
78
79
80
81
82
tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); void aom_highbd_quantize_b_64x64_adaptive_c( const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan);
+ show +
83
84
85
86
87
88
89
90
void quantize_b_helper_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan, const qm_val_t *qm_ptr, const qm_val_t *iqm_ptr, const int log_scale);
+ show +
91
92
93
94
95
96
97
98
99
100
void aom_quantize_b_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); void highbd_quantize_b_helper_c( const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr,

[CVE-2020-0478_1.diff] noise_model.c #3
+ lut->num_points = 0; + block_finder->A = NULL; + block_finder->AtA_inv = NULL; + - const float score = - (float)(1.0 / (1 + exp(-(weights[0] * var + weights[1] * ratio + - weights[2] * trace + weights[3] * norm + - weights[4])))); + double sum_weights = weights[0] * var + weights[1] * ratio + + weights[2] * trace + weights[3] * norm + + weights[4]; + // clamp the value to [-25.0, 100.0] to prevent overflow + sum_weights = fclamp(sum_weights, -25.0, 100.0); + const float score = (float)(1.0 / (1 + exp(-sum_weights)));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/noise_model.c
625
626
627
628
629
630
631
632
633
634
(ratio < kRatioThreshold) && (norm < kNormThreshold) && (var > kVarThreshold); // The following weights are used to combine the above features to give // a sigmoid score for flatness. If the input was normalized to [0,100] // the magnitude of these values would be close to 1 (e.g., weights // corresponding to variance would be a factor of 10000x smaller). // The weights are given in the following order: // [{var}, {ratio}, {trace}, {norm}, offset] // with one of the most discriminative being simply the variance. const double weights[5] = { -6682, -0.2056, 13087, -12434, 2.5694 };
+ show +
635
636
637
638
const float score = (float)(1.0 / (1 + exp(-(weights[0] * var + weights[1] * ratio + weights[2] * trace + weights[3] * norm + weights[4]))));
+ show +
639
640
641
642
643
644
645
646
647
648
flat_blocks[by * num_blocks_w + bx] = is_flat ? 255 : 0; scores[by * num_blocks_w + bx].score = var > kVarThreshold ? score : 0; scores[by * num_blocks_w + bx].index = by * num_blocks_w + bx; #ifdef NOISE_MODEL_LOG_SCORE fprintf(stderr, "%g %g %g %g %g %d ", score, var, ratio, trace, norm, is_flat); #endif num_flat += is_flat; } }

[CVE-2020-0470_1.diff] noise_model.c #3
+ lut->num_points = 0; + block_finder->A = NULL; + block_finder->AtA_inv = NULL; + - const float score = - (float)(1.0 / (1 + exp(-(weights[0] * var + weights[1] * ratio + - weights[2] * trace + weights[3] * norm + - weights[4])))); + double sum_weights = weights[0] * var + weights[1] * ratio + + weights[2] * trace + weights[3] * norm + + weights[4]; + // clamp the value to [-25.0, 100.0] to prevent overflow + sum_weights = fclamp(sum_weights, -25.0, 100.0); + const float score = (float)(1.0 / (1 + exp(-sum_weights)));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/noise_model.c
625
626
627
628
629
630
631
632
633
634
(ratio < kRatioThreshold) && (norm < kNormThreshold) && (var > kVarThreshold); // The following weights are used to combine the above features to give // a sigmoid score for flatness. If the input was normalized to [0,100] // the magnitude of these values would be close to 1 (e.g., weights // corresponding to variance would be a factor of 10000x smaller). // The weights are given in the following order: // [{var}, {ratio}, {trace}, {norm}, offset] // with one of the most discriminative being simply the variance. const double weights[5] = { -6682, -0.2056, 13087, -12434, 2.5694 };
+ show +
635
636
637
638
const float score = (float)(1.0 / (1 + exp(-(weights[0] * var + weights[1] * ratio + weights[2] * trace + weights[3] * norm + weights[4]))));
+ show +
639
640
641
642
643
644
645
646
647
648
flat_blocks[by * num_blocks_w + bx] = is_flat ? 255 : 0; scores[by * num_blocks_w + bx].score = var > kVarThreshold ? score : 0; scores[by * num_blocks_w + bx].index = by * num_blocks_w + bx; #ifdef NOISE_MODEL_LOG_SCORE fprintf(stderr, "%g %g %g %g %g %d ", score, var, ratio, trace, norm, is_flat); #endif num_flat += is_flat; } }

[CVE-2020-0478_1.diff] aom_dsp.cmake #5
- "${AOM_ROOT}/aom_dsp/bitreader.h" - "${AOM_ROOT}/aom_dsp/daalaboolreader.c" - "${AOM_ROOT}/aom_dsp/daalaboolreader.h" - "${AOM_ROOT}/aom_dsp/entdec.c" "${AOM_ROOT}/aom_dsp/entdec.h" + "${AOM_ROOT}/aom_dsp/bitreader.c" + "${AOM_ROOT}/aom_dsp/bitreader.h" "${AOM_ROOT}/aom_dsp/entdec.c" + "${AOM_ROOT}/aom_dsp/entdec.h"
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/aom_dsp.cmake
131
132
133
134
135
136
137
138
139
140
"${AOM_ROOT}/aom_dsp/mips/aom_convolve8_vert_msa.c" "${AOM_ROOT}/aom_dsp/mips/aom_convolve_copy_msa.c" "${AOM_ROOT}/aom_dsp/mips/aom_convolve_msa.h" "${AOM_ROOT}/aom_dsp/mips/intrapred_msa.c" "${AOM_ROOT}/aom_dsp/mips/macros_msa.h") if(CONFIG_AV1_DECODER) list(APPEND AOM_DSP_DECODER_SOURCES "${AOM_ROOT}/aom_dsp/binary_codes_reader.c" "${AOM_ROOT}/aom_dsp/binary_codes_reader.h"
+ show +
141
142
143
144
"${AOM_ROOT}/aom_dsp/bitreader.h" "${AOM_ROOT}/aom_dsp/daalaboolreader.c" "${AOM_ROOT}/aom_dsp/daalaboolreader.h" "${AOM_ROOT}/aom_dsp/entdec.c" "${AOM_ROOT}/aom_dsp/entdec.h"
+ show +
145
146
147
148
149
150
151
152
153
154
"${AOM_ROOT}/aom_dsp/grain_synthesis.c" "${AOM_ROOT}/aom_dsp/grain_synthesis.h") endif() if(CONFIG_AV1_ENCODER) list(APPEND AOM_DSP_ENCODER_SOURCES "${AOM_ROOT}/aom_dsp/binary_codes_writer.c" "${AOM_ROOT}/aom_dsp/binary_codes_writer.h" "${AOM_ROOT}/aom_dsp/bitwriter.h" "${AOM_ROOT}/aom_dsp/daalaboolwriter.c"

[CVE-2020-0470_1.diff] aom_dsp.cmake #5
- "${AOM_ROOT}/aom_dsp/bitreader.h" - "${AOM_ROOT}/aom_dsp/daalaboolreader.c" - "${AOM_ROOT}/aom_dsp/daalaboolreader.h" - "${AOM_ROOT}/aom_dsp/entdec.c" "${AOM_ROOT}/aom_dsp/entdec.h" + "${AOM_ROOT}/aom_dsp/bitreader.c" + "${AOM_ROOT}/aom_dsp/bitreader.h" "${AOM_ROOT}/aom_dsp/entdec.c" + "${AOM_ROOT}/aom_dsp/entdec.h"
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/aom_dsp.cmake
131
132
133
134
135
136
137
138
139
140
"${AOM_ROOT}/aom_dsp/mips/aom_convolve8_vert_msa.c" "${AOM_ROOT}/aom_dsp/mips/aom_convolve_copy_msa.c" "${AOM_ROOT}/aom_dsp/mips/aom_convolve_msa.h" "${AOM_ROOT}/aom_dsp/mips/intrapred_msa.c" "${AOM_ROOT}/aom_dsp/mips/macros_msa.h") if(CONFIG_AV1_DECODER) list(APPEND AOM_DSP_DECODER_SOURCES "${AOM_ROOT}/aom_dsp/binary_codes_reader.c" "${AOM_ROOT}/aom_dsp/binary_codes_reader.h"
+ show +
141
142
143
144
"${AOM_ROOT}/aom_dsp/bitreader.h" "${AOM_ROOT}/aom_dsp/daalaboolreader.c" "${AOM_ROOT}/aom_dsp/daalaboolreader.h" "${AOM_ROOT}/aom_dsp/entdec.c" "${AOM_ROOT}/aom_dsp/entdec.h"
+ show +
145
146
147
148
149
150
151
152
153
154
"${AOM_ROOT}/aom_dsp/grain_synthesis.c" "${AOM_ROOT}/aom_dsp/grain_synthesis.h") endif() if(CONFIG_AV1_ENCODER) list(APPEND AOM_DSP_ENCODER_SOURCES "${AOM_ROOT}/aom_dsp/binary_codes_writer.c" "${AOM_ROOT}/aom_dsp/binary_codes_writer.h" "${AOM_ROOT}/aom_dsp/bitwriter.h" "${AOM_ROOT}/aom_dsp/daalaboolwriter.c"

[CVE-2020-0478_1.diff] bitwriter_buffer.c #3
-static void aom_wb_write_primitive_refsubexpfin(struct aom_write_bit_buffer *wb, - uint16_t n, uint16_t k, - uint16_t ref, uint16_t v) { - aom_wb_write_primitive_subexpfin(wb, n, k, recenter_finite_nonneg(n, ref, v)); +static void wb_write_primitive_refsubexpfin(struct aom_write_bit_buffer *wb, + uint16_t n, uint16_t k, + uint16_t ref, uint16_t v) { + wb_write_primitive_subexpfin(wb, n, k, recenter_finite_nonneg(n, ref, v));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/bitwriter_buffer.c
119
120
121
122
123
124
125
126
127
128
i = i + 1; mk += a; } else { aom_wb_write_literal(wb, v - mk, b); break; } } } }
+ show +
129
130
131
132
static void aom_wb_write_primitive_refsubexpfin(struct aom_write_bit_buffer *wb, uint16_t n, uint16_t k, uint16_t ref, uint16_t v) { aom_wb_write_primitive_subexpfin(wb, n, k, recenter_finite_nonneg(n, ref, v));
+ show +
133
134
135
136
137
138
139
140
141
142
} void aom_wb_write_signed_primitive_refsubexpfin(struct aom_write_bit_buffer *wb, uint16_t n, uint16_t k, int16_t ref, int16_t v) { ref += n - 1; v += n - 1; const uint16_t scaled_n = (n << 1) - 1; aom_wb_write_primitive_refsubexpfin(wb, scaled_n, k, ref, v); }

[CVE-2020-0470_1.diff] bitwriter_buffer.c #3
-static void aom_wb_write_primitive_refsubexpfin(struct aom_write_bit_buffer *wb, - uint16_t n, uint16_t k, - uint16_t ref, uint16_t v) { - aom_wb_write_primitive_subexpfin(wb, n, k, recenter_finite_nonneg(n, ref, v)); +static void wb_write_primitive_refsubexpfin(struct aom_write_bit_buffer *wb, + uint16_t n, uint16_t k, + uint16_t ref, uint16_t v) { + wb_write_primitive_subexpfin(wb, n, k, recenter_finite_nonneg(n, ref, v));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/bitwriter_buffer.c
119
120
121
122
123
124
125
126
127
128
i = i + 1; mk += a; } else { aom_wb_write_literal(wb, v - mk, b); break; } } } }
+ show +
129
130
131
132
static void aom_wb_write_primitive_refsubexpfin(struct aom_write_bit_buffer *wb, uint16_t n, uint16_t k, uint16_t ref, uint16_t v) { aom_wb_write_primitive_subexpfin(wb, n, k, recenter_finite_nonneg(n, ref, v));
+ show +
133
134
135
136
137
138
139
140
141
142
} void aom_wb_write_signed_primitive_refsubexpfin(struct aom_write_bit_buffer *wb, uint16_t n, uint16_t k, int16_t ref, int16_t v) { ref += n - 1; v += n - 1; const uint16_t scaled_n = (n << 1) - 1; aom_wb_write_primitive_refsubexpfin(wb, scaled_n, k, ref, v); }

[CVE-2020-0478_1.diff] sad.c #1
+#endif // CONFIG_AV1_HIGHBITDEPTH -#define sadMxNx4D(m, n) \ - void aom_sad##m##x##n##x4d_c(const uint8_t *src, int src_stride, \ - const uint8_t *const ref_array[], \ - int ref_stride, uint32_t *sad_array) { \ - int i; \ - for (i = 0; i < 4; ++i) { \ - sad_array[i] = \ - aom_sad##m##x##n##_c(src, src_stride, ref_array[i], ref_stride); \ - } \ +#define sadMxNx4D(m, n) \ + void aom_sad##m##x##n##x4d_c(const uint8_t *src, int src_stride, \ + const uint8_t *const ref_array[], \ + int ref_stride, uint32_t *sad_array) { \ + int i; \ + for (i = 0; i < 4; ++i) { \ + sad_array[i] = \ + aom_sad##m##x##n##_c(src, src_stride, ref_array[i], ref_stride); \ + } \ + } \ + void aom_sad##m##x##n##x4d_avg_c( \ + const uint8_t *src, int src_stride, const uint8_t *const ref_array[], \ + int ref_stride, const uint8_t *second_pred, uint32_t *sad_array) { \ + int i; \ + for (i = 0; i < 4; ++i) { \ + sad_array[i] = aom_sad##m##x##n##_avg_c(src, src_stride, ref_array[i], \ + ref_stride, second_pred); \ + } \
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/sad.c
57
58
59
60
61
62
63
64
65
66
unsigned int aom_dist_wtd_sad##m##x##n##_avg_c( \ const uint8_t *src, int src_stride, const uint8_t *ref, int ref_stride, \ const uint8_t *second_pred, const DIST_WTD_COMP_PARAMS *jcp_param) { \ uint8_t comp_pred[m * n]; \ aom_dist_wtd_comp_avg_pred_c(comp_pred, second_pred, m, n, ref, \ ref_stride, jcp_param); \ return sad(src, src_stride, comp_pred, m, m, n); \ } // Calculate sad against 4 reference locations and store each in sad_array
+ show +
67
68
69
70
71
72
73
74
75
#define sadMxNx4D(m, n) \ void aom_sad##m##x##n##x4d_c(const uint8_t *src, int src_stride, \ const uint8_t *const ref_array[], \ int ref_stride, uint32_t *sad_array) { \ int i; \ for (i = 0; i < 4; ++i) { \ sad_array[i] = \ aom_sad##m##x##n##_c(src, src_stride, ref_array[i], ref_stride); \ } \
+ show +
76
77
78
79
80
81
82
83
84
85
} // 128x128 sadMxN(128, 128); sadMxNx4D(128, 128); // 128x64 sadMxN(128, 64); sadMxNx4D(128, 64);

[CVE-2020-0470_1.diff] sad.c #1
+#endif // CONFIG_AV1_HIGHBITDEPTH -#define sadMxNx4D(m, n) \ - void aom_sad##m##x##n##x4d_c(const uint8_t *src, int src_stride, \ - const uint8_t *const ref_array[], \ - int ref_stride, uint32_t *sad_array) { \ - int i; \ - for (i = 0; i < 4; ++i) { \ - sad_array[i] = \ - aom_sad##m##x##n##_c(src, src_stride, ref_array[i], ref_stride); \ - } \ +#define sadMxNx4D(m, n) \ + void aom_sad##m##x##n##x4d_c(const uint8_t *src, int src_stride, \ + const uint8_t *const ref_array[], \ + int ref_stride, uint32_t *sad_array) { \ + int i; \ + for (i = 0; i < 4; ++i) { \ + sad_array[i] = \ + aom_sad##m##x##n##_c(src, src_stride, ref_array[i], ref_stride); \ + } \ + } \ + void aom_sad##m##x##n##x4d_avg_c( \ + const uint8_t *src, int src_stride, const uint8_t *const ref_array[], \ + int ref_stride, const uint8_t *second_pred, uint32_t *sad_array) { \ + int i; \ + for (i = 0; i < 4; ++i) { \ + sad_array[i] = aom_sad##m##x##n##_avg_c(src, src_stride, ref_array[i], \ + ref_stride, second_pred); \ + } \
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/sad.c
57
58
59
60
61
62
63
64
65
66
unsigned int aom_dist_wtd_sad##m##x##n##_avg_c( \ const uint8_t *src, int src_stride, const uint8_t *ref, int ref_stride, \ const uint8_t *second_pred, const DIST_WTD_COMP_PARAMS *jcp_param) { \ uint8_t comp_pred[m * n]; \ aom_dist_wtd_comp_avg_pred_c(comp_pred, second_pred, m, n, ref, \ ref_stride, jcp_param); \ return sad(src, src_stride, comp_pred, m, m, n); \ } // Calculate sad against 4 reference locations and store each in sad_array
+ show +
67
68
69
70
71
72
73
74
75
#define sadMxNx4D(m, n) \ void aom_sad##m##x##n##x4d_c(const uint8_t *src, int src_stride, \ const uint8_t *const ref_array[], \ int ref_stride, uint32_t *sad_array) { \ int i; \ for (i = 0; i < 4; ++i) { \ sad_array[i] = \ aom_sad##m##x##n##_c(src, src_stride, ref_array[i], ref_stride); \ } \
+ show +
76
77
78
79
80
81
82
83
84
85
} // 128x128 sadMxN(128, 128); sadMxNx4D(128, 128); // 128x64 sadMxN(128, 64); sadMxNx4D(128, 64);

[CVE-2020-0478_1.diff] bitwriter.h #3
-static INLINE void aom_start_encode(aom_writer *bc, uint8_t *buffer) { - aom_daala_start_encode(bc, buffer); -} +void aom_start_encode(aom_writer *w, uint8_t *buffer); -static INLINE int aom_stop_encode(aom_writer *bc) { - return aom_daala_stop_encode(bc); -} +int aom_stop_encode(aom_writer *w); -static INLINE void aom_write(aom_writer *br, int bit, int probability) { - aom_daala_write(br, bit, probability); +static INLINE void aom_write(aom_writer *w, int bit, int probability) { + int p = (0x7FFFFF - (probability << 15) + probability) >> 8; +#if CONFIG_BITSTREAM_DEBUG + aom_cdf_prob cdf[2] = { (aom_cdf_prob)p, 32767 }; + /*int queue_r = 0; + int frame_idx_r = 0; + int queue_w = bitstream_queue_get_write(); + int frame_idx_w = aom_bitstream_queue_get_frame_writee(); + if (frame_idx_w == frame_idx_r && queue_w == queue_r) { + fprintf(stderr, "\n *** bitstream queue at frame_idx_w %d queue_w %d\n", + frame_idx_w, queue_w); + }*/ + bitstream_queue_push(bit, cdf, 2); +#endif + + od_ec_encode_bool_q15(&w->ec, bit, p);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/bitwriter.h
42
43
44
45
46
47
48
49
50
51
int r, c; for (r = 0; r < TXB_COEFF_COST_MAP_SIZE; ++r) { for (c = 0; c < TXB_COEFF_COST_MAP_SIZE; ++c) { token_stats->txb_coeff_cost_map[r][c] = 0; } } #endif token_stats->cost = 0; }
+ show +
52
53
54
55
56
57
58
59
60
61
static INLINE void aom_start_encode(aom_writer *bc, uint8_t *buffer) { aom_daala_start_encode(bc, buffer); } static INLINE int aom_stop_encode(aom_writer *bc) { return aom_daala_stop_encode(bc); } static INLINE void aom_write(aom_writer *br, int bit, int probability) { aom_daala_write(br, bit, probability);
+ show +
62
63
64
65
66
67
68
69
70
71
} static INLINE void aom_write_bit(aom_writer *w, int bit) { aom_write(w, bit, 128); // aom_prob_half } static INLINE void aom_write_literal(aom_writer *w, int data, int bits) { int bit; for (bit = bits - 1; bit >= 0; bit--) aom_write_bit(w, 1 & (data >> bit));

[CVE-2020-0470_1.diff] bitwriter.h #3
-static INLINE void aom_start_encode(aom_writer *bc, uint8_t *buffer) { - aom_daala_start_encode(bc, buffer); -} +void aom_start_encode(aom_writer *w, uint8_t *buffer); -static INLINE int aom_stop_encode(aom_writer *bc) { - return aom_daala_stop_encode(bc); -} +int aom_stop_encode(aom_writer *w); -static INLINE void aom_write(aom_writer *br, int bit, int probability) { - aom_daala_write(br, bit, probability); +static INLINE void aom_write(aom_writer *w, int bit, int probability) { + int p = (0x7FFFFF - (probability << 15) + probability) >> 8; +#if CONFIG_BITSTREAM_DEBUG + aom_cdf_prob cdf[2] = { (aom_cdf_prob)p, 32767 }; + /*int queue_r = 0; + int frame_idx_r = 0; + int queue_w = bitstream_queue_get_write(); + int frame_idx_w = aom_bitstream_queue_get_frame_writee(); + if (frame_idx_w == frame_idx_r && queue_w == queue_r) { + fprintf(stderr, "\n *** bitstream queue at frame_idx_w %d queue_w %d\n", + frame_idx_w, queue_w); + }*/ + bitstream_queue_push(bit, cdf, 2); +#endif + + od_ec_encode_bool_q15(&w->ec, bit, p);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/bitwriter.h
42
43
44
45
46
47
48
49
50
51
int r, c; for (r = 0; r < TXB_COEFF_COST_MAP_SIZE; ++r) { for (c = 0; c < TXB_COEFF_COST_MAP_SIZE; ++c) { token_stats->txb_coeff_cost_map[r][c] = 0; } } #endif token_stats->cost = 0; }
+ show +
52
53
54
55
56
57
58
59
60
61
static INLINE void aom_start_encode(aom_writer *bc, uint8_t *buffer) { aom_daala_start_encode(bc, buffer); } static INLINE int aom_stop_encode(aom_writer *bc) { return aom_daala_stop_encode(bc); } static INLINE void aom_write(aom_writer *br, int bit, int probability) { aom_daala_write(br, bit, probability);
+ show +
62
63
64
65
66
67
68
69
70
71
} static INLINE void aom_write_bit(aom_writer *w, int bit) { aom_write(w, bit, 128); // aom_prob_half } static INLINE void aom_write_literal(aom_writer *w, int data, int bits) { int bit; for (bit = bits - 1; bit >= 0; bit--) aom_write_bit(w, 1 & (data >> bit));

[CVE-2020-0478_1.diff] v256_intrinsics_v128.h #4
-#define v256_shr_n_byte(a, n) \ - ((n) < 16 ? v256_from_v128(v128_shr_n_byte(a.val[1], n), \ - v128_or(v128_shr_n_byte(a.val[0], n), \ - v128_shl_n_byte(a.val[1], 16 - (n)))) \ - : v256_from_v128( \ - v128_zero(), \ - (n) > 16 ? v128_shr_n_byte(a.val[1], (n)-16) : a.val[1])) +#define v256_shr_n_byte(a, n) \ + (n == 0 \ + ? a \ + : ((n) < 16 \ + ? v256_from_v128(v128_shr_n_byte(a.val[1], n), \ + v128_or(v128_shr_n_byte(a.val[0], n), \ + v128_shl_n_byte(a.val[1], 16 - (n)))) \ + : v256_from_v128( \ + v128_zero(), \ + (n) > 16 ? v128_shr_n_byte(a.val[1], (n)-16) : a.val[1])))
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/simd/v256_intrinsics_v128.h
773
774
775
776
777
778
779
780
781
782
/* These intrinsics require immediate values, so we must use #defines to enforce that. */ #define v256_shl_n_byte(a, n) \ ((n) < 16 ? v256_from_v128(v128_or(v128_shl_n_byte(a.val[1], n), \ v128_shr_n_byte(a.val[0], 16 - (n))), \ v128_shl_n_byte(a.val[0], (n))) \ : v256_from_v128( \ (n) > 16 ? v128_shl_n_byte(a.val[0], (n)-16) : a.val[0], \ v128_zero()))
+ show +
783
784
785
786
787
788
789
#define v256_shr_n_byte(a, n) \ ((n) < 16 ? v256_from_v128(v128_shr_n_byte(a.val[1], n), \ v128_or(v128_shr_n_byte(a.val[0], n), \ v128_shl_n_byte(a.val[1], 16 - (n)))) \ : v256_from_v128( \ v128_zero(), \ (n) > 16 ? v128_shr_n_byte(a.val[1], (n)-16) : a.val[1]))
+ show +
790
791
792
793
794
795
796
797
798
799
#define v256_align(a, b, c) \ ((c) ? v256_or(v256_shr_n_byte(b, c), v256_shl_n_byte(a, 32 - (c))) : b) #define v256_shl_n_8(a, n) \ v256_from_v128(v128_shl_n_8(a.val[1], n), v128_shl_n_8(a.val[0], n)) #define v256_shl_n_16(a, n) \ v256_from_v128(v128_shl_n_16(a.val[1], n), v128_shl_n_16(a.val[0], n)) #define v256_shl_n_32(a, n) \ v256_from_v128(v128_shl_n_32(a.val[1], n), v128_shl_n_32(a.val[0], n))

[CVE-2020-0470_1.diff] v256_intrinsics_v128.h #4
-#define v256_shr_n_byte(a, n) \ - ((n) < 16 ? v256_from_v128(v128_shr_n_byte(a.val[1], n), \ - v128_or(v128_shr_n_byte(a.val[0], n), \ - v128_shl_n_byte(a.val[1], 16 - (n)))) \ - : v256_from_v128( \ - v128_zero(), \ - (n) > 16 ? v128_shr_n_byte(a.val[1], (n)-16) : a.val[1])) +#define v256_shr_n_byte(a, n) \ + (n == 0 \ + ? a \ + : ((n) < 16 \ + ? v256_from_v128(v128_shr_n_byte(a.val[1], n), \ + v128_or(v128_shr_n_byte(a.val[0], n), \ + v128_shl_n_byte(a.val[1], 16 - (n)))) \ + : v256_from_v128( \ + v128_zero(), \ + (n) > 16 ? v128_shr_n_byte(a.val[1], (n)-16) : a.val[1])))
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/simd/v256_intrinsics_v128.h
773
774
775
776
777
778
779
780
781
782
/* These intrinsics require immediate values, so we must use #defines to enforce that. */ #define v256_shl_n_byte(a, n) \ ((n) < 16 ? v256_from_v128(v128_or(v128_shl_n_byte(a.val[1], n), \ v128_shr_n_byte(a.val[0], 16 - (n))), \ v128_shl_n_byte(a.val[0], (n))) \ : v256_from_v128( \ (n) > 16 ? v128_shl_n_byte(a.val[0], (n)-16) : a.val[0], \ v128_zero()))
+ show +
783
784
785
786
787
788
789
#define v256_shr_n_byte(a, n) \ ((n) < 16 ? v256_from_v128(v128_shr_n_byte(a.val[1], n), \ v128_or(v128_shr_n_byte(a.val[0], n), \ v128_shl_n_byte(a.val[1], 16 - (n)))) \ : v256_from_v128( \ v128_zero(), \ (n) > 16 ? v128_shr_n_byte(a.val[1], (n)-16) : a.val[1]))
+ show +
790
791
792
793
794
795
796
797
798
799
#define v256_align(a, b, c) \ ((c) ? v256_or(v256_shr_n_byte(b, c), v256_shl_n_byte(a, 32 - (c))) : b) #define v256_shl_n_8(a, n) \ v256_from_v128(v128_shl_n_8(a.val[1], n), v128_shl_n_8(a.val[0], n)) #define v256_shl_n_16(a, n) \ v256_from_v128(v128_shl_n_16(a.val[1], n), v128_shl_n_16(a.val[0], n)) #define v256_shl_n_32(a, n) \ v256_from_v128(v128_shl_n_32(a.val[1], n), v128_shl_n_32(a.val[0], n))

[CVE-2020-0478_1.diff] v64_intrinsics_c.h #6
- t.u8[7] = a.s16[3] > 127 ? 127 : a.s16[3] < -128 ? 128 : a.s16[3]; - t.u8[6] = a.s16[2] > 127 ? 127 : a.s16[2] < -128 ? 128 : a.s16[2]; - t.u8[5] = a.s16[1] > 127 ? 127 : a.s16[1] < -128 ? 128 : a.s16[1]; - t.u8[4] = a.s16[0] > 127 ? 127 : a.s16[0] < -128 ? 128 : a.s16[0]; - t.u8[3] = b.s16[3] > 127 ? 127 : b.s16[3] < -128 ? 128 : b.s16[3]; - t.u8[2] = b.s16[2] > 127 ? 127 : b.s16[2] < -128 ? 128 : b.s16[2]; - t.u8[1] = b.s16[1] > 127 ? 127 : b.s16[1] < -128 ? 128 : b.s16[1]; - t.u8[0] = b.s16[0] > 127 ? 127 : b.s16[0] < -128 ? 128 : b.s16[0]; + t.u8[7] = (uint8_t)(a.s16[3] > 127 ? 127 : a.s16[3] < -128 ? 128 : a.s16[3]); + t.u8[6] = (uint8_t)(a.s16[2] > 127 ? 127 : a.s16[2] < -128 ? 128 : a.s16[2]); + t.u8[5] = (uint8_t)(a.s16[1] > 127 ? 127 : a.s16[1] < -128 ? 128 : a.s16[1]); + t.u8[4] = (uint8_t)(a.s16[0] > 127 ? 127 : a.s16[0] < -128 ? 128 : a.s16[0]); + t.u8[3] = (uint8_t)(b.s16[3] > 127 ? 127 : b.s16[3] < -128 ? 128 : b.s16[3]); + t.u8[2] = (uint8_t)(b.s16[2] > 127 ? 127 : b.s16[2] < -128 ? 128 : b.s16[2]); + t.u8[1] = (uint8_t)(b.s16[1] > 127 ? 127 : b.s16[1] < -128 ? 128 : b.s16[1]); + t.u8[0] = (uint8_t)(b.s16[0] > 127 ? 127 : b.s16[0] < -128 ? 128 : b.s16[0]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/simd/v64_intrinsics_c.h
519
520
521
522
523
524
525
526
527
528
return t; } SIMD_INLINE c_v64 c_v64_pack_s16_s8(c_v64 a, c_v64 b) { c_v64 t; if (CONFIG_BIG_ENDIAN) { c_v64 u = a; a = b; b = u; }
+ show +
529
530
531
532
533
534
535
536
t.u8[7] = a.s16[3] > 127 ? 127 : a.s16[3] < -128 ? 128 : a.s16[3]; t.u8[6] = a.s16[2] > 127 ? 127 : a.s16[2] < -128 ? 128 : a.s16[2]; t.u8[5] = a.s16[1] > 127 ? 127 : a.s16[1] < -128 ? 128 : a.s16[1]; t.u8[4] = a.s16[0] > 127 ? 127 : a.s16[0] < -128 ? 128 : a.s16[0]; t.u8[3] = b.s16[3] > 127 ? 127 : b.s16[3] < -128 ? 128 : b.s16[3]; t.u8[2] = b.s16[2] > 127 ? 127 : b.s16[2] < -128 ? 128 : b.s16[2]; t.u8[1] = b.s16[1] > 127 ? 127 : b.s16[1] < -128 ? 128 : b.s16[1]; t.u8[0] = b.s16[0] > 127 ? 127 : b.s16[0] < -128 ? 128 : b.s16[0];
+ show +
537
538
539
540
541
542
543
544
545
546
return t; } SIMD_INLINE c_v64 c_v64_unpacklo_u16_s32(c_v64 a) { c_v64 t; t.s32[1] = a.u16[1 + !!CONFIG_BIG_ENDIAN * 2]; t.s32[0] = a.u16[0 + !!CONFIG_BIG_ENDIAN * 2]; return t; }

[CVE-2020-0470_1.diff] v64_intrinsics_c.h #6
- t.u8[7] = a.s16[3] > 127 ? 127 : a.s16[3] < -128 ? 128 : a.s16[3]; - t.u8[6] = a.s16[2] > 127 ? 127 : a.s16[2] < -128 ? 128 : a.s16[2]; - t.u8[5] = a.s16[1] > 127 ? 127 : a.s16[1] < -128 ? 128 : a.s16[1]; - t.u8[4] = a.s16[0] > 127 ? 127 : a.s16[0] < -128 ? 128 : a.s16[0]; - t.u8[3] = b.s16[3] > 127 ? 127 : b.s16[3] < -128 ? 128 : b.s16[3]; - t.u8[2] = b.s16[2] > 127 ? 127 : b.s16[2] < -128 ? 128 : b.s16[2]; - t.u8[1] = b.s16[1] > 127 ? 127 : b.s16[1] < -128 ? 128 : b.s16[1]; - t.u8[0] = b.s16[0] > 127 ? 127 : b.s16[0] < -128 ? 128 : b.s16[0]; + t.u8[7] = (uint8_t)(a.s16[3] > 127 ? 127 : a.s16[3] < -128 ? 128 : a.s16[3]); + t.u8[6] = (uint8_t)(a.s16[2] > 127 ? 127 : a.s16[2] < -128 ? 128 : a.s16[2]); + t.u8[5] = (uint8_t)(a.s16[1] > 127 ? 127 : a.s16[1] < -128 ? 128 : a.s16[1]); + t.u8[4] = (uint8_t)(a.s16[0] > 127 ? 127 : a.s16[0] < -128 ? 128 : a.s16[0]); + t.u8[3] = (uint8_t)(b.s16[3] > 127 ? 127 : b.s16[3] < -128 ? 128 : b.s16[3]); + t.u8[2] = (uint8_t)(b.s16[2] > 127 ? 127 : b.s16[2] < -128 ? 128 : b.s16[2]); + t.u8[1] = (uint8_t)(b.s16[1] > 127 ? 127 : b.s16[1] < -128 ? 128 : b.s16[1]); + t.u8[0] = (uint8_t)(b.s16[0] > 127 ? 127 : b.s16[0] < -128 ? 128 : b.s16[0]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/simd/v64_intrinsics_c.h
519
520
521
522
523
524
525
526
527
528
return t; } SIMD_INLINE c_v64 c_v64_pack_s16_s8(c_v64 a, c_v64 b) { c_v64 t; if (CONFIG_BIG_ENDIAN) { c_v64 u = a; a = b; b = u; }
+ show +
529
530
531
532
533
534
535
536
t.u8[7] = a.s16[3] > 127 ? 127 : a.s16[3] < -128 ? 128 : a.s16[3]; t.u8[6] = a.s16[2] > 127 ? 127 : a.s16[2] < -128 ? 128 : a.s16[2]; t.u8[5] = a.s16[1] > 127 ? 127 : a.s16[1] < -128 ? 128 : a.s16[1]; t.u8[4] = a.s16[0] > 127 ? 127 : a.s16[0] < -128 ? 128 : a.s16[0]; t.u8[3] = b.s16[3] > 127 ? 127 : b.s16[3] < -128 ? 128 : b.s16[3]; t.u8[2] = b.s16[2] > 127 ? 127 : b.s16[2] < -128 ? 128 : b.s16[2]; t.u8[1] = b.s16[1] > 127 ? 127 : b.s16[1] < -128 ? 128 : b.s16[1]; t.u8[0] = b.s16[0] > 127 ? 127 : b.s16[0] < -128 ? 128 : b.s16[0];
+ show +
537
538
539
540
541
542
543
544
545
546
return t; } SIMD_INLINE c_v64 c_v64_unpacklo_u16_s32(c_v64 a) { c_v64 t; t.s32[1] = a.u16[1 + !!CONFIG_BIG_ENDIAN * 2]; t.s32[0] = a.u16[0 + !!CONFIG_BIG_ENDIAN * 2]; return t; }

[CVE-2020-0478_1.diff] variance_neon.c #1
- +#include "aom_dsp/arm/sum_neon.h" -static INLINE int horizontal_add_s16x8(const int16x8_t v_16x8) { - const int32x4_t a = vpaddlq_s16(v_16x8); - const int64x2_t b = vpaddlq_s32(a); - const int32x2_t c = vadd_s32(vreinterpret_s32_s64(vget_low_s64(b)), - vreinterpret_s32_s64(vget_high_s64(b))); - return vget_lane_s32(c, 0); -} - -static INLINE int horizontal_add_s32x4(const int32x4_t v_32x4) { - const int64x2_t b = vpaddlq_s32(v_32x4); - const int32x2_t c = vadd_s32(vreinterpret_s32_s64(vget_low_s64(b)), - vreinterpret_s32_s64(vget_high_s64(b))); - return vget_lane_s32(c, 0); -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/arm/variance_neon.c
10
11
12
13
14
15
16
17
18
19
*/ #include <arm_neon.h> #include "config/aom_dsp_rtcd.h" #include "config/aom_config.h" #include "aom/aom_integer.h" #include "aom_ports/mem.h"
+ show +
20
21
22
23
24
25
26
27
28
29
30
31
32
static INLINE int horizontal_add_s16x8(const int16x8_t v_16x8) { const int32x4_t a = vpaddlq_s16(v_16x8); const int64x2_t b = vpaddlq_s32(a); const int32x2_t c = vadd_s32(vreinterpret_s32_s64(vget_low_s64(b)), vreinterpret_s32_s64(vget_high_s64(b))); return vget_lane_s32(c, 0); } static INLINE int horizontal_add_s32x4(const int32x4_t v_32x4) { const int64x2_t b = vpaddlq_s32(v_32x4); const int32x2_t c = vadd_s32(vreinterpret_s32_s64(vget_low_s64(b)), vreinterpret_s32_s64(vget_high_s64(b))); return vget_lane_s32(c, 0);
+ show +
33
34
35
36
37
38
39
40
41
42
} // w * h must be less than 2048 or local variable v_sum may overflow. static void variance_neon_w8(const uint8_t *a, int a_stride, const uint8_t *b, int b_stride, int w, int h, uint32_t *sse, int *sum) { int i, j; int16x8_t v_sum = vdupq_n_s16(0); int32x4_t v_sse_lo = vdupq_n_s32(0); int32x4_t v_sse_hi = vdupq_n_s32(0);

[CVE-2020-0470_1.diff] variance_neon.c #1
- +#include "aom_dsp/arm/sum_neon.h" -static INLINE int horizontal_add_s16x8(const int16x8_t v_16x8) { - const int32x4_t a = vpaddlq_s16(v_16x8); - const int64x2_t b = vpaddlq_s32(a); - const int32x2_t c = vadd_s32(vreinterpret_s32_s64(vget_low_s64(b)), - vreinterpret_s32_s64(vget_high_s64(b))); - return vget_lane_s32(c, 0); -} - -static INLINE int horizontal_add_s32x4(const int32x4_t v_32x4) { - const int64x2_t b = vpaddlq_s32(v_32x4); - const int32x2_t c = vadd_s32(vreinterpret_s32_s64(vget_low_s64(b)), - vreinterpret_s32_s64(vget_high_s64(b))); - return vget_lane_s32(c, 0); -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/arm/variance_neon.c
10
11
12
13
14
15
16
17
18
19
*/ #include <arm_neon.h> #include "config/aom_dsp_rtcd.h" #include "config/aom_config.h" #include "aom/aom_integer.h" #include "aom_ports/mem.h"
+ show +
20
21
22
23
24
25
26
27
28
29
30
31
32
static INLINE int horizontal_add_s16x8(const int16x8_t v_16x8) { const int32x4_t a = vpaddlq_s16(v_16x8); const int64x2_t b = vpaddlq_s32(a); const int32x2_t c = vadd_s32(vreinterpret_s32_s64(vget_low_s64(b)), vreinterpret_s32_s64(vget_high_s64(b))); return vget_lane_s32(c, 0); } static INLINE int horizontal_add_s32x4(const int32x4_t v_32x4) { const int64x2_t b = vpaddlq_s32(v_32x4); const int32x2_t c = vadd_s32(vreinterpret_s32_s64(vget_low_s64(b)), vreinterpret_s32_s64(vget_high_s64(b))); return vget_lane_s32(c, 0);
+ show +
33
34
35
36
37
38
39
40
41
42
} // w * h must be less than 2048 or local variable v_sum may overflow. static void variance_neon_w8(const uint8_t *a, int a_stride, const uint8_t *b, int b_stride, int w, int h, uint32_t *sse, int *sum) { int i, j; int16x8_t v_sum = vdupq_n_s16(0); int32x4_t v_sse_lo = vdupq_n_s32(0); int32x4_t v_sse_hi = vdupq_n_s32(0);

[CVE-2020-0478_1.diff] intrapred_avx2.c #3
+#include "aom_dsp/x86/intrapred_x86.h" +static DECLARE_ALIGNED(16, uint8_t, HighbdLoadMaskx[8][16]) = { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, + { 0, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 }, + { 0, 1, 0, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, + { 0, 1, 0, 1, 0, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, + { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 3, 4, 5, 6, 7 }, + { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 3, 4, 5 }, + { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 3 }, + { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 }, +}; + +static DECLARE_ALIGNED(16, uint8_t, HighbdEvenOddMaskx4[4][16]) = { + { 0, 1, 4, 5, 8, 9, 12, 13, 2, 3, 6, 7, 10, 11, 14, 15 }, + { 0, 1, 2, 3, 6, 7, 10, 11, 14, 15, 4, 5, 8, 9, 12, 13 }, + { 0, 1, 0, 1, 4, 5, 8, 9, 12, 13, 0, 1, 6, 7, 10, 11 }, + { 0, 1, 0, 1, 0, 1, 6, 7, 10, 11, 14, 15, 0, 1, 8, 9 } +}; + +static DECLARE_ALIGNED(16, uint8_t, HighbdEvenOddMaskx[8][32]) = { + { 0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29, + 2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31 }, + { 0, 1, 2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, + 0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29 }, + { 0, 1, 0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, + 0, 1, 0, 1, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27 }, + { 0, 1, 0, 1, 0, 1, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, + 0, 1, 0, 1, 0, 1, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25 }, + { 0, 1, 0, 1, 0, 1, 0, 1, 8, 9, 12, 13, 16, 17, 20, 21, + 0, 1, 0, 1, 0, 1, 0, 1, 10, 11, 14, 15, 18, 19, 22, 23 }, + { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 10, 11, 14, 15, 18, 19, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 12, 13, 16, 17, 20, 21 }, + { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 12, 13, 16, 17, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 14, 15, 18, 19 }, + { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 14, 15, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 16, 17 } +}; + +static DECLARE_ALIGNED(32, uint16_t, HighbdBaseMask[17][16]) = { + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0xffff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0xffff, 0xffff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0, 0, 0, 0, 0, 0, 0, + 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0, 0, 0, 0, + 0, 0, 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0, + 0, 0, 0, 0, 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0, 0, 0, 0, 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0, 0, 0, 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0, 0, 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0, 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff } +}; + - -// TODO(luoyi) The following two functions are shared with intrapred_sse2.c. -// Use a header file, intrapred_common_x86.h -static INLINE __m128i dc_sum_16_sse2(const uint8_t *ref) { - __m128i x = _mm_load_si128((__m128i const *)ref); - const __m128i zero = _mm_setzero_si128(); - x = _mm_sad_epu8(x, zero); - const __m128i high = _mm_unpackhi_epi64(x, x); - return _mm_add_epi16(x, high); -} - -static INLINE __m128i dc_sum_32_sse2(const uint8_t *ref) { - __m128i x0 = _mm_load_si128((__m128i const *)ref); - __m128i x1 = _mm_load_si128((__m128i const *)(ref + 16)); - const __m128i zero = _mm_setzero_si128(); - x0 = _mm_sad_epu8(x0, zero); - x1 = _mm_sad_epu8(x1, zero); - x0 = _mm_add_epi16(x0, x1); - const __m128i high = _mm_unpackhi_epi64(x0, x0); - return _mm_add_epi16(x0, high); -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
347
348
349
350
351
352
353
354
355
356
v = _mm256_unpackhi_epi8(u, u); h_predictor_32x8line(&v, dst, stride); } // ----------------------------------------------------------------------------- // Rectangle // TODO(luoyi) The following two functions are shared with intrapred_sse2.c. // Use a header file, intrapred_common_x86.h
+ show +
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
static INLINE __m128i dc_sum_16_sse2(const uint8_t *ref) { __m128i x = _mm_load_si128((__m128i const *)ref); const __m128i zero = _mm_setzero_si128(); x = _mm_sad_epu8(x, zero); const __m128i high = _mm_unpackhi_epi64(x, x); return _mm_add_epi16(x, high); } static INLINE __m128i dc_sum_32_sse2(const uint8_t *ref) { __m128i x0 = _mm_load_si128((__m128i const *)ref); __m128i x1 = _mm_load_si128((__m128i const *)(ref + 16)); const __m128i zero = _mm_setzero_si128(); x0 = _mm_sad_epu8(x0, zero); x1 = _mm_sad_epu8(x1, zero); x0 = _mm_add_epi16(x0, x1); const __m128i high = _mm_unpackhi_epi64(x0, x0); return _mm_add_epi16(x0, high);
+ show +
374
375
376
377
378
379
380
381
382
383
} void aom_dc_predictor_32x16_avx2(uint8_t *dst, ptrdiff_t stride, const uint8_t *above, const uint8_t *left) { const __m128i top_sum = dc_sum_32_sse2(above); __m128i left_sum = dc_sum_16_sse2(left); left_sum = _mm_add_epi16(top_sum, left_sum); uint16_t sum = _mm_cvtsi128_si32(left_sum); sum += 24; sum /= 48;

[CVE-2020-0478_1.diff] intrapred_avx2.c #37
+ a0_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift)); - a0_x128 = _mm_setr_epi16( - above[base_x + HighbdEvenOddMaskx8_2[base_shift][0]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][1]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][2]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][3]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][4]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][5]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][6]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][7]]); - a1_x128 = _mm_setr_epi16( - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][0]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][1]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][2]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][3]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][4]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][5]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][6]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][7]]); + __m128i mask, atmp0, atmp1, atmp2, atmp3; + a1_x128 = _mm_loadu_si128((__m128i *)(above + base_x + 8 + base_shift)); + atmp0 = _mm_shuffle_epi8(a0_x128, + *(__m128i *)HighbdEvenOddMaskx[base_shift]); + atmp1 = _mm_shuffle_epi8(a1_x128, + *(__m128i *)HighbdEvenOddMaskx[base_shift]); + atmp2 = _mm_shuffle_epi8( + a0_x128, *(__m128i *)(HighbdEvenOddMaskx[base_shift] + 16)); + atmp3 = _mm_shuffle_epi8( + a1_x128, *(__m128i *)(HighbdEvenOddMaskx[base_shift] + 16)); + mask = _mm_cmpgt_epi8(*(__m128i *)HighbdEvenOddMaskx[base_shift], + _mm_set1_epi8(15)); + a0_x128 = _mm_blendv_epi8(atmp0, atmp1, mask); + mask = _mm_cmpgt_epi8(*(__m128i *)(HighbdEvenOddMaskx[base_shift] + 16), + _mm_set1_epi8(15)); + a1_x128 = _mm_blendv_epi8(atmp2, atmp3, mask);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
if (base_min_diff > 8) { base_min_diff = 8; } else { if (base_min_diff < 0) base_min_diff = 0; } if (base_shift > 7) { resx = _mm_setzero_si128(); } else { if (upsample_above) {
+ show +
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
a0_x128 = _mm_setr_epi16( above[base_x + HighbdEvenOddMaskx8_2[base_shift][0]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][1]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][2]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][3]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][4]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][5]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][6]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][7]]); a1_x128 = _mm_setr_epi16( above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][0]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][1]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][2]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][3]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][4]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][5]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][6]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][7]]);
+ show +
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
shift = _mm256_srli_epi32( _mm256_and_si256( _mm256_slli_epi32( _mm256_setr_epi32(-y * dx, (1 << 6) - y * dx, (2 << 6) - y * dx, (3 << 6) - y * dx, (4 << 6) - y * dx, (5 << 6) - y * dx, (6 << 6) - y * dx, (7 << 6) - y * dx), upsample_above), c3f), 1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
} else { if (base_min_diff < 0) base_min_diff = 0; } if (base_shift > 7) { a0_x = _mm256_setzero_si256(); a1_x = _mm256_setzero_si256(); shift = _mm256_setzero_si256(); } else { if (upsample_above) {
+ show +
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
a0_x128 = _mm_setr_epi16( above[base_x + HighbdEvenOddMaskx8_2[base_shift][0]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][1]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][2]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][3]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][4]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][5]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][6]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][7]]); a1_x128 = _mm_setr_epi16( above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][0]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][1]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][2]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][3]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][4]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][5]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][6]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][7]]);
+ show +
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
shift = _mm256_castsi128_si256(_mm_srli_epi16( _mm_and_si128( _mm_slli_epi16( _mm_setr_epi16(-y * dx, (1 << 6) - y * dx, (2 << 6) - y * dx, (3 << 6) - y * dx, (4 << 6) - y * dx, (5 << 6) - y * dx, (6 << 6) - y * dx, (7 << 6) - y * dx), upsample_above), c3f), 1));

[CVE-2020-0478_1.diff] intrapred_avx2.c #42
+ a0_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift)); - a0_x128 = _mm_setr_epi16( - above[base_x + HighbdEvenOddMaskx8_2[base_shift][0]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][1]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][2]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][3]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][4]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][5]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][6]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][7]]); - a1_x128 = _mm_setr_epi16( - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][0]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][1]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][2]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][3]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][4]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][5]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][6]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][7]]); + __m128i mask, atmp0, atmp1, atmp2, atmp3; + a1_x128 = _mm_loadu_si128((__m128i *)(above + base_x + 8 + base_shift)); + atmp0 = _mm_shuffle_epi8(a0_x128, + *(__m128i *)HighbdEvenOddMaskx[base_shift]); + atmp1 = _mm_shuffle_epi8(a1_x128, + *(__m128i *)HighbdEvenOddMaskx[base_shift]); + atmp2 = _mm_shuffle_epi8( + a0_x128, *(__m128i *)(HighbdEvenOddMaskx[base_shift] + 16)); + atmp3 = _mm_shuffle_epi8( + a1_x128, *(__m128i *)(HighbdEvenOddMaskx[base_shift] + 16)); + mask = _mm_cmpgt_epi8(*(__m128i *)HighbdEvenOddMaskx[base_shift], + _mm_set1_epi8(15)); + a0_x128 = _mm_blendv_epi8(atmp0, atmp1, mask); + mask = _mm_cmpgt_epi8(*(__m128i *)(HighbdEvenOddMaskx[base_shift] + 16), + _mm_set1_epi8(15)); + a1_x128 = _mm_blendv_epi8(atmp2, atmp3, mask); +
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
if (base_min_diff > 8) { base_min_diff = 8; } else { if (base_min_diff < 0) base_min_diff = 0; } if (base_shift > 7) { resx = _mm_setzero_si128(); } else { if (upsample_above) {
+ show +
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
a0_x128 = _mm_setr_epi16( above[base_x + HighbdEvenOddMaskx8_2[base_shift][0]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][1]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][2]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][3]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][4]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][5]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][6]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][7]]); a1_x128 = _mm_setr_epi16( above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][0]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][1]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][2]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][3]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][4]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][5]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][6]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][7]]);
+ show +
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
shift = _mm256_srli_epi32( _mm256_and_si256( _mm256_slli_epi32( _mm256_setr_epi32(-y * dx, (1 << 6) - y * dx, (2 << 6) - y * dx, (3 << 6) - y * dx, (4 << 6) - y * dx, (5 << 6) - y * dx, (6 << 6) - y * dx, (7 << 6) - y * dx), upsample_above), c3f), 1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
} else { if (base_min_diff < 0) base_min_diff = 0; } if (base_shift > 7) { a0_x = _mm256_setzero_si256(); a1_x = _mm256_setzero_si256(); shift = _mm256_setzero_si256(); } else { if (upsample_above) {
+ show +
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
a0_x128 = _mm_setr_epi16( above[base_x + HighbdEvenOddMaskx8_2[base_shift][0]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][1]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][2]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][3]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][4]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][5]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][6]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][7]]); a1_x128 = _mm_setr_epi16( above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][0]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][1]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][2]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][3]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][4]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][5]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][6]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][7]]);
+ show +
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
shift = _mm256_castsi128_si256(_mm_srli_epi16( _mm_and_si128( _mm_slli_epi16( _mm_setr_epi16(-y * dx, (1 << 6) - y * dx, (2 << 6) - y * dx, (3 << 6) - y * dx, (4 << 6) - y * dx, (5 << 6) - y * dx, (6 << 6) - y * dx, (7 << 6) - y * dx), upsample_above), c3f), 1));

[CVE-2020-0478_1.diff] intrapred_avx2.c #47
+ r6 = _mm256_slli_epi32(_mm256_add_epi32(c0123, j256), 6); - _mm256_and_si256( - _mm256_setr_epi32( - ((0 + j) << 6) - y * dx, ((1 + j) << 6) - y * dx, - ((2 + j) << 6) - y * dx, ((3 + j) << 6) - y * dx, - ((4 + j) << 6) - y * dx, ((5 + j) << 6) - y * dx, - ((6 + j) << 6) - y * dx, ((7 + j) << 6) - y * dx), - c3f), - 1); + _mm256_and_si256(_mm256_sub_epi32(r6, ydx), c3f), 1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
_mm_loadu_si128((__m128i *)(above + base_x + base_shift + 1 + j)); a0_x128 = _mm_shuffle_epi8(a0_x128, *(__m128i *)HighbdLoadMaskx[base_shift]); a1_x128 = _mm_shuffle_epi8(a1_x128, *(__m128i *)HighbdLoadMaskx[base_shift]); a0_x = _mm256_cvtepu16_epi32(a0_x128); a1_x = _mm256_cvtepu16_epi32(a1_x128); shift = _mm256_srli_epi32(
+ show +
2147
2148
2149
2150
2151
2152
2153
2154
_mm256_and_si256( _mm256_setr_epi32( ((0 + j) << 6) - y * dx, ((1 + j) << 6) - y * dx, ((2 + j) << 6) - y * dx, ((3 + j) << 6) - y * dx, ((4 + j) << 6) - y * dx, ((5 + j) << 6) - y * dx, ((6 + j) << 6) - y * dx, ((7 + j) << 6) - y * dx), c3f), 1);
+ show +
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
diff = _mm256_sub_epi32(a1_x, a0_x); // a[x+1] - a[x] a32 = _mm256_slli_epi32(a0_x, 5); // a[x] * 32 a32 = _mm256_add_epi32(a32, a16); // a[x] * 32 + 16 b = _mm256_mullo_epi32(diff, shift); res = _mm256_add_epi32(a32, b); res = _mm256_srli_epi32(res, 5); resx[0] = _mm256_packus_epi32(

[CVE-2020-0478_1.diff] intrapred_avx2.c #49
+ r6 = _mm256_slli_epi32( + _mm256_add_epi32(c0123, _mm256_add_epi32(j256, c8)), 6); - _mm256_and_si256( - _mm256_setr_epi32( - ((8 + j) << 6) - y * dx, ((9 + j) << 6) - y * dx, - ((10 + j) << 6) - y * dx, ((11 + j) << 6) - y * dx, - ((12 + j) << 6) - y * dx, ((13 + j) << 6) - y * dx, - ((14 + j) << 6) - y * dx, ((15 + j) << 6) - y * dx), - c3f), - 1); + _mm256_and_si256(_mm256_sub_epi32(r6, ydx), c3f), 1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
_mm_loadu_si128((__m128i *)(above + base_x + base_shift8 + 9 + j)); a0_1_x128 = _mm_shuffle_epi8(a0_1_x128, *(__m128i *)HighbdLoadMaskx[base_shift8]); a1_1_x128 = _mm_shuffle_epi8(a1_1_x128, *(__m128i *)HighbdLoadMaskx[base_shift8]); a0_1_x = _mm256_cvtepu16_epi32(a0_1_x128); a1_1_x = _mm256_cvtepu16_epi32(a1_1_x128); shift = _mm256_srli_epi32(
+ show +
2187
2188
2189
2190
2191
2192
2193
2194
_mm256_and_si256( _mm256_setr_epi32( ((8 + j) << 6) - y * dx, ((9 + j) << 6) - y * dx, ((10 + j) << 6) - y * dx, ((11 + j) << 6) - y * dx, ((12 + j) << 6) - y * dx, ((13 + j) << 6) - y * dx, ((14 + j) << 6) - y * dx, ((15 + j) << 6) - y * dx), c3f), 1);
+ show +
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
diff = _mm256_sub_epi32(a1_1_x, a0_1_x); // a[x+1] - a[x] a32 = _mm256_slli_epi32(a0_1_x, 5); // a[x] * 32 a32 = _mm256_add_epi32(a32, a16); // a[x] * 32 + 16 b = _mm256_mullo_epi32(diff, shift); resx[1] = _mm256_add_epi32(a32, b); resx[1] = _mm256_srli_epi32(resx[1], 5); resx[1] = _mm256_packus_epi32( resx[1],

[CVE-2020-0478_1.diff] intrapred_avx2.c #55
+ base_y_c256 = _mm256_add_epi16(base_y_c256, c1); + _mm256_store_si256((__m256i *)base_y_c, base_y_c256); + - left[base_y_c[0] + 1], left[base_y_c[1] + 1], left[base_y_c[2] + 1], - left[base_y_c[3] + 1], left[base_y_c[4] + 1], left[base_y_c[5] + 1], - left[base_y_c[6] + 1], left[base_y_c[7] + 1], left[base_y_c[8] + 1], - left[base_y_c[9] + 1], left[base_y_c[10] + 1], - left[base_y_c[11] + 1], left[base_y_c[12] + 1], - left[base_y_c[13] + 1], left[base_y_c[14] + 1], - left[base_y_c[15] + 1]); + left[base_y_c[0]], left[base_y_c[1]], left[base_y_c[2]], + left[base_y_c[3]], left[base_y_c[4]], left[base_y_c[5]], + left[base_y_c[6]], left[base_y_c[7]], left[base_y_c[8]], + left[base_y_c[9]], left[base_y_c[10]], left[base_y_c[11]], + left[base_y_c[12]], left[base_y_c[13]], left[base_y_c[14]], + left[base_y_c[15]]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
_mm256_store_si256((__m256i *)base_y_c, base_y_c256); a0_y = _mm256_setr_epi16( left[base_y_c[0]], left[base_y_c[1]], left[base_y_c[2]], left[base_y_c[3]], left[base_y_c[4]], left[base_y_c[5]], left[base_y_c[6]], left[base_y_c[7]], left[base_y_c[8]], left[base_y_c[9]], left[base_y_c[10]], left[base_y_c[11]], left[base_y_c[12]], left[base_y_c[13]], left[base_y_c[14]], left[base_y_c[15]]); a1_y = _mm256_setr_epi16(
+ show +
2425
2426
2427
2428
2429
2430
2431
left[base_y_c[0] + 1], left[base_y_c[1] + 1], left[base_y_c[2] + 1], left[base_y_c[3] + 1], left[base_y_c[4] + 1], left[base_y_c[5] + 1], left[base_y_c[6] + 1], left[base_y_c[7] + 1], left[base_y_c[8] + 1], left[base_y_c[9] + 1], left[base_y_c[10] + 1], left[base_y_c[11] + 1], left[base_y_c[12] + 1], left[base_y_c[13] + 1], left[base_y_c[14] + 1], left[base_y_c[15] + 1]);
+ show +
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
shifty = _mm256_srli_epi16(_mm256_and_si256(y_c256, c3f), 1); diff = _mm256_sub_epi16(a1_y, a0_y); // a[x+1] - a[x] a32 = _mm256_slli_epi16(a0_y, 5); // a[x] * 32 a32 = _mm256_add_epi16(a32, a16); // a[x] * 32 + 16 b = _mm256_mullo_epi16(diff, shifty); res = _mm256_add_epi16(a32, b); resy = _mm256_srli_epi16(res, 5);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
_mm256_store_si256((__m256i *)base_y_c, base_y_c256); /**/ a0_y = _mm256_setr_epi16( left[base_y_c[0]], left[base_y_c[1]], left[base_y_c[2]], left[base_y_c[3]], left[base_y_c[4]], left[base_y_c[5]], left[base_y_c[6]], left[base_y_c[7]], left[base_y_c[8]], left[base_y_c[9]], left[base_y_c[10]], left[base_y_c[11]], left[base_y_c[12]], left[base_y_c[13]], left[base_y_c[14]], left[base_y_c[15]]); a1_y = _mm256_setr_epi16(
+ show +
3957
3958
3959
3960
3961
3962
3963
left[base_y_c[0] + 1], left[base_y_c[1] + 1], left[base_y_c[2] + 1], left[base_y_c[3] + 1], left[base_y_c[4] + 1], left[base_y_c[5] + 1], left[base_y_c[6] + 1], left[base_y_c[7] + 1], left[base_y_c[8] + 1], left[base_y_c[9] + 1], left[base_y_c[10] + 1], left[base_y_c[11] + 1], left[base_y_c[12] + 1], left[base_y_c[13] + 1], left[base_y_c[14] + 1], left[base_y_c[15] + 1]);
+ show +
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
shifty = _mm256_srli_epi16(_mm256_and_si256(y_c256, c3f), 1); diff = _mm256_sub_epi16(a1_y, a0_y); // a[x+1] - a[x] a32 = _mm256_slli_epi16(a0_y, 5); // a[x] * 32 a32 = _mm256_add_epi16(a32, a16); // a[x] * 32 + 16 b = _mm256_mullo_epi16(diff, shifty); res = _mm256_add_epi16(a32, b); res = _mm256_srli_epi16(res, 5); // 16 16-bit values

[CVE-2020-0478_1.diff] intrapred_avx2.c #88
-static uint8_t LoadMaskx[8][16] = { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - { 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, - { 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 }, - { 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }, - { 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, - { 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, - { 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, - { 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8 }, -}; - -static uint8_t EvenOddMaskx4[8][16] = { - { 0, 2, 4, 6, 1, 3, 5, 7, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 0, 1, 3, 5, 7, 2, 4, 6, 8, 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 2, 4, 6, 8, 3, 5, 7, 9, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 3, 5, 7, 9, 4, 6, 8, 10, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 4, 6, 8, 10, 5, 7, 9, 11, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 5, 7, 9, 11, 6, 8, 10, 12, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 6, 8, 10, 12, 7, 9, 11, 13, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0, 7, 9, 11, 13, 8, 10, 12, 14, 0 } -}; - -static uint8_t EvenOddMaskx[8][16] = { - { 0, 2, 4, 6, 8, 10, 12, 14, 1, 3, 5, 7, 0, 0, 0, 0 }, - { 0, 1, 3, 5, 7, 9, 11, 13, 15, 2, 4, 6, 8, 0, 0, 0 }, - { 0, 0, 2, 4, 6, 8, 10, 12, 14, 3, 5, 7, 9, 0, 0, 0 }, - { 0, 0, 0, 3, 5, 7, 9, 11, 13, 15, 4, 6, 8, 10, 0 }, - { 0, 0, 0, 0, 4, 6, 8, 10, 12, 14, 5, 7, 9, 11, 0, 0 }, - { 0, 0, 0, 0, 0, 5, 7, 9, 11, 13, 15, 6, 8, 10, 12, 0 }, - { 0, 0, 0, 0, 0, 0, 6, 8, 10, 12, 14, 7, 9, 11, 13, 0 }, - { 0, 0, 0, 0, 0, 0, 0, 7, 9, 11, 13, 15, 8, 10, 12, 14 } -}; -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
dr_prediction_z1_32xN_avx2(bh, dst, stride, above, upsample_above, dx); break; case 64: dr_prediction_z1_64xN_avx2(bh, dst, stride, above, upsample_above, dx); break; default: break; } return; }
+ show +
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
static uint8_t LoadMaskx[8][16] = { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, { 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, { 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 }, { 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }, { 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, { 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, { 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, { 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8 }, }; static uint8_t EvenOddMaskx4[8][16] = { { 0, 2, 4, 6, 1, 3, 5, 7, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 1, 3, 5, 7, 2, 4, 6, 8, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 2, 4, 6, 8, 3, 5, 7, 9, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 3, 5, 7, 9, 4, 6, 8, 10, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 4, 6, 8, 10, 5, 7, 9, 11, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 5, 7, 9, 11, 6, 8, 10, 12, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 6, 8, 10, 12, 7, 9, 11, 13, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 7, 9, 11, 13, 8, 10, 12, 14, 0 } }; static uint8_t EvenOddMaskx[8][16] = { { 0, 2, 4, 6, 8, 10, 12, 14, 1, 3, 5, 7, 0, 0, 0, 0 }, { 0, 1, 3, 5, 7, 9, 11, 13, 15, 2, 4, 6, 8, 0, 0, 0 }, { 0, 0, 2, 4, 6, 8, 10, 12, 14, 3, 5, 7, 9, 0, 0, 0 }, { 0, 0, 0, 3, 5, 7, 9, 11, 13, 15, 4, 6, 8, 10, 0 }, { 0, 0, 0, 0, 4, 6, 8, 10, 12, 14, 5, 7, 9, 11, 0, 0 }, { 0, 0, 0, 0, 0, 5, 7, 9, 11, 13, 15, 6, 8, 10, 12, 0 }, { 0, 0, 0, 0, 0, 0, 6, 8, 10, 12, 14, 7, 9, 11, 13, 0 }, { 0, 0, 0, 0, 0, 0, 0, 7, 9, 11, 13, 15, 8, 10, 12, 14 } };
+ show +
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
static void dr_prediction_z2_Nx4_avx2(int N, uint8_t *dst, ptrdiff_t stride, const uint8_t *above, const uint8_t *left, int upsample_above, int upsample_left, int dx, int dy) { const int min_base_x = -(1 << upsample_above); const int min_base_y = -(1 << upsample_left); const int frac_bits_x = 6 - upsample_above; const int frac_bits_y = 6 - upsample_left;

[CVE-2020-0478_1.diff] intrapred_avx2.c #94
- a1_y = _mm_setr_epi16(left[base_y_c[0] + 1], left[base_y_c[1] + 1], - left[base_y_c[2] + 1], left[base_y_c[3] + 1], - left[base_y_c[4] + 1], left[base_y_c[5] + 1], - left[base_y_c[6] + 1], left[base_y_c[7] + 1]); + base_y_c128 = _mm_add_epi16( + base_y_c128, _mm_srli_epi16(_mm256_castsi256_si128(a16), 4)); + _mm_store_si128((__m128i *)base_y_c, base_y_c128); + + a1_y = _mm_setr_epi16(left[base_y_c[0]], left[base_y_c[1]], + left[base_y_c[2]], left[base_y_c[3]], + left[base_y_c[4]], left[base_y_c[5]], + left[base_y_c[6]], left[base_y_c[7]]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
y_c128 = _mm_sub_epi16(r6, _mm_mullo_epi16(c1234, dy128)); base_y_c128 = _mm_srai_epi16(y_c128, frac_bits_y); mask128 = _mm_cmpgt_epi16(min_base_y128, base_y_c128); base_y_c128 = _mm_andnot_si128(mask128, base_y_c128); _mm_store_si128((__m128i *)base_y_c, base_y_c128); a0_y = _mm_setr_epi16(left[base_y_c[0]], left[base_y_c[1]], left[base_y_c[2]], left[base_y_c[3]], left[base_y_c[4]], left[base_y_c[5]], left[base_y_c[6]], left[base_y_c[7]]);
+ show +
2053
2054
2055
2056
a1_y = _mm_setr_epi16(left[base_y_c[0] + 1], left[base_y_c[1] + 1], left[base_y_c[2] + 1], left[base_y_c[3] + 1], left[base_y_c[4] + 1], left[base_y_c[5] + 1], left[base_y_c[6] + 1], left[base_y_c[7] + 1]);
+ show +
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
if (upsample_left) { shifty = _mm_srli_epi16( _mm_and_si128(_mm_slli_epi16((y_c128), upsample_left), c3f), 1); } else { shifty = _mm_srli_epi16(_mm_and_si128(y_c128, c3f), 1); } a0_x = _mm256_inserti128_si256(a0_x, a0_y, 1); a1_x = _mm256_inserti128_si256(a1_x, a1_y, 1); shift = _mm256_inserti128_si256(shift, shifty, 1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
y_c128 = _mm_sub_epi16(r6, _mm_mullo_epi16(c1234, dy128)); base_y_c128 = _mm_srai_epi16(y_c128, frac_bits_y); mask128 = _mm_cmpgt_epi16(min_base_y128, base_y_c128); base_y_c128 = _mm_andnot_si128(mask128, base_y_c128); _mm_store_si128((__m128i *)base_y_c, base_y_c128); a0_y = _mm_setr_epi16(left[base_y_c[0]], left[base_y_c[1]], left[base_y_c[2]], left[base_y_c[3]], left[base_y_c[4]], left[base_y_c[5]], left[base_y_c[6]], left[base_y_c[7]]);
+ show +
3784
3785
3786
3787
a1_y = _mm_setr_epi16(left[base_y_c[0] + 1], left[base_y_c[1] + 1], left[base_y_c[2] + 1], left[base_y_c[3] + 1], left[base_y_c[4] + 1], left[base_y_c[5] + 1], left[base_y_c[6] + 1], left[base_y_c[7] + 1]);
+ show +
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
if (upsample_left) { shifty = _mm_srli_epi16( _mm_and_si128(_mm_slli_epi16(y_c128, upsample_left), c3f), 1); } else { shifty = _mm_srli_epi16(_mm_and_si128(y_c128, c3f), 1); } a0_x = _mm256_inserti128_si256(a0_x, a0_y, 1); a1_x = _mm256_inserti128_si256(a1_x, a1_y, 1);

[CVE-2020-0478_1.diff] intrapred_avx2.c #96
- if (base_shift > 7) { - a0_x = _mm256_setzero_si256(); - a1_x = _mm256_setzero_si256(); - shift = _mm256_setzero_si256(); - } else { + + if (base_shift < 16) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
base_shift = (min_base_x - base_x - 1) >> upsample_above; } int base_min_diff = (min_base_x - base_x + upsample_above) >> upsample_above; if (base_min_diff > 8) { base_min_diff = 8; } else { if (base_min_diff < 0) base_min_diff = 0; }
+ show +
1981
1982
1983
1984
1985
if (base_shift > 7) { a0_x = _mm256_setzero_si256(); a1_x = _mm256_setzero_si256(); shift = _mm256_setzero_si256(); } else {
+ show +
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
if (upsample_above) { a0_x128 = _mm_setr_epi16( above[base_x + HighbdEvenOddMaskx8_2[base_shift][0]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][1]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][2]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][3]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][4]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][5]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][6]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][7]]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
if ((base_x + j) < (min_base_x - 1)) { base_shift = (min_base_x - (base_x + j) - 1); } int base_min_diff = (min_base_x - base_x - j); if (base_min_diff > 16) { base_min_diff = 16; } else { if (base_min_diff < 0) base_min_diff = 0; }
+ show +
2336
2337
2338
2339
2340
if (base_shift > 7) { a0_x = _mm256_setzero_si256(); a1_x = _mm256_setzero_si256(); shift = _mm256_setzero_si256(); } else {
+ show +
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
a0_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift + j)); a1_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift + 1 + j)); a0_x128 = _mm_shuffle_epi8(a0_x128, *(__m128i *)HighbdLoadMaskx[base_shift]); a1_x128 = _mm_shuffle_epi8(a1_x128, *(__m128i *)HighbdLoadMaskx[base_shift]); a0_x = _mm256_castsi128_si256(a0_x128); a1_x = _mm256_castsi128_si256(a1_x128);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
base_shift = (min_base_x - base_x - 1) >> upsample_above; } int base_min_diff = (min_base_x - base_x + upsample_above) >> upsample_above; if (base_min_diff > 8) { base_min_diff = 8; } else { if (base_min_diff < 0) base_min_diff = 0; }
+ show +
3727
3728
3729
3730
3731
if (base_shift > 7) { a0_x = _mm256_setzero_si256(); a1_x = _mm256_setzero_si256(); shift = _mm256_setzero_si256(); } else {
+ show +
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
a0_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift)); a1_x128 = _mm_loadu_si128((__m128i *)(above + base_x + 1 + base_shift)); if (upsample_above) { a0_x128 = _mm_shuffle_epi8(a0_x128, *(__m128i *)EvenOddMaskx[base_shift]); a1_x128 = _mm_shuffle_epi8(a1_x128, *(__m128i *)EvenOddMaskx[base_shift]); shift = _mm256_castsi128_si256(_mm_srli_epi16( _mm_and_si128(
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
int base_shift = 0; if ((base_x + j) < (min_base_x - 1)) { base_shift = (min_base_x - (base_x + j) - 1); } int base_min_diff = (min_base_x - base_x - j); if (base_min_diff > 16) { base_min_diff = 16; } else { if (base_min_diff < 0) base_min_diff = 0; }
+ show +
3865
3866
3867
3868
3869
if (base_shift > 7) { a0_x = _mm256_setzero_si256(); a1_x = _mm256_setzero_si256(); shift = _mm256_setzero_si256(); } else {
+ show +
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
a0_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift + j)); a1_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift + 1 + j)); a0_x128 = _mm_shuffle_epi8(a0_x128, *(__m128i *)LoadMaskx[base_shift]); a1_x128 = _mm_shuffle_epi8(a1_x128, *(__m128i *)LoadMaskx[base_shift]); a0_x = _mm256_cvtepu8_epi16(a0_x128); a1_x = _mm256_cvtepu8_epi16(a1_x128); shift = _mm256_castsi128_si256(_mm_srli_epi16(

[CVE-2020-0470_1.diff] intrapred_avx2.c #3
+#include "aom_dsp/x86/intrapred_x86.h" +static DECLARE_ALIGNED(16, uint8_t, HighbdLoadMaskx[8][16]) = { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, + { 0, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 }, + { 0, 1, 0, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, + { 0, 1, 0, 1, 0, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, + { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 3, 4, 5, 6, 7 }, + { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 3, 4, 5 }, + { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 3 }, + { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 }, +}; + +static DECLARE_ALIGNED(16, uint8_t, HighbdEvenOddMaskx4[4][16]) = { + { 0, 1, 4, 5, 8, 9, 12, 13, 2, 3, 6, 7, 10, 11, 14, 15 }, + { 0, 1, 2, 3, 6, 7, 10, 11, 14, 15, 4, 5, 8, 9, 12, 13 }, + { 0, 1, 0, 1, 4, 5, 8, 9, 12, 13, 0, 1, 6, 7, 10, 11 }, + { 0, 1, 0, 1, 0, 1, 6, 7, 10, 11, 14, 15, 0, 1, 8, 9 } +}; + +static DECLARE_ALIGNED(16, uint8_t, HighbdEvenOddMaskx[8][32]) = { + { 0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29, + 2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31 }, + { 0, 1, 2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, + 0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29 }, + { 0, 1, 0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, + 0, 1, 0, 1, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27 }, + { 0, 1, 0, 1, 0, 1, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, + 0, 1, 0, 1, 0, 1, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25 }, + { 0, 1, 0, 1, 0, 1, 0, 1, 8, 9, 12, 13, 16, 17, 20, 21, + 0, 1, 0, 1, 0, 1, 0, 1, 10, 11, 14, 15, 18, 19, 22, 23 }, + { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 10, 11, 14, 15, 18, 19, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 12, 13, 16, 17, 20, 21 }, + { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 12, 13, 16, 17, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 14, 15, 18, 19 }, + { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 14, 15, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 16, 17 } +}; + +static DECLARE_ALIGNED(32, uint16_t, HighbdBaseMask[17][16]) = { + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0xffff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0xffff, 0xffff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0, 0, 0, 0, 0, 0, 0, + 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0, 0, 0, 0, + 0, 0, 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0, + 0, 0, 0, 0, 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0, 0, 0, 0, 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0, 0, 0, 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0, 0, 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0, 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0 }, + { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff } +}; + - -// TODO(luoyi) The following two functions are shared with intrapred_sse2.c. -// Use a header file, intrapred_common_x86.h -static INLINE __m128i dc_sum_16_sse2(const uint8_t *ref) { - __m128i x = _mm_load_si128((__m128i const *)ref); - const __m128i zero = _mm_setzero_si128(); - x = _mm_sad_epu8(x, zero); - const __m128i high = _mm_unpackhi_epi64(x, x); - return _mm_add_epi16(x, high); -} - -static INLINE __m128i dc_sum_32_sse2(const uint8_t *ref) { - __m128i x0 = _mm_load_si128((__m128i const *)ref); - __m128i x1 = _mm_load_si128((__m128i const *)(ref + 16)); - const __m128i zero = _mm_setzero_si128(); - x0 = _mm_sad_epu8(x0, zero); - x1 = _mm_sad_epu8(x1, zero); - x0 = _mm_add_epi16(x0, x1); - const __m128i high = _mm_unpackhi_epi64(x0, x0); - return _mm_add_epi16(x0, high); -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
347
348
349
350
351
352
353
354
355
356
v = _mm256_unpackhi_epi8(u, u); h_predictor_32x8line(&v, dst, stride); } // ----------------------------------------------------------------------------- // Rectangle // TODO(luoyi) The following two functions are shared with intrapred_sse2.c. // Use a header file, intrapred_common_x86.h
+ show +
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
static INLINE __m128i dc_sum_16_sse2(const uint8_t *ref) { __m128i x = _mm_load_si128((__m128i const *)ref); const __m128i zero = _mm_setzero_si128(); x = _mm_sad_epu8(x, zero); const __m128i high = _mm_unpackhi_epi64(x, x); return _mm_add_epi16(x, high); } static INLINE __m128i dc_sum_32_sse2(const uint8_t *ref) { __m128i x0 = _mm_load_si128((__m128i const *)ref); __m128i x1 = _mm_load_si128((__m128i const *)(ref + 16)); const __m128i zero = _mm_setzero_si128(); x0 = _mm_sad_epu8(x0, zero); x1 = _mm_sad_epu8(x1, zero); x0 = _mm_add_epi16(x0, x1); const __m128i high = _mm_unpackhi_epi64(x0, x0); return _mm_add_epi16(x0, high);
+ show +
374
375
376
377
378
379
380
381
382
383
} void aom_dc_predictor_32x16_avx2(uint8_t *dst, ptrdiff_t stride, const uint8_t *above, const uint8_t *left) { const __m128i top_sum = dc_sum_32_sse2(above); __m128i left_sum = dc_sum_16_sse2(left); left_sum = _mm_add_epi16(top_sum, left_sum); uint16_t sum = _mm_cvtsi128_si32(left_sum); sum += 24; sum /= 48;

[CVE-2020-0470_1.diff] intrapred_avx2.c #37
+ a0_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift)); - a0_x128 = _mm_setr_epi16( - above[base_x + HighbdEvenOddMaskx8_2[base_shift][0]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][1]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][2]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][3]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][4]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][5]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][6]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][7]]); - a1_x128 = _mm_setr_epi16( - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][0]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][1]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][2]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][3]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][4]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][5]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][6]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][7]]); + __m128i mask, atmp0, atmp1, atmp2, atmp3; + a1_x128 = _mm_loadu_si128((__m128i *)(above + base_x + 8 + base_shift)); + atmp0 = _mm_shuffle_epi8(a0_x128, + *(__m128i *)HighbdEvenOddMaskx[base_shift]); + atmp1 = _mm_shuffle_epi8(a1_x128, + *(__m128i *)HighbdEvenOddMaskx[base_shift]); + atmp2 = _mm_shuffle_epi8( + a0_x128, *(__m128i *)(HighbdEvenOddMaskx[base_shift] + 16)); + atmp3 = _mm_shuffle_epi8( + a1_x128, *(__m128i *)(HighbdEvenOddMaskx[base_shift] + 16)); + mask = _mm_cmpgt_epi8(*(__m128i *)HighbdEvenOddMaskx[base_shift], + _mm_set1_epi8(15)); + a0_x128 = _mm_blendv_epi8(atmp0, atmp1, mask); + mask = _mm_cmpgt_epi8(*(__m128i *)(HighbdEvenOddMaskx[base_shift] + 16), + _mm_set1_epi8(15)); + a1_x128 = _mm_blendv_epi8(atmp2, atmp3, mask);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
if (base_min_diff > 8) { base_min_diff = 8; } else { if (base_min_diff < 0) base_min_diff = 0; } if (base_shift > 7) { resx = _mm_setzero_si128(); } else { if (upsample_above) {
+ show +
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
a0_x128 = _mm_setr_epi16( above[base_x + HighbdEvenOddMaskx8_2[base_shift][0]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][1]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][2]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][3]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][4]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][5]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][6]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][7]]); a1_x128 = _mm_setr_epi16( above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][0]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][1]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][2]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][3]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][4]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][5]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][6]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][7]]);
+ show +
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
shift = _mm256_srli_epi32( _mm256_and_si256( _mm256_slli_epi32( _mm256_setr_epi32(-y * dx, (1 << 6) - y * dx, (2 << 6) - y * dx, (3 << 6) - y * dx, (4 << 6) - y * dx, (5 << 6) - y * dx, (6 << 6) - y * dx, (7 << 6) - y * dx), upsample_above), c3f), 1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
} else { if (base_min_diff < 0) base_min_diff = 0; } if (base_shift > 7) { a0_x = _mm256_setzero_si256(); a1_x = _mm256_setzero_si256(); shift = _mm256_setzero_si256(); } else { if (upsample_above) {
+ show +
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
a0_x128 = _mm_setr_epi16( above[base_x + HighbdEvenOddMaskx8_2[base_shift][0]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][1]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][2]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][3]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][4]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][5]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][6]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][7]]); a1_x128 = _mm_setr_epi16( above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][0]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][1]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][2]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][3]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][4]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][5]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][6]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][7]]);
+ show +
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
shift = _mm256_castsi128_si256(_mm_srli_epi16( _mm_and_si128( _mm_slli_epi16( _mm_setr_epi16(-y * dx, (1 << 6) - y * dx, (2 << 6) - y * dx, (3 << 6) - y * dx, (4 << 6) - y * dx, (5 << 6) - y * dx, (6 << 6) - y * dx, (7 << 6) - y * dx), upsample_above), c3f), 1));

[CVE-2020-0470_1.diff] intrapred_avx2.c #42
+ a0_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift)); - a0_x128 = _mm_setr_epi16( - above[base_x + HighbdEvenOddMaskx8_2[base_shift][0]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][1]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][2]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][3]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][4]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][5]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][6]], - above[base_x + HighbdEvenOddMaskx8_2[base_shift][7]]); - a1_x128 = _mm_setr_epi16( - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][0]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][1]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][2]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][3]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][4]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][5]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][6]], - above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][7]]); + __m128i mask, atmp0, atmp1, atmp2, atmp3; + a1_x128 = _mm_loadu_si128((__m128i *)(above + base_x + 8 + base_shift)); + atmp0 = _mm_shuffle_epi8(a0_x128, + *(__m128i *)HighbdEvenOddMaskx[base_shift]); + atmp1 = _mm_shuffle_epi8(a1_x128, + *(__m128i *)HighbdEvenOddMaskx[base_shift]); + atmp2 = _mm_shuffle_epi8( + a0_x128, *(__m128i *)(HighbdEvenOddMaskx[base_shift] + 16)); + atmp3 = _mm_shuffle_epi8( + a1_x128, *(__m128i *)(HighbdEvenOddMaskx[base_shift] + 16)); + mask = _mm_cmpgt_epi8(*(__m128i *)HighbdEvenOddMaskx[base_shift], + _mm_set1_epi8(15)); + a0_x128 = _mm_blendv_epi8(atmp0, atmp1, mask); + mask = _mm_cmpgt_epi8(*(__m128i *)(HighbdEvenOddMaskx[base_shift] + 16), + _mm_set1_epi8(15)); + a1_x128 = _mm_blendv_epi8(atmp2, atmp3, mask); +
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
if (base_min_diff > 8) { base_min_diff = 8; } else { if (base_min_diff < 0) base_min_diff = 0; } if (base_shift > 7) { resx = _mm_setzero_si128(); } else { if (upsample_above) {
+ show +
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
a0_x128 = _mm_setr_epi16( above[base_x + HighbdEvenOddMaskx8_2[base_shift][0]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][1]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][2]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][3]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][4]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][5]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][6]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][7]]); a1_x128 = _mm_setr_epi16( above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][0]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][1]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][2]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][3]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][4]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][5]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][6]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][7]]);
+ show +
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
shift = _mm256_srli_epi32( _mm256_and_si256( _mm256_slli_epi32( _mm256_setr_epi32(-y * dx, (1 << 6) - y * dx, (2 << 6) - y * dx, (3 << 6) - y * dx, (4 << 6) - y * dx, (5 << 6) - y * dx, (6 << 6) - y * dx, (7 << 6) - y * dx), upsample_above), c3f), 1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
} else { if (base_min_diff < 0) base_min_diff = 0; } if (base_shift > 7) { a0_x = _mm256_setzero_si256(); a1_x = _mm256_setzero_si256(); shift = _mm256_setzero_si256(); } else { if (upsample_above) {
+ show +
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
a0_x128 = _mm_setr_epi16( above[base_x + HighbdEvenOddMaskx8_2[base_shift][0]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][1]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][2]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][3]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][4]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][5]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][6]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][7]]); a1_x128 = _mm_setr_epi16( above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][0]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][1]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][2]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][3]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][4]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][5]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][6]], above[base_x + 1 + HighbdEvenOddMaskx8_2[base_shift][7]]);
+ show +
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
shift = _mm256_castsi128_si256(_mm_srli_epi16( _mm_and_si128( _mm_slli_epi16( _mm_setr_epi16(-y * dx, (1 << 6) - y * dx, (2 << 6) - y * dx, (3 << 6) - y * dx, (4 << 6) - y * dx, (5 << 6) - y * dx, (6 << 6) - y * dx, (7 << 6) - y * dx), upsample_above), c3f), 1));

[CVE-2020-0470_1.diff] intrapred_avx2.c #47
+ r6 = _mm256_slli_epi32(_mm256_add_epi32(c0123, j256), 6); - _mm256_and_si256( - _mm256_setr_epi32( - ((0 + j) << 6) - y * dx, ((1 + j) << 6) - y * dx, - ((2 + j) << 6) - y * dx, ((3 + j) << 6) - y * dx, - ((4 + j) << 6) - y * dx, ((5 + j) << 6) - y * dx, - ((6 + j) << 6) - y * dx, ((7 + j) << 6) - y * dx), - c3f), - 1); + _mm256_and_si256(_mm256_sub_epi32(r6, ydx), c3f), 1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
_mm_loadu_si128((__m128i *)(above + base_x + base_shift + 1 + j)); a0_x128 = _mm_shuffle_epi8(a0_x128, *(__m128i *)HighbdLoadMaskx[base_shift]); a1_x128 = _mm_shuffle_epi8(a1_x128, *(__m128i *)HighbdLoadMaskx[base_shift]); a0_x = _mm256_cvtepu16_epi32(a0_x128); a1_x = _mm256_cvtepu16_epi32(a1_x128); shift = _mm256_srli_epi32(
+ show +
2147
2148
2149
2150
2151
2152
2153
2154
_mm256_and_si256( _mm256_setr_epi32( ((0 + j) << 6) - y * dx, ((1 + j) << 6) - y * dx, ((2 + j) << 6) - y * dx, ((3 + j) << 6) - y * dx, ((4 + j) << 6) - y * dx, ((5 + j) << 6) - y * dx, ((6 + j) << 6) - y * dx, ((7 + j) << 6) - y * dx), c3f), 1);
+ show +
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
diff = _mm256_sub_epi32(a1_x, a0_x); // a[x+1] - a[x] a32 = _mm256_slli_epi32(a0_x, 5); // a[x] * 32 a32 = _mm256_add_epi32(a32, a16); // a[x] * 32 + 16 b = _mm256_mullo_epi32(diff, shift); res = _mm256_add_epi32(a32, b); res = _mm256_srli_epi32(res, 5); resx[0] = _mm256_packus_epi32(

[CVE-2020-0470_1.diff] intrapred_avx2.c #49
+ r6 = _mm256_slli_epi32( + _mm256_add_epi32(c0123, _mm256_add_epi32(j256, c8)), 6); - _mm256_and_si256( - _mm256_setr_epi32( - ((8 + j) << 6) - y * dx, ((9 + j) << 6) - y * dx, - ((10 + j) << 6) - y * dx, ((11 + j) << 6) - y * dx, - ((12 + j) << 6) - y * dx, ((13 + j) << 6) - y * dx, - ((14 + j) << 6) - y * dx, ((15 + j) << 6) - y * dx), - c3f), - 1); + _mm256_and_si256(_mm256_sub_epi32(r6, ydx), c3f), 1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
_mm_loadu_si128((__m128i *)(above + base_x + base_shift8 + 9 + j)); a0_1_x128 = _mm_shuffle_epi8(a0_1_x128, *(__m128i *)HighbdLoadMaskx[base_shift8]); a1_1_x128 = _mm_shuffle_epi8(a1_1_x128, *(__m128i *)HighbdLoadMaskx[base_shift8]); a0_1_x = _mm256_cvtepu16_epi32(a0_1_x128); a1_1_x = _mm256_cvtepu16_epi32(a1_1_x128); shift = _mm256_srli_epi32(
+ show +
2187
2188
2189
2190
2191
2192
2193
2194
_mm256_and_si256( _mm256_setr_epi32( ((8 + j) << 6) - y * dx, ((9 + j) << 6) - y * dx, ((10 + j) << 6) - y * dx, ((11 + j) << 6) - y * dx, ((12 + j) << 6) - y * dx, ((13 + j) << 6) - y * dx, ((14 + j) << 6) - y * dx, ((15 + j) << 6) - y * dx), c3f), 1);
+ show +
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
diff = _mm256_sub_epi32(a1_1_x, a0_1_x); // a[x+1] - a[x] a32 = _mm256_slli_epi32(a0_1_x, 5); // a[x] * 32 a32 = _mm256_add_epi32(a32, a16); // a[x] * 32 + 16 b = _mm256_mullo_epi32(diff, shift); resx[1] = _mm256_add_epi32(a32, b); resx[1] = _mm256_srli_epi32(resx[1], 5); resx[1] = _mm256_packus_epi32( resx[1],

[CVE-2020-0470_1.diff] intrapred_avx2.c #55
+ base_y_c256 = _mm256_add_epi16(base_y_c256, c1); + _mm256_store_si256((__m256i *)base_y_c, base_y_c256); + - left[base_y_c[0] + 1], left[base_y_c[1] + 1], left[base_y_c[2] + 1], - left[base_y_c[3] + 1], left[base_y_c[4] + 1], left[base_y_c[5] + 1], - left[base_y_c[6] + 1], left[base_y_c[7] + 1], left[base_y_c[8] + 1], - left[base_y_c[9] + 1], left[base_y_c[10] + 1], - left[base_y_c[11] + 1], left[base_y_c[12] + 1], - left[base_y_c[13] + 1], left[base_y_c[14] + 1], - left[base_y_c[15] + 1]); + left[base_y_c[0]], left[base_y_c[1]], left[base_y_c[2]], + left[base_y_c[3]], left[base_y_c[4]], left[base_y_c[5]], + left[base_y_c[6]], left[base_y_c[7]], left[base_y_c[8]], + left[base_y_c[9]], left[base_y_c[10]], left[base_y_c[11]], + left[base_y_c[12]], left[base_y_c[13]], left[base_y_c[14]], + left[base_y_c[15]]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
_mm256_store_si256((__m256i *)base_y_c, base_y_c256); a0_y = _mm256_setr_epi16( left[base_y_c[0]], left[base_y_c[1]], left[base_y_c[2]], left[base_y_c[3]], left[base_y_c[4]], left[base_y_c[5]], left[base_y_c[6]], left[base_y_c[7]], left[base_y_c[8]], left[base_y_c[9]], left[base_y_c[10]], left[base_y_c[11]], left[base_y_c[12]], left[base_y_c[13]], left[base_y_c[14]], left[base_y_c[15]]); a1_y = _mm256_setr_epi16(
+ show +
2425
2426
2427
2428
2429
2430
2431
left[base_y_c[0] + 1], left[base_y_c[1] + 1], left[base_y_c[2] + 1], left[base_y_c[3] + 1], left[base_y_c[4] + 1], left[base_y_c[5] + 1], left[base_y_c[6] + 1], left[base_y_c[7] + 1], left[base_y_c[8] + 1], left[base_y_c[9] + 1], left[base_y_c[10] + 1], left[base_y_c[11] + 1], left[base_y_c[12] + 1], left[base_y_c[13] + 1], left[base_y_c[14] + 1], left[base_y_c[15] + 1]);
+ show +
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
shifty = _mm256_srli_epi16(_mm256_and_si256(y_c256, c3f), 1); diff = _mm256_sub_epi16(a1_y, a0_y); // a[x+1] - a[x] a32 = _mm256_slli_epi16(a0_y, 5); // a[x] * 32 a32 = _mm256_add_epi16(a32, a16); // a[x] * 32 + 16 b = _mm256_mullo_epi16(diff, shifty); res = _mm256_add_epi16(a32, b); resy = _mm256_srli_epi16(res, 5);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
_mm256_store_si256((__m256i *)base_y_c, base_y_c256); /**/ a0_y = _mm256_setr_epi16( left[base_y_c[0]], left[base_y_c[1]], left[base_y_c[2]], left[base_y_c[3]], left[base_y_c[4]], left[base_y_c[5]], left[base_y_c[6]], left[base_y_c[7]], left[base_y_c[8]], left[base_y_c[9]], left[base_y_c[10]], left[base_y_c[11]], left[base_y_c[12]], left[base_y_c[13]], left[base_y_c[14]], left[base_y_c[15]]); a1_y = _mm256_setr_epi16(
+ show +
3957
3958
3959
3960
3961
3962
3963
left[base_y_c[0] + 1], left[base_y_c[1] + 1], left[base_y_c[2] + 1], left[base_y_c[3] + 1], left[base_y_c[4] + 1], left[base_y_c[5] + 1], left[base_y_c[6] + 1], left[base_y_c[7] + 1], left[base_y_c[8] + 1], left[base_y_c[9] + 1], left[base_y_c[10] + 1], left[base_y_c[11] + 1], left[base_y_c[12] + 1], left[base_y_c[13] + 1], left[base_y_c[14] + 1], left[base_y_c[15] + 1]);
+ show +
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
shifty = _mm256_srli_epi16(_mm256_and_si256(y_c256, c3f), 1); diff = _mm256_sub_epi16(a1_y, a0_y); // a[x+1] - a[x] a32 = _mm256_slli_epi16(a0_y, 5); // a[x] * 32 a32 = _mm256_add_epi16(a32, a16); // a[x] * 32 + 16 b = _mm256_mullo_epi16(diff, shifty); res = _mm256_add_epi16(a32, b); res = _mm256_srli_epi16(res, 5); // 16 16-bit values

[CVE-2020-0470_1.diff] intrapred_avx2.c #88
-static uint8_t LoadMaskx[8][16] = { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - { 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, - { 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 }, - { 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }, - { 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, - { 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, - { 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, - { 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8 }, -}; - -static uint8_t EvenOddMaskx4[8][16] = { - { 0, 2, 4, 6, 1, 3, 5, 7, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 0, 1, 3, 5, 7, 2, 4, 6, 8, 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 2, 4, 6, 8, 3, 5, 7, 9, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 3, 5, 7, 9, 4, 6, 8, 10, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 4, 6, 8, 10, 5, 7, 9, 11, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 5, 7, 9, 11, 6, 8, 10, 12, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 6, 8, 10, 12, 7, 9, 11, 13, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0, 7, 9, 11, 13, 8, 10, 12, 14, 0 } -}; - -static uint8_t EvenOddMaskx[8][16] = { - { 0, 2, 4, 6, 8, 10, 12, 14, 1, 3, 5, 7, 0, 0, 0, 0 }, - { 0, 1, 3, 5, 7, 9, 11, 13, 15, 2, 4, 6, 8, 0, 0, 0 }, - { 0, 0, 2, 4, 6, 8, 10, 12, 14, 3, 5, 7, 9, 0, 0, 0 }, - { 0, 0, 0, 3, 5, 7, 9, 11, 13, 15, 4, 6, 8, 10, 0 }, - { 0, 0, 0, 0, 4, 6, 8, 10, 12, 14, 5, 7, 9, 11, 0, 0 }, - { 0, 0, 0, 0, 0, 5, 7, 9, 11, 13, 15, 6, 8, 10, 12, 0 }, - { 0, 0, 0, 0, 0, 0, 6, 8, 10, 12, 14, 7, 9, 11, 13, 0 }, - { 0, 0, 0, 0, 0, 0, 0, 7, 9, 11, 13, 15, 8, 10, 12, 14 } -}; -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
dr_prediction_z1_32xN_avx2(bh, dst, stride, above, upsample_above, dx); break; case 64: dr_prediction_z1_64xN_avx2(bh, dst, stride, above, upsample_above, dx); break; default: break; } return; }
+ show +
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
static uint8_t LoadMaskx[8][16] = { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, { 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, { 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 }, { 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }, { 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, { 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, { 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, { 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8 }, }; static uint8_t EvenOddMaskx4[8][16] = { { 0, 2, 4, 6, 1, 3, 5, 7, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 1, 3, 5, 7, 2, 4, 6, 8, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 2, 4, 6, 8, 3, 5, 7, 9, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 3, 5, 7, 9, 4, 6, 8, 10, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 4, 6, 8, 10, 5, 7, 9, 11, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 5, 7, 9, 11, 6, 8, 10, 12, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 6, 8, 10, 12, 7, 9, 11, 13, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 7, 9, 11, 13, 8, 10, 12, 14, 0 } }; static uint8_t EvenOddMaskx[8][16] = { { 0, 2, 4, 6, 8, 10, 12, 14, 1, 3, 5, 7, 0, 0, 0, 0 }, { 0, 1, 3, 5, 7, 9, 11, 13, 15, 2, 4, 6, 8, 0, 0, 0 }, { 0, 0, 2, 4, 6, 8, 10, 12, 14, 3, 5, 7, 9, 0, 0, 0 }, { 0, 0, 0, 3, 5, 7, 9, 11, 13, 15, 4, 6, 8, 10, 0 }, { 0, 0, 0, 0, 4, 6, 8, 10, 12, 14, 5, 7, 9, 11, 0, 0 }, { 0, 0, 0, 0, 0, 5, 7, 9, 11, 13, 15, 6, 8, 10, 12, 0 }, { 0, 0, 0, 0, 0, 0, 6, 8, 10, 12, 14, 7, 9, 11, 13, 0 }, { 0, 0, 0, 0, 0, 0, 0, 7, 9, 11, 13, 15, 8, 10, 12, 14 } };
+ show +
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
static void dr_prediction_z2_Nx4_avx2(int N, uint8_t *dst, ptrdiff_t stride, const uint8_t *above, const uint8_t *left, int upsample_above, int upsample_left, int dx, int dy) { const int min_base_x = -(1 << upsample_above); const int min_base_y = -(1 << upsample_left); const int frac_bits_x = 6 - upsample_above; const int frac_bits_y = 6 - upsample_left;

[CVE-2020-0470_1.diff] intrapred_avx2.c #94
- a1_y = _mm_setr_epi16(left[base_y_c[0] + 1], left[base_y_c[1] + 1], - left[base_y_c[2] + 1], left[base_y_c[3] + 1], - left[base_y_c[4] + 1], left[base_y_c[5] + 1], - left[base_y_c[6] + 1], left[base_y_c[7] + 1]); + base_y_c128 = _mm_add_epi16( + base_y_c128, _mm_srli_epi16(_mm256_castsi256_si128(a16), 4)); + _mm_store_si128((__m128i *)base_y_c, base_y_c128); + + a1_y = _mm_setr_epi16(left[base_y_c[0]], left[base_y_c[1]], + left[base_y_c[2]], left[base_y_c[3]], + left[base_y_c[4]], left[base_y_c[5]], + left[base_y_c[6]], left[base_y_c[7]]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
y_c128 = _mm_sub_epi16(r6, _mm_mullo_epi16(c1234, dy128)); base_y_c128 = _mm_srai_epi16(y_c128, frac_bits_y); mask128 = _mm_cmpgt_epi16(min_base_y128, base_y_c128); base_y_c128 = _mm_andnot_si128(mask128, base_y_c128); _mm_store_si128((__m128i *)base_y_c, base_y_c128); a0_y = _mm_setr_epi16(left[base_y_c[0]], left[base_y_c[1]], left[base_y_c[2]], left[base_y_c[3]], left[base_y_c[4]], left[base_y_c[5]], left[base_y_c[6]], left[base_y_c[7]]);
+ show +
2053
2054
2055
2056
a1_y = _mm_setr_epi16(left[base_y_c[0] + 1], left[base_y_c[1] + 1], left[base_y_c[2] + 1], left[base_y_c[3] + 1], left[base_y_c[4] + 1], left[base_y_c[5] + 1], left[base_y_c[6] + 1], left[base_y_c[7] + 1]);
+ show +
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
if (upsample_left) { shifty = _mm_srli_epi16( _mm_and_si128(_mm_slli_epi16((y_c128), upsample_left), c3f), 1); } else { shifty = _mm_srli_epi16(_mm_and_si128(y_c128, c3f), 1); } a0_x = _mm256_inserti128_si256(a0_x, a0_y, 1); a1_x = _mm256_inserti128_si256(a1_x, a1_y, 1); shift = _mm256_inserti128_si256(shift, shifty, 1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
y_c128 = _mm_sub_epi16(r6, _mm_mullo_epi16(c1234, dy128)); base_y_c128 = _mm_srai_epi16(y_c128, frac_bits_y); mask128 = _mm_cmpgt_epi16(min_base_y128, base_y_c128); base_y_c128 = _mm_andnot_si128(mask128, base_y_c128); _mm_store_si128((__m128i *)base_y_c, base_y_c128); a0_y = _mm_setr_epi16(left[base_y_c[0]], left[base_y_c[1]], left[base_y_c[2]], left[base_y_c[3]], left[base_y_c[4]], left[base_y_c[5]], left[base_y_c[6]], left[base_y_c[7]]);
+ show +
3784
3785
3786
3787
a1_y = _mm_setr_epi16(left[base_y_c[0] + 1], left[base_y_c[1] + 1], left[base_y_c[2] + 1], left[base_y_c[3] + 1], left[base_y_c[4] + 1], left[base_y_c[5] + 1], left[base_y_c[6] + 1], left[base_y_c[7] + 1]);
+ show +
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
if (upsample_left) { shifty = _mm_srli_epi16( _mm_and_si128(_mm_slli_epi16(y_c128, upsample_left), c3f), 1); } else { shifty = _mm_srli_epi16(_mm_and_si128(y_c128, c3f), 1); } a0_x = _mm256_inserti128_si256(a0_x, a0_y, 1); a1_x = _mm256_inserti128_si256(a1_x, a1_y, 1);

[CVE-2020-0470_1.diff] intrapred_avx2.c #96
- if (base_shift > 7) { - a0_x = _mm256_setzero_si256(); - a1_x = _mm256_setzero_si256(); - shift = _mm256_setzero_si256(); - } else { + + if (base_shift < 16) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
base_shift = (min_base_x - base_x - 1) >> upsample_above; } int base_min_diff = (min_base_x - base_x + upsample_above) >> upsample_above; if (base_min_diff > 8) { base_min_diff = 8; } else { if (base_min_diff < 0) base_min_diff = 0; }
+ show +
1981
1982
1983
1984
1985
if (base_shift > 7) { a0_x = _mm256_setzero_si256(); a1_x = _mm256_setzero_si256(); shift = _mm256_setzero_si256(); } else {
+ show +
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
if (upsample_above) { a0_x128 = _mm_setr_epi16( above[base_x + HighbdEvenOddMaskx8_2[base_shift][0]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][1]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][2]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][3]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][4]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][5]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][6]], above[base_x + HighbdEvenOddMaskx8_2[base_shift][7]]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
if ((base_x + j) < (min_base_x - 1)) { base_shift = (min_base_x - (base_x + j) - 1); } int base_min_diff = (min_base_x - base_x - j); if (base_min_diff > 16) { base_min_diff = 16; } else { if (base_min_diff < 0) base_min_diff = 0; }
+ show +
2336
2337
2338
2339
2340
if (base_shift > 7) { a0_x = _mm256_setzero_si256(); a1_x = _mm256_setzero_si256(); shift = _mm256_setzero_si256(); } else {
+ show +
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
a0_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift + j)); a1_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift + 1 + j)); a0_x128 = _mm_shuffle_epi8(a0_x128, *(__m128i *)HighbdLoadMaskx[base_shift]); a1_x128 = _mm_shuffle_epi8(a1_x128, *(__m128i *)HighbdLoadMaskx[base_shift]); a0_x = _mm256_castsi128_si256(a0_x128); a1_x = _mm256_castsi128_si256(a1_x128);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
base_shift = (min_base_x - base_x - 1) >> upsample_above; } int base_min_diff = (min_base_x - base_x + upsample_above) >> upsample_above; if (base_min_diff > 8) { base_min_diff = 8; } else { if (base_min_diff < 0) base_min_diff = 0; }
+ show +
3727
3728
3729
3730
3731
if (base_shift > 7) { a0_x = _mm256_setzero_si256(); a1_x = _mm256_setzero_si256(); shift = _mm256_setzero_si256(); } else {
+ show +
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
a0_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift)); a1_x128 = _mm_loadu_si128((__m128i *)(above + base_x + 1 + base_shift)); if (upsample_above) { a0_x128 = _mm_shuffle_epi8(a0_x128, *(__m128i *)EvenOddMaskx[base_shift]); a1_x128 = _mm_shuffle_epi8(a1_x128, *(__m128i *)EvenOddMaskx[base_shift]); shift = _mm256_castsi128_si256(_mm_srli_epi16( _mm_and_si128(
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_avx2.c
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
int base_shift = 0; if ((base_x + j) < (min_base_x - 1)) { base_shift = (min_base_x - (base_x + j) - 1); } int base_min_diff = (min_base_x - base_x - j); if (base_min_diff > 16) { base_min_diff = 16; } else { if (base_min_diff < 0) base_min_diff = 0; }
+ show +
3865
3866
3867
3868
3869
if (base_shift > 7) { a0_x = _mm256_setzero_si256(); a1_x = _mm256_setzero_si256(); shift = _mm256_setzero_si256(); } else {
+ show +
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
a0_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift + j)); a1_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift + 1 + j)); a0_x128 = _mm_shuffle_epi8(a0_x128, *(__m128i *)LoadMaskx[base_shift]); a1_x128 = _mm_shuffle_epi8(a1_x128, *(__m128i *)LoadMaskx[base_shift]); a0_x = _mm256_cvtepu8_epi16(a0_x128); a1_x = _mm256_cvtepu8_epi16(a1_x128); shift = _mm256_castsi128_si256(_mm_srli_epi16(

[CVE-2020-0478_1.diff] txfm_common_avx2.h #1
+static INLINE void transpose2_8x8_avx2(const __m256i *const in, + __m256i *const out) { + __m256i t[16], u[16]; + // (1st, 2nd) ==> (lo, hi) + // (0, 1) ==> (0, 1) + // (2, 3) ==> (2, 3) + // (4, 5) ==> (4, 5) + // (6, 7) ==> (6, 7) + for (int i = 0; i < 4; i++) { + t[2 * i] = _mm256_unpacklo_epi16(in[2 * i], in[2 * i + 1]); + t[2 * i + 1] = _mm256_unpackhi_epi16(in[2 * i], in[2 * i + 1]); + } + + // (1st, 2nd) ==> (lo, hi) + // (0, 2) ==> (0, 2) + // (1, 3) ==> (1, 3) + // (4, 6) ==> (4, 6) + // (5, 7) ==> (5, 7) + for (int i = 0; i < 2; i++) { + u[i] = _mm256_unpacklo_epi32(t[i], t[i + 2]); + u[i + 2] = _mm256_unpackhi_epi32(t[i], t[i + 2]); + + u[i + 4] = _mm256_unpacklo_epi32(t[i + 4], t[i + 6]); + u[i + 6] = _mm256_unpackhi_epi32(t[i + 4], t[i + 6]); + } + + // (1st, 2nd) ==> (lo, hi) + // (0, 4) ==> (0, 1) + // (1, 5) ==> (4, 5) + // (2, 6) ==> (2, 3) + // (3, 7) ==> (6, 7) + for (int i = 0; i < 2; i++) { + out[2 * i] = _mm256_unpacklo_epi64(u[2 * i], u[2 * i + 4]); + out[2 * i + 1] = _mm256_unpackhi_epi64(u[2 * i], u[2 * i + 4]); + + out[2 * i + 4] = _mm256_unpacklo_epi64(u[2 * i + 1], u[2 * i + 5]); + out[2 * i + 5] = _mm256_unpackhi_epi64(u[2 * i + 1], u[2 * i + 5]); + } +} + - // Unpack 16 bit elements. Goes from: - // in[0]: 00 01 02 03 08 09 0a 0b 04 05 06 07 0c 0d 0e 0f - // in[1]: 10 11 12 13 18 19 1a 1b 14 15 16 17 1c 1d 1e 1f - // in[2]: 20 21 22 23 28 29 2a 2b 24 25 26 27 2c 2d 2e 2f - // in[3]: 30 31 32 33 38 39 3a 3b 34 35 36 37 3c 3d 3e 3f - // in[4]: 40 41 42 43 48 49 4a 4b 44 45 46 47 4c 4d 4e 4f - // in[5]: 50 51 52 53 58 59 5a 5b 54 55 56 57 5c 5d 5e 5f - // in[6]: 60 61 62 63 68 69 6a 6b 64 65 66 67 6c 6d 6e 6f - // in[7]: 70 71 72 73 78 79 7a 7b 74 75 76 77 7c 7d 7e 7f - // in[8]: 80 81 82 83 88 89 8a 8b 84 85 86 87 8c 8d 8e 8f - // to: - // a0: 00 10 01 11 02 12 03 13 04 14 05 15 06 16 07 17 - // a1: 20 30 21 31 22 32 23 33 24 34 25 35 26 36 27 37 - // a2: 40 50 41 51 42 52 43 53 44 54 45 55 46 56 47 57 - // a3: 60 70 61 71 62 72 63 73 64 74 65 75 66 76 67 77 - // ... - __m256i a[16]; - for (int i = 0; i < 16; i += 2) { - a[i / 2 + 0] = _mm256_unpacklo_epi16(in[i], in[i + 1]); - a[i / 2 + 8] = _mm256_unpackhi_epi16(in[i], in[i + 1]); - } - __m256i b[16]; - for (int i = 0; i < 16; i += 2) { - b[i / 2 + 0] = _mm256_unpacklo_epi32(a[i], a[i + 1]); - b[i / 2 + 8] = _mm256_unpackhi_epi32(a[i], a[i + 1]); - } - __m256i c[16]; - for (int i = 0; i < 16; i += 2) { - c[i / 2 + 0] = _mm256_unpacklo_epi64(b[i], b[i + 1]); - c[i / 2 + 8] = _mm256_unpackhi_epi64(b[i], b[i + 1]); - } - out[0 + 0] = _mm256_permute2x128_si256(c[0], c[1], 0x20); - out[1 + 0] = _mm256_permute2x128_si256(c[8], c[9], 0x20); - out[2 + 0] = _mm256_permute2x128_si256(c[4], c[5], 0x20); - out[3 + 0] = _mm256_permute2x128_si256(c[12], c[13], 0x20); + __m256i t[16]; - out[0 + 8] = _mm256_permute2x128_si256(c[0], c[1], 0x31); - out[1 + 8] = _mm256_permute2x128_si256(c[8], c[9], 0x31); - out[2 + 8] = _mm256_permute2x128_si256(c[4], c[5], 0x31); - out[3 + 8] = _mm256_permute2x128_si256(c[12], c[13], 0x31); +#define LOADL(idx) \ + t[idx] = _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx])); \ + t[idx] = _mm256_inserti128_si256( \ + t[idx], _mm_load_si128((__m128i const *)&in[idx + 8]), 1); - out[4 + 0] = _mm256_permute2x128_si256(c[0 + 2], c[1 + 2], 0x20); - out[5 + 0] = _mm256_permute2x128_si256(c[8 + 2], c[9 + 2], 0x20); - out[6 + 0] = _mm256_permute2x128_si256(c[4 + 2], c[5 + 2], 0x20); - out[7 + 0] = _mm256_permute2x128_si256(c[12 + 2], c[13 + 2], 0x20); +#define LOADR(idx) \ + t[8 + idx] = \ + _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx] + 1)); \ + t[8 + idx] = _mm256_inserti128_si256( \ + t[8 + idx], _mm_load_si128((__m128i const *)&in[idx + 8] + 1), 1); - out[4 + 8] = _mm256_permute2x128_si256(c[0 + 2], c[1 + 2], 0x31); - out[5 + 8] = _mm256_permute2x128_si256(c[8 + 2], c[9 + 2], 0x31); - out[6 + 8] = _mm256_permute2x128_si256(c[4 + 2], c[5 + 2], 0x31); - out[7 + 8] = _mm256_permute2x128_si256(c[12 + 2], c[13 + 2], 0x31); + // load left 8x16 + LOADL(0) + LOADL(1) + LOADL(2) + LOADL(3) + LOADL(4) + LOADL(5) + LOADL(6) + LOADL(7) + + // load right 8x16 + LOADR(0) + LOADR(1) + LOADR(2) + LOADR(3) + LOADR(4) + LOADR(5) + LOADR(6) + LOADR(7) + + // get the top 16x8 result + transpose2_8x8_avx2(t, out); + // get the bottom 16x8 result + transpose2_8x8_avx2(&t[8], &out[8]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/txfm_common_avx2.h
125
126
127
128
129
130
131
132
133
134
// in[5]: 50 51 52 53 58 59 5a 5b 54 55 56 57 5c 5d 5e 5f // in[6]: 60 61 62 63 68 69 6a 6b 64 65 66 67 6c 6d 6e 6f // in[7]: 70 71 72 73 78 79 7a 7b 74 75 76 77 7c 7d 7e 7f // in[8]: 80 81 82 83 88 89 8a 8b 84 85 86 87 8c 8d 8e 8f // to: // a0: 00 10 01 11 02 12 03 13 04 14 05 15 06 16 07 17 // a1: 20 30 21 31 22 32 23 33 24 34 25 35 26 36 27 37 // a2: 40 50 41 51 42 52 43 53 44 54 45 55 46 56 47 57 // a3: 60 70 61 71 62 72 63 73 64 74 65 75 66 76 67 77 // ...
+ show +
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
__m256i a[16]; for (int i = 0; i < 16; i += 2) { a[i / 2 + 0] = _mm256_unpacklo_epi16(in[i], in[i + 1]); a[i / 2 + 8] = _mm256_unpackhi_epi16(in[i], in[i + 1]); } __m256i b[16]; for (int i = 0; i < 16; i += 2) { b[i / 2 + 0] = _mm256_unpacklo_epi32(a[i], a[i + 1]); b[i / 2 + 8] = _mm256_unpackhi_epi32(a[i], a[i + 1]); } __m256i c[16]; for (int i = 0; i < 16; i += 2) { c[i / 2 + 0] = _mm256_unpacklo_epi64(b[i], b[i + 1]); c[i / 2 + 8] = _mm256_unpackhi_epi64(b[i], b[i + 1]); } out[0 + 0] = _mm256_permute2x128_si256(c[0], c[1], 0x20); out[1 + 0] = _mm256_permute2x128_si256(c[8], c[9], 0x20); out[2 + 0] = _mm256_permute2x128_si256(c[4], c[5], 0x20); out[3 + 0] = _mm256_permute2x128_si256(c[12], c[13], 0x20); out[0 + 8] = _mm256_permute2x128_si256(c[0], c[1], 0x31); out[1 + 8] = _mm256_permute2x128_si256(c[8], c[9], 0x31); out[2 + 8] = _mm256_permute2x128_si256(c[4], c[5], 0x31); out[3 + 8] = _mm256_permute2x128_si256(c[12], c[13], 0x31); out[4 + 0] = _mm256_permute2x128_si256(c[0 + 2], c[1 + 2], 0x20); out[5 + 0] = _mm256_permute2x128_si256(c[8 + 2], c[9 + 2], 0x20); out[6 + 0] = _mm256_permute2x128_si256(c[4 + 2], c[5 + 2], 0x20); out[7 + 0] = _mm256_permute2x128_si256(c[12 + 2], c[13 + 2], 0x20); out[4 + 8] = _mm256_permute2x128_si256(c[0 + 2], c[1 + 2], 0x31); out[5 + 8] = _mm256_permute2x128_si256(c[8 + 2], c[9 + 2], 0x31); out[6 + 8] = _mm256_permute2x128_si256(c[4 + 2], c[5 + 2], 0x31); out[7 + 8] = _mm256_permute2x128_si256(c[12 + 2], c[13 + 2], 0x31);
+ show +
169
170
171
172
173
174
175
176
177
178
} static INLINE void transpose_16bit_16x8_avx2(const __m256i *const in, __m256i *const out) { const __m256i a0 = _mm256_unpacklo_epi16(in[0], in[1]); const __m256i a1 = _mm256_unpacklo_epi16(in[2], in[3]); const __m256i a2 = _mm256_unpacklo_epi16(in[4], in[5]); const __m256i a3 = _mm256_unpacklo_epi16(in[6], in[7]); const __m256i a4 = _mm256_unpackhi_epi16(in[0], in[1]); const __m256i a5 = _mm256_unpackhi_epi16(in[2], in[3]);

[CVE-2020-0470_1.diff] txfm_common_avx2.h #1
+static INLINE void transpose2_8x8_avx2(const __m256i *const in, + __m256i *const out) { + __m256i t[16], u[16]; + // (1st, 2nd) ==> (lo, hi) + // (0, 1) ==> (0, 1) + // (2, 3) ==> (2, 3) + // (4, 5) ==> (4, 5) + // (6, 7) ==> (6, 7) + for (int i = 0; i < 4; i++) { + t[2 * i] = _mm256_unpacklo_epi16(in[2 * i], in[2 * i + 1]); + t[2 * i + 1] = _mm256_unpackhi_epi16(in[2 * i], in[2 * i + 1]); + } + + // (1st, 2nd) ==> (lo, hi) + // (0, 2) ==> (0, 2) + // (1, 3) ==> (1, 3) + // (4, 6) ==> (4, 6) + // (5, 7) ==> (5, 7) + for (int i = 0; i < 2; i++) { + u[i] = _mm256_unpacklo_epi32(t[i], t[i + 2]); + u[i + 2] = _mm256_unpackhi_epi32(t[i], t[i + 2]); + + u[i + 4] = _mm256_unpacklo_epi32(t[i + 4], t[i + 6]); + u[i + 6] = _mm256_unpackhi_epi32(t[i + 4], t[i + 6]); + } + + // (1st, 2nd) ==> (lo, hi) + // (0, 4) ==> (0, 1) + // (1, 5) ==> (4, 5) + // (2, 6) ==> (2, 3) + // (3, 7) ==> (6, 7) + for (int i = 0; i < 2; i++) { + out[2 * i] = _mm256_unpacklo_epi64(u[2 * i], u[2 * i + 4]); + out[2 * i + 1] = _mm256_unpackhi_epi64(u[2 * i], u[2 * i + 4]); + + out[2 * i + 4] = _mm256_unpacklo_epi64(u[2 * i + 1], u[2 * i + 5]); + out[2 * i + 5] = _mm256_unpackhi_epi64(u[2 * i + 1], u[2 * i + 5]); + } +} + - // Unpack 16 bit elements. Goes from: - // in[0]: 00 01 02 03 08 09 0a 0b 04 05 06 07 0c 0d 0e 0f - // in[1]: 10 11 12 13 18 19 1a 1b 14 15 16 17 1c 1d 1e 1f - // in[2]: 20 21 22 23 28 29 2a 2b 24 25 26 27 2c 2d 2e 2f - // in[3]: 30 31 32 33 38 39 3a 3b 34 35 36 37 3c 3d 3e 3f - // in[4]: 40 41 42 43 48 49 4a 4b 44 45 46 47 4c 4d 4e 4f - // in[5]: 50 51 52 53 58 59 5a 5b 54 55 56 57 5c 5d 5e 5f - // in[6]: 60 61 62 63 68 69 6a 6b 64 65 66 67 6c 6d 6e 6f - // in[7]: 70 71 72 73 78 79 7a 7b 74 75 76 77 7c 7d 7e 7f - // in[8]: 80 81 82 83 88 89 8a 8b 84 85 86 87 8c 8d 8e 8f - // to: - // a0: 00 10 01 11 02 12 03 13 04 14 05 15 06 16 07 17 - // a1: 20 30 21 31 22 32 23 33 24 34 25 35 26 36 27 37 - // a2: 40 50 41 51 42 52 43 53 44 54 45 55 46 56 47 57 - // a3: 60 70 61 71 62 72 63 73 64 74 65 75 66 76 67 77 - // ... - __m256i a[16]; - for (int i = 0; i < 16; i += 2) { - a[i / 2 + 0] = _mm256_unpacklo_epi16(in[i], in[i + 1]); - a[i / 2 + 8] = _mm256_unpackhi_epi16(in[i], in[i + 1]); - } - __m256i b[16]; - for (int i = 0; i < 16; i += 2) { - b[i / 2 + 0] = _mm256_unpacklo_epi32(a[i], a[i + 1]); - b[i / 2 + 8] = _mm256_unpackhi_epi32(a[i], a[i + 1]); - } - __m256i c[16]; - for (int i = 0; i < 16; i += 2) { - c[i / 2 + 0] = _mm256_unpacklo_epi64(b[i], b[i + 1]); - c[i / 2 + 8] = _mm256_unpackhi_epi64(b[i], b[i + 1]); - } - out[0 + 0] = _mm256_permute2x128_si256(c[0], c[1], 0x20); - out[1 + 0] = _mm256_permute2x128_si256(c[8], c[9], 0x20); - out[2 + 0] = _mm256_permute2x128_si256(c[4], c[5], 0x20); - out[3 + 0] = _mm256_permute2x128_si256(c[12], c[13], 0x20); + __m256i t[16]; - out[0 + 8] = _mm256_permute2x128_si256(c[0], c[1], 0x31); - out[1 + 8] = _mm256_permute2x128_si256(c[8], c[9], 0x31); - out[2 + 8] = _mm256_permute2x128_si256(c[4], c[5], 0x31); - out[3 + 8] = _mm256_permute2x128_si256(c[12], c[13], 0x31); +#define LOADL(idx) \ + t[idx] = _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx])); \ + t[idx] = _mm256_inserti128_si256( \ + t[idx], _mm_load_si128((__m128i const *)&in[idx + 8]), 1); - out[4 + 0] = _mm256_permute2x128_si256(c[0 + 2], c[1 + 2], 0x20); - out[5 + 0] = _mm256_permute2x128_si256(c[8 + 2], c[9 + 2], 0x20); - out[6 + 0] = _mm256_permute2x128_si256(c[4 + 2], c[5 + 2], 0x20); - out[7 + 0] = _mm256_permute2x128_si256(c[12 + 2], c[13 + 2], 0x20); +#define LOADR(idx) \ + t[8 + idx] = \ + _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx] + 1)); \ + t[8 + idx] = _mm256_inserti128_si256( \ + t[8 + idx], _mm_load_si128((__m128i const *)&in[idx + 8] + 1), 1); - out[4 + 8] = _mm256_permute2x128_si256(c[0 + 2], c[1 + 2], 0x31); - out[5 + 8] = _mm256_permute2x128_si256(c[8 + 2], c[9 + 2], 0x31); - out[6 + 8] = _mm256_permute2x128_si256(c[4 + 2], c[5 + 2], 0x31); - out[7 + 8] = _mm256_permute2x128_si256(c[12 + 2], c[13 + 2], 0x31); + // load left 8x16 + LOADL(0) + LOADL(1) + LOADL(2) + LOADL(3) + LOADL(4) + LOADL(5) + LOADL(6) + LOADL(7) + + // load right 8x16 + LOADR(0) + LOADR(1) + LOADR(2) + LOADR(3) + LOADR(4) + LOADR(5) + LOADR(6) + LOADR(7) + + // get the top 16x8 result + transpose2_8x8_avx2(t, out); + // get the bottom 16x8 result + transpose2_8x8_avx2(&t[8], &out[8]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/txfm_common_avx2.h
125
126
127
128
129
130
131
132
133
134
// in[5]: 50 51 52 53 58 59 5a 5b 54 55 56 57 5c 5d 5e 5f // in[6]: 60 61 62 63 68 69 6a 6b 64 65 66 67 6c 6d 6e 6f // in[7]: 70 71 72 73 78 79 7a 7b 74 75 76 77 7c 7d 7e 7f // in[8]: 80 81 82 83 88 89 8a 8b 84 85 86 87 8c 8d 8e 8f // to: // a0: 00 10 01 11 02 12 03 13 04 14 05 15 06 16 07 17 // a1: 20 30 21 31 22 32 23 33 24 34 25 35 26 36 27 37 // a2: 40 50 41 51 42 52 43 53 44 54 45 55 46 56 47 57 // a3: 60 70 61 71 62 72 63 73 64 74 65 75 66 76 67 77 // ...
+ show +
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
__m256i a[16]; for (int i = 0; i < 16; i += 2) { a[i / 2 + 0] = _mm256_unpacklo_epi16(in[i], in[i + 1]); a[i / 2 + 8] = _mm256_unpackhi_epi16(in[i], in[i + 1]); } __m256i b[16]; for (int i = 0; i < 16; i += 2) { b[i / 2 + 0] = _mm256_unpacklo_epi32(a[i], a[i + 1]); b[i / 2 + 8] = _mm256_unpackhi_epi32(a[i], a[i + 1]); } __m256i c[16]; for (int i = 0; i < 16; i += 2) { c[i / 2 + 0] = _mm256_unpacklo_epi64(b[i], b[i + 1]); c[i / 2 + 8] = _mm256_unpackhi_epi64(b[i], b[i + 1]); } out[0 + 0] = _mm256_permute2x128_si256(c[0], c[1], 0x20); out[1 + 0] = _mm256_permute2x128_si256(c[8], c[9], 0x20); out[2 + 0] = _mm256_permute2x128_si256(c[4], c[5], 0x20); out[3 + 0] = _mm256_permute2x128_si256(c[12], c[13], 0x20); out[0 + 8] = _mm256_permute2x128_si256(c[0], c[1], 0x31); out[1 + 8] = _mm256_permute2x128_si256(c[8], c[9], 0x31); out[2 + 8] = _mm256_permute2x128_si256(c[4], c[5], 0x31); out[3 + 8] = _mm256_permute2x128_si256(c[12], c[13], 0x31); out[4 + 0] = _mm256_permute2x128_si256(c[0 + 2], c[1 + 2], 0x20); out[5 + 0] = _mm256_permute2x128_si256(c[8 + 2], c[9 + 2], 0x20); out[6 + 0] = _mm256_permute2x128_si256(c[4 + 2], c[5 + 2], 0x20); out[7 + 0] = _mm256_permute2x128_si256(c[12 + 2], c[13 + 2], 0x20); out[4 + 8] = _mm256_permute2x128_si256(c[0 + 2], c[1 + 2], 0x31); out[5 + 8] = _mm256_permute2x128_si256(c[8 + 2], c[9 + 2], 0x31); out[6 + 8] = _mm256_permute2x128_si256(c[4 + 2], c[5 + 2], 0x31); out[7 + 8] = _mm256_permute2x128_si256(c[12 + 2], c[13 + 2], 0x31);
+ show +
169
170
171
172
173
174
175
176
177
178
} static INLINE void transpose_16bit_16x8_avx2(const __m256i *const in, __m256i *const out) { const __m256i a0 = _mm256_unpacklo_epi16(in[0], in[1]); const __m256i a1 = _mm256_unpacklo_epi16(in[2], in[3]); const __m256i a2 = _mm256_unpacklo_epi16(in[4], in[5]); const __m256i a3 = _mm256_unpacklo_epi16(in[6], in[7]); const __m256i a4 = _mm256_unpackhi_epi16(in[0], in[1]); const __m256i a5 = _mm256_unpackhi_epi16(in[2], in[3]);

[CVE-2020-0478_1.diff] sad_impl_avx2.c #1
-static void sad64x64x4d(const uint8_t *src, int src_stride, - const uint8_t *const ref[4], int ref_stride, - __m128i *res) { - uint32_t sum[4]; - aom_sad64x64x4d_avx2(src, src_stride, ref, ref_stride, sum); - *res = _mm_loadu_si128((const __m128i *)sum); -} - -void aom_sad64x128x4d_avx2(const uint8_t *src, int src_stride, - const uint8_t *const ref[4], int ref_stride, - uint32_t res[4]) { - __m128i sum0, sum1; - const uint8_t *rf[4]; - - rf[0] = ref[0]; - rf[1] = ref[1]; - rf[2] = ref[2]; - rf[3] = ref[3]; - sad64x64x4d(src, src_stride, rf, ref_stride, &sum0); - src += src_stride << 6; - rf[0] += ref_stride << 6; - rf[1] += ref_stride << 6; - rf[2] += ref_stride << 6; - rf[3] += ref_stride << 6; - sad64x64x4d(src, src_stride, rf, ref_stride, &sum1); - sum0 = _mm_add_epi32(sum0, sum1); - _mm_storeu_si128((__m128i *)res, sum0); -} - -void aom_sad128x64x4d_avx2(const uint8_t *src, int src_stride, - const uint8_t *const ref[4], int ref_stride, - uint32_t res[4]) { - __m128i sum0, sum1; - unsigned int half_width = 64; - const uint8_t *rf[4]; - - rf[0] = ref[0]; - rf[1] = ref[1]; - rf[2] = ref[2]; - rf[3] = ref[3]; - sad64x64x4d(src, src_stride, rf, ref_stride, &sum0); - src += half_width; - rf[0] += half_width; - rf[1] += half_width; - rf[2] += half_width; - rf[3] += half_width; - sad64x64x4d(src, src_stride, rf, ref_stride, &sum1); - sum0 = _mm_add_epi32(sum0, sum1); - _mm_storeu_si128((__m128i *)res, sum0); -} - -void aom_sad128x128x4d_avx2(const uint8_t *src, int src_stride, - const uint8_t *const ref[4], int ref_stride, - uint32_t res[4]) { - const uint8_t *rf[4]; - uint32_t sum0[4]; - uint32_t sum1[4]; - - rf[0] = ref[0]; - rf[1] = ref[1]; - rf[2] = ref[2]; - rf[3] = ref[3]; - aom_sad128x64x4d_avx2(src, src_stride, rf, ref_stride, sum0); - src += src_stride << 6; - rf[0] += ref_stride << 6; - rf[1] += ref_stride << 6; - rf[2] += ref_stride << 6; - rf[3] += ref_stride << 6; - aom_sad128x64x4d_avx2(src, src_stride, rf, ref_stride, sum1); - res[0] = sum0[0] + sum1[0]; - res[1] = sum0[1] + sum1[1]; - res[2] = sum0[2] + sum1[2]; - res[3] = sum0[3] + sum1[3]; -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/sad_impl_avx2.c
77
78
79
80
81
82
83
84
85
86
unsigned int aom_sad128x128_avx2(const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride) { uint32_t sum = aom_sad128x64_avx2(src_ptr, src_stride, ref_ptr, ref_stride); src_ptr += src_stride << 6; ref_ptr += ref_stride << 6; sum += aom_sad128x64_avx2(src_ptr, src_stride, ref_ptr, ref_stride); return sum; }
+ show +
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
static void sad64x64x4d(const uint8_t *src, int src_stride, const uint8_t *const ref[4], int ref_stride, __m128i *res) { uint32_t sum[4]; aom_sad64x64x4d_avx2(src, src_stride, ref, ref_stride, sum); *res = _mm_loadu_si128((const __m128i *)sum); } void aom_sad64x128x4d_avx2(const uint8_t *src, int src_stride, const uint8_t *const ref[4], int ref_stride, uint32_t res[4]) { __m128i sum0, sum1; const uint8_t *rf[4]; rf[0] = ref[0]; rf[1] = ref[1]; rf[2] = ref[2]; rf[3] = ref[3]; sad64x64x4d(src, src_stride, rf, ref_stride, &sum0); src += src_stride << 6; rf[0] += ref_stride << 6; rf[1] += ref_stride << 6; rf[2] += ref_stride << 6; rf[3] += ref_stride << 6; sad64x64x4d(src, src_stride, rf, ref_stride, &sum1); sum0 = _mm_add_epi32(sum0, sum1); _mm_storeu_si128((__m128i *)res, sum0); } void aom_sad128x64x4d_avx2(const uint8_t *src, int src_stride, const uint8_t *const ref[4], int ref_stride, uint32_t res[4]) { __m128i sum0, sum1; unsigned int half_width = 64; const uint8_t *rf[4]; rf[0] = ref[0]; rf[1] = ref[1]; rf[2] = ref[2]; rf[3] = ref[3]; sad64x64x4d(src, src_stride, rf, ref_stride, &sum0); src += half_width; rf[0] += half_width; rf[1] += half_width; rf[2] += half_width; rf[3] += half_width; sad64x64x4d(src, src_stride, rf, ref_stride, &sum1); sum0 = _mm_add_epi32(sum0, sum1); _mm_storeu_si128((__m128i *)res, sum0); } void aom_sad128x128x4d_avx2(const uint8_t *src, int src_stride, const uint8_t *const ref[4], int ref_stride, uint32_t res[4]) { const uint8_t *rf[4]; uint32_t sum0[4]; uint32_t sum1[4]; rf[0] = ref[0]; rf[1] = ref[1]; rf[2] = ref[2]; rf[3] = ref[3]; aom_sad128x64x4d_avx2(src, src_stride, rf, ref_stride, sum0); src += src_stride << 6; rf[0] += ref_stride << 6; rf[1] += ref_stride << 6; rf[2] += ref_stride << 6; rf[3] += ref_stride << 6; aom_sad128x64x4d_avx2(src, src_stride, rf, ref_stride, sum1); res[0] = sum0[0] + sum1[0]; res[1] = sum0[1] + sum1[1]; res[2] = sum0[2] + sum1[2]; res[3] = sum0[3] + sum1[3];
+ show +
160
161
162
163
164
165
166
167
168
169
} static unsigned int sad_w64_avg_avx2(const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const int h, const uint8_t *second_pred, const int second_pred_stride) { int i, res; __m256i sad1_reg, sad2_reg, ref1_reg, ref2_reg; __m256i sum_sad = _mm256_setzero_si256(); __m256i sum_sad_h;

[CVE-2020-0470_1.diff] sad_impl_avx2.c #1
-static void sad64x64x4d(const uint8_t *src, int src_stride, - const uint8_t *const ref[4], int ref_stride, - __m128i *res) { - uint32_t sum[4]; - aom_sad64x64x4d_avx2(src, src_stride, ref, ref_stride, sum); - *res = _mm_loadu_si128((const __m128i *)sum); -} - -void aom_sad64x128x4d_avx2(const uint8_t *src, int src_stride, - const uint8_t *const ref[4], int ref_stride, - uint32_t res[4]) { - __m128i sum0, sum1; - const uint8_t *rf[4]; - - rf[0] = ref[0]; - rf[1] = ref[1]; - rf[2] = ref[2]; - rf[3] = ref[3]; - sad64x64x4d(src, src_stride, rf, ref_stride, &sum0); - src += src_stride << 6; - rf[0] += ref_stride << 6; - rf[1] += ref_stride << 6; - rf[2] += ref_stride << 6; - rf[3] += ref_stride << 6; - sad64x64x4d(src, src_stride, rf, ref_stride, &sum1); - sum0 = _mm_add_epi32(sum0, sum1); - _mm_storeu_si128((__m128i *)res, sum0); -} - -void aom_sad128x64x4d_avx2(const uint8_t *src, int src_stride, - const uint8_t *const ref[4], int ref_stride, - uint32_t res[4]) { - __m128i sum0, sum1; - unsigned int half_width = 64; - const uint8_t *rf[4]; - - rf[0] = ref[0]; - rf[1] = ref[1]; - rf[2] = ref[2]; - rf[3] = ref[3]; - sad64x64x4d(src, src_stride, rf, ref_stride, &sum0); - src += half_width; - rf[0] += half_width; - rf[1] += half_width; - rf[2] += half_width; - rf[3] += half_width; - sad64x64x4d(src, src_stride, rf, ref_stride, &sum1); - sum0 = _mm_add_epi32(sum0, sum1); - _mm_storeu_si128((__m128i *)res, sum0); -} - -void aom_sad128x128x4d_avx2(const uint8_t *src, int src_stride, - const uint8_t *const ref[4], int ref_stride, - uint32_t res[4]) { - const uint8_t *rf[4]; - uint32_t sum0[4]; - uint32_t sum1[4]; - - rf[0] = ref[0]; - rf[1] = ref[1]; - rf[2] = ref[2]; - rf[3] = ref[3]; - aom_sad128x64x4d_avx2(src, src_stride, rf, ref_stride, sum0); - src += src_stride << 6; - rf[0] += ref_stride << 6; - rf[1] += ref_stride << 6; - rf[2] += ref_stride << 6; - rf[3] += ref_stride << 6; - aom_sad128x64x4d_avx2(src, src_stride, rf, ref_stride, sum1); - res[0] = sum0[0] + sum1[0]; - res[1] = sum0[1] + sum1[1]; - res[2] = sum0[2] + sum1[2]; - res[3] = sum0[3] + sum1[3]; -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/sad_impl_avx2.c
77
78
79
80
81
82
83
84
85
86
unsigned int aom_sad128x128_avx2(const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride) { uint32_t sum = aom_sad128x64_avx2(src_ptr, src_stride, ref_ptr, ref_stride); src_ptr += src_stride << 6; ref_ptr += ref_stride << 6; sum += aom_sad128x64_avx2(src_ptr, src_stride, ref_ptr, ref_stride); return sum; }
+ show +
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
static void sad64x64x4d(const uint8_t *src, int src_stride, const uint8_t *const ref[4], int ref_stride, __m128i *res) { uint32_t sum[4]; aom_sad64x64x4d_avx2(src, src_stride, ref, ref_stride, sum); *res = _mm_loadu_si128((const __m128i *)sum); } void aom_sad64x128x4d_avx2(const uint8_t *src, int src_stride, const uint8_t *const ref[4], int ref_stride, uint32_t res[4]) { __m128i sum0, sum1; const uint8_t *rf[4]; rf[0] = ref[0]; rf[1] = ref[1]; rf[2] = ref[2]; rf[3] = ref[3]; sad64x64x4d(src, src_stride, rf, ref_stride, &sum0); src += src_stride << 6; rf[0] += ref_stride << 6; rf[1] += ref_stride << 6; rf[2] += ref_stride << 6; rf[3] += ref_stride << 6; sad64x64x4d(src, src_stride, rf, ref_stride, &sum1); sum0 = _mm_add_epi32(sum0, sum1); _mm_storeu_si128((__m128i *)res, sum0); } void aom_sad128x64x4d_avx2(const uint8_t *src, int src_stride, const uint8_t *const ref[4], int ref_stride, uint32_t res[4]) { __m128i sum0, sum1; unsigned int half_width = 64; const uint8_t *rf[4]; rf[0] = ref[0]; rf[1] = ref[1]; rf[2] = ref[2]; rf[3] = ref[3]; sad64x64x4d(src, src_stride, rf, ref_stride, &sum0); src += half_width; rf[0] += half_width; rf[1] += half_width; rf[2] += half_width; rf[3] += half_width; sad64x64x4d(src, src_stride, rf, ref_stride, &sum1); sum0 = _mm_add_epi32(sum0, sum1); _mm_storeu_si128((__m128i *)res, sum0); } void aom_sad128x128x4d_avx2(const uint8_t *src, int src_stride, const uint8_t *const ref[4], int ref_stride, uint32_t res[4]) { const uint8_t *rf[4]; uint32_t sum0[4]; uint32_t sum1[4]; rf[0] = ref[0]; rf[1] = ref[1]; rf[2] = ref[2]; rf[3] = ref[3]; aom_sad128x64x4d_avx2(src, src_stride, rf, ref_stride, sum0); src += src_stride << 6; rf[0] += ref_stride << 6; rf[1] += ref_stride << 6; rf[2] += ref_stride << 6; rf[3] += ref_stride << 6; aom_sad128x64x4d_avx2(src, src_stride, rf, ref_stride, sum1); res[0] = sum0[0] + sum1[0]; res[1] = sum0[1] + sum1[1]; res[2] = sum0[2] + sum1[2]; res[3] = sum0[3] + sum1[3];
+ show +
160
161
162
163
164
165
166
167
168
169
} static unsigned int sad_w64_avg_avx2(const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const int h, const uint8_t *second_pred, const int second_pred_stride) { int i, res; __m256i sad1_reg, sad2_reg, ref1_reg, ref2_reg; __m256i sum_sad = _mm256_setzero_si256(); __m256i sum_sad_h;

[CVE-2020-0478_1.diff] fwd_txfm_sse2.h #1
+static void FDCT4x4_2D_HELPER(const int16_t *input, int stride, __m128i *in0, + __m128i *in1) { + // Constants + // These are the coefficients used for the multiplies. + // In the comments, pN means cos(N pi /64) and mN is -cos(N pi /64), + // where cospi_N_64 = cos(N pi /64) + const __m128i k__cospi_A = + octa_set_epi16(cospi_16_64, cospi_16_64, cospi_16_64, cospi_16_64, + cospi_16_64, -cospi_16_64, cospi_16_64, -cospi_16_64); + const __m128i k__cospi_B = + octa_set_epi16(cospi_16_64, -cospi_16_64, cospi_16_64, -cospi_16_64, + cospi_16_64, cospi_16_64, cospi_16_64, cospi_16_64); + const __m128i k__cospi_C = + octa_set_epi16(cospi_8_64, cospi_24_64, cospi_8_64, cospi_24_64, + cospi_24_64, -cospi_8_64, cospi_24_64, -cospi_8_64); + const __m128i k__cospi_D = + octa_set_epi16(cospi_24_64, -cospi_8_64, cospi_24_64, -cospi_8_64, + cospi_8_64, cospi_24_64, cospi_8_64, cospi_24_64); + const __m128i k__cospi_E = + octa_set_epi16(cospi_16_64, cospi_16_64, cospi_16_64, cospi_16_64, + cospi_16_64, cospi_16_64, cospi_16_64, cospi_16_64); + const __m128i k__cospi_F = + octa_set_epi16(cospi_16_64, -cospi_16_64, cospi_16_64, -cospi_16_64, + cospi_16_64, -cospi_16_64, cospi_16_64, -cospi_16_64); + const __m128i k__cospi_G = + octa_set_epi16(cospi_8_64, cospi_24_64, cospi_8_64, cospi_24_64, + -cospi_8_64, -cospi_24_64, -cospi_8_64, -cospi_24_64); + const __m128i k__cospi_H = + octa_set_epi16(cospi_24_64, -cospi_8_64, cospi_24_64, -cospi_8_64, + -cospi_24_64, cospi_8_64, -cospi_24_64, cospi_8_64); + + const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING); + // This second rounding constant saves doing some extra adds at the end + const __m128i k__DCT_CONST_ROUNDING2 = + _mm_set1_epi32(DCT_CONST_ROUNDING + (DCT_CONST_ROUNDING << 1)); + const int DCT_CONST_BITS2 = DCT_CONST_BITS + 2; + const __m128i k__nonzero_bias_a = _mm_setr_epi16(0, 1, 1, 1, 1, 1, 1, 1); + const __m128i k__nonzero_bias_b = _mm_setr_epi16(1, 0, 0, 0, 0, 0, 0, 0); + + // Load inputs. + *in0 = _mm_loadl_epi64((const __m128i *)(input + 0 * stride)); + *in1 = _mm_loadl_epi64((const __m128i *)(input + 1 * stride)); + *in1 = _mm_unpacklo_epi64( + *in1, _mm_loadl_epi64((const __m128i *)(input + 2 * stride))); + *in0 = _mm_unpacklo_epi64( + *in0, _mm_loadl_epi64((const __m128i *)(input + 3 * stride))); + // in0 = [i0 i1 i2 i3 iC iD iE iF] + // in1 = [i4 i5 i6 i7 i8 i9 iA iB] + // multiply by 16 to give some extra precision + *in0 = _mm_slli_epi16(*in0, 4); + *in1 = _mm_slli_epi16(*in1, 4); + // if (i == 0 && input[0]) input[0] += 1; + // add 1 to the upper left pixel if it is non-zero, which helps reduce + // the round-trip error + { + // The mask will only contain whether the first value is zero, all + // other comparison will fail as something shifted by 4 (above << 4) + // can never be equal to one. To increment in the non-zero case, we + // add the mask and one for the first element: + // - if zero, mask = -1, v = v - 1 + 1 = v + // - if non-zero, mask = 0, v = v + 0 + 1 = v + 1 + __m128i mask = _mm_cmpeq_epi16(*in0, k__nonzero_bias_a); + *in0 = _mm_add_epi16(*in0, mask); + *in0 = _mm_add_epi16(*in0, k__nonzero_bias_b); + } + // There are 4 total stages, alternating between an add/subtract stage + // followed by an multiply-and-add stage. + { + // Stage 1: Add/subtract + + // in0 = [i0 i1 i2 i3 iC iD iE iF] + // in1 = [i4 i5 i6 i7 i8 i9 iA iB] + const __m128i r0 = _mm_unpacklo_epi16(*in0, *in1); + const __m128i r1 = _mm_unpackhi_epi16(*in0, *in1); + // r0 = [i0 i4 i1 i5 i2 i6 i3 i7] + // r1 = [iC i8 iD i9 iE iA iF iB] + const __m128i r2 = _mm_shuffle_epi32(r0, 0xB4); + const __m128i r3 = _mm_shuffle_epi32(r1, 0xB4); + // r2 = [i0 i4 i1 i5 i3 i7 i2 i6] + // r3 = [iC i8 iD i9 iF iB iE iA] + + const __m128i t0 = _mm_add_epi16(r2, r3); + const __m128i t1 = _mm_sub_epi16(r2, r3); + // t0 = [a0 a4 a1 a5 a3 a7 a2 a6] + // t1 = [aC a8 aD a9 aF aB aE aA] + + // Stage 2: multiply by constants (which gets us into 32 bits). + // The constants needed here are: + // k__cospi_A = [p16 p16 p16 p16 p16 m16 p16 m16] + // k__cospi_B = [p16 m16 p16 m16 p16 p16 p16 p16] + // k__cospi_C = [p08 p24 p08 p24 p24 m08 p24 m08] + // k__cospi_D = [p24 m08 p24 m08 p08 p24 p08 p24] + const __m128i u0 = _mm_madd_epi16(t0, k__cospi_A); + const __m128i u2 = _mm_madd_epi16(t0, k__cospi_B); + const __m128i u1 = _mm_madd_epi16(t1, k__cospi_C); + const __m128i u3 = _mm_madd_epi16(t1, k__cospi_D); + // Then add and right-shift to get back to 16-bit range + const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING); + const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING); + const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING); + const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING); + const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS); + const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS); + const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS); + const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS); + // w0 = [b0 b1 b7 b6] + // w1 = [b8 b9 bF bE] + // w2 = [b4 b5 b3 b2] + // w3 = [bC bD bB bA] + const __m128i x0 = _mm_packs_epi32(w0, w1); + const __m128i x1 = _mm_packs_epi32(w2, w3); + + // x0 = [b0 b1 b7 b6 b8 b9 bF bE] + // x1 = [b4 b5 b3 b2 bC bD bB bA] + *in0 = _mm_shuffle_epi32(x0, 0xD8); + *in1 = _mm_shuffle_epi32(x1, 0x8D); + // in0 = [b0 b1 b8 b9 b7 b6 bF bE] + // in1 = [b3 b2 bB bA b4 b5 bC bD] + } + { + // vertical DCTs finished. Now we do the horizontal DCTs. + // Stage 3: Add/subtract + + const __m128i t0 = ADD_EPI16(*in0, *in1); + const __m128i t1 = SUB_EPI16(*in0, *in1); + + // Stage 4: multiply by constants (which gets us into 32 bits). + { + // The constants needed here are: + // k__cospi_E = [p16 p16 p16 p16 p16 p16 p16 p16] + // k__cospi_F = [p16 m16 p16 m16 p16 m16 p16 m16] + // k__cospi_G = [p08 p24 p08 p24 m08 m24 m08 m24] + // k__cospi_H = [p24 m08 p24 m08 m24 p08 m24 p08] + const __m128i u0 = _mm_madd_epi16(t0, k__cospi_E); + const __m128i u1 = _mm_madd_epi16(t0, k__cospi_F); + const __m128i u2 = _mm_madd_epi16(t1, k__cospi_G); + const __m128i u3 = _mm_madd_epi16(t1, k__cospi_H); + // Then add and right-shift to get back to 16-bit range + // but this combines the final right-shift as well to save operations + // This unusual rounding operations is to maintain bit-accurate + // compatibility with the c version of this function which has two + // rounding steps in a row. + const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING2); + const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING2); + const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING2); + const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING2); + const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS2); + const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS2); + const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS2); + const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS2); + // w0 = [o0 o4 o8 oC] + // w1 = [o2 o6 oA oE] + // w2 = [o1 o5 o9 oD] + // w3 = [o3 o7 oB oF] + // remember the o's are numbered according to the correct output location + const __m128i x0 = _mm_packs_epi32(w0, w1); + const __m128i x1 = _mm_packs_epi32(w2, w3); + { + // x0 = [o0 o4 o8 oC o2 o6 oA oE] + // x1 = [o1 o5 o9 oD o3 o7 oB oF] + const __m128i y0 = _mm_unpacklo_epi16(x0, x1); + const __m128i y1 = _mm_unpackhi_epi16(x0, x1); + // y0 = [o0 o1 o4 o5 o8 o9 oC oD] + // y1 = [o2 o3 o6 o7 oA oB oE oF] + *in0 = _mm_unpacklo_epi32(y0, y1); + // in0 = [o0 o1 o2 o3 o4 o5 o6 o7] + *in1 = _mm_unpackhi_epi32(y0, y1); + // in1 = [o8 o9 oA oB oC oD oE oF] + } + } + } +} + +void FDCT4x4_2D(const int16_t *input, tran_low_t *output, int stride) { + // This 2D transform implements 4 vertical 1D transforms followed + // by 4 horizontal 1D transforms. The multiplies and adds are as given + // by Chen, Smith and Fralick ('77). The commands for moving the data + // around have been minimized by hand. + // For the purposes of the comments, the 16 inputs are referred to at i0 + // through iF (in raster order), intermediate variables are a0, b0, c0 + // through f, and correspond to the in-place computations mapped to input + // locations. The outputs, o0 through oF are labeled according to the + // output locations. + __m128i in0, in1; + FDCT4x4_2D_HELPER(input, stride, &in0, &in1); + + // Post-condition (v + 1) >> 2 is now incorporated into previous + // add and right-shift commands. Only 2 store instructions needed + // because we are using the fact that 1/3 are stored just after 0/2. + storeu_output(&in0, output + 0 * 4); + storeu_output(&in1, output + 2 * 4); +} + +void FDCT4x4_2D_LP(const int16_t *input, int16_t *output, int stride) { + __m128i in0, in1; + FDCT4x4_2D_HELPER(input, stride, &in0, &in1); + _mm_storeu_si128((__m128i *)(output + 0 * 4), in0); + _mm_storeu_si128((__m128i *)(output + 2 * 4), in1); +} + +#define FDCT4x4_2D_HELPER fdct4x4_helper +#define FDCT4x4_2D aom_fdct4x4_sse2 +#define FDCT4x4_2D_LP aom_fdct4x4_lp_sse2 +#undef FDCT4x4_2D_HELPER +#undef FDCT4x4_2D +#undef FDCT4x4_2D_LP +#if CONFIG_AV1_HIGHBITDEPTH + + +#endif - if (sizeof(tran_low_t) == 4) { - const __m128i zero = _mm_setzero_si128(); - const __m128i sign_bits = _mm_cmplt_epi16(*poutput, zero); - __m128i out0 = _mm_unpacklo_epi16(*poutput, sign_bits); - __m128i out1 = _mm_unpackhi_epi16(*poutput, sign_bits); - _mm_store_si128((__m128i *)(dst_ptr), out0); - _mm_store_si128((__m128i *)(dst_ptr + 4), out1); - } else { - _mm_store_si128((__m128i *)(dst_ptr), *poutput); - } + const __m128i zero = _mm_setzero_si128(); + const __m128i sign_bits = _mm_cmplt_epi16(*poutput, zero); + __m128i out0 = _mm_unpacklo_epi16(*poutput, sign_bits); + __m128i out1 = _mm_unpackhi_epi16(*poutput, sign_bits); + _mm_store_si128((__m128i *)(dst_ptr), out0); + _mm_store_si128((__m128i *)(dst_ptr + 4), out1); +} + +static INLINE void storeu_output(const __m128i *poutput, tran_low_t *dst_ptr) { + const __m128i zero = _mm_setzero_si128(); + const __m128i sign_bits = _mm_cmplt_epi16(*poutput, zero); + __m128i out0 = _mm_unpacklo_epi16(*poutput, sign_bits); + __m128i out1 = _mm_unpackhi_epi16(*poutput, sign_bits); + _mm_storeu_si128((__m128i *)(dst_ptr), out0); + _mm_storeu_si128((__m128i *)(dst_ptr + 4), out1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/fwd_txfm_sse2.h
129
130
131
132
133
134
135
136
137
138
res1 = check_epi16_overflow_x4(preg28, preg29, preg30, preg31); } } } } } return res0 + res1; } static INLINE void store_output(const __m128i *poutput, tran_low_t *dst_ptr) {
+ show +
139
140
141
142
143
144
145
146
147
if (sizeof(tran_low_t) == 4) { const __m128i zero = _mm_setzero_si128(); const __m128i sign_bits = _mm_cmplt_epi16(*poutput, zero); __m128i out0 = _mm_unpacklo_epi16(*poutput, sign_bits); __m128i out1 = _mm_unpackhi_epi16(*poutput, sign_bits); _mm_store_si128((__m128i *)(dst_ptr), out0); _mm_store_si128((__m128i *)(dst_ptr + 4), out1); } else { _mm_store_si128((__m128i *)(dst_ptr), *poutput);
+ show +
148
149
150
151
152
153
154
155
} } #ifdef __cplusplus } // extern "C" #endif #endif // AOM_AOM_DSP_X86_FWD_TXFM_SSE2_H_

[CVE-2020-0470_1.diff] fwd_txfm_sse2.h #1
+static void FDCT4x4_2D_HELPER(const int16_t *input, int stride, __m128i *in0, + __m128i *in1) { + // Constants + // These are the coefficients used for the multiplies. + // In the comments, pN means cos(N pi /64) and mN is -cos(N pi /64), + // where cospi_N_64 = cos(N pi /64) + const __m128i k__cospi_A = + octa_set_epi16(cospi_16_64, cospi_16_64, cospi_16_64, cospi_16_64, + cospi_16_64, -cospi_16_64, cospi_16_64, -cospi_16_64); + const __m128i k__cospi_B = + octa_set_epi16(cospi_16_64, -cospi_16_64, cospi_16_64, -cospi_16_64, + cospi_16_64, cospi_16_64, cospi_16_64, cospi_16_64); + const __m128i k__cospi_C = + octa_set_epi16(cospi_8_64, cospi_24_64, cospi_8_64, cospi_24_64, + cospi_24_64, -cospi_8_64, cospi_24_64, -cospi_8_64); + const __m128i k__cospi_D = + octa_set_epi16(cospi_24_64, -cospi_8_64, cospi_24_64, -cospi_8_64, + cospi_8_64, cospi_24_64, cospi_8_64, cospi_24_64); + const __m128i k__cospi_E = + octa_set_epi16(cospi_16_64, cospi_16_64, cospi_16_64, cospi_16_64, + cospi_16_64, cospi_16_64, cospi_16_64, cospi_16_64); + const __m128i k__cospi_F = + octa_set_epi16(cospi_16_64, -cospi_16_64, cospi_16_64, -cospi_16_64, + cospi_16_64, -cospi_16_64, cospi_16_64, -cospi_16_64); + const __m128i k__cospi_G = + octa_set_epi16(cospi_8_64, cospi_24_64, cospi_8_64, cospi_24_64, + -cospi_8_64, -cospi_24_64, -cospi_8_64, -cospi_24_64); + const __m128i k__cospi_H = + octa_set_epi16(cospi_24_64, -cospi_8_64, cospi_24_64, -cospi_8_64, + -cospi_24_64, cospi_8_64, -cospi_24_64, cospi_8_64); + + const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING); + // This second rounding constant saves doing some extra adds at the end + const __m128i k__DCT_CONST_ROUNDING2 = + _mm_set1_epi32(DCT_CONST_ROUNDING + (DCT_CONST_ROUNDING << 1)); + const int DCT_CONST_BITS2 = DCT_CONST_BITS + 2; + const __m128i k__nonzero_bias_a = _mm_setr_epi16(0, 1, 1, 1, 1, 1, 1, 1); + const __m128i k__nonzero_bias_b = _mm_setr_epi16(1, 0, 0, 0, 0, 0, 0, 0); + + // Load inputs. + *in0 = _mm_loadl_epi64((const __m128i *)(input + 0 * stride)); + *in1 = _mm_loadl_epi64((const __m128i *)(input + 1 * stride)); + *in1 = _mm_unpacklo_epi64( + *in1, _mm_loadl_epi64((const __m128i *)(input + 2 * stride))); + *in0 = _mm_unpacklo_epi64( + *in0, _mm_loadl_epi64((const __m128i *)(input + 3 * stride))); + // in0 = [i0 i1 i2 i3 iC iD iE iF] + // in1 = [i4 i5 i6 i7 i8 i9 iA iB] + // multiply by 16 to give some extra precision + *in0 = _mm_slli_epi16(*in0, 4); + *in1 = _mm_slli_epi16(*in1, 4); + // if (i == 0 && input[0]) input[0] += 1; + // add 1 to the upper left pixel if it is non-zero, which helps reduce + // the round-trip error + { + // The mask will only contain whether the first value is zero, all + // other comparison will fail as something shifted by 4 (above << 4) + // can never be equal to one. To increment in the non-zero case, we + // add the mask and one for the first element: + // - if zero, mask = -1, v = v - 1 + 1 = v + // - if non-zero, mask = 0, v = v + 0 + 1 = v + 1 + __m128i mask = _mm_cmpeq_epi16(*in0, k__nonzero_bias_a); + *in0 = _mm_add_epi16(*in0, mask); + *in0 = _mm_add_epi16(*in0, k__nonzero_bias_b); + } + // There are 4 total stages, alternating between an add/subtract stage + // followed by an multiply-and-add stage. + { + // Stage 1: Add/subtract + + // in0 = [i0 i1 i2 i3 iC iD iE iF] + // in1 = [i4 i5 i6 i7 i8 i9 iA iB] + const __m128i r0 = _mm_unpacklo_epi16(*in0, *in1); + const __m128i r1 = _mm_unpackhi_epi16(*in0, *in1); + // r0 = [i0 i4 i1 i5 i2 i6 i3 i7] + // r1 = [iC i8 iD i9 iE iA iF iB] + const __m128i r2 = _mm_shuffle_epi32(r0, 0xB4); + const __m128i r3 = _mm_shuffle_epi32(r1, 0xB4); + // r2 = [i0 i4 i1 i5 i3 i7 i2 i6] + // r3 = [iC i8 iD i9 iF iB iE iA] + + const __m128i t0 = _mm_add_epi16(r2, r3); + const __m128i t1 = _mm_sub_epi16(r2, r3); + // t0 = [a0 a4 a1 a5 a3 a7 a2 a6] + // t1 = [aC a8 aD a9 aF aB aE aA] + + // Stage 2: multiply by constants (which gets us into 32 bits). + // The constants needed here are: + // k__cospi_A = [p16 p16 p16 p16 p16 m16 p16 m16] + // k__cospi_B = [p16 m16 p16 m16 p16 p16 p16 p16] + // k__cospi_C = [p08 p24 p08 p24 p24 m08 p24 m08] + // k__cospi_D = [p24 m08 p24 m08 p08 p24 p08 p24] + const __m128i u0 = _mm_madd_epi16(t0, k__cospi_A); + const __m128i u2 = _mm_madd_epi16(t0, k__cospi_B); + const __m128i u1 = _mm_madd_epi16(t1, k__cospi_C); + const __m128i u3 = _mm_madd_epi16(t1, k__cospi_D); + // Then add and right-shift to get back to 16-bit range + const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING); + const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING); + const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING); + const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING); + const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS); + const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS); + const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS); + const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS); + // w0 = [b0 b1 b7 b6] + // w1 = [b8 b9 bF bE] + // w2 = [b4 b5 b3 b2] + // w3 = [bC bD bB bA] + const __m128i x0 = _mm_packs_epi32(w0, w1); + const __m128i x1 = _mm_packs_epi32(w2, w3); + + // x0 = [b0 b1 b7 b6 b8 b9 bF bE] + // x1 = [b4 b5 b3 b2 bC bD bB bA] + *in0 = _mm_shuffle_epi32(x0, 0xD8); + *in1 = _mm_shuffle_epi32(x1, 0x8D); + // in0 = [b0 b1 b8 b9 b7 b6 bF bE] + // in1 = [b3 b2 bB bA b4 b5 bC bD] + } + { + // vertical DCTs finished. Now we do the horizontal DCTs. + // Stage 3: Add/subtract + + const __m128i t0 = ADD_EPI16(*in0, *in1); + const __m128i t1 = SUB_EPI16(*in0, *in1); + + // Stage 4: multiply by constants (which gets us into 32 bits). + { + // The constants needed here are: + // k__cospi_E = [p16 p16 p16 p16 p16 p16 p16 p16] + // k__cospi_F = [p16 m16 p16 m16 p16 m16 p16 m16] + // k__cospi_G = [p08 p24 p08 p24 m08 m24 m08 m24] + // k__cospi_H = [p24 m08 p24 m08 m24 p08 m24 p08] + const __m128i u0 = _mm_madd_epi16(t0, k__cospi_E); + const __m128i u1 = _mm_madd_epi16(t0, k__cospi_F); + const __m128i u2 = _mm_madd_epi16(t1, k__cospi_G); + const __m128i u3 = _mm_madd_epi16(t1, k__cospi_H); + // Then add and right-shift to get back to 16-bit range + // but this combines the final right-shift as well to save operations + // This unusual rounding operations is to maintain bit-accurate + // compatibility with the c version of this function which has two + // rounding steps in a row. + const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING2); + const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING2); + const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING2); + const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING2); + const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS2); + const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS2); + const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS2); + const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS2); + // w0 = [o0 o4 o8 oC] + // w1 = [o2 o6 oA oE] + // w2 = [o1 o5 o9 oD] + // w3 = [o3 o7 oB oF] + // remember the o's are numbered according to the correct output location + const __m128i x0 = _mm_packs_epi32(w0, w1); + const __m128i x1 = _mm_packs_epi32(w2, w3); + { + // x0 = [o0 o4 o8 oC o2 o6 oA oE] + // x1 = [o1 o5 o9 oD o3 o7 oB oF] + const __m128i y0 = _mm_unpacklo_epi16(x0, x1); + const __m128i y1 = _mm_unpackhi_epi16(x0, x1); + // y0 = [o0 o1 o4 o5 o8 o9 oC oD] + // y1 = [o2 o3 o6 o7 oA oB oE oF] + *in0 = _mm_unpacklo_epi32(y0, y1); + // in0 = [o0 o1 o2 o3 o4 o5 o6 o7] + *in1 = _mm_unpackhi_epi32(y0, y1); + // in1 = [o8 o9 oA oB oC oD oE oF] + } + } + } +} + +void FDCT4x4_2D(const int16_t *input, tran_low_t *output, int stride) { + // This 2D transform implements 4 vertical 1D transforms followed + // by 4 horizontal 1D transforms. The multiplies and adds are as given + // by Chen, Smith and Fralick ('77). The commands for moving the data + // around have been minimized by hand. + // For the purposes of the comments, the 16 inputs are referred to at i0 + // through iF (in raster order), intermediate variables are a0, b0, c0 + // through f, and correspond to the in-place computations mapped to input + // locations. The outputs, o0 through oF are labeled according to the + // output locations. + __m128i in0, in1; + FDCT4x4_2D_HELPER(input, stride, &in0, &in1); + + // Post-condition (v + 1) >> 2 is now incorporated into previous + // add and right-shift commands. Only 2 store instructions needed + // because we are using the fact that 1/3 are stored just after 0/2. + storeu_output(&in0, output + 0 * 4); + storeu_output(&in1, output + 2 * 4); +} + +void FDCT4x4_2D_LP(const int16_t *input, int16_t *output, int stride) { + __m128i in0, in1; + FDCT4x4_2D_HELPER(input, stride, &in0, &in1); + _mm_storeu_si128((__m128i *)(output + 0 * 4), in0); + _mm_storeu_si128((__m128i *)(output + 2 * 4), in1); +} + +#define FDCT4x4_2D_HELPER fdct4x4_helper +#define FDCT4x4_2D aom_fdct4x4_sse2 +#define FDCT4x4_2D_LP aom_fdct4x4_lp_sse2 +#undef FDCT4x4_2D_HELPER +#undef FDCT4x4_2D +#undef FDCT4x4_2D_LP +#if CONFIG_AV1_HIGHBITDEPTH + + +#endif - if (sizeof(tran_low_t) == 4) { - const __m128i zero = _mm_setzero_si128(); - const __m128i sign_bits = _mm_cmplt_epi16(*poutput, zero); - __m128i out0 = _mm_unpacklo_epi16(*poutput, sign_bits); - __m128i out1 = _mm_unpackhi_epi16(*poutput, sign_bits); - _mm_store_si128((__m128i *)(dst_ptr), out0); - _mm_store_si128((__m128i *)(dst_ptr + 4), out1); - } else { - _mm_store_si128((__m128i *)(dst_ptr), *poutput); - } + const __m128i zero = _mm_setzero_si128(); + const __m128i sign_bits = _mm_cmplt_epi16(*poutput, zero); + __m128i out0 = _mm_unpacklo_epi16(*poutput, sign_bits); + __m128i out1 = _mm_unpackhi_epi16(*poutput, sign_bits); + _mm_store_si128((__m128i *)(dst_ptr), out0); + _mm_store_si128((__m128i *)(dst_ptr + 4), out1); +} + +static INLINE void storeu_output(const __m128i *poutput, tran_low_t *dst_ptr) { + const __m128i zero = _mm_setzero_si128(); + const __m128i sign_bits = _mm_cmplt_epi16(*poutput, zero); + __m128i out0 = _mm_unpacklo_epi16(*poutput, sign_bits); + __m128i out1 = _mm_unpackhi_epi16(*poutput, sign_bits); + _mm_storeu_si128((__m128i *)(dst_ptr), out0); + _mm_storeu_si128((__m128i *)(dst_ptr + 4), out1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/fwd_txfm_sse2.h
129
130
131
132
133
134
135
136
137
138
res1 = check_epi16_overflow_x4(preg28, preg29, preg30, preg31); } } } } } return res0 + res1; } static INLINE void store_output(const __m128i *poutput, tran_low_t *dst_ptr) {
+ show +
139
140
141
142
143
144
145
146
147
if (sizeof(tran_low_t) == 4) { const __m128i zero = _mm_setzero_si128(); const __m128i sign_bits = _mm_cmplt_epi16(*poutput, zero); __m128i out0 = _mm_unpacklo_epi16(*poutput, sign_bits); __m128i out1 = _mm_unpackhi_epi16(*poutput, sign_bits); _mm_store_si128((__m128i *)(dst_ptr), out0); _mm_store_si128((__m128i *)(dst_ptr + 4), out1); } else { _mm_store_si128((__m128i *)(dst_ptr), *poutput);
+ show +
148
149
150
151
152
153
154
155
} } #ifdef __cplusplus } // extern "C" #endif #endif // AOM_AOM_DSP_X86_FWD_TXFM_SSE2_H_

[CVE-2020-0478_1.diff] adaptive_quantize_sse2.c #4
- prescan0 = _mm_loadu_si128((const __m128i *)(prescan + index)); - prescan1 = _mm_loadu_si128((const __m128i *)(prescan + index + 8)); + update_mask0(&qcoeff0, &qcoeff1, threshold, iscan + index, &is_found0, + &mask0); - cmp_mask0 = _mm_and_si128(prescan0, _mm_cmpgt_epi16(qcoeff0, zbin)); - cmp_mask1 = _mm_and_si128(prescan1, _mm_cmpgt_epi16(qcoeff1, zbin)); + cmp_mask0 = _mm_cmpgt_epi16(qcoeff0, zbin); + cmp_mask1 = _mm_cmpgt_epi16(qcoeff1, zbin); + + update_mask1(&cmp_mask0, &cmp_mask1, iscan + index, &is_found1, &mask1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/adaptive_quantize_sse2.c
130
131
132
133
134
135
136
137
138
139
// based on eob logic while (index < n_coeffs) { coeff0 = load_coefficients(coeff_ptr + index); coeff1 = load_coefficients(coeff_ptr + index + 8); coeff0_sign = _mm_srai_epi16(coeff0, 15); coeff1_sign = _mm_srai_epi16(coeff1, 15); qcoeff0 = invert_sign_sse2(coeff0, coeff0_sign); qcoeff1 = invert_sign_sse2(coeff1, coeff1_sign);
+ show +
140
141
142
143
144
prescan0 = _mm_loadu_si128((const __m128i *)(prescan + index)); prescan1 = _mm_loadu_si128((const __m128i *)(prescan + index + 8)); cmp_mask0 = _mm_and_si128(prescan0, _mm_cmpgt_epi16(qcoeff0, zbin)); cmp_mask1 = _mm_and_si128(prescan1, _mm_cmpgt_epi16(qcoeff1, zbin));
+ show +
145
146
147
148
149
150
151
152
153
154
all_zero = _mm_or_si128(cmp_mask0, cmp_mask1); if (_mm_movemask_epi8(all_zero) == 0) { _mm_store_si128((__m128i *)(qcoeff_ptr + index), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 4), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 8), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 12), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index + 4), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index + 8), zero);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/adaptive_quantize_sse2.c
338
339
340
341
342
343
344
345
346
347
// based on eob logic while (index < n_coeffs) { coeff0 = load_coefficients(coeff_ptr + index); coeff1 = load_coefficients(coeff_ptr + index + 8); coeff0_sign = _mm_srai_epi16(coeff0, 15); coeff1_sign = _mm_srai_epi16(coeff1, 15); qcoeff0 = invert_sign_sse2(coeff0, coeff0_sign); qcoeff1 = invert_sign_sse2(coeff1, coeff1_sign);
+ show +
348
349
350
351
352
prescan0 = _mm_loadu_si128((const __m128i *)(prescan + index)); prescan1 = _mm_loadu_si128((const __m128i *)(prescan + index + 8)); cmp_mask0 = _mm_and_si128(prescan0, _mm_cmpgt_epi16(qcoeff0, zbin)); cmp_mask1 = _mm_and_si128(prescan1, _mm_cmpgt_epi16(qcoeff1, zbin));
+ show +
353
354
355
356
357
358
359
360
361
362
all_zero = _mm_or_si128(cmp_mask0, cmp_mask1); if (_mm_movemask_epi8(all_zero) == 0) { _mm_store_si128((__m128i *)(qcoeff_ptr + index), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 4), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 8), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 12), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index + 4), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index + 8), zero);

[CVE-2020-0478_1.diff] adaptive_quantize_sse2.c #13
- prescan0 = _mm_loadu_si128((const __m128i *)(prescan + index)); - prescan1 = _mm_loadu_si128((const __m128i *)(prescan + index + 8)); + update_mask0(&qcoeff0, &qcoeff1, threshold, iscan + index, &is_found0, + &mask0); - cmp_mask0 = _mm_and_si128(prescan0, _mm_cmpgt_epi16(qcoeff0, zbin)); - cmp_mask1 = _mm_and_si128(prescan1, _mm_cmpgt_epi16(qcoeff1, zbin)); + cmp_mask0 = _mm_cmpgt_epi16(qcoeff0, zbin); + cmp_mask1 = _mm_cmpgt_epi16(qcoeff1, zbin); + + update_mask1(&cmp_mask0, &cmp_mask1, iscan + index, &is_found1, &mask1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/adaptive_quantize_sse2.c
130
131
132
133
134
135
136
137
138
139
// based on eob logic while (index < n_coeffs) { coeff0 = load_coefficients(coeff_ptr + index); coeff1 = load_coefficients(coeff_ptr + index + 8); coeff0_sign = _mm_srai_epi16(coeff0, 15); coeff1_sign = _mm_srai_epi16(coeff1, 15); qcoeff0 = invert_sign_sse2(coeff0, coeff0_sign); qcoeff1 = invert_sign_sse2(coeff1, coeff1_sign);
+ show +
140
141
142
143
144
prescan0 = _mm_loadu_si128((const __m128i *)(prescan + index)); prescan1 = _mm_loadu_si128((const __m128i *)(prescan + index + 8)); cmp_mask0 = _mm_and_si128(prescan0, _mm_cmpgt_epi16(qcoeff0, zbin)); cmp_mask1 = _mm_and_si128(prescan1, _mm_cmpgt_epi16(qcoeff1, zbin));
+ show +
145
146
147
148
149
150
151
152
153
154
all_zero = _mm_or_si128(cmp_mask0, cmp_mask1); if (_mm_movemask_epi8(all_zero) == 0) { _mm_store_si128((__m128i *)(qcoeff_ptr + index), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 4), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 8), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 12), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index + 4), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index + 8), zero);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/adaptive_quantize_sse2.c
338
339
340
341
342
343
344
345
346
347
// based on eob logic while (index < n_coeffs) { coeff0 = load_coefficients(coeff_ptr + index); coeff1 = load_coefficients(coeff_ptr + index + 8); coeff0_sign = _mm_srai_epi16(coeff0, 15); coeff1_sign = _mm_srai_epi16(coeff1, 15); qcoeff0 = invert_sign_sse2(coeff0, coeff0_sign); qcoeff1 = invert_sign_sse2(coeff1, coeff1_sign);
+ show +
348
349
350
351
352
prescan0 = _mm_loadu_si128((const __m128i *)(prescan + index)); prescan1 = _mm_loadu_si128((const __m128i *)(prescan + index + 8)); cmp_mask0 = _mm_and_si128(prescan0, _mm_cmpgt_epi16(qcoeff0, zbin)); cmp_mask1 = _mm_and_si128(prescan1, _mm_cmpgt_epi16(qcoeff1, zbin));
+ show +
353
354
355
356
357
358
359
360
361
362
all_zero = _mm_or_si128(cmp_mask0, cmp_mask1); if (_mm_movemask_epi8(all_zero) == 0) { _mm_store_si128((__m128i *)(qcoeff_ptr + index), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 4), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 8), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 12), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index + 4), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index + 8), zero);

[CVE-2020-0470_1.diff] adaptive_quantize_sse2.c #4
- prescan0 = _mm_loadu_si128((const __m128i *)(prescan + index)); - prescan1 = _mm_loadu_si128((const __m128i *)(prescan + index + 8)); + update_mask0(&qcoeff0, &qcoeff1, threshold, iscan + index, &is_found0, + &mask0); - cmp_mask0 = _mm_and_si128(prescan0, _mm_cmpgt_epi16(qcoeff0, zbin)); - cmp_mask1 = _mm_and_si128(prescan1, _mm_cmpgt_epi16(qcoeff1, zbin)); + cmp_mask0 = _mm_cmpgt_epi16(qcoeff0, zbin); + cmp_mask1 = _mm_cmpgt_epi16(qcoeff1, zbin); + + update_mask1(&cmp_mask0, &cmp_mask1, iscan + index, &is_found1, &mask1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/adaptive_quantize_sse2.c
130
131
132
133
134
135
136
137
138
139
// based on eob logic while (index < n_coeffs) { coeff0 = load_coefficients(coeff_ptr + index); coeff1 = load_coefficients(coeff_ptr + index + 8); coeff0_sign = _mm_srai_epi16(coeff0, 15); coeff1_sign = _mm_srai_epi16(coeff1, 15); qcoeff0 = invert_sign_sse2(coeff0, coeff0_sign); qcoeff1 = invert_sign_sse2(coeff1, coeff1_sign);
+ show +
140
141
142
143
144
prescan0 = _mm_loadu_si128((const __m128i *)(prescan + index)); prescan1 = _mm_loadu_si128((const __m128i *)(prescan + index + 8)); cmp_mask0 = _mm_and_si128(prescan0, _mm_cmpgt_epi16(qcoeff0, zbin)); cmp_mask1 = _mm_and_si128(prescan1, _mm_cmpgt_epi16(qcoeff1, zbin));
+ show +
145
146
147
148
149
150
151
152
153
154
all_zero = _mm_or_si128(cmp_mask0, cmp_mask1); if (_mm_movemask_epi8(all_zero) == 0) { _mm_store_si128((__m128i *)(qcoeff_ptr + index), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 4), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 8), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 12), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index + 4), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index + 8), zero);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/adaptive_quantize_sse2.c
338
339
340
341
342
343
344
345
346
347
// based on eob logic while (index < n_coeffs) { coeff0 = load_coefficients(coeff_ptr + index); coeff1 = load_coefficients(coeff_ptr + index + 8); coeff0_sign = _mm_srai_epi16(coeff0, 15); coeff1_sign = _mm_srai_epi16(coeff1, 15); qcoeff0 = invert_sign_sse2(coeff0, coeff0_sign); qcoeff1 = invert_sign_sse2(coeff1, coeff1_sign);
+ show +
348
349
350
351
352
prescan0 = _mm_loadu_si128((const __m128i *)(prescan + index)); prescan1 = _mm_loadu_si128((const __m128i *)(prescan + index + 8)); cmp_mask0 = _mm_and_si128(prescan0, _mm_cmpgt_epi16(qcoeff0, zbin)); cmp_mask1 = _mm_and_si128(prescan1, _mm_cmpgt_epi16(qcoeff1, zbin));
+ show +
353
354
355
356
357
358
359
360
361
362
all_zero = _mm_or_si128(cmp_mask0, cmp_mask1); if (_mm_movemask_epi8(all_zero) == 0) { _mm_store_si128((__m128i *)(qcoeff_ptr + index), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 4), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 8), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 12), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index + 4), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index + 8), zero);

[CVE-2020-0470_1.diff] adaptive_quantize_sse2.c #13
- prescan0 = _mm_loadu_si128((const __m128i *)(prescan + index)); - prescan1 = _mm_loadu_si128((const __m128i *)(prescan + index + 8)); + update_mask0(&qcoeff0, &qcoeff1, threshold, iscan + index, &is_found0, + &mask0); - cmp_mask0 = _mm_and_si128(prescan0, _mm_cmpgt_epi16(qcoeff0, zbin)); - cmp_mask1 = _mm_and_si128(prescan1, _mm_cmpgt_epi16(qcoeff1, zbin)); + cmp_mask0 = _mm_cmpgt_epi16(qcoeff0, zbin); + cmp_mask1 = _mm_cmpgt_epi16(qcoeff1, zbin); + + update_mask1(&cmp_mask0, &cmp_mask1, iscan + index, &is_found1, &mask1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/adaptive_quantize_sse2.c
130
131
132
133
134
135
136
137
138
139
// based on eob logic while (index < n_coeffs) { coeff0 = load_coefficients(coeff_ptr + index); coeff1 = load_coefficients(coeff_ptr + index + 8); coeff0_sign = _mm_srai_epi16(coeff0, 15); coeff1_sign = _mm_srai_epi16(coeff1, 15); qcoeff0 = invert_sign_sse2(coeff0, coeff0_sign); qcoeff1 = invert_sign_sse2(coeff1, coeff1_sign);
+ show +
140
141
142
143
144
prescan0 = _mm_loadu_si128((const __m128i *)(prescan + index)); prescan1 = _mm_loadu_si128((const __m128i *)(prescan + index + 8)); cmp_mask0 = _mm_and_si128(prescan0, _mm_cmpgt_epi16(qcoeff0, zbin)); cmp_mask1 = _mm_and_si128(prescan1, _mm_cmpgt_epi16(qcoeff1, zbin));
+ show +
145
146
147
148
149
150
151
152
153
154
all_zero = _mm_or_si128(cmp_mask0, cmp_mask1); if (_mm_movemask_epi8(all_zero) == 0) { _mm_store_si128((__m128i *)(qcoeff_ptr + index), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 4), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 8), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 12), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index + 4), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index + 8), zero);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/adaptive_quantize_sse2.c
338
339
340
341
342
343
344
345
346
347
// based on eob logic while (index < n_coeffs) { coeff0 = load_coefficients(coeff_ptr + index); coeff1 = load_coefficients(coeff_ptr + index + 8); coeff0_sign = _mm_srai_epi16(coeff0, 15); coeff1_sign = _mm_srai_epi16(coeff1, 15); qcoeff0 = invert_sign_sse2(coeff0, coeff0_sign); qcoeff1 = invert_sign_sse2(coeff1, coeff1_sign);
+ show +
348
349
350
351
352
prescan0 = _mm_loadu_si128((const __m128i *)(prescan + index)); prescan1 = _mm_loadu_si128((const __m128i *)(prescan + index + 8)); cmp_mask0 = _mm_and_si128(prescan0, _mm_cmpgt_epi16(qcoeff0, zbin)); cmp_mask1 = _mm_and_si128(prescan1, _mm_cmpgt_epi16(qcoeff1, zbin));
+ show +
353
354
355
356
357
358
359
360
361
362
all_zero = _mm_or_si128(cmp_mask0, cmp_mask1); if (_mm_movemask_epi8(all_zero) == 0) { _mm_store_si128((__m128i *)(qcoeff_ptr + index), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 4), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 8), zero); _mm_store_si128((__m128i *)(qcoeff_ptr + index + 12), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index + 4), zero); _mm_store_si128((__m128i *)(dqcoeff_ptr + index + 8), zero);

[CVE-2020-0478_1.diff] intrapred_sse2.c #2
-static INLINE __m128i dc_sum_16(const uint8_t *ref) { - __m128i x = _mm_load_si128((__m128i const *)ref); - const __m128i zero = _mm_setzero_si128(); - x = _mm_sad_epu8(x, zero); - const __m128i high = _mm_unpackhi_epi64(x, x); - return _mm_add_epi16(x, high); -} - -static INLINE __m128i dc_sum_32(const uint8_t *ref) { - __m128i x0 = _mm_load_si128((__m128i const *)ref); - __m128i x1 = _mm_load_si128((__m128i const *)(ref + 16)); - const __m128i zero = _mm_setzero_si128(); - x0 = _mm_sad_epu8(x0, zero); - x1 = _mm_sad_epu8(x1, zero); - x0 = _mm_add_epi16(x0, x1); - const __m128i high = _mm_unpackhi_epi64(x0, x0); - return _mm_add_epi16(x0, high); -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_sse2.c
68
69
70
71
72
73
74
75
76
77
x = _mm_unpacklo_epi8(x, zero); return _mm_sad_epu8(x, zero); } static INLINE __m128i dc_sum_8(const uint8_t *ref) { __m128i x = _mm_loadl_epi64((__m128i const *)ref); const __m128i zero = _mm_setzero_si128(); return _mm_sad_epu8(x, zero); }
+ show +
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
static INLINE __m128i dc_sum_16(const uint8_t *ref) { __m128i x = _mm_load_si128((__m128i const *)ref); const __m128i zero = _mm_setzero_si128(); x = _mm_sad_epu8(x, zero); const __m128i high = _mm_unpackhi_epi64(x, x); return _mm_add_epi16(x, high); } static INLINE __m128i dc_sum_32(const uint8_t *ref) { __m128i x0 = _mm_load_si128((__m128i const *)ref); __m128i x1 = _mm_load_si128((__m128i const *)(ref + 16)); const __m128i zero = _mm_setzero_si128(); x0 = _mm_sad_epu8(x0, zero); x1 = _mm_sad_epu8(x1, zero); x0 = _mm_add_epi16(x0, x1); const __m128i high = _mm_unpackhi_epi64(x0, x0); return _mm_add_epi16(x0, high);
+ show +
95
96
97
98
99
100
101
102
103
104
} static INLINE __m128i dc_sum_64(const uint8_t *ref) { __m128i x0 = _mm_load_si128((__m128i const *)ref); __m128i x1 = _mm_load_si128((__m128i const *)(ref + 16)); __m128i x2 = _mm_load_si128((__m128i const *)(ref + 32)); __m128i x3 = _mm_load_si128((__m128i const *)(ref + 48)); const __m128i zero = _mm_setzero_si128(); x0 = _mm_sad_epu8(x0, zero); x1 = _mm_sad_epu8(x1, zero);

[CVE-2020-0470_1.diff] intrapred_sse2.c #2
-static INLINE __m128i dc_sum_16(const uint8_t *ref) { - __m128i x = _mm_load_si128((__m128i const *)ref); - const __m128i zero = _mm_setzero_si128(); - x = _mm_sad_epu8(x, zero); - const __m128i high = _mm_unpackhi_epi64(x, x); - return _mm_add_epi16(x, high); -} - -static INLINE __m128i dc_sum_32(const uint8_t *ref) { - __m128i x0 = _mm_load_si128((__m128i const *)ref); - __m128i x1 = _mm_load_si128((__m128i const *)(ref + 16)); - const __m128i zero = _mm_setzero_si128(); - x0 = _mm_sad_epu8(x0, zero); - x1 = _mm_sad_epu8(x1, zero); - x0 = _mm_add_epi16(x0, x1); - const __m128i high = _mm_unpackhi_epi64(x0, x0); - return _mm_add_epi16(x0, high); -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/intrapred_sse2.c
68
69
70
71
72
73
74
75
76
77
x = _mm_unpacklo_epi8(x, zero); return _mm_sad_epu8(x, zero); } static INLINE __m128i dc_sum_8(const uint8_t *ref) { __m128i x = _mm_loadl_epi64((__m128i const *)ref); const __m128i zero = _mm_setzero_si128(); return _mm_sad_epu8(x, zero); }
+ show +
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
static INLINE __m128i dc_sum_16(const uint8_t *ref) { __m128i x = _mm_load_si128((__m128i const *)ref); const __m128i zero = _mm_setzero_si128(); x = _mm_sad_epu8(x, zero); const __m128i high = _mm_unpackhi_epi64(x, x); return _mm_add_epi16(x, high); } static INLINE __m128i dc_sum_32(const uint8_t *ref) { __m128i x0 = _mm_load_si128((__m128i const *)ref); __m128i x1 = _mm_load_si128((__m128i const *)(ref + 16)); const __m128i zero = _mm_setzero_si128(); x0 = _mm_sad_epu8(x0, zero); x1 = _mm_sad_epu8(x1, zero); x0 = _mm_add_epi16(x0, x1); const __m128i high = _mm_unpackhi_epi64(x0, x0); return _mm_add_epi16(x0, high);
+ show +
95
96
97
98
99
100
101
102
103
104
} static INLINE __m128i dc_sum_64(const uint8_t *ref) { __m128i x0 = _mm_load_si128((__m128i const *)ref); __m128i x1 = _mm_load_si128((__m128i const *)(ref + 16)); __m128i x2 = _mm_load_si128((__m128i const *)(ref + 32)); __m128i x3 = _mm_load_si128((__m128i const *)(ref + 48)); const __m128i zero = _mm_setzero_si128(); x0 = _mm_sad_epu8(x0, zero); x1 = _mm_sad_epu8(x1, zero);

[CVE-2020-0478_1.diff] aom_subpixel_8t_intrin_ssse3.c #1
-DECLARE_ALIGNED(16, static const uint8_t, filt1_4_h8[16]) = { - 0, 1, 1, 2, 2, 3, 3, 4, 2, 3, 3, 4, 4, 5, 5, 6 -}; +DECLARE_ALIGNED(16, static const uint8_t, filt1_4_h8[16]) = { 0, 1, 1, 2, 2, 3, + 3, 4, 2, 3, 3, 4, + 4, 5, 5, 6 }; -DECLARE_ALIGNED(16, static const uint8_t, filt2_4_h8[16]) = { - 4, 5, 5, 6, 6, 7, 7, 8, 6, 7, 7, 8, 8, 9, 9, 10 -}; +DECLARE_ALIGNED(16, static const uint8_t, filt2_4_h8[16]) = { 4, 5, 5, 6, 6, 7, + 7, 8, 6, 7, 7, 8, + 8, 9, 9, 10 }; -DECLARE_ALIGNED(16, static const uint8_t, filt1_global[16]) = { - 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 -}; +DECLARE_ALIGNED(16, static const uint8_t, + filt1_global[16]) = { 0, 1, 1, 2, 2, 3, 3, 4, + 4, 5, 5, 6, 6, 7, 7, 8 }; -DECLARE_ALIGNED(16, static const uint8_t, filt2_global[16]) = { - 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10 -}; +DECLARE_ALIGNED(16, static const uint8_t, + filt2_global[16]) = { 2, 3, 3, 4, 4, 5, 5, 6, + 6, 7, 7, 8, 8, 9, 9, 10 }; -DECLARE_ALIGNED(16, static const uint8_t, filt3_global[16]) = { - 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12 -}; +DECLARE_ALIGNED(16, static const uint8_t, + filt3_global[16]) = { 4, 5, 5, 6, 6, 7, 7, 8, + 8, 9, 9, 10, 10, 11, 11, 12 }; -DECLARE_ALIGNED(16, static const uint8_t, filt4_global[16]) = { - 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14 -}; +DECLARE_ALIGNED(16, static const uint8_t, + filt4_global[16]) = { 6, 7, 7, 8, 8, 9, 9, 10, + 10, 11, 11, 12, 12, 13, 13, 14 };
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/aom_subpixel_8t_intrin_ssse3.c
13
14
15
16
17
18
19
20
21
22
#include "config/aom_dsp_rtcd.h" #include "aom_dsp/aom_filter.h" #include "aom_dsp/x86/convolve.h" #include "aom_mem/aom_mem.h" #include "aom_ports/mem.h" #include "aom_ports/emmintrin_compat.h" // filters only for the 4_h8 convolution
+ show +
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
DECLARE_ALIGNED(16, static const uint8_t, filt1_4_h8[16]) = { 0, 1, 1, 2, 2, 3, 3, 4, 2, 3, 3, 4, 4, 5, 5, 6 }; DECLARE_ALIGNED(16, static const uint8_t, filt2_4_h8[16]) = { 4, 5, 5, 6, 6, 7, 7, 8, 6, 7, 7, 8, 8, 9, 9, 10 }; // filters for 8_h8 and 16_h8 DECLARE_ALIGNED(16, static const uint8_t, filt1_global[16]) = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 }; DECLARE_ALIGNED(16, static const uint8_t, filt2_global[16]) = { 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10 }; DECLARE_ALIGNED(16, static const uint8_t, filt3_global[16]) = { 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12 }; DECLARE_ALIGNED(16, static const uint8_t, filt4_global[16]) = { 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14 };
+ show +
47
48
49
50
51
52
53
54
55
56
DECLARE_ALIGNED(32, static const uint8_t, filt_h4[]) = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14 };

[CVE-2020-0470_1.diff] aom_subpixel_8t_intrin_ssse3.c #1
-DECLARE_ALIGNED(16, static const uint8_t, filt1_4_h8[16]) = { - 0, 1, 1, 2, 2, 3, 3, 4, 2, 3, 3, 4, 4, 5, 5, 6 -}; +DECLARE_ALIGNED(16, static const uint8_t, filt1_4_h8[16]) = { 0, 1, 1, 2, 2, 3, + 3, 4, 2, 3, 3, 4, + 4, 5, 5, 6 }; -DECLARE_ALIGNED(16, static const uint8_t, filt2_4_h8[16]) = { - 4, 5, 5, 6, 6, 7, 7, 8, 6, 7, 7, 8, 8, 9, 9, 10 -}; +DECLARE_ALIGNED(16, static const uint8_t, filt2_4_h8[16]) = { 4, 5, 5, 6, 6, 7, + 7, 8, 6, 7, 7, 8, + 8, 9, 9, 10 }; -DECLARE_ALIGNED(16, static const uint8_t, filt1_global[16]) = { - 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 -}; +DECLARE_ALIGNED(16, static const uint8_t, + filt1_global[16]) = { 0, 1, 1, 2, 2, 3, 3, 4, + 4, 5, 5, 6, 6, 7, 7, 8 }; -DECLARE_ALIGNED(16, static const uint8_t, filt2_global[16]) = { - 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10 -}; +DECLARE_ALIGNED(16, static const uint8_t, + filt2_global[16]) = { 2, 3, 3, 4, 4, 5, 5, 6, + 6, 7, 7, 8, 8, 9, 9, 10 }; -DECLARE_ALIGNED(16, static const uint8_t, filt3_global[16]) = { - 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12 -}; +DECLARE_ALIGNED(16, static const uint8_t, + filt3_global[16]) = { 4, 5, 5, 6, 6, 7, 7, 8, + 8, 9, 9, 10, 10, 11, 11, 12 }; -DECLARE_ALIGNED(16, static const uint8_t, filt4_global[16]) = { - 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14 -}; +DECLARE_ALIGNED(16, static const uint8_t, + filt4_global[16]) = { 6, 7, 7, 8, 8, 9, 9, 10, + 10, 11, 11, 12, 12, 13, 13, 14 };
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/aom_dsp/x86/aom_subpixel_8t_intrin_ssse3.c
13
14
15
16
17
18
19
20
21
22
#include "config/aom_dsp_rtcd.h" #include "aom_dsp/aom_filter.h" #include "aom_dsp/x86/convolve.h" #include "aom_mem/aom_mem.h" #include "aom_ports/mem.h" #include "aom_ports/emmintrin_compat.h" // filters only for the 4_h8 convolution
+ show +
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
DECLARE_ALIGNED(16, static const uint8_t, filt1_4_h8[16]) = { 0, 1, 1, 2, 2, 3, 3, 4, 2, 3, 3, 4, 4, 5, 5, 6 }; DECLARE_ALIGNED(16, static const uint8_t, filt2_4_h8[16]) = { 4, 5, 5, 6, 6, 7, 7, 8, 6, 7, 7, 8, 8, 9, 9, 10 }; // filters for 8_h8 and 16_h8 DECLARE_ALIGNED(16, static const uint8_t, filt1_global[16]) = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 }; DECLARE_ALIGNED(16, static const uint8_t, filt2_global[16]) = { 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10 }; DECLARE_ALIGNED(16, static const uint8_t, filt3_global[16]) = { 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12 }; DECLARE_ALIGNED(16, static const uint8_t, filt4_global[16]) = { 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14 };
+ show +
47
48
49
50
51
52
53
54
55
56
DECLARE_ALIGNED(32, static const uint8_t, filt_h4[]) = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14 };

[CVE-2020-0478_1.diff] av1_dx_iface.c #3
- // TODO(wtc): This can be simplified. num_frame_workers is always 1, and - // next_output_worker_id is always 0. The frame_workers array of size 1 can - // be replaced by a single AVxWorker. - AVxWorker *frame_workers; - int num_frame_workers; - int next_output_worker_id; + AVxWorker *frame_worker; - aom_image_t *image_with_grain[MAX_NUM_SPATIAL_LAYERS]; + aom_image_t image_with_grain; + aom_codec_frame_buffer_t grain_image_frame_buffers[MAX_NUM_SPATIAL_LAYERS]; + size_t num_grain_image_frame_buffers;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/av1_dx_iface.c
54
55
56
57
58
59
60
61
62
63
unsigned int ext_tile_debug; unsigned int row_mt; EXTERNAL_REFERENCES ext_refs; unsigned int is_annexb; int operating_point; int output_all_layers; // TODO(wtc): This can be simplified. num_frame_workers is always 1, and // next_output_worker_id is always 0. The frame_workers array of size 1 can // be replaced by a single AVxWorker.
+ show +
64
65
66
67
68
AVxWorker *frame_workers; int num_frame_workers; int next_output_worker_id; aom_image_t *image_with_grain[MAX_NUM_SPATIAL_LAYERS];
+ show +
69
70
71
72
73
74
75
76
77
78
int need_resync; // wait for key/intra-only frame // BufferPool that holds all reference frames. Shared by all the FrameWorkers. BufferPool *buffer_pool; // External frame buffer info to save for AV1 common. void *ext_priv; // Private data associated with the external frame buffers. aom_get_frame_buffer_cb_fn_t get_ext_fb_cb; aom_release_frame_buffer_cb_fn_t release_ext_fb_cb; #if CONFIG_INSPECTION

[CVE-2020-0478_1.diff] av1_dx_iface.c #8
+ } else if (frame_type == INTRA_ONLY_FRAME) { + intra_only_flag = 1; - int i; + AVxWorker *const worker = ctx->frame_worker; + FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1; + AV1Decoder *const pbi = frame_worker_data->pbi; + AV1_COMMON *const cm = &pbi->common; + BufferPool *const pool = cm->buffer_pool; - for (i = 0; i < ctx->num_frame_workers; ++i) { - AVxWorker *const worker = &ctx->frame_workers[i]; - FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1; - AV1_COMMON *const cm = &frame_worker_data->pbi->common; - BufferPool *const pool = cm->buffer_pool; + cm->cur_frame = NULL; + cm->features.byte_alignment = ctx->byte_alignment; + pbi->skip_loop_filter = ctx->skip_loop_filter; + pbi->skip_film_grain = ctx->skip_film_grain; - cm->cur_frame = NULL; - cm->byte_alignment = ctx->byte_alignment; - cm->skip_loop_filter = ctx->skip_loop_filter; - cm->skip_film_grain = ctx->skip_film_grain; + if (ctx->get_ext_fb_cb != NULL && ctx->release_ext_fb_cb != NULL) { + pool->get_fb_cb = ctx->get_ext_fb_cb; + pool->release_fb_cb = ctx->release_ext_fb_cb; + pool->cb_priv = ctx->ext_priv; + } else { + pool->get_fb_cb = av1_get_frame_buffer; + pool->release_fb_cb = av1_release_frame_buffer; - if (ctx->get_ext_fb_cb != NULL && ctx->release_ext_fb_cb != NULL) { - pool->get_fb_cb = ctx->get_ext_fb_cb; - pool->release_fb_cb = ctx->release_ext_fb_cb; - pool->cb_priv = ctx->ext_priv; - } else { - pool->get_fb_cb = av1_get_frame_buffer; - pool->release_fb_cb = av1_release_frame_buffer; + if (av1_alloc_internal_frame_buffers(&pool->int_frame_buffers)) + aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR, + "Failed to initialize internal frame buffers"); - if (av1_alloc_internal_frame_buffers(&pool->int_frame_buffers)) - aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR, - "Failed to initialize internal frame buffers"); - - pool->cb_priv = &pool->int_frame_buffers; - } + pool->cb_priv = &pool->int_frame_buffers; -static void set_default_ppflags(aom_postproc_cfg_t *cfg) { - cfg->post_proc_flag = AOM_DEBLOCK | AOM_DEMACROBLOCK; - cfg->deblocking_level = 4; - cfg->noise_level = 0; -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/av1_dx_iface.c
372
373
374
375
376
377
378
379
380
381
static aom_codec_err_t update_error_state( aom_codec_alg_priv_t *ctx, const struct aom_internal_error_info *error) { if (error->error_code) set_error_detail(ctx, error->has_detail ? error->detail : NULL); return error->error_code; } static void init_buffer_callbacks(aom_codec_alg_priv_t *ctx) {
+ show +
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
int i; for (i = 0; i < ctx->num_frame_workers; ++i) { AVxWorker *const worker = &ctx->frame_workers[i]; FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1; AV1_COMMON *const cm = &frame_worker_data->pbi->common; BufferPool *const pool = cm->buffer_pool; cm->cur_frame = NULL; cm->byte_alignment = ctx->byte_alignment; cm->skip_loop_filter = ctx->skip_loop_filter; cm->skip_film_grain = ctx->skip_film_grain; if (ctx->get_ext_fb_cb != NULL && ctx->release_ext_fb_cb != NULL) { pool->get_fb_cb = ctx->get_ext_fb_cb; pool->release_fb_cb = ctx->release_ext_fb_cb; pool->cb_priv = ctx->ext_priv; } else { pool->get_fb_cb = av1_get_frame_buffer; pool->release_fb_cb = av1_release_frame_buffer; if (av1_alloc_internal_frame_buffers(&pool->int_frame_buffers)) aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR, "Failed to initialize internal frame buffers"); pool->cb_priv = &pool->int_frame_buffers; } } } static void set_default_ppflags(aom_postproc_cfg_t *cfg) { cfg->post_proc_flag = AOM_DEBLOCK | AOM_DEMACROBLOCK; cfg->deblocking_level = 4; cfg->noise_level = 0;
+ show +
416
417
418
419
420
421
422
423
424
425
} static int frame_worker_hook(void *arg1, void *arg2) { FrameWorkerData *const frame_worker_data = (FrameWorkerData *)arg1; const uint8_t *data = frame_worker_data->data; (void)arg2; int result = av1_receive_compressed_data(frame_worker_data->pbi, frame_worker_data->data_size, &data); frame_worker_data->data_end = data;

[CVE-2020-0478_1.diff] av1_dx_iface.c #39
- { AOM_SET_POSTPROC, ctrl_set_postproc }, - { AOM_SET_DBG_COLOR_REF_FRAME, ctrl_set_dbg_options }, - { AOM_SET_DBG_COLOR_MB_MODES, ctrl_set_dbg_options }, - { AOM_SET_DBG_COLOR_B_MODES, ctrl_set_dbg_options }, - { AOM_SET_DBG_DISPLAY_MV, ctrl_set_dbg_options },
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/av1_dx_iface.c
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
va_list args) { ctx->row_mt = va_arg(args, unsigned int); return AOM_CODEC_OK; } static aom_codec_ctrl_fn_map_t decoder_ctrl_maps[] = { { AV1_COPY_REFERENCE, ctrl_copy_reference }, // Setters { AV1_SET_REFERENCE, ctrl_set_reference },
+ show +
1362
1363
1364
1365
1366
{ AOM_SET_POSTPROC, ctrl_set_postproc }, { AOM_SET_DBG_COLOR_REF_FRAME, ctrl_set_dbg_options }, { AOM_SET_DBG_COLOR_MB_MODES, ctrl_set_dbg_options }, { AOM_SET_DBG_COLOR_B_MODES, ctrl_set_dbg_options }, { AOM_SET_DBG_DISPLAY_MV, ctrl_set_dbg_options },
+ show +
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
{ AV1_INVERT_TILE_DECODE_ORDER, ctrl_set_invert_tile_order }, { AV1_SET_BYTE_ALIGNMENT, ctrl_set_byte_alignment }, { AV1_SET_SKIP_LOOP_FILTER, ctrl_set_skip_loop_filter }, { AV1_SET_DECODE_TILE_ROW, ctrl_set_decode_tile_row }, { AV1_SET_DECODE_TILE_COL, ctrl_set_decode_tile_col }, { AV1_SET_TILE_MODE, ctrl_set_tile_mode }, { AV1D_SET_IS_ANNEXB, ctrl_set_is_annexb }, { AV1D_SET_OPERATING_POINT, ctrl_set_operating_point }, { AV1D_SET_OUTPUT_ALL_LAYERS, ctrl_set_output_all_layers }, { AV1_SET_INSPECTION_CALLBACK, ctrl_set_inspection_callback },

[CVE-2020-0470_1.diff] av1_dx_iface.c #3
- // TODO(wtc): This can be simplified. num_frame_workers is always 1, and - // next_output_worker_id is always 0. The frame_workers array of size 1 can - // be replaced by a single AVxWorker. - AVxWorker *frame_workers; - int num_frame_workers; - int next_output_worker_id; + AVxWorker *frame_worker; - aom_image_t *image_with_grain[MAX_NUM_SPATIAL_LAYERS]; + aom_image_t image_with_grain; + aom_codec_frame_buffer_t grain_image_frame_buffers[MAX_NUM_SPATIAL_LAYERS]; + size_t num_grain_image_frame_buffers;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/av1_dx_iface.c
54
55
56
57
58
59
60
61
62
63
unsigned int ext_tile_debug; unsigned int row_mt; EXTERNAL_REFERENCES ext_refs; unsigned int is_annexb; int operating_point; int output_all_layers; // TODO(wtc): This can be simplified. num_frame_workers is always 1, and // next_output_worker_id is always 0. The frame_workers array of size 1 can // be replaced by a single AVxWorker.
+ show +
64
65
66
67
68
AVxWorker *frame_workers; int num_frame_workers; int next_output_worker_id; aom_image_t *image_with_grain[MAX_NUM_SPATIAL_LAYERS];
+ show +
69
70
71
72
73
74
75
76
77
78
int need_resync; // wait for key/intra-only frame // BufferPool that holds all reference frames. Shared by all the FrameWorkers. BufferPool *buffer_pool; // External frame buffer info to save for AV1 common. void *ext_priv; // Private data associated with the external frame buffers. aom_get_frame_buffer_cb_fn_t get_ext_fb_cb; aom_release_frame_buffer_cb_fn_t release_ext_fb_cb; #if CONFIG_INSPECTION

[CVE-2020-0470_1.diff] av1_dx_iface.c #8
+ } else if (frame_type == INTRA_ONLY_FRAME) { + intra_only_flag = 1; - int i; + AVxWorker *const worker = ctx->frame_worker; + FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1; + AV1Decoder *const pbi = frame_worker_data->pbi; + AV1_COMMON *const cm = &pbi->common; + BufferPool *const pool = cm->buffer_pool; - for (i = 0; i < ctx->num_frame_workers; ++i) { - AVxWorker *const worker = &ctx->frame_workers[i]; - FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1; - AV1_COMMON *const cm = &frame_worker_data->pbi->common; - BufferPool *const pool = cm->buffer_pool; + cm->cur_frame = NULL; + cm->features.byte_alignment = ctx->byte_alignment; + pbi->skip_loop_filter = ctx->skip_loop_filter; + pbi->skip_film_grain = ctx->skip_film_grain; - cm->cur_frame = NULL; - cm->byte_alignment = ctx->byte_alignment; - cm->skip_loop_filter = ctx->skip_loop_filter; - cm->skip_film_grain = ctx->skip_film_grain; + if (ctx->get_ext_fb_cb != NULL && ctx->release_ext_fb_cb != NULL) { + pool->get_fb_cb = ctx->get_ext_fb_cb; + pool->release_fb_cb = ctx->release_ext_fb_cb; + pool->cb_priv = ctx->ext_priv; + } else { + pool->get_fb_cb = av1_get_frame_buffer; + pool->release_fb_cb = av1_release_frame_buffer; - if (ctx->get_ext_fb_cb != NULL && ctx->release_ext_fb_cb != NULL) { - pool->get_fb_cb = ctx->get_ext_fb_cb; - pool->release_fb_cb = ctx->release_ext_fb_cb; - pool->cb_priv = ctx->ext_priv; - } else { - pool->get_fb_cb = av1_get_frame_buffer; - pool->release_fb_cb = av1_release_frame_buffer; + if (av1_alloc_internal_frame_buffers(&pool->int_frame_buffers)) + aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR, + "Failed to initialize internal frame buffers"); - if (av1_alloc_internal_frame_buffers(&pool->int_frame_buffers)) - aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR, - "Failed to initialize internal frame buffers"); - - pool->cb_priv = &pool->int_frame_buffers; - } + pool->cb_priv = &pool->int_frame_buffers; -static void set_default_ppflags(aom_postproc_cfg_t *cfg) { - cfg->post_proc_flag = AOM_DEBLOCK | AOM_DEMACROBLOCK; - cfg->deblocking_level = 4; - cfg->noise_level = 0; -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/av1_dx_iface.c
372
373
374
375
376
377
378
379
380
381
static aom_codec_err_t update_error_state( aom_codec_alg_priv_t *ctx, const struct aom_internal_error_info *error) { if (error->error_code) set_error_detail(ctx, error->has_detail ? error->detail : NULL); return error->error_code; } static void init_buffer_callbacks(aom_codec_alg_priv_t *ctx) {
+ show +
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
int i; for (i = 0; i < ctx->num_frame_workers; ++i) { AVxWorker *const worker = &ctx->frame_workers[i]; FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1; AV1_COMMON *const cm = &frame_worker_data->pbi->common; BufferPool *const pool = cm->buffer_pool; cm->cur_frame = NULL; cm->byte_alignment = ctx->byte_alignment; cm->skip_loop_filter = ctx->skip_loop_filter; cm->skip_film_grain = ctx->skip_film_grain; if (ctx->get_ext_fb_cb != NULL && ctx->release_ext_fb_cb != NULL) { pool->get_fb_cb = ctx->get_ext_fb_cb; pool->release_fb_cb = ctx->release_ext_fb_cb; pool->cb_priv = ctx->ext_priv; } else { pool->get_fb_cb = av1_get_frame_buffer; pool->release_fb_cb = av1_release_frame_buffer; if (av1_alloc_internal_frame_buffers(&pool->int_frame_buffers)) aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR, "Failed to initialize internal frame buffers"); pool->cb_priv = &pool->int_frame_buffers; } } } static void set_default_ppflags(aom_postproc_cfg_t *cfg) { cfg->post_proc_flag = AOM_DEBLOCK | AOM_DEMACROBLOCK; cfg->deblocking_level = 4; cfg->noise_level = 0;
+ show +
416
417
418
419
420
421
422
423
424
425
} static int frame_worker_hook(void *arg1, void *arg2) { FrameWorkerData *const frame_worker_data = (FrameWorkerData *)arg1; const uint8_t *data = frame_worker_data->data; (void)arg2; int result = av1_receive_compressed_data(frame_worker_data->pbi, frame_worker_data->data_size, &data); frame_worker_data->data_end = data;

[CVE-2020-0470_1.diff] av1_dx_iface.c #39
- { AOM_SET_POSTPROC, ctrl_set_postproc }, - { AOM_SET_DBG_COLOR_REF_FRAME, ctrl_set_dbg_options }, - { AOM_SET_DBG_COLOR_MB_MODES, ctrl_set_dbg_options }, - { AOM_SET_DBG_COLOR_B_MODES, ctrl_set_dbg_options }, - { AOM_SET_DBG_DISPLAY_MV, ctrl_set_dbg_options },
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/av1_dx_iface.c
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
va_list args) { ctx->row_mt = va_arg(args, unsigned int); return AOM_CODEC_OK; } static aom_codec_ctrl_fn_map_t decoder_ctrl_maps[] = { { AV1_COPY_REFERENCE, ctrl_copy_reference }, // Setters { AV1_SET_REFERENCE, ctrl_set_reference },
+ show +
1362
1363
1364
1365
1366
{ AOM_SET_POSTPROC, ctrl_set_postproc }, { AOM_SET_DBG_COLOR_REF_FRAME, ctrl_set_dbg_options }, { AOM_SET_DBG_COLOR_MB_MODES, ctrl_set_dbg_options }, { AOM_SET_DBG_COLOR_B_MODES, ctrl_set_dbg_options }, { AOM_SET_DBG_DISPLAY_MV, ctrl_set_dbg_options },
+ show +
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
{ AV1_INVERT_TILE_DECODE_ORDER, ctrl_set_invert_tile_order }, { AV1_SET_BYTE_ALIGNMENT, ctrl_set_byte_alignment }, { AV1_SET_SKIP_LOOP_FILTER, ctrl_set_skip_loop_filter }, { AV1_SET_DECODE_TILE_ROW, ctrl_set_decode_tile_row }, { AV1_SET_DECODE_TILE_COL, ctrl_set_decode_tile_col }, { AV1_SET_TILE_MODE, ctrl_set_tile_mode }, { AV1D_SET_IS_ANNEXB, ctrl_set_is_annexb }, { AV1D_SET_OPERATING_POINT, ctrl_set_operating_point }, { AV1D_SET_OUTPUT_ALL_LAYERS, ctrl_set_output_all_layers }, { AV1_SET_INSPECTION_CALLBACK, ctrl_set_inspection_callback },

[CVE-2020-0478_1.diff] av1_cx_iface.c #18
-#if CONFIG_DIST_8X8 - if (extra_cfg->enable_dist_8x8) - ERROR("dist-8x8 cannot be used with lossless compression."); -#endif + if (extra_cfg->enable_chroma_deltaq) + ERROR("Only --enable_chroma_deltaq=0 can be used with --lossless=1."); + } + + if (cfg->rc_resize_mode != RESIZE_NONE && + extra_cfg->aq_mode == CYCLIC_REFRESH_AQ) { + ERROR("--aq_mode=3 is only supported for --resize-mode=0.");
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/av1_cx_iface.c
446
447
448
449
450
451
452
453
454
455
#endif RANGE_CHECK(extra_cfg, timing_info_type, AOM_TIMING_UNSPECIFIED, AOM_TIMING_DEC_MODEL); RANGE_CHECK(extra_cfg, film_grain_test_vector, 0, 16); if (extra_cfg->lossless) { if (extra_cfg->aq_mode != 0) ERROR("Only --aq_mode=0 can be used with --lossless=1.");
+ show +
456
457
458
459
#if CONFIG_DIST_8X8 if (extra_cfg->enable_dist_8x8) ERROR("dist-8x8 cannot be used with lossless compression."); #endif
+ show +
460
461
462
463
464
465
466
467
468
469
} RANGE_CHECK(extra_cfg, max_reference_frames, 3, 7); RANGE_CHECK(extra_cfg, enable_reduced_reference_set, 0, 1); RANGE_CHECK_HI(extra_cfg, chroma_subsampling_x, 1); RANGE_CHECK_HI(extra_cfg, chroma_subsampling_y, 1); RANGE_CHECK_HI(extra_cfg, disable_trellis_quant, 3); RANGE_CHECK(extra_cfg, coeff_cost_upd_freq, 0, 2); RANGE_CHECK(extra_cfg, mode_cost_upd_freq, 0, 2);

[CVE-2020-0478_1.diff] av1_cx_iface.c #25
-#if CONFIG_DIST_8X8 - oxcf->using_dist_8x8 = extra_cfg->enable_dist_8x8; - if (extra_cfg->tuning == AOM_TUNE_CDEF_DIST || - extra_cfg->tuning == AOM_TUNE_DAALA_DIST) - oxcf->using_dist_8x8 = 1; -#endif + oxcf->mv_cost_upd_freq = (COST_UPDATE_TYPE)extra_cfg->mv_cost_upd_freq;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/av1_cx_iface.c
627
628
629
630
631
632
633
634
635
636
oxcf->qm_v = extra_cfg->qm_v; oxcf->qm_minlevel = extra_cfg->qm_min; oxcf->qm_maxlevel = extra_cfg->qm_max; oxcf->reduced_tx_type_set = extra_cfg->reduced_tx_type_set; oxcf->use_intra_dct_only = extra_cfg->use_intra_dct_only; oxcf->use_inter_dct_only = extra_cfg->use_inter_dct_only; oxcf->use_intra_default_tx_only = extra_cfg->use_intra_default_tx_only; oxcf->quant_b_adapt = extra_cfg->quant_b_adapt; oxcf->coeff_cost_upd_freq = (COST_UPDATE_TYPE)extra_cfg->coeff_cost_upd_freq; oxcf->mode_cost_upd_freq = (COST_UPDATE_TYPE)extra_cfg->mode_cost_upd_freq;
+ show +
637
638
639
640
641
642
#if CONFIG_DIST_8X8 oxcf->using_dist_8x8 = extra_cfg->enable_dist_8x8; if (extra_cfg->tuning == AOM_TUNE_CDEF_DIST || extra_cfg->tuning == AOM_TUNE_DAALA_DIST) oxcf->using_dist_8x8 = 1; #endif
+ show +
643
644
645
646
647
648
649
650
651
652
oxcf->num_tile_groups = extra_cfg->num_tg; // In large-scale tile encoding mode, num_tile_groups is always 1. if (cfg->large_scale_tile) oxcf->num_tile_groups = 1; oxcf->mtu = extra_cfg->mtu_size; // FIXME(debargha): Should this be: // oxcf->allow_ref_frame_mvs = extra_cfg->allow_ref_frame_mvs & // extra_cfg->enable_order_hint ? // Disallow using temporal MVs while large_scale_tile = 1. oxcf->allow_ref_frame_mvs =

[CVE-2020-0478_1.diff] av1_cx_iface.c #36
+static aom_codec_err_t ctrl_set_enable_keyframe_filtering( + aom_codec_alg_priv_t *ctx, va_list args) { + struct av1_extracfg extra_cfg = ctx->extra_cfg; + extra_cfg.enable_keyframe_filtering = + CAST(AV1E_SET_ENABLE_KEYFRAME_FILTERING, args); + return update_extra_cfg(ctx, &extra_cfg); +} + +static aom_codec_err_t ctrl_set_force_video_mode(aom_codec_alg_priv_t *ctx, + va_list args) { + struct av1_extracfg extra_cfg = ctx->extra_cfg; + extra_cfg.force_video_mode = CAST(AV1E_SET_FORCE_VIDEO_MODE, args); + return update_extra_cfg(ctx, &extra_cfg); +} + -#if CONFIG_DIST_8X8 -static aom_codec_err_t ctrl_set_enable_dist_8x8(aom_codec_alg_priv_t *ctx, - va_list args) { - struct av1_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.enable_dist_8x8 = CAST(AV1E_SET_ENABLE_DIST_8X8, args); - return update_extra_cfg(ctx, &extra_cfg); -} -#endif +
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/av1_cx_iface.c
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
extra_cfg.qm_min = CAST(AV1E_SET_QM_MIN, args); return update_extra_cfg(ctx, &extra_cfg); } static aom_codec_err_t ctrl_set_qm_max(aom_codec_alg_priv_t *ctx, va_list args) { struct av1_extracfg extra_cfg = ctx->extra_cfg; extra_cfg.qm_max = CAST(AV1E_SET_QM_MAX, args); return update_extra_cfg(ctx, &extra_cfg); }
+ show +
1112
1113
1114
1115
1116
1117
1118
1119
#if CONFIG_DIST_8X8 static aom_codec_err_t ctrl_set_enable_dist_8x8(aom_codec_alg_priv_t *ctx, va_list args) { struct av1_extracfg extra_cfg = ctx->extra_cfg; extra_cfg.enable_dist_8x8 = CAST(AV1E_SET_ENABLE_DIST_8X8, args); return update_extra_cfg(ctx, &extra_cfg); } #endif
+ show +
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
static aom_codec_err_t ctrl_set_num_tg(aom_codec_alg_priv_t *ctx, va_list args) { struct av1_extracfg extra_cfg = ctx->extra_cfg; extra_cfg.num_tg = CAST(AV1E_SET_NUM_TG, args); return update_extra_cfg(ctx, &extra_cfg); } static aom_codec_err_t ctrl_set_mtu(aom_codec_alg_priv_t *ctx, va_list args) { struct av1_extracfg extra_cfg = ctx->extra_cfg; extra_cfg.mtu_size = CAST(AV1E_SET_MTU, args);

[CVE-2020-0478_1.diff] av1_cx_iface.c #38
+static aom_codec_err_t ctrl_set_enable_chroma_deltaq(aom_codec_alg_priv_t *ctx, + va_list args) { + struct av1_extracfg extra_cfg = ctx->extra_cfg; + extra_cfg.enable_chroma_deltaq = CAST(AV1E_SET_ENABLE_CHROMA_DELTAQ, args); + return update_extra_cfg(ctx, &extra_cfg); +} + -static aom_codec_err_t ctrl_set_tx_size_search_method(aom_codec_alg_priv_t *ctx, - va_list args) { - struct av1_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.tx_size_search_method = CAST(AV1E_SET_TX_SIZE_SEARCH_METHOD, args); - return update_extra_cfg(ctx, &extra_cfg); -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/av1_cx_iface.c
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
return update_extra_cfg(ctx, &extra_cfg); } static aom_codec_err_t ctrl_set_enable_tx64(aom_codec_alg_priv_t *ctx, va_list args) { struct av1_extracfg extra_cfg = ctx->extra_cfg; extra_cfg.enable_tx64 = CAST(AV1E_SET_ENABLE_TX64, args); return update_extra_cfg(ctx, &extra_cfg); }
+ show +
1205
1206
1207
1208
1209
static aom_codec_err_t ctrl_set_tx_size_search_method(aom_codec_alg_priv_t *ctx, va_list args) { struct av1_extracfg extra_cfg = ctx->extra_cfg; extra_cfg.tx_size_search_method = CAST(AV1E_SET_TX_SIZE_SEARCH_METHOD, args); return update_extra_cfg(ctx, &extra_cfg);
+ show +
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
} static aom_codec_err_t ctrl_set_enable_flip_idtx(aom_codec_alg_priv_t *ctx, va_list args) { struct av1_extracfg extra_cfg = ctx->extra_cfg; extra_cfg.enable_flip_idtx = CAST(AV1E_SET_ENABLE_FLIP_IDTX, args); return update_extra_cfg(ctx, &extra_cfg); } static aom_codec_err_t ctrl_set_enable_dist_wtd_comp(aom_codec_alg_priv_t *ctx,

[CVE-2020-0478_1.diff] av1_cx_iface.c #46
- ctx->priv->enc.total_encoders = 1; - priv->buffer_pool = (BufferPool *)aom_calloc(1, sizeof(BufferPool)); - if (priv->buffer_pool == NULL) return AOM_CODEC_MEM_ERROR; - -#if CONFIG_MULTITHREAD - if (pthread_mutex_init(&priv->buffer_pool->pool_mutex, NULL)) { - return AOM_CODEC_MEM_ERROR; - } -#endif
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/av1_cx_iface.c
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
aom_codec_priv_enc_mr_cfg_t *data) { aom_codec_err_t res = AOM_CODEC_OK; (void)data; if (ctx->priv == NULL) { aom_codec_alg_priv_t *const priv = aom_calloc(1, sizeof(*priv)); if (priv == NULL) return AOM_CODEC_MEM_ERROR; ctx->priv = (aom_codec_priv_t *)priv; ctx->priv->init_flags = ctx->init_flags;
+ show +
1577
1578
1579
1580
1581
1582
1583
1584
1585
ctx->priv->enc.total_encoders = 1; priv->buffer_pool = (BufferPool *)aom_calloc(1, sizeof(BufferPool)); if (priv->buffer_pool == NULL) return AOM_CODEC_MEM_ERROR; #if CONFIG_MULTITHREAD if (pthread_mutex_init(&priv->buffer_pool->pool_mutex, NULL)) { return AOM_CODEC_MEM_ERROR; } #endif
+ show +
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
if (ctx->config.enc) { // Update the reference to the config structure to an internal copy. priv->cfg = *ctx->config.enc; ctx->config.enc = &priv->cfg; } priv->extra_cfg = default_extra_cfg; aom_once(av1_initialize_enc);

[CVE-2020-0478_1.diff] av1_cx_iface.c #52
+ + // Call for LAP stage + if (cpi_lap != NULL) { + int status; + aom_rational64_t timestamp_ratio_la = *timestamp_ratio; + int64_t dst_time_stamp_la = dst_time_stamp; + int64_t dst_end_time_stamp_la = dst_end_time_stamp; + status = av1_get_compressed_data( + cpi_lap, &lib_flags, &frame_size, NULL, &dst_time_stamp_la, + &dst_end_time_stamp_la, !img, ×tamp_ratio_la); + if (status != -1) { + if (status != AOM_CODEC_OK) { + aom_internal_error(&cpi_lap->common.error, AOM_CODEC_ERROR, NULL); + } + cpi_lap->seq_params_locked = 1; + } + lib_flags = 0; + frame_size = 0; + } + - !is_frame_visible && - -1 != av1_get_compressed_data(cpi, &lib_flags, &frame_size, cx_data, - &dst_time_stamp, &dst_end_time_stamp, - !img, timebase)) { + !is_frame_visible) { + const int status = av1_get_compressed_data( + cpi, &lib_flags, &frame_size, cx_data, &dst_time_stamp, + &dst_end_time_stamp, !img, timestamp_ratio); + if (status == -1) break; + if (status != AOM_CODEC_OK) { + aom_internal_error(&cpi->common.error, AOM_CODEC_ERROR, NULL); + } +
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/av1_cx_iface.c
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
} } size_t frame_size = 0; unsigned int lib_flags = 0; int is_frame_visible = 0; int index_size = 0; int has_fwd_keyframe = 0; // invisible frames get packed with the next visible frame while (cx_data_sz - index_size >= ctx->cx_data_sz / 2 &&
+ show +
1751
1752
1753
1754
!is_frame_visible && -1 != av1_get_compressed_data(cpi, &lib_flags, &frame_size, cx_data, &dst_time_stamp, &dst_end_time_stamp, !img, timebase)) {
+ show +
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
cpi->seq_params_locked = 1; if (frame_size) { if (ctx->pending_cx_data == 0) ctx->pending_cx_data = cx_data; const int write_temporal_delimiter = !cpi->common.spatial_layer_id && !ctx->pending_frame_count; if (write_temporal_delimiter) { uint32_t obu_header_size = 1; const uint32_t obu_payload_size = 0;

[CVE-2020-0478_1.diff] av1_cx_iface.c #58
-static aom_codec_err_t ctrl_set_previewpp(aom_codec_alg_priv_t *ctx, - va_list args) { - (void)ctx; - (void)args; - return AOM_CODEC_INCAPABLE; -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/av1_cx_iface.c
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
image2yuvconfig(new_img, &sd); return av1_copy_new_frame_enc(&ctx->cpi->common, &new_frame, &sd); } else { return AOM_CODEC_ERROR; } } else { return AOM_CODEC_INVALID_PARAM; } }
+ show +
1958
1959
1960
1961
1962
static aom_codec_err_t ctrl_set_previewpp(aom_codec_alg_priv_t *ctx, va_list args) { (void)ctx; (void)args; return AOM_CODEC_INCAPABLE;
+ show +
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
} static aom_image_t *encoder_get_preview(aom_codec_alg_priv_t *ctx) { YV12_BUFFER_CONFIG sd; if (av1_get_preview_raw_frame(ctx->cpi, &sd) == 0) { yuvconfig2image(&ctx->preview_img, &sd, NULL); return &ctx->preview_img; } else { return NULL;

[CVE-2020-0470_1.diff] av1_cx_iface.c #18
-#if CONFIG_DIST_8X8 - if (extra_cfg->enable_dist_8x8) - ERROR("dist-8x8 cannot be used with lossless compression."); -#endif + if (extra_cfg->enable_chroma_deltaq) + ERROR("Only --enable_chroma_deltaq=0 can be used with --lossless=1."); + } + + if (cfg->rc_resize_mode != RESIZE_NONE && + extra_cfg->aq_mode == CYCLIC_REFRESH_AQ) { + ERROR("--aq_mode=3 is only supported for --resize-mode=0.");
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/av1_cx_iface.c
446
447
448
449
450
451
452
453
454
455
#endif RANGE_CHECK(extra_cfg, timing_info_type, AOM_TIMING_UNSPECIFIED, AOM_TIMING_DEC_MODEL); RANGE_CHECK(extra_cfg, film_grain_test_vector, 0, 16); if (extra_cfg->lossless) { if (extra_cfg->aq_mode != 0) ERROR("Only --aq_mode=0 can be used with --lossless=1.");
+ show +
456
457
458
459
#if CONFIG_DIST_8X8 if (extra_cfg->enable_dist_8x8) ERROR("dist-8x8 cannot be used with lossless compression."); #endif
+ show +
460
461
462
463
464
465
466
467
468
469
} RANGE_CHECK(extra_cfg, max_reference_frames, 3, 7); RANGE_CHECK(extra_cfg, enable_reduced_reference_set, 0, 1); RANGE_CHECK_HI(extra_cfg, chroma_subsampling_x, 1); RANGE_CHECK_HI(extra_cfg, chroma_subsampling_y, 1); RANGE_CHECK_HI(extra_cfg, disable_trellis_quant, 3); RANGE_CHECK(extra_cfg, coeff_cost_upd_freq, 0, 2); RANGE_CHECK(extra_cfg, mode_cost_upd_freq, 0, 2);

[CVE-2020-0470_1.diff] av1_cx_iface.c #25
-#if CONFIG_DIST_8X8 - oxcf->using_dist_8x8 = extra_cfg->enable_dist_8x8; - if (extra_cfg->tuning == AOM_TUNE_CDEF_DIST || - extra_cfg->tuning == AOM_TUNE_DAALA_DIST) - oxcf->using_dist_8x8 = 1; -#endif + oxcf->mv_cost_upd_freq = (COST_UPDATE_TYPE)extra_cfg->mv_cost_upd_freq;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/av1_cx_iface.c
627
628
629
630
631
632
633
634
635
636
oxcf->qm_v = extra_cfg->qm_v; oxcf->qm_minlevel = extra_cfg->qm_min; oxcf->qm_maxlevel = extra_cfg->qm_max; oxcf->reduced_tx_type_set = extra_cfg->reduced_tx_type_set; oxcf->use_intra_dct_only = extra_cfg->use_intra_dct_only; oxcf->use_inter_dct_only = extra_cfg->use_inter_dct_only; oxcf->use_intra_default_tx_only = extra_cfg->use_intra_default_tx_only; oxcf->quant_b_adapt = extra_cfg->quant_b_adapt; oxcf->coeff_cost_upd_freq = (COST_UPDATE_TYPE)extra_cfg->coeff_cost_upd_freq; oxcf->mode_cost_upd_freq = (COST_UPDATE_TYPE)extra_cfg->mode_cost_upd_freq;
+ show +
637
638
639
640
641
642
#if CONFIG_DIST_8X8 oxcf->using_dist_8x8 = extra_cfg->enable_dist_8x8; if (extra_cfg->tuning == AOM_TUNE_CDEF_DIST || extra_cfg->tuning == AOM_TUNE_DAALA_DIST) oxcf->using_dist_8x8 = 1; #endif
+ show +
643
644
645
646
647
648
649
650
651
652
oxcf->num_tile_groups = extra_cfg->num_tg; // In large-scale tile encoding mode, num_tile_groups is always 1. if (cfg->large_scale_tile) oxcf->num_tile_groups = 1; oxcf->mtu = extra_cfg->mtu_size; // FIXME(debargha): Should this be: // oxcf->allow_ref_frame_mvs = extra_cfg->allow_ref_frame_mvs & // extra_cfg->enable_order_hint ? // Disallow using temporal MVs while large_scale_tile = 1. oxcf->allow_ref_frame_mvs =

[CVE-2020-0470_1.diff] av1_cx_iface.c #36
+static aom_codec_err_t ctrl_set_enable_keyframe_filtering( + aom_codec_alg_priv_t *ctx, va_list args) { + struct av1_extracfg extra_cfg = ctx->extra_cfg; + extra_cfg.enable_keyframe_filtering = + CAST(AV1E_SET_ENABLE_KEYFRAME_FILTERING, args); + return update_extra_cfg(ctx, &extra_cfg); +} + +static aom_codec_err_t ctrl_set_force_video_mode(aom_codec_alg_priv_t *ctx, + va_list args) { + struct av1_extracfg extra_cfg = ctx->extra_cfg; + extra_cfg.force_video_mode = CAST(AV1E_SET_FORCE_VIDEO_MODE, args); + return update_extra_cfg(ctx, &extra_cfg); +} + -#if CONFIG_DIST_8X8 -static aom_codec_err_t ctrl_set_enable_dist_8x8(aom_codec_alg_priv_t *ctx, - va_list args) { - struct av1_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.enable_dist_8x8 = CAST(AV1E_SET_ENABLE_DIST_8X8, args); - return update_extra_cfg(ctx, &extra_cfg); -} -#endif +
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/av1_cx_iface.c
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
extra_cfg.qm_min = CAST(AV1E_SET_QM_MIN, args); return update_extra_cfg(ctx, &extra_cfg); } static aom_codec_err_t ctrl_set_qm_max(aom_codec_alg_priv_t *ctx, va_list args) { struct av1_extracfg extra_cfg = ctx->extra_cfg; extra_cfg.qm_max = CAST(AV1E_SET_QM_MAX, args); return update_extra_cfg(ctx, &extra_cfg); }
+ show +
1112
1113
1114
1115
1116
1117
1118
1119
#if CONFIG_DIST_8X8 static aom_codec_err_t ctrl_set_enable_dist_8x8(aom_codec_alg_priv_t *ctx, va_list args) { struct av1_extracfg extra_cfg = ctx->extra_cfg; extra_cfg.enable_dist_8x8 = CAST(AV1E_SET_ENABLE_DIST_8X8, args); return update_extra_cfg(ctx, &extra_cfg); } #endif
+ show +
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
static aom_codec_err_t ctrl_set_num_tg(aom_codec_alg_priv_t *ctx, va_list args) { struct av1_extracfg extra_cfg = ctx->extra_cfg; extra_cfg.num_tg = CAST(AV1E_SET_NUM_TG, args); return update_extra_cfg(ctx, &extra_cfg); } static aom_codec_err_t ctrl_set_mtu(aom_codec_alg_priv_t *ctx, va_list args) { struct av1_extracfg extra_cfg = ctx->extra_cfg; extra_cfg.mtu_size = CAST(AV1E_SET_MTU, args);

[CVE-2020-0470_1.diff] av1_cx_iface.c #38
+static aom_codec_err_t ctrl_set_enable_chroma_deltaq(aom_codec_alg_priv_t *ctx, + va_list args) { + struct av1_extracfg extra_cfg = ctx->extra_cfg; + extra_cfg.enable_chroma_deltaq = CAST(AV1E_SET_ENABLE_CHROMA_DELTAQ, args); + return update_extra_cfg(ctx, &extra_cfg); +} + -static aom_codec_err_t ctrl_set_tx_size_search_method(aom_codec_alg_priv_t *ctx, - va_list args) { - struct av1_extracfg extra_cfg = ctx->extra_cfg; - extra_cfg.tx_size_search_method = CAST(AV1E_SET_TX_SIZE_SEARCH_METHOD, args); - return update_extra_cfg(ctx, &extra_cfg); -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/av1_cx_iface.c
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
return update_extra_cfg(ctx, &extra_cfg); } static aom_codec_err_t ctrl_set_enable_tx64(aom_codec_alg_priv_t *ctx, va_list args) { struct av1_extracfg extra_cfg = ctx->extra_cfg; extra_cfg.enable_tx64 = CAST(AV1E_SET_ENABLE_TX64, args); return update_extra_cfg(ctx, &extra_cfg); }
+ show +
1205
1206
1207
1208
1209
static aom_codec_err_t ctrl_set_tx_size_search_method(aom_codec_alg_priv_t *ctx, va_list args) { struct av1_extracfg extra_cfg = ctx->extra_cfg; extra_cfg.tx_size_search_method = CAST(AV1E_SET_TX_SIZE_SEARCH_METHOD, args); return update_extra_cfg(ctx, &extra_cfg);
+ show +
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
} static aom_codec_err_t ctrl_set_enable_flip_idtx(aom_codec_alg_priv_t *ctx, va_list args) { struct av1_extracfg extra_cfg = ctx->extra_cfg; extra_cfg.enable_flip_idtx = CAST(AV1E_SET_ENABLE_FLIP_IDTX, args); return update_extra_cfg(ctx, &extra_cfg); } static aom_codec_err_t ctrl_set_enable_dist_wtd_comp(aom_codec_alg_priv_t *ctx,

[CVE-2020-0470_1.diff] av1_cx_iface.c #46
- ctx->priv->enc.total_encoders = 1; - priv->buffer_pool = (BufferPool *)aom_calloc(1, sizeof(BufferPool)); - if (priv->buffer_pool == NULL) return AOM_CODEC_MEM_ERROR; - -#if CONFIG_MULTITHREAD - if (pthread_mutex_init(&priv->buffer_pool->pool_mutex, NULL)) { - return AOM_CODEC_MEM_ERROR; - } -#endif
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/av1_cx_iface.c
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
aom_codec_priv_enc_mr_cfg_t *data) { aom_codec_err_t res = AOM_CODEC_OK; (void)data; if (ctx->priv == NULL) { aom_codec_alg_priv_t *const priv = aom_calloc(1, sizeof(*priv)); if (priv == NULL) return AOM_CODEC_MEM_ERROR; ctx->priv = (aom_codec_priv_t *)priv; ctx->priv->init_flags = ctx->init_flags;
+ show +
1577
1578
1579
1580
1581
1582
1583
1584
1585
ctx->priv->enc.total_encoders = 1; priv->buffer_pool = (BufferPool *)aom_calloc(1, sizeof(BufferPool)); if (priv->buffer_pool == NULL) return AOM_CODEC_MEM_ERROR; #if CONFIG_MULTITHREAD if (pthread_mutex_init(&priv->buffer_pool->pool_mutex, NULL)) { return AOM_CODEC_MEM_ERROR; } #endif
+ show +
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
if (ctx->config.enc) { // Update the reference to the config structure to an internal copy. priv->cfg = *ctx->config.enc; ctx->config.enc = &priv->cfg; } priv->extra_cfg = default_extra_cfg; aom_once(av1_initialize_enc);

[CVE-2020-0470_1.diff] av1_cx_iface.c #52
+ + // Call for LAP stage + if (cpi_lap != NULL) { + int status; + aom_rational64_t timestamp_ratio_la = *timestamp_ratio; + int64_t dst_time_stamp_la = dst_time_stamp; + int64_t dst_end_time_stamp_la = dst_end_time_stamp; + status = av1_get_compressed_data( + cpi_lap, &lib_flags, &frame_size, NULL, &dst_time_stamp_la, + &dst_end_time_stamp_la, !img, ×tamp_ratio_la); + if (status != -1) { + if (status != AOM_CODEC_OK) { + aom_internal_error(&cpi_lap->common.error, AOM_CODEC_ERROR, NULL); + } + cpi_lap->seq_params_locked = 1; + } + lib_flags = 0; + frame_size = 0; + } + - !is_frame_visible && - -1 != av1_get_compressed_data(cpi, &lib_flags, &frame_size, cx_data, - &dst_time_stamp, &dst_end_time_stamp, - !img, timebase)) { + !is_frame_visible) { + const int status = av1_get_compressed_data( + cpi, &lib_flags, &frame_size, cx_data, &dst_time_stamp, + &dst_end_time_stamp, !img, timestamp_ratio); + if (status == -1) break; + if (status != AOM_CODEC_OK) { + aom_internal_error(&cpi->common.error, AOM_CODEC_ERROR, NULL); + } +
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/av1_cx_iface.c
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
} } size_t frame_size = 0; unsigned int lib_flags = 0; int is_frame_visible = 0; int index_size = 0; int has_fwd_keyframe = 0; // invisible frames get packed with the next visible frame while (cx_data_sz - index_size >= ctx->cx_data_sz / 2 &&
+ show +
1751
1752
1753
1754
!is_frame_visible && -1 != av1_get_compressed_data(cpi, &lib_flags, &frame_size, cx_data, &dst_time_stamp, &dst_end_time_stamp, !img, timebase)) {
+ show +
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
cpi->seq_params_locked = 1; if (frame_size) { if (ctx->pending_cx_data == 0) ctx->pending_cx_data = cx_data; const int write_temporal_delimiter = !cpi->common.spatial_layer_id && !ctx->pending_frame_count; if (write_temporal_delimiter) { uint32_t obu_header_size = 1; const uint32_t obu_payload_size = 0;

[CVE-2020-0470_1.diff] av1_cx_iface.c #58
-static aom_codec_err_t ctrl_set_previewpp(aom_codec_alg_priv_t *ctx, - va_list args) { - (void)ctx; - (void)args; - return AOM_CODEC_INCAPABLE; -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/av1_cx_iface.c
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
image2yuvconfig(new_img, &sd); return av1_copy_new_frame_enc(&ctx->cpi->common, &new_frame, &sd); } else { return AOM_CODEC_ERROR; } } else { return AOM_CODEC_INVALID_PARAM; } }
+ show +
1958
1959
1960
1961
1962
static aom_codec_err_t ctrl_set_previewpp(aom_codec_alg_priv_t *ctx, va_list args) { (void)ctx; (void)args; return AOM_CODEC_INCAPABLE;
+ show +
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
} static aom_image_t *encoder_get_preview(aom_codec_alg_priv_t *ctx) { YV12_BUFFER_CONFIG sd; if (av1_get_preview_raw_frame(ctx->cpi, &sd) == 0) { yuvconfig2image(&ctx->preview_img, &sd, NULL); return &ctx->preview_img; } else { return NULL;

[CVE-2020-0478_1.diff] partition_strategy.h #1
+ +// Get the minimum partition block width and height(in log scale) under a +// PC_TREE. +static AOM_INLINE void get_min_bsize(const PC_TREE *pc_tree, int *min_bw, + int *min_bh) { + if (!pc_tree) return; + + const BLOCK_SIZE bsize = pc_tree->block_size; + if (bsize == BLOCK_4X4) { + *min_bw = 0; + *min_bh = 0; + return; + } + + PARTITION_TYPE part_type = pc_tree->partitioning; + if (part_type == PARTITION_INVALID) return; + + if (part_type == PARTITION_SPLIT) { + for (int i = 0; i < 4; ++i) { + get_min_bsize(pc_tree->split[i], min_bw, min_bh); + } + } else { + if (part_type == PARTITION_HORZ_A || part_type == PARTITION_HORZ_B || + part_type == PARTITION_VERT_A || part_type == PARTITION_VERT_B) + part_type = PARTITION_SPLIT; + const BLOCK_SIZE subsize = get_partition_subsize(bsize, part_type); + if (subsize != BLOCK_INVALID) { + *min_bw = AOMMIN(*min_bw, mi_size_wide_log2[subsize]); + *min_bh = AOMMIN(*min_bh, mi_size_high_log2[subsize]); + } + } +} + +static INLINE void add_rd_feature(int64_t rd, int64_t best_rd, float *features, + int *feature_idx) { + const int rd_valid = rd > 0 && rd < INT64_MAX; + const float rd_ratio = rd_valid ? (float)rd / best_rd : 1.0f; + features[(*feature_idx)++] = (float)rd_valid; + features[(*feature_idx)++] = rd_ratio; +} + +#define FEATURES 31 +void av1_ml_early_term_after_split(AV1_COMP *const cpi, MACROBLOCK *const x, + PC_TREE *const pc_tree, BLOCK_SIZE bsize, + int64_t best_rd, int64_t part_none_rd, + int64_t part_split_rd, + int64_t *split_block_rd, int mi_row, + int mi_col, + int *const terminate_partition_search) { + if (best_rd <= 0 || best_rd == INT64_MAX || *terminate_partition_search) + return; + + const AV1_COMMON *const cm = &cpi->common; + const int is_480p_or_larger = AOMMIN(cm->width, cm->height) >= 480; + const NN_CONFIG *nn_config = NULL; + float thresh = -1e6; + switch (bsize) { + case BLOCK_128X128: break; + case BLOCK_64X64: + nn_config = &av1_early_term_after_split_nnconfig_64; + thresh = is_480p_or_larger ? -2.0f : -1.2f; + break; + case BLOCK_32X32: + nn_config = &av1_early_term_after_split_nnconfig_32; + thresh = is_480p_or_larger ? -2.6f : -2.3f; + break; + case BLOCK_16X16: + nn_config = &av1_early_term_after_split_nnconfig_16; + thresh = is_480p_or_larger ? -2.0f : -2.4f; + break; + case BLOCK_8X8: + nn_config = &av1_early_term_after_split_nnconfig_8; + thresh = is_480p_or_larger ? -1.0f : -1.4f; + break; + case BLOCK_4X4: break; + default: + assert(0 && "Invalid block size in av1_ml_early_term_after_split()."); + break; + } + if (!nn_config) return; + + // Use more conservative threshold for level 1. + if (cpi->sf.part_sf.ml_early_term_after_part_split_level < 2) thresh -= 0.3f; + + const MACROBLOCKD *const xd = &x->e_mbd; + const int dc_q = av1_dc_quant_QTX(x->qindex, 0, xd->bd) >> (xd->bd - 8); + const int bs = block_size_wide[bsize]; + int f_idx = 0; + float features[FEATURES] = { 0.0f }; + + aom_clear_system_state(); + + features[f_idx++] = logf(1.0f + (float)dc_q / 4.0f); + features[f_idx++] = logf(1.0f + (float)best_rd / bs / bs / 1024.0f); + + add_rd_feature(part_none_rd, best_rd, features, &f_idx); + add_rd_feature(part_split_rd, best_rd, features, &f_idx); + + for (int i = 0; i < 4; ++i) { + add_rd_feature(split_block_rd[i], best_rd, features, &f_idx); + int min_bw = MAX_SB_SIZE_LOG2; + int min_bh = MAX_SB_SIZE_LOG2; + get_min_bsize(pc_tree->split[i], &min_bw, &min_bh); + features[f_idx++] = (float)min_bw; + features[f_idx++] = (float)min_bh; + } + + simple_motion_search_prune_part_features(cpi, x, pc_tree, mi_row, mi_col, + bsize, NULL, + FEATURE_SMS_PRUNE_PART_FLAG); + + features[f_idx++] = logf(1.0f + (float)pc_tree->sms_none_feat[1]); + + features[f_idx++] = logf(1.0f + (float)pc_tree->split[0]->sms_none_feat[1]); + features[f_idx++] = logf(1.0f + (float)pc_tree->split[1]->sms_none_feat[1]); + features[f_idx++] = logf(1.0f + (float)pc_tree->split[2]->sms_none_feat[1]); + features[f_idx++] = logf(1.0f + (float)pc_tree->split[3]->sms_none_feat[1]); + + features[f_idx++] = logf(1.0f + (float)pc_tree->sms_rect_feat[1]); + features[f_idx++] = logf(1.0f + (float)pc_tree->sms_rect_feat[3]); + features[f_idx++] = logf(1.0f + (float)pc_tree->sms_rect_feat[5]); + features[f_idx++] = logf(1.0f + (float)pc_tree->sms_rect_feat[7]); + + assert(f_idx == FEATURES); + + float score = 0.0f; + av1_nn_predict(features, nn_config, 1, &score); + // Score is indicator of confidence that we should NOT terminate. + if (score < thresh) *terminate_partition_search = 1; +} +#undef FEATURES + +void av1_ml_prune_rect_partition(const AV1_COMP *const cpi, + const MACROBLOCK *const x, BLOCK_SIZE bsize, + int64_t best_rd, int64_t none_rd, + int64_t *split_rd, int *const dst_prune_horz, + int *const dst_prune_vert) { + if (bsize < BLOCK_8X8 || best_rd >= 1000000000) return; + best_rd = AOMMAX(best_rd, 1); + const NN_CONFIG *nn_config = NULL; + const float prob_thresholds[5] = { 0.01f, 0.01f, 0.004f, 0.002f, 0.002f }; + float cur_thresh = 0.0f; + switch (bsize) { + case BLOCK_8X8: + nn_config = &av1_rect_partition_nnconfig_8; + cur_thresh = prob_thresholds[0]; + break; + case BLOCK_16X16: + nn_config = &av1_rect_partition_nnconfig_16; + cur_thresh = prob_thresholds[1]; + break; + case BLOCK_32X32: + nn_config = &av1_rect_partition_nnconfig_32; + cur_thresh = prob_thresholds[2]; + break; + case BLOCK_64X64: + nn_config = &av1_rect_partition_nnconfig_64; + cur_thresh = prob_thresholds[3]; + break; + case BLOCK_128X128: + nn_config = &av1_rect_partition_nnconfig_128; + cur_thresh = prob_thresholds[4]; + break; + default: assert(0 && "Unexpected bsize."); + } + if (!nn_config) return; + aom_clear_system_state(); + + // 1. Compute input features + float features[9]; + + // RD cost ratios + for (int i = 0; i < 5; i++) features[i] = 1.0f; + if (none_rd > 0 && none_rd < 1000000000) + features[0] = (float)none_rd / (float)best_rd; + for (int i = 0; i < 4; i++) { + if (split_rd[i] > 0 && split_rd[i] < 1000000000) + features[1 + i] = (float)split_rd[i] / (float)best_rd; + } + + // Variance ratios + const MACROBLOCKD *const xd = &x->e_mbd; + int whole_block_variance; + if (is_cur_buf_hbd(xd)) { + whole_block_variance = av1_high_get_sby_perpixel_variance( + cpi, &x->plane[0].src, bsize, xd->bd); + } else { + whole_block_variance = + av1_get_sby_perpixel_variance(cpi, &x->plane[0].src, bsize); + } + whole_block_variance = AOMMAX(whole_block_variance, 1); + + int split_variance[4]; + const BLOCK_SIZE subsize = get_partition_subsize(bsize, PARTITION_SPLIT); + struct buf_2d buf; + buf.stride = x->plane[0].src.stride; + const int bw = block_size_wide[bsize]; + for (int i = 0; i < 4; ++i) { + const int x_idx = (i & 1) * bw / 2; + const int y_idx = (i >> 1) * bw / 2; + buf.buf = x->plane[0].src.buf + x_idx + y_idx * buf.stride; + if (is_cur_buf_hbd(xd)) { + split_variance[i] = + av1_high_get_sby_perpixel_variance(cpi, &buf, subsize, xd->bd); + } else { + split_variance[i] = av1_get_sby_perpixel_variance(cpi, &buf, subsize); + } + } + + for (int i = 0; i < 4; i++) + features[5 + i] = (float)split_variance[i] / (float)whole_block_variance; + + // 2. Do the prediction and prune 0-2 partitions based on their probabilities + float raw_scores[3] = { 0.0f }; + av1_nn_predict(features, nn_config, 1, raw_scores); + aom_clear_system_state(); + float probs[3] = { 0.0f }; + av1_nn_softmax(raw_scores, probs, 3); + + // probs[0] is the probability of the fact that both rectangular partitions + // are worse than current best_rd + if (probs[1] <= cur_thresh) (*dst_prune_horz) = 1; + if (probs[2] <= cur_thresh) (*dst_prune_vert) = 1; +} + +// Use a ML model to predict if horz_a, horz_b, vert_a, and vert_b should be +// considered. +void av1_ml_prune_ab_partition(BLOCK_SIZE bsize, int part_ctx, int var_ctx, + int64_t best_rd, int64_t horz_rd[2], + int64_t vert_rd[2], int64_t split_rd[4], + int *const horza_partition_allowed, + int *const horzb_partition_allowed, + int *const verta_partition_allowed, + int *const vertb_partition_allowed) { + if (bsize < BLOCK_8X8 || best_rd >= 1000000000) return; + const NN_CONFIG *nn_config = NULL; + switch (bsize) { + case BLOCK_8X8: nn_config = NULL; break; + case BLOCK_16X16: nn_config = &av1_ab_partition_nnconfig_16; break; + case BLOCK_32X32: nn_config = &av1_ab_partition_nnconfig_32; break; + case BLOCK_64X64: nn_config = &av1_ab_partition_nnconfig_64; break; + case BLOCK_128X128: nn_config = &av1_ab_partition_nnconfig_128; break; + default: assert(0 && "Unexpected bsize."); + } + if (!nn_config) return; + + aom_clear_system_state(); + + // Generate features. + float features[10]; + int feature_index = 0; + features[feature_index++] = (float)part_ctx; + features[feature_index++] = (float)var_ctx; + const int rdcost = (int)AOMMIN(INT_MAX, best_rd); + int sub_block_rdcost[8] = { 0 }; + int rd_index = 0; + for (int i = 0; i < 2; ++i) { + if (horz_rd[i] > 0 && horz_rd[i] < 1000000000) + sub_block_rdcost[rd_index] = (int)horz_rd[i]; + ++rd_index; + } + for (int i = 0; i < 2; ++i) { + if (vert_rd[i] > 0 && vert_rd[i] < 1000000000) + sub_block_rdcost[rd_index] = (int)vert_rd[i]; + ++rd_index; + } + for (int i = 0; i < 4; ++i) { + if (split_rd[i] > 0 && split_rd[i] < 1000000000) + sub_block_rdcost[rd_index] = (int)split_rd[i]; + ++rd_index; + } + for (int i = 0; i < 8; ++i) { + // Ratio between the sub-block RD and the whole-block RD. + float rd_ratio = 1.0f; + if (sub_block_rdcost[i] > 0 && sub_block_rdcost[i] < rdcost) + rd_ratio = (float)sub_block_rdcost[i] / (float)rdcost; + features[feature_index++] = rd_ratio; + } + assert(feature_index == 10); + + // Calculate scores using the NN model. + float score[16] = { 0.0f }; + av1_nn_predict(features, nn_config, 1, score); + aom_clear_system_state(); + int int_score[16]; + int max_score = -1000; + for (int i = 0; i < 16; ++i) { + int_score[i] = (int)(100 * score[i]); + max_score = AOMMAX(int_score[i], max_score); + } + + // Make decisions based on the model scores. + int thresh = max_score; + switch (bsize) { + case BLOCK_16X16: thresh -= 150; break; + case BLOCK_32X32: thresh -= 100; break; + default: break; + } + *horza_partition_allowed = 0; + *horzb_partition_allowed = 0; + *verta_partition_allowed = 0; + *vertb_partition_allowed = 0; + for (int i = 0; i < 16; ++i) { + if (int_score[i] >= thresh) { + if ((i >> 0) & 1) *horza_partition_allowed = 1; + if ((i >> 1) & 1) *horzb_partition_allowed = 1; + if ((i >> 2) & 1) *verta_partition_allowed = 1; + if ((i >> 3) & 1) *vertb_partition_allowed = 1; + } + } +} + +#define FEATURES 18 +#define LABELS 4 +// Use a ML model to predict if horz4 and vert4 should be considered. +void av1_ml_prune_4_partition(const AV1_COMP *const cpi, MACROBLOCK *const x, + BLOCK_SIZE bsize, int part_ctx, int64_t best_rd, + int64_t horz_rd[2], int64_t vert_rd[2], + int64_t split_rd[4], + int *const partition_horz4_allowed, + int *const partition_vert4_allowed, + unsigned int pb_source_variance, int mi_row, + int mi_col) { + if (best_rd >= 1000000000) return; + const NN_CONFIG *nn_config = NULL; + switch (bsize) { + case BLOCK_16X16: nn_config = &av1_4_partition_nnconfig_16; break; + case BLOCK_32X32: nn_config = &av1_4_partition_nnconfig_32; break; + case BLOCK_64X64: nn_config = &av1_4_partition_nnconfig_64; break; + default: assert(0 && "Unexpected bsize."); + } + if (!nn_config) return; + + aom_clear_system_state(); + + // Generate features. + float features[FEATURES]; + int feature_index = 0; + features[feature_index++] = (float)part_ctx; + features[feature_index++] = (float)get_unsigned_bits(pb_source_variance); + + const int rdcost = (int)AOMMIN(INT_MAX, best_rd); + int sub_block_rdcost[8] = { 0 }; + int rd_index = 0; + for (int i = 0; i < 2; ++i) { + if (horz_rd[i] > 0 && horz_rd[i] < 1000000000) + sub_block_rdcost[rd_index] = (int)horz_rd[i]; + ++rd_index; + } + for (int i = 0; i < 2; ++i) { + if (vert_rd[i] > 0 && vert_rd[i] < 1000000000) + sub_block_rdcost[rd_index] = (int)vert_rd[i]; + ++rd_index; + } + for (int i = 0; i < 4; ++i) { + if (split_rd[i] > 0 && split_rd[i] < 1000000000) + sub_block_rdcost[rd_index] = (int)split_rd[i]; + ++rd_index; + } + for (int i = 0; i < 8; ++i) { + // Ratio between the sub-block RD and the whole-block RD. + float rd_ratio = 1.0f; + if (sub_block_rdcost[i] > 0 && sub_block_rdcost[i] < rdcost) + rd_ratio = (float)sub_block_rdcost[i] / (float)rdcost; + features[feature_index++] = rd_ratio; + } + + // Get variance of the 1:4 and 4:1 sub-blocks. + unsigned int horz_4_source_var[4] = { 0 }; + unsigned int vert_4_source_var[4] = { 0 }; + { + BLOCK_SIZE horz_4_bs = get_partition_subsize(bsize, PARTITION_HORZ_4); + BLOCK_SIZE vert_4_bs = get_partition_subsize(bsize, PARTITION_VERT_4); + av1_setup_src_planes(x, cpi->source, mi_row, mi_col, + av1_num_planes(&cpi->common), bsize); + const int src_stride = x->plane[0].src.stride; + uint8_t *src = x->plane[0].src.buf; + const MACROBLOCKD *const xd = &x->e_mbd; + + struct buf_2d horz_4_src, vert_4_src; + horz_4_src.stride = src_stride; + vert_4_src.stride = src_stride; + + for (int i = 0; i < 4; ++i) { + horz_4_src.buf = src + i * block_size_high[horz_4_bs] * src_stride; + vert_4_src.buf = src + i * block_size_wide[vert_4_bs]; + + if (is_cur_buf_hbd(xd)) { + horz_4_source_var[i] = av1_high_get_sby_perpixel_variance( + cpi, &horz_4_src, horz_4_bs, xd->bd); + vert_4_source_var[i] = av1_high_get_sby_perpixel_variance( + cpi, &vert_4_src, vert_4_bs, xd->bd); + } else { + horz_4_source_var[i] = + av1_get_sby_perpixel_variance(cpi, &horz_4_src, horz_4_bs); + vert_4_source_var[i] = + av1_get_sby_perpixel_variance(cpi, &vert_4_src, vert_4_bs); + } + } + } + + const float denom = (float)(pb_source_variance + 1); + const float low_b = 0.1f; + const float high_b = 10.0f; + for (int i = 0; i < 4; ++i) { + // Ratio between the 4:1 sub-block variance and the whole-block variance. + float var_ratio = (float)(horz_4_source_var[i] + 1) / denom; + if (var_ratio < low_b) var_ratio = low_b; + if (var_ratio > high_b) var_ratio = high_b; + features[feature_index++] = var_ratio; + } + for (int i = 0; i < 4; ++i) { + // Ratio between the 1:4 sub-block RD and the whole-block RD. + float var_ratio = (float)(vert_4_source_var[i] + 1) / denom; + if (var_ratio < low_b) var_ratio = low_b; + if (var_ratio > high_b) var_ratio = high_b; + features[feature_index++] = var_ratio; + } + assert(feature_index == FEATURES); + + // Calculate scores using the NN model. + float score[LABELS] = { 0.0f }; + av1_nn_predict(features, nn_config, 1, score); + aom_clear_system_state(); + int int_score[LABELS]; + int max_score = -1000; + for (int i = 0; i < LABELS; ++i) { + int_score[i] = (int)(100 * score[i]); + max_score = AOMMAX(int_score[i], max_score); + } + + // Make decisions based on the model scores. + int thresh = max_score; + switch (bsize) { + case BLOCK_16X16: thresh -= 500; break; + case BLOCK_32X32: thresh -= 500; break; + case BLOCK_64X64: thresh -= 200; break; + default: break; + } + *partition_horz4_allowed = 0; + *partition_vert4_allowed = 0; + for (int i = 0; i < LABELS; ++i) { + if (int_score[i] >= thresh) { + if ((i >> 0) & 1) *partition_horz4_allowed = 1; + if ((i >> 1) & 1) *partition_vert4_allowed = 1; + } + } +} +#undef FEATURES +#undef LABELS + +#define FEATURES 4 +int av1_ml_predict_breakout(const AV1_COMP *const cpi, BLOCK_SIZE bsize, + const MACROBLOCK *const x, + const RD_STATS *const rd_stats, + unsigned int pb_source_variance) { + const NN_CONFIG *nn_config = NULL; + int thresh = 0; + switch (bsize) { + case BLOCK_8X8: + nn_config = &av1_partition_breakout_nnconfig_8; + thresh = cpi->sf.part_sf.ml_partition_search_breakout_thresh[0]; + break; + case BLOCK_16X16: + nn_config = &av1_partition_breakout_nnconfig_16; + thresh = cpi->sf.part_sf.ml_partition_search_breakout_thresh[1]; + break; + case BLOCK_32X32: + nn_config = &av1_partition_breakout_nnconfig_32; + thresh = cpi->sf.part_sf.ml_partition_search_breakout_thresh[2]; + break; + case BLOCK_64X64: + nn_config = &av1_partition_breakout_nnconfig_64; + thresh = cpi->sf.part_sf.ml_partition_search_breakout_thresh[3]; + break; + case BLOCK_128X128: + nn_config = &av1_partition_breakout_nnconfig_128; + thresh = cpi->sf.part_sf.ml_partition_search_breakout_thresh[4]; + break; + default: assert(0 && "Unexpected bsize."); + } + if (!nn_config || thresh < 0) return 0; + + // Generate feature values. + float features[FEATURES]; + int feature_index = 0; + aom_clear_system_state(); + + const int num_pels_log2 = num_pels_log2_lookup[bsize]; + float rate_f = (float)AOMMIN(rd_stats->rate, INT_MAX); + rate_f = ((float)x->rdmult / 128.0f / 512.0f / (float)(1 << num_pels_log2)) * + rate_f; + features[feature_index++] = rate_f; + + const float dist_f = + (float)(AOMMIN(rd_stats->dist, INT_MAX) >> num_pels_log2); + features[feature_index++] = dist_f; + + features[feature_index++] = (float)pb_source_variance; + + const int dc_q = (int)x->plane[0].dequant_QTX[0]; + features[feature_index++] = (float)(dc_q * dc_q) / 256.0f; + assert(feature_index == FEATURES); + + // Calculate score using the NN model. + float score = 0.0f; + av1_nn_predict(features, nn_config, 1, &score); + aom_clear_system_state(); + + // Make decision. + return (int)(score * 100) >= thresh; +} +#undef FEATURES +#endif // !CONFIG_REALTIME_ONLY +#define FEATURE_SIZE_SMS_SPLIT_FAST 6 +#define FEATURE_SIZE_SMS_SPLIT 17 +#define FEATURE_SMS_NONE_FLAG 1 +#define FEATURE_SMS_SPLIT_FLAG (1 << 1) +#define FEATURE_SMS_RECT_FLAG (1 << 2) + +#define FEATURE_SMS_PRUNE_PART_FLAG \ + (FEATURE_SMS_NONE_FLAG | FEATURE_SMS_SPLIT_FLAG | FEATURE_SMS_RECT_FLAG) +#define FEATURE_SMS_SPLIT_MODEL_FLAG \ + (FEATURE_SMS_NONE_FLAG | FEATURE_SMS_SPLIT_FLAG) + +void av1_intra_mode_cnn_partition(const AV1_COMMON *const cm, MACROBLOCK *x, + int bsize, int label_idx, + int *partition_none_allowed, + int *partition_horz_allowed, + int *partition_vert_allowed, + int *do_rectangular_split, + int *do_square_split); + - AV1_COMP *const cpi, MACROBLOCK *x, int mi_row, int mi_col, - BLOCK_SIZE bsize, int *partition_none_allowed, int *partition_horz_allowed, - int *partition_vert_allowed, int *do_rectangular_split, - int *do_square_split); + AV1_COMP *const cpi, MACROBLOCK *x, PC_TREE *pc_tree, int mi_row, + int mi_col, BLOCK_SIZE bsize, int *partition_none_allowed, + int *partition_horz_allowed, int *partition_vert_allowed, + int *do_rectangular_split, int *do_square_split); -void av1_simple_motion_search_prune_part( - AV1_COMP *const cpi, MACROBLOCK *x, PC_TREE *pc_tree, int mi_row, - int mi_col, BLOCK_SIZE bsize, int *partition_none_allowed, - int *partition_horz_allowed, int *partition_vert_allowed, - int *do_square_split, int *do_rectangular_split, int *prune_horz, - int *prune_vert, float *features, int *valid); +void av1_simple_motion_search_prune_rect(AV1_COMP *const cpi, MACROBLOCK *x, + PC_TREE *pc_tree, int mi_row, + int mi_col, BLOCK_SIZE bsize, + int *partition_horz_allowed, + int *partition_vert_allowed, + int *prune_horz, int *prune_vert); +#if !CONFIG_REALTIME_ONLY -void av1_simple_motion_search_early_term_none( - AV1_COMP *const cpi, MACROBLOCK *x, PC_TREE *pc_tree, int mi_row, - int mi_col, BLOCK_SIZE bsize, const RD_STATS *none_rdc, - int *early_terminate, float *simple_motion_features, - int *simple_motion_features_are_valid); - -// Early terminates after PARTITION_NONE in firstpass of two pass partition -// search. -void av1_firstpass_simple_motion_search_early_term(AV1_COMP *const cpi, - MACROBLOCK *x, - PC_TREE *pc_tree, int mi_row, - int mi_col, BLOCK_SIZE bsize, - const RD_STATS *none_rdc, - int *do_square_split); +void av1_simple_motion_search_early_term_none(AV1_COMP *const cpi, + MACROBLOCK *x, PC_TREE *pc_tree, + int mi_row, int mi_col, + BLOCK_SIZE bsize, + const RD_STATS *none_rdc, + int *early_terminate); -// performs simple_motion_search on 16X16 subblocks of the currnet superblock, +// performs simple_motion_search on 16X16 subblocks of the current superblock,
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/partition_strategy.h
19
20
21
22
23
24
25
26
27
28
#define FEATURE_SIZE_SMS_PRUNE_PART 25 #define FEATURE_SIZE_SMS_TERM_NONE 28 #define FEATURE_SIZE_FP_SMS_TERM_NONE 20 #define FEATURE_SIZE_MAX_MIN_PART_PRED 13 #define MAX_NUM_CLASSES_MAX_MIN_PART_PRED 4 // Performs a simple_motion_search with a single reference frame and extract // the variance of residues. Then use the features to determine whether we want // to go straight to splitting without trying PARTITION_NONE void av1_simple_motion_search_based_split(
+ show +
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
AV1_COMP *const cpi, MACROBLOCK *x, int mi_row, int mi_col, BLOCK_SIZE bsize, int *partition_none_allowed, int *partition_horz_allowed, int *partition_vert_allowed, int *do_rectangular_split, int *do_square_split); // Performs a simple_motion_search with two reference frames and extract // the variance of residues. Then use the features to determine whether we want // to prune some partitions. void av1_simple_motion_search_prune_part( AV1_COMP *const cpi, MACROBLOCK *x, PC_TREE *pc_tree, int mi_row, int mi_col, BLOCK_SIZE bsize, int *partition_none_allowed, int *partition_horz_allowed, int *partition_vert_allowed, int *do_square_split, int *do_rectangular_split, int *prune_horz, int *prune_vert, float *features, int *valid); // Early terminates PARTITION_NONE using simple_motion_search features and the // rate, distortion, and rdcost of PARTITION_NONE. This is only called when: // - The frame is a show frame // - The frame is not intra only // - The current bsize is > BLOCK_8X8 // - blk_row + blk_height/2 < total_rows and blk_col + blk_width/2 < total_cols void av1_simple_motion_search_early_term_none( AV1_COMP *const cpi, MACROBLOCK *x, PC_TREE *pc_tree, int mi_row, int mi_col, BLOCK_SIZE bsize, const RD_STATS *none_rdc, int *early_terminate, float *simple_motion_features, int *simple_motion_features_are_valid); // Early terminates after PARTITION_NONE in firstpass of two pass partition // search. void av1_firstpass_simple_motion_search_early_term(AV1_COMP *const cpi, MACROBLOCK *x, PC_TREE *pc_tree, int mi_row, int mi_col, BLOCK_SIZE bsize, const RD_STATS *none_rdc, int *do_square_split);
+ show +
64
65
66
67
68
69
70
71
72
73
// Get the features for selecting the max and min partition size. Currently this // performs simple_motion_search on 16X16 subblocks of the currnet superblock, // and then extract the statistics of sse and motion vectors as features. void av1_get_max_min_partition_features(AV1_COMP *const cpi, MACROBLOCK *x, int mi_row, int mi_col, float *features); // Predict the maximum BLOCK_SIZE to be used to encoder the current superblock. BLOCK_SIZE av1_predict_max_partition(AV1_COMP *const cpi, MACROBLOCK *const x,

[CVE-2020-0470_1.diff] partition_strategy.h #1
+ +// Get the minimum partition block width and height(in log scale) under a +// PC_TREE. +static AOM_INLINE void get_min_bsize(const PC_TREE *pc_tree, int *min_bw, + int *min_bh) { + if (!pc_tree) return; + + const BLOCK_SIZE bsize = pc_tree->block_size; + if (bsize == BLOCK_4X4) { + *min_bw = 0; + *min_bh = 0; + return; + } + + PARTITION_TYPE part_type = pc_tree->partitioning; + if (part_type == PARTITION_INVALID) return; + + if (part_type == PARTITION_SPLIT) { + for (int i = 0; i < 4; ++i) { + get_min_bsize(pc_tree->split[i], min_bw, min_bh); + } + } else { + if (part_type == PARTITION_HORZ_A || part_type == PARTITION_HORZ_B || + part_type == PARTITION_VERT_A || part_type == PARTITION_VERT_B) + part_type = PARTITION_SPLIT; + const BLOCK_SIZE subsize = get_partition_subsize(bsize, part_type); + if (subsize != BLOCK_INVALID) { + *min_bw = AOMMIN(*min_bw, mi_size_wide_log2[subsize]); + *min_bh = AOMMIN(*min_bh, mi_size_high_log2[subsize]); + } + } +} + +static INLINE void add_rd_feature(int64_t rd, int64_t best_rd, float *features, + int *feature_idx) { + const int rd_valid = rd > 0 && rd < INT64_MAX; + const float rd_ratio = rd_valid ? (float)rd / best_rd : 1.0f; + features[(*feature_idx)++] = (float)rd_valid; + features[(*feature_idx)++] = rd_ratio; +} + +#define FEATURES 31 +void av1_ml_early_term_after_split(AV1_COMP *const cpi, MACROBLOCK *const x, + PC_TREE *const pc_tree, BLOCK_SIZE bsize, + int64_t best_rd, int64_t part_none_rd, + int64_t part_split_rd, + int64_t *split_block_rd, int mi_row, + int mi_col, + int *const terminate_partition_search) { + if (best_rd <= 0 || best_rd == INT64_MAX || *terminate_partition_search) + return; + + const AV1_COMMON *const cm = &cpi->common; + const int is_480p_or_larger = AOMMIN(cm->width, cm->height) >= 480; + const NN_CONFIG *nn_config = NULL; + float thresh = -1e6; + switch (bsize) { + case BLOCK_128X128: break; + case BLOCK_64X64: + nn_config = &av1_early_term_after_split_nnconfig_64; + thresh = is_480p_or_larger ? -2.0f : -1.2f; + break; + case BLOCK_32X32: + nn_config = &av1_early_term_after_split_nnconfig_32; + thresh = is_480p_or_larger ? -2.6f : -2.3f; + break; + case BLOCK_16X16: + nn_config = &av1_early_term_after_split_nnconfig_16; + thresh = is_480p_or_larger ? -2.0f : -2.4f; + break; + case BLOCK_8X8: + nn_config = &av1_early_term_after_split_nnconfig_8; + thresh = is_480p_or_larger ? -1.0f : -1.4f; + break; + case BLOCK_4X4: break; + default: + assert(0 && "Invalid block size in av1_ml_early_term_after_split()."); + break; + } + if (!nn_config) return; + + // Use more conservative threshold for level 1. + if (cpi->sf.part_sf.ml_early_term_after_part_split_level < 2) thresh -= 0.3f; + + const MACROBLOCKD *const xd = &x->e_mbd; + const int dc_q = av1_dc_quant_QTX(x->qindex, 0, xd->bd) >> (xd->bd - 8); + const int bs = block_size_wide[bsize]; + int f_idx = 0; + float features[FEATURES] = { 0.0f }; + + aom_clear_system_state(); + + features[f_idx++] = logf(1.0f + (float)dc_q / 4.0f); + features[f_idx++] = logf(1.0f + (float)best_rd / bs / bs / 1024.0f); + + add_rd_feature(part_none_rd, best_rd, features, &f_idx); + add_rd_feature(part_split_rd, best_rd, features, &f_idx); + + for (int i = 0; i < 4; ++i) { + add_rd_feature(split_block_rd[i], best_rd, features, &f_idx); + int min_bw = MAX_SB_SIZE_LOG2; + int min_bh = MAX_SB_SIZE_LOG2; + get_min_bsize(pc_tree->split[i], &min_bw, &min_bh); + features[f_idx++] = (float)min_bw; + features[f_idx++] = (float)min_bh; + } + + simple_motion_search_prune_part_features(cpi, x, pc_tree, mi_row, mi_col, + bsize, NULL, + FEATURE_SMS_PRUNE_PART_FLAG); + + features[f_idx++] = logf(1.0f + (float)pc_tree->sms_none_feat[1]); + + features[f_idx++] = logf(1.0f + (float)pc_tree->split[0]->sms_none_feat[1]); + features[f_idx++] = logf(1.0f + (float)pc_tree->split[1]->sms_none_feat[1]); + features[f_idx++] = logf(1.0f + (float)pc_tree->split[2]->sms_none_feat[1]); + features[f_idx++] = logf(1.0f + (float)pc_tree->split[3]->sms_none_feat[1]); + + features[f_idx++] = logf(1.0f + (float)pc_tree->sms_rect_feat[1]); + features[f_idx++] = logf(1.0f + (float)pc_tree->sms_rect_feat[3]); + features[f_idx++] = logf(1.0f + (float)pc_tree->sms_rect_feat[5]); + features[f_idx++] = logf(1.0f + (float)pc_tree->sms_rect_feat[7]); + + assert(f_idx == FEATURES); + + float score = 0.0f; + av1_nn_predict(features, nn_config, 1, &score); + // Score is indicator of confidence that we should NOT terminate. + if (score < thresh) *terminate_partition_search = 1; +} +#undef FEATURES + +void av1_ml_prune_rect_partition(const AV1_COMP *const cpi, + const MACROBLOCK *const x, BLOCK_SIZE bsize, + int64_t best_rd, int64_t none_rd, + int64_t *split_rd, int *const dst_prune_horz, + int *const dst_prune_vert) { + if (bsize < BLOCK_8X8 || best_rd >= 1000000000) return; + best_rd = AOMMAX(best_rd, 1); + const NN_CONFIG *nn_config = NULL; + const float prob_thresholds[5] = { 0.01f, 0.01f, 0.004f, 0.002f, 0.002f }; + float cur_thresh = 0.0f; + switch (bsize) { + case BLOCK_8X8: + nn_config = &av1_rect_partition_nnconfig_8; + cur_thresh = prob_thresholds[0]; + break; + case BLOCK_16X16: + nn_config = &av1_rect_partition_nnconfig_16; + cur_thresh = prob_thresholds[1]; + break; + case BLOCK_32X32: + nn_config = &av1_rect_partition_nnconfig_32; + cur_thresh = prob_thresholds[2]; + break; + case BLOCK_64X64: + nn_config = &av1_rect_partition_nnconfig_64; + cur_thresh = prob_thresholds[3]; + break; + case BLOCK_128X128: + nn_config = &av1_rect_partition_nnconfig_128; + cur_thresh = prob_thresholds[4]; + break; + default: assert(0 && "Unexpected bsize."); + } + if (!nn_config) return; + aom_clear_system_state(); + + // 1. Compute input features + float features[9]; + + // RD cost ratios + for (int i = 0; i < 5; i++) features[i] = 1.0f; + if (none_rd > 0 && none_rd < 1000000000) + features[0] = (float)none_rd / (float)best_rd; + for (int i = 0; i < 4; i++) { + if (split_rd[i] > 0 && split_rd[i] < 1000000000) + features[1 + i] = (float)split_rd[i] / (float)best_rd; + } + + // Variance ratios + const MACROBLOCKD *const xd = &x->e_mbd; + int whole_block_variance; + if (is_cur_buf_hbd(xd)) { + whole_block_variance = av1_high_get_sby_perpixel_variance( + cpi, &x->plane[0].src, bsize, xd->bd); + } else { + whole_block_variance = + av1_get_sby_perpixel_variance(cpi, &x->plane[0].src, bsize); + } + whole_block_variance = AOMMAX(whole_block_variance, 1); + + int split_variance[4]; + const BLOCK_SIZE subsize = get_partition_subsize(bsize, PARTITION_SPLIT); + struct buf_2d buf; + buf.stride = x->plane[0].src.stride; + const int bw = block_size_wide[bsize]; + for (int i = 0; i < 4; ++i) { + const int x_idx = (i & 1) * bw / 2; + const int y_idx = (i >> 1) * bw / 2; + buf.buf = x->plane[0].src.buf + x_idx + y_idx * buf.stride; + if (is_cur_buf_hbd(xd)) { + split_variance[i] = + av1_high_get_sby_perpixel_variance(cpi, &buf, subsize, xd->bd); + } else { + split_variance[i] = av1_get_sby_perpixel_variance(cpi, &buf, subsize); + } + } + + for (int i = 0; i < 4; i++) + features[5 + i] = (float)split_variance[i] / (float)whole_block_variance; + + // 2. Do the prediction and prune 0-2 partitions based on their probabilities + float raw_scores[3] = { 0.0f }; + av1_nn_predict(features, nn_config, 1, raw_scores); + aom_clear_system_state(); + float probs[3] = { 0.0f }; + av1_nn_softmax(raw_scores, probs, 3); + + // probs[0] is the probability of the fact that both rectangular partitions + // are worse than current best_rd + if (probs[1] <= cur_thresh) (*dst_prune_horz) = 1; + if (probs[2] <= cur_thresh) (*dst_prune_vert) = 1; +} + +// Use a ML model to predict if horz_a, horz_b, vert_a, and vert_b should be +// considered. +void av1_ml_prune_ab_partition(BLOCK_SIZE bsize, int part_ctx, int var_ctx, + int64_t best_rd, int64_t horz_rd[2], + int64_t vert_rd[2], int64_t split_rd[4], + int *const horza_partition_allowed, + int *const horzb_partition_allowed, + int *const verta_partition_allowed, + int *const vertb_partition_allowed) { + if (bsize < BLOCK_8X8 || best_rd >= 1000000000) return; + const NN_CONFIG *nn_config = NULL; + switch (bsize) { + case BLOCK_8X8: nn_config = NULL; break; + case BLOCK_16X16: nn_config = &av1_ab_partition_nnconfig_16; break; + case BLOCK_32X32: nn_config = &av1_ab_partition_nnconfig_32; break; + case BLOCK_64X64: nn_config = &av1_ab_partition_nnconfig_64; break; + case BLOCK_128X128: nn_config = &av1_ab_partition_nnconfig_128; break; + default: assert(0 && "Unexpected bsize."); + } + if (!nn_config) return; + + aom_clear_system_state(); + + // Generate features. + float features[10]; + int feature_index = 0; + features[feature_index++] = (float)part_ctx; + features[feature_index++] = (float)var_ctx; + const int rdcost = (int)AOMMIN(INT_MAX, best_rd); + int sub_block_rdcost[8] = { 0 }; + int rd_index = 0; + for (int i = 0; i < 2; ++i) { + if (horz_rd[i] > 0 && horz_rd[i] < 1000000000) + sub_block_rdcost[rd_index] = (int)horz_rd[i]; + ++rd_index; + } + for (int i = 0; i < 2; ++i) { + if (vert_rd[i] > 0 && vert_rd[i] < 1000000000) + sub_block_rdcost[rd_index] = (int)vert_rd[i]; + ++rd_index; + } + for (int i = 0; i < 4; ++i) { + if (split_rd[i] > 0 && split_rd[i] < 1000000000) + sub_block_rdcost[rd_index] = (int)split_rd[i]; + ++rd_index; + } + for (int i = 0; i < 8; ++i) { + // Ratio between the sub-block RD and the whole-block RD. + float rd_ratio = 1.0f; + if (sub_block_rdcost[i] > 0 && sub_block_rdcost[i] < rdcost) + rd_ratio = (float)sub_block_rdcost[i] / (float)rdcost; + features[feature_index++] = rd_ratio; + } + assert(feature_index == 10); + + // Calculate scores using the NN model. + float score[16] = { 0.0f }; + av1_nn_predict(features, nn_config, 1, score); + aom_clear_system_state(); + int int_score[16]; + int max_score = -1000; + for (int i = 0; i < 16; ++i) { + int_score[i] = (int)(100 * score[i]); + max_score = AOMMAX(int_score[i], max_score); + } + + // Make decisions based on the model scores. + int thresh = max_score; + switch (bsize) { + case BLOCK_16X16: thresh -= 150; break; + case BLOCK_32X32: thresh -= 100; break; + default: break; + } + *horza_partition_allowed = 0; + *horzb_partition_allowed = 0; + *verta_partition_allowed = 0; + *vertb_partition_allowed = 0; + for (int i = 0; i < 16; ++i) { + if (int_score[i] >= thresh) { + if ((i >> 0) & 1) *horza_partition_allowed = 1; + if ((i >> 1) & 1) *horzb_partition_allowed = 1; + if ((i >> 2) & 1) *verta_partition_allowed = 1; + if ((i >> 3) & 1) *vertb_partition_allowed = 1; + } + } +} + +#define FEATURES 18 +#define LABELS 4 +// Use a ML model to predict if horz4 and vert4 should be considered. +void av1_ml_prune_4_partition(const AV1_COMP *const cpi, MACROBLOCK *const x, + BLOCK_SIZE bsize, int part_ctx, int64_t best_rd, + int64_t horz_rd[2], int64_t vert_rd[2], + int64_t split_rd[4], + int *const partition_horz4_allowed, + int *const partition_vert4_allowed, + unsigned int pb_source_variance, int mi_row, + int mi_col) { + if (best_rd >= 1000000000) return; + const NN_CONFIG *nn_config = NULL; + switch (bsize) { + case BLOCK_16X16: nn_config = &av1_4_partition_nnconfig_16; break; + case BLOCK_32X32: nn_config = &av1_4_partition_nnconfig_32; break; + case BLOCK_64X64: nn_config = &av1_4_partition_nnconfig_64; break; + default: assert(0 && "Unexpected bsize."); + } + if (!nn_config) return; + + aom_clear_system_state(); + + // Generate features. + float features[FEATURES]; + int feature_index = 0; + features[feature_index++] = (float)part_ctx; + features[feature_index++] = (float)get_unsigned_bits(pb_source_variance); + + const int rdcost = (int)AOMMIN(INT_MAX, best_rd); + int sub_block_rdcost[8] = { 0 }; + int rd_index = 0; + for (int i = 0; i < 2; ++i) { + if (horz_rd[i] > 0 && horz_rd[i] < 1000000000) + sub_block_rdcost[rd_index] = (int)horz_rd[i]; + ++rd_index; + } + for (int i = 0; i < 2; ++i) { + if (vert_rd[i] > 0 && vert_rd[i] < 1000000000) + sub_block_rdcost[rd_index] = (int)vert_rd[i]; + ++rd_index; + } + for (int i = 0; i < 4; ++i) { + if (split_rd[i] > 0 && split_rd[i] < 1000000000) + sub_block_rdcost[rd_index] = (int)split_rd[i]; + ++rd_index; + } + for (int i = 0; i < 8; ++i) { + // Ratio between the sub-block RD and the whole-block RD. + float rd_ratio = 1.0f; + if (sub_block_rdcost[i] > 0 && sub_block_rdcost[i] < rdcost) + rd_ratio = (float)sub_block_rdcost[i] / (float)rdcost; + features[feature_index++] = rd_ratio; + } + + // Get variance of the 1:4 and 4:1 sub-blocks. + unsigned int horz_4_source_var[4] = { 0 }; + unsigned int vert_4_source_var[4] = { 0 }; + { + BLOCK_SIZE horz_4_bs = get_partition_subsize(bsize, PARTITION_HORZ_4); + BLOCK_SIZE vert_4_bs = get_partition_subsize(bsize, PARTITION_VERT_4); + av1_setup_src_planes(x, cpi->source, mi_row, mi_col, + av1_num_planes(&cpi->common), bsize); + const int src_stride = x->plane[0].src.stride; + uint8_t *src = x->plane[0].src.buf; + const MACROBLOCKD *const xd = &x->e_mbd; + + struct buf_2d horz_4_src, vert_4_src; + horz_4_src.stride = src_stride; + vert_4_src.stride = src_stride; + + for (int i = 0; i < 4; ++i) { + horz_4_src.buf = src + i * block_size_high[horz_4_bs] * src_stride; + vert_4_src.buf = src + i * block_size_wide[vert_4_bs]; + + if (is_cur_buf_hbd(xd)) { + horz_4_source_var[i] = av1_high_get_sby_perpixel_variance( + cpi, &horz_4_src, horz_4_bs, xd->bd); + vert_4_source_var[i] = av1_high_get_sby_perpixel_variance( + cpi, &vert_4_src, vert_4_bs, xd->bd); + } else { + horz_4_source_var[i] = + av1_get_sby_perpixel_variance(cpi, &horz_4_src, horz_4_bs); + vert_4_source_var[i] = + av1_get_sby_perpixel_variance(cpi, &vert_4_src, vert_4_bs); + } + } + } + + const float denom = (float)(pb_source_variance + 1); + const float low_b = 0.1f; + const float high_b = 10.0f; + for (int i = 0; i < 4; ++i) { + // Ratio between the 4:1 sub-block variance and the whole-block variance. + float var_ratio = (float)(horz_4_source_var[i] + 1) / denom; + if (var_ratio < low_b) var_ratio = low_b; + if (var_ratio > high_b) var_ratio = high_b; + features[feature_index++] = var_ratio; + } + for (int i = 0; i < 4; ++i) { + // Ratio between the 1:4 sub-block RD and the whole-block RD. + float var_ratio = (float)(vert_4_source_var[i] + 1) / denom; + if (var_ratio < low_b) var_ratio = low_b; + if (var_ratio > high_b) var_ratio = high_b; + features[feature_index++] = var_ratio; + } + assert(feature_index == FEATURES); + + // Calculate scores using the NN model. + float score[LABELS] = { 0.0f }; + av1_nn_predict(features, nn_config, 1, score); + aom_clear_system_state(); + int int_score[LABELS]; + int max_score = -1000; + for (int i = 0; i < LABELS; ++i) { + int_score[i] = (int)(100 * score[i]); + max_score = AOMMAX(int_score[i], max_score); + } + + // Make decisions based on the model scores. + int thresh = max_score; + switch (bsize) { + case BLOCK_16X16: thresh -= 500; break; + case BLOCK_32X32: thresh -= 500; break; + case BLOCK_64X64: thresh -= 200; break; + default: break; + } + *partition_horz4_allowed = 0; + *partition_vert4_allowed = 0; + for (int i = 0; i < LABELS; ++i) { + if (int_score[i] >= thresh) { + if ((i >> 0) & 1) *partition_horz4_allowed = 1; + if ((i >> 1) & 1) *partition_vert4_allowed = 1; + } + } +} +#undef FEATURES +#undef LABELS + +#define FEATURES 4 +int av1_ml_predict_breakout(const AV1_COMP *const cpi, BLOCK_SIZE bsize, + const MACROBLOCK *const x, + const RD_STATS *const rd_stats, + unsigned int pb_source_variance) { + const NN_CONFIG *nn_config = NULL; + int thresh = 0; + switch (bsize) { + case BLOCK_8X8: + nn_config = &av1_partition_breakout_nnconfig_8; + thresh = cpi->sf.part_sf.ml_partition_search_breakout_thresh[0]; + break; + case BLOCK_16X16: + nn_config = &av1_partition_breakout_nnconfig_16; + thresh = cpi->sf.part_sf.ml_partition_search_breakout_thresh[1]; + break; + case BLOCK_32X32: + nn_config = &av1_partition_breakout_nnconfig_32; + thresh = cpi->sf.part_sf.ml_partition_search_breakout_thresh[2]; + break; + case BLOCK_64X64: + nn_config = &av1_partition_breakout_nnconfig_64; + thresh = cpi->sf.part_sf.ml_partition_search_breakout_thresh[3]; + break; + case BLOCK_128X128: + nn_config = &av1_partition_breakout_nnconfig_128; + thresh = cpi->sf.part_sf.ml_partition_search_breakout_thresh[4]; + break; + default: assert(0 && "Unexpected bsize."); + } + if (!nn_config || thresh < 0) return 0; + + // Generate feature values. + float features[FEATURES]; + int feature_index = 0; + aom_clear_system_state(); + + const int num_pels_log2 = num_pels_log2_lookup[bsize]; + float rate_f = (float)AOMMIN(rd_stats->rate, INT_MAX); + rate_f = ((float)x->rdmult / 128.0f / 512.0f / (float)(1 << num_pels_log2)) * + rate_f; + features[feature_index++] = rate_f; + + const float dist_f = + (float)(AOMMIN(rd_stats->dist, INT_MAX) >> num_pels_log2); + features[feature_index++] = dist_f; + + features[feature_index++] = (float)pb_source_variance; + + const int dc_q = (int)x->plane[0].dequant_QTX[0]; + features[feature_index++] = (float)(dc_q * dc_q) / 256.0f; + assert(feature_index == FEATURES); + + // Calculate score using the NN model. + float score = 0.0f; + av1_nn_predict(features, nn_config, 1, &score); + aom_clear_system_state(); + + // Make decision. + return (int)(score * 100) >= thresh; +} +#undef FEATURES +#endif // !CONFIG_REALTIME_ONLY +#define FEATURE_SIZE_SMS_SPLIT_FAST 6 +#define FEATURE_SIZE_SMS_SPLIT 17 +#define FEATURE_SMS_NONE_FLAG 1 +#define FEATURE_SMS_SPLIT_FLAG (1 << 1) +#define FEATURE_SMS_RECT_FLAG (1 << 2) + +#define FEATURE_SMS_PRUNE_PART_FLAG \ + (FEATURE_SMS_NONE_FLAG | FEATURE_SMS_SPLIT_FLAG | FEATURE_SMS_RECT_FLAG) +#define FEATURE_SMS_SPLIT_MODEL_FLAG \ + (FEATURE_SMS_NONE_FLAG | FEATURE_SMS_SPLIT_FLAG) + +void av1_intra_mode_cnn_partition(const AV1_COMMON *const cm, MACROBLOCK *x, + int bsize, int label_idx, + int *partition_none_allowed, + int *partition_horz_allowed, + int *partition_vert_allowed, + int *do_rectangular_split, + int *do_square_split); + - AV1_COMP *const cpi, MACROBLOCK *x, int mi_row, int mi_col, - BLOCK_SIZE bsize, int *partition_none_allowed, int *partition_horz_allowed, - int *partition_vert_allowed, int *do_rectangular_split, - int *do_square_split); + AV1_COMP *const cpi, MACROBLOCK *x, PC_TREE *pc_tree, int mi_row, + int mi_col, BLOCK_SIZE bsize, int *partition_none_allowed, + int *partition_horz_allowed, int *partition_vert_allowed, + int *do_rectangular_split, int *do_square_split); -void av1_simple_motion_search_prune_part( - AV1_COMP *const cpi, MACROBLOCK *x, PC_TREE *pc_tree, int mi_row, - int mi_col, BLOCK_SIZE bsize, int *partition_none_allowed, - int *partition_horz_allowed, int *partition_vert_allowed, - int *do_square_split, int *do_rectangular_split, int *prune_horz, - int *prune_vert, float *features, int *valid); +void av1_simple_motion_search_prune_rect(AV1_COMP *const cpi, MACROBLOCK *x, + PC_TREE *pc_tree, int mi_row, + int mi_col, BLOCK_SIZE bsize, + int *partition_horz_allowed, + int *partition_vert_allowed, + int *prune_horz, int *prune_vert); +#if !CONFIG_REALTIME_ONLY -void av1_simple_motion_search_early_term_none( - AV1_COMP *const cpi, MACROBLOCK *x, PC_TREE *pc_tree, int mi_row, - int mi_col, BLOCK_SIZE bsize, const RD_STATS *none_rdc, - int *early_terminate, float *simple_motion_features, - int *simple_motion_features_are_valid); - -// Early terminates after PARTITION_NONE in firstpass of two pass partition -// search. -void av1_firstpass_simple_motion_search_early_term(AV1_COMP *const cpi, - MACROBLOCK *x, - PC_TREE *pc_tree, int mi_row, - int mi_col, BLOCK_SIZE bsize, - const RD_STATS *none_rdc, - int *do_square_split); +void av1_simple_motion_search_early_term_none(AV1_COMP *const cpi, + MACROBLOCK *x, PC_TREE *pc_tree, + int mi_row, int mi_col, + BLOCK_SIZE bsize, + const RD_STATS *none_rdc, + int *early_terminate); -// performs simple_motion_search on 16X16 subblocks of the currnet superblock, +// performs simple_motion_search on 16X16 subblocks of the current superblock,
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/partition_strategy.h
19
20
21
22
23
24
25
26
27
28
#define FEATURE_SIZE_SMS_PRUNE_PART 25 #define FEATURE_SIZE_SMS_TERM_NONE 28 #define FEATURE_SIZE_FP_SMS_TERM_NONE 20 #define FEATURE_SIZE_MAX_MIN_PART_PRED 13 #define MAX_NUM_CLASSES_MAX_MIN_PART_PRED 4 // Performs a simple_motion_search with a single reference frame and extract // the variance of residues. Then use the features to determine whether we want // to go straight to splitting without trying PARTITION_NONE void av1_simple_motion_search_based_split(
+ show +
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
AV1_COMP *const cpi, MACROBLOCK *x, int mi_row, int mi_col, BLOCK_SIZE bsize, int *partition_none_allowed, int *partition_horz_allowed, int *partition_vert_allowed, int *do_rectangular_split, int *do_square_split); // Performs a simple_motion_search with two reference frames and extract // the variance of residues. Then use the features to determine whether we want // to prune some partitions. void av1_simple_motion_search_prune_part( AV1_COMP *const cpi, MACROBLOCK *x, PC_TREE *pc_tree, int mi_row, int mi_col, BLOCK_SIZE bsize, int *partition_none_allowed, int *partition_horz_allowed, int *partition_vert_allowed, int *do_square_split, int *do_rectangular_split, int *prune_horz, int *prune_vert, float *features, int *valid); // Early terminates PARTITION_NONE using simple_motion_search features and the // rate, distortion, and rdcost of PARTITION_NONE. This is only called when: // - The frame is a show frame // - The frame is not intra only // - The current bsize is > BLOCK_8X8 // - blk_row + blk_height/2 < total_rows and blk_col + blk_width/2 < total_cols void av1_simple_motion_search_early_term_none( AV1_COMP *const cpi, MACROBLOCK *x, PC_TREE *pc_tree, int mi_row, int mi_col, BLOCK_SIZE bsize, const RD_STATS *none_rdc, int *early_terminate, float *simple_motion_features, int *simple_motion_features_are_valid); // Early terminates after PARTITION_NONE in firstpass of two pass partition // search. void av1_firstpass_simple_motion_search_early_term(AV1_COMP *const cpi, MACROBLOCK *x, PC_TREE *pc_tree, int mi_row, int mi_col, BLOCK_SIZE bsize, const RD_STATS *none_rdc, int *do_square_split);
+ show +
64
65
66
67
68
69
70
71
72
73
// Get the features for selecting the max and min partition size. Currently this // performs simple_motion_search on 16X16 subblocks of the currnet superblock, // and then extract the statistics of sse and motion vectors as features. void av1_get_max_min_partition_features(AV1_COMP *const cpi, MACROBLOCK *x, int mi_row, int mi_col, float *features); // Predict the maximum BLOCK_SIZE to be used to encoder the current superblock. BLOCK_SIZE av1_predict_max_partition(AV1_COMP *const cpi, MACROBLOCK *const x,

[CVE-2020-0478_1.diff] av1_quantize.h #2
+ int use_optimize_b; + int xform_quant_idx; - v_dequant_QTX[QINDEX_RANGE][8]); // 8: SIMD width - DECLARE_ALIGNED(16, int16_t, y_dequant_Q3[QINDEX_RANGE][8]); // 8: SIMD width - DECLARE_ALIGNED(16, int16_t, u_dequant_Q3[QINDEX_RANGE][8]); // 8: SIMD width - DECLARE_ALIGNED(16, int16_t, v_dequant_Q3[QINDEX_RANGE][8]); // 8: SIMD width + v_dequant_QTX[QINDEX_RANGE][8]); // 8: SIMD width +typedef struct { + // Quantization parameters for internal quantizer setup. + QUANTS quants; + // Dequantization parameters for internal quantizer setup. + Dequants dequants; +} EncQuantDequantParams; +
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/av1_quantize.h
72
73
74
75
76
77
78
79
80
81
// The Dequants structure is used only for internal quantizer setup in // av1_quantize.c. // Fields are suffixed according to whether or not they're expressed in // the same coefficient shift/precision as TX or a fixed Q3 format. typedef struct { DECLARE_ALIGNED(16, int16_t, y_dequant_QTX[QINDEX_RANGE][8]); // 8: SIMD width DECLARE_ALIGNED(16, int16_t, u_dequant_QTX[QINDEX_RANGE][8]); // 8: SIMD width DECLARE_ALIGNED(16, int16_t,
+ show +
82
83
84
85
v_dequant_QTX[QINDEX_RANGE][8]); // 8: SIMD width DECLARE_ALIGNED(16, int16_t, y_dequant_Q3[QINDEX_RANGE][8]); // 8: SIMD width DECLARE_ALIGNED(16, int16_t, u_dequant_Q3[QINDEX_RANGE][8]); // 8: SIMD width DECLARE_ALIGNED(16, int16_t, v_dequant_Q3[QINDEX_RANGE][8]); // 8: SIMD width
+ show +
86
87
88
89
90
91
92
93
94
95
} Dequants; struct AV1_COMP; struct AV1Common; void av1_frame_init_quantizer(struct AV1_COMP *cpi); void av1_init_plane_quantizers(const struct AV1_COMP *cpi, MACROBLOCK *x, int segment_id);

[CVE-2020-0470_1.diff] av1_quantize.h #2
+ int use_optimize_b; + int xform_quant_idx; - v_dequant_QTX[QINDEX_RANGE][8]); // 8: SIMD width - DECLARE_ALIGNED(16, int16_t, y_dequant_Q3[QINDEX_RANGE][8]); // 8: SIMD width - DECLARE_ALIGNED(16, int16_t, u_dequant_Q3[QINDEX_RANGE][8]); // 8: SIMD width - DECLARE_ALIGNED(16, int16_t, v_dequant_Q3[QINDEX_RANGE][8]); // 8: SIMD width + v_dequant_QTX[QINDEX_RANGE][8]); // 8: SIMD width +typedef struct { + // Quantization parameters for internal quantizer setup. + QUANTS quants; + // Dequantization parameters for internal quantizer setup. + Dequants dequants; +} EncQuantDequantParams; +
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/av1_quantize.h
72
73
74
75
76
77
78
79
80
81
// The Dequants structure is used only for internal quantizer setup in // av1_quantize.c. // Fields are suffixed according to whether or not they're expressed in // the same coefficient shift/precision as TX or a fixed Q3 format. typedef struct { DECLARE_ALIGNED(16, int16_t, y_dequant_QTX[QINDEX_RANGE][8]); // 8: SIMD width DECLARE_ALIGNED(16, int16_t, u_dequant_QTX[QINDEX_RANGE][8]); // 8: SIMD width DECLARE_ALIGNED(16, int16_t,
+ show +
82
83
84
85
v_dequant_QTX[QINDEX_RANGE][8]); // 8: SIMD width DECLARE_ALIGNED(16, int16_t, y_dequant_Q3[QINDEX_RANGE][8]); // 8: SIMD width DECLARE_ALIGNED(16, int16_t, u_dequant_Q3[QINDEX_RANGE][8]); // 8: SIMD width DECLARE_ALIGNED(16, int16_t, v_dequant_Q3[QINDEX_RANGE][8]); // 8: SIMD width
+ show +
86
87
88
89
90
91
92
93
94
95
} Dequants; struct AV1_COMP; struct AV1Common; void av1_frame_init_quantizer(struct AV1_COMP *cpi); void av1_init_plane_quantizers(const struct AV1_COMP *cpi, MACROBLOCK *x, int segment_id);

[CVE-2020-0478_1.diff] mcomp.c #2
-static void set_subpel_mv_search_range(const MvLimits *mv_limits, int *col_min, - int *col_max, int *row_min, int *row_max, - const MV *ref_mv) { - const int max_mv = MAX_FULL_PEL_VAL * 8; - const int minc = AOMMAX(mv_limits->col_min * 8, ref_mv->col - max_mv); - const int maxc = AOMMIN(mv_limits->col_max * 8, ref_mv->col + max_mv); - const int minr = AOMMAX(mv_limits->row_min * 8, ref_mv->row - max_mv); - const int maxr = AOMMIN(mv_limits->row_max * 8, ref_mv->row + max_mv); - - *col_min = AOMMAX(MV_LOW + 1, minc); - *col_max = AOMMIN(MV_UPP - 1, maxc); - *row_min = AOMMAX(MV_LOW + 1, minr); - *row_max = AOMMIN(MV_UPP - 1, maxr); -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/mcomp.c
52
53
54
55
56
57
58
59
60
61
row_max = AOMMIN(row_max, (MV_UPP >> 3) - 1); // Get intersection of UMV window and valid MV window to reduce # of checks // in diamond search. if (mv_limits->col_min < col_min) mv_limits->col_min = col_min; if (mv_limits->col_max > col_max) mv_limits->col_max = col_max; if (mv_limits->row_min < row_min) mv_limits->row_min = row_min; if (mv_limits->row_max > row_max) mv_limits->row_max = row_max; }
+ show +
62
63
64
65
66
67
68
69
70
71
72
73
74
static void set_subpel_mv_search_range(const MvLimits *mv_limits, int *col_min, int *col_max, int *row_min, int *row_max, const MV *ref_mv) { const int max_mv = MAX_FULL_PEL_VAL * 8; const int minc = AOMMAX(mv_limits->col_min * 8, ref_mv->col - max_mv); const int maxc = AOMMIN(mv_limits->col_max * 8, ref_mv->col + max_mv); const int minr = AOMMAX(mv_limits->row_min * 8, ref_mv->row - max_mv); const int maxr = AOMMIN(mv_limits->row_max * 8, ref_mv->row + max_mv); *col_min = AOMMAX(MV_LOW + 1, minc); *col_max = AOMMIN(MV_UPP - 1, maxc); *row_min = AOMMAX(MV_LOW + 1, minr); *row_max = AOMMIN(MV_UPP - 1, maxr);
+ show +
75
76
77
78
79
80
81
82
83
84
} int av1_init_search_range(int size) { int sr = 0; // Minimum search size no matter what the passed in value. size = AOMMAX(16, size); while ((size << sr) < MAX_FULL_PEL_VAL) sr++; sr = AOMMIN(sr, MAX_MVSEARCH_STEPS - 2);

[CVE-2020-0478_1.diff] mcomp.c #12
- return pattern_search(x, start_mv, search_param, sad_per_bit, do_init_search, - cost_list, vfp, use_mvcost, center_mv, - hex_num_candidates, hex_candidates); + return pattern_search(start_mv, ms_params, search_param, do_init_search, + hex_num_candidates, hex_candidates, cost_list, best_mv); -static int bigdia_search(MACROBLOCK *x, MV *start_mv, int search_param, - int sad_per_bit, int do_init_search, int *cost_list, - const aom_variance_fn_ptr_t *vfp, int use_mvcost, - const MV *center_mv) { +static int bigdia_search(const FULLPEL_MV start_mv, + const FULLPEL_MOTION_SEARCH_PARAMS *ms_params, + const int search_param, const int do_init_search, + int *cost_list, FULLPEL_MV *best_mv) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/mcomp.c
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
{ { -64, -128 }, { 64, -128 }, { 128, 0 }, { 64, 128 }, { -64, 128 }, { -128, 0 } }, { { -128, -256 }, { 128, -256 }, { 256, 0 }, { 128, 256 }, { -128, 256 }, { -256, 0 } }, { { -256, -512 }, { 256, -512 }, { 512, 0 }, { 256, 512 }, { -256, 512 }, { -512, 0 } }, { { -512, -1024 }, { 512, -1024 }, { 1024, 0 }, { 512, 1024 }, { -512, 1024 }, { -1024, 0 } }, }; /* clang-format on */
+ show +
1454
1455
1456
1457
1458
1459
1460
1461
1462
return pattern_search(x, start_mv, search_param, sad_per_bit, do_init_search, cost_list, vfp, use_mvcost, center_mv, hex_num_candidates, hex_candidates); } static int bigdia_search(MACROBLOCK *x, MV *start_mv, int search_param, int sad_per_bit, int do_init_search, int *cost_list, const aom_variance_fn_ptr_t *vfp, int use_mvcost, const MV *center_mv) {
+ show +
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
// First scale has 4-closest points, the rest have 8 points in diamond // shape at increasing scales static const int bigdia_num_candidates[MAX_PATTERN_SCALES] = { 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, }; // Note that the largest candidate step at each scale is 2^scale /* clang-format off */ static const MV bigdia_candidates[MAX_PATTERN_SCALES][MAX_PATTERN_CANDIDATES] = { { { 0, -1 }, { 1, 0 }, { 0, 1 }, { -1, 0 } },

[CVE-2020-0478_1.diff] mcomp.c #13
- return pattern_search(x, start_mv, search_param, sad_per_bit, do_init_search, - cost_list, vfp, use_mvcost, center_mv, - bigdia_num_candidates, bigdia_candidates); + return pattern_search(start_mv, ms_params, search_param, do_init_search, + bigdia_num_candidates, bigdia_candidates, cost_list, + best_mv); -static int square_search(MACROBLOCK *x, MV *start_mv, int search_param, - int sad_per_bit, int do_init_search, int *cost_list, - const aom_variance_fn_ptr_t *vfp, int use_mvcost, - const MV *center_mv) { +static int square_search(const FULLPEL_MV start_mv, + const FULLPEL_MOTION_SEARCH_PARAMS *ms_params, + const int search_param, const int do_init_search, + int *cost_list, FULLPEL_MV *best_mv) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/mcomp.c
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
{ { -64, -64 }, { 0, -128 }, { 64, -64 }, { 128, 0 }, { 64, 64 }, { 0, 128 }, { -64, 64 }, { -128, 0 } }, { { -128, -128 }, { 0, -256 }, { 128, -128 }, { 256, 0 }, { 128, 128 }, { 0, 256 }, { -128, 128 }, { -256, 0 } }, { { -256, -256 }, { 0, -512 }, { 256, -256 }, { 512, 0 }, { 256, 256 }, { 0, 512 }, { -256, 256 }, { -512, 0 } }, { { -512, -512 }, { 0, -1024 }, { 512, -512 }, { 1024, 0 }, { 512, 512 }, { 0, 1024 }, { -512, 512 }, { -1024, 0 } }, }; /* clang-format on */
+ show +
1495
1496
1497
1498
1499
1500
1501
1502
1503
return pattern_search(x, start_mv, search_param, sad_per_bit, do_init_search, cost_list, vfp, use_mvcost, center_mv, bigdia_num_candidates, bigdia_candidates); } static int square_search(MACROBLOCK *x, MV *start_mv, int search_param, int sad_per_bit, int do_init_search, int *cost_list, const aom_variance_fn_ptr_t *vfp, int use_mvcost, const MV *center_mv) {
+ show +
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
// All scales have 8 closest points in square shape static const int square_num_candidates[MAX_PATTERN_SCALES] = { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, }; // Note that the largest candidate step at each scale is 2^scale /* clang-format off */ static const MV square_candidates[MAX_PATTERN_SCALES][MAX_PATTERN_CANDIDATES] = { { { -1, -1 }, { 0, -1 }, { 1, -1 }, { 1, 0 }, { 1, 1 }, { 0, 1 }, { -1, 1 }, { -1, 0 } },

[CVE-2020-0478_1.diff] mcomp.c #14
- return pattern_search(x, start_mv, search_param, sad_per_bit, do_init_search, - cost_list, vfp, use_mvcost, center_mv, - square_num_candidates, square_candidates); + return pattern_search(start_mv, ms_params, search_param, do_init_search, + square_num_candidates, square_candidates, cost_list, + best_mv); -static int fast_hex_search(MACROBLOCK *x, MV *ref_mv, int search_param, - int sad_per_bit, - int do_init_search, // must be zero for fast_hex - int *cost_list, const aom_variance_fn_ptr_t *vfp, - int use_mvcost, const MV *center_mv) { - return av1_hex_search(x, ref_mv, AOMMAX(MAX_MVSEARCH_STEPS - 2, search_param), - sad_per_bit, do_init_search, cost_list, vfp, use_mvcost, - center_mv); +static int fast_hex_search(const FULLPEL_MV start_mv, + const FULLPEL_MOTION_SEARCH_PARAMS *ms_params, + const int search_param, const int do_init_search, + int *cost_list, FULLPEL_MV *best_mv) { + return hex_search(start_mv, ms_params, + AOMMAX(MAX_MVSEARCH_STEPS - 2, search_param), + do_init_search, cost_list, best_mv); -static int fast_dia_search(MACROBLOCK *x, MV *ref_mv, int search_param, - int sad_per_bit, int do_init_search, int *cost_list, - const aom_variance_fn_ptr_t *vfp, int use_mvcost, - const MV *center_mv) { - return bigdia_search(x, ref_mv, AOMMAX(MAX_MVSEARCH_STEPS - 2, search_param), - sad_per_bit, do_init_search, cost_list, vfp, use_mvcost, - center_mv); +static int fast_dia_search(const FULLPEL_MV start_mv, + const FULLPEL_MOTION_SEARCH_PARAMS *ms_params, + const int search_param, const int do_init_search, + int *cost_list, FULLPEL_MV *best_mv) { + return bigdia_search(start_mv, ms_params, + AOMMAX(MAX_MVSEARCH_STEPS - 2, search_param), + do_init_search, cost_list, best_mv); -#undef CHECK_BETTER +static int diamond_search_sad(FULLPEL_MV start_mv, + const FULLPEL_MOTION_SEARCH_PARAMS *ms_params, + const int search_param, int *num00, + FULLPEL_MV *best_mv, FULLPEL_MV *second_best_mv) { + const struct buf_2d *const src = ms_params->ms_buffers.src; + const struct buf_2d *const ref = ms_params->ms_buffers.ref; -// Exhuastive motion search around a given centre position with a given + const int ref_stride = ref->stride; + const uint8_t *best_address; + + const aom_variance_fn_ptr_t *vfp = ms_params->vfp; + const uint8_t *mask = ms_params->ms_buffers.mask; + const uint8_t *second_pred = ms_params->ms_buffers.second_pred; + const MV_COST_PARAMS *mv_cost_params = &ms_params->mv_cost_params; + + const search_site_config *cfg = ms_params->search_sites; + + unsigned int bestsad = INT_MAX; + int best_site = 0; + int is_off_center = 0; + + clamp_fullmv(&start_mv, &ms_params->mv_limits); + + // search_param determines the length of the initial step and hence the number + // of iterations. + const int tot_steps = cfg->ss_count - search_param; + + *num00 = 0; + *best_mv = start_mv; + + // Check the starting position + best_address = get_buf_from_fullmv(ref, &start_mv); + bestsad = get_mvpred_compound_sad(ms_params, src, best_address, ref_stride); + bestsad += mvsad_err_cost_(best_mv, &ms_params->mv_cost_params); + + int next_step_size = tot_steps > 2 ? cfg->radius[tot_steps - 2] : 1; + for (int step = tot_steps - 1; step >= 0; --step) { + const search_site *ss = cfg->ss[step]; + best_site = 0; + if (step > 0) next_step_size = cfg->radius[step - 1]; + + int all_in = 1, j; + // Trap illegal vectors + all_in &= best_mv->row + ss[1].mv.row >= ms_params->mv_limits.row_min; + all_in &= best_mv->row + ss[2].mv.row <= ms_params->mv_limits.row_max; + all_in &= best_mv->col + ss[3].mv.col >= ms_params->mv_limits.col_min; + all_in &= best_mv->col + ss[4].mv.col <= ms_params->mv_limits.col_max; + + // TODO(anyone): Implement 4 points search for msdf&sdaf + if (all_in && !mask && !second_pred) { + const uint8_t *src_buf = src->buf; + const int src_stride = src->stride; + for (int idx = 1; idx <= cfg->searches_per_step[step]; idx += 4) { + unsigned char const *block_offset[4]; + unsigned int sads[4]; + + for (j = 0; j < 4; j++) + block_offset[j] = ss[idx + j].offset + best_address; + + vfp->sdx4df(src_buf, src_stride, block_offset, ref_stride, sads); + for (j = 0; j < 4; j++) { + if (sads[j] < bestsad) { + const FULLPEL_MV this_mv = { best_mv->row + ss[idx + j].mv.row, + best_mv->col + ss[idx + j].mv.col }; + unsigned int thissad = + sads[j] + mvsad_err_cost_(&this_mv, mv_cost_params); + if (thissad < bestsad) { + bestsad = thissad; + best_site = idx + j; + } + } + } + } + } else { + for (int idx = 1; idx <= cfg->searches_per_step[step]; idx++) { + const FULLPEL_MV this_mv = { best_mv->row + ss[idx].mv.row, + best_mv->col + ss[idx].mv.col }; + + if (av1_is_fullmv_in_range(&ms_params->mv_limits, this_mv)) { + const uint8_t *const check_here = ss[idx].offset + best_address; + unsigned int thissad; + + thissad = + get_mvpred_compound_sad(ms_params, src, check_here, ref_stride); + + if (thissad < bestsad) { + thissad += mvsad_err_cost_(&this_mv, mv_cost_params); + if (thissad < bestsad) { + bestsad = thissad; + best_site = idx; + } + } + } + } + } + + if (best_site != 0) { + if (second_best_mv) { + *second_best_mv = *best_mv; + } + best_mv->row += ss[best_site].mv.row; + best_mv->col += ss[best_site].mv.col; + best_address += ss[best_site].offset; + is_off_center = 1; + } + + if (is_off_center == 0) (*num00)++; + + if (best_site == 0) { + while (next_step_size == cfg->radius[step] && step > 2) { + ++(*num00); + --step; + next_step_size = cfg->radius[step - 1]; + } + } + } + + return bestsad; +} + +/* do_refine: If last step (1-away) of n-step search doesn't pick the center + point as the best match, we will do a final 1-away diamond + refining search */ +static int full_pixel_diamond(const FULLPEL_MV start_mv, + const FULLPEL_MOTION_SEARCH_PARAMS *ms_params, + const int step_param, int *cost_list, + FULLPEL_MV *best_mv, FULLPEL_MV *second_best_mv) { + const search_site_config *cfg = ms_params->search_sites; + int thissme, n, num00 = 0; + int bestsme = diamond_search_sad(start_mv, ms_params, step_param, &n, best_mv, + second_best_mv); + + if (bestsme < INT_MAX) { + bestsme = get_mvpred_compound_var_cost(ms_params, best_mv); + } + + // If there won't be more n-step search, check to see if refining search is + // needed. + const int further_steps = cfg->ss_count - 1 - step_param; + while (n < further_steps) { + ++n; + + if (num00) { + num00--; + } else { + // TODO(chiyotsai@google.com): There is another bug here where the second + // best mv gets incorrectly overwritten. Fix it later. + FULLPEL_MV tmp_best_mv; + thissme = diamond_search_sad(start_mv, ms_params, step_param + n, &num00, + &tmp_best_mv, second_best_mv); + + if (thissme < INT_MAX) { + thissme = get_mvpred_compound_var_cost(ms_params, &tmp_best_mv); + } + + if (thissme < bestsme) { + bestsme = thissme; + *best_mv = tmp_best_mv; + } + } + } + + // Return cost list. + if (cost_list) { + if (USE_SAD_COSTLIST) { + const int costlist_has_sad = 0; + calc_int_sad_list(*best_mv, ms_params, cost_list, costlist_has_sad); + } else { + calc_int_cost_list(*best_mv, ms_params, cost_list); + } + } + return bestsme; +} + +// Exhaustive motion search around a given centre position with a given -static int exhuastive_mesh_search(MACROBLOCK *x, MV *ref_mv, MV *best_mv, - int range, int step, int sad_per_bit, - const aom_variance_fn_ptr_t *fn_ptr, - const MV *center_mv) { - const MACROBLOCKD *const xd = &x->e_mbd; - const struct buf_2d *const what = &x->plane[0].src; - const struct buf_2d *const in_what = &xd->plane[0].pre[0]; - MV fcenter_mv = { center_mv->row, center_mv->col }; +static int exhaustive_mesh_search(FULLPEL_MV start_mv, + const FULLPEL_MOTION_SEARCH_PARAMS *ms_params, + const int range, const int step, + FULLPEL_MV *best_mv, + FULLPEL_MV *second_best_mv) { + const aom_variance_fn_ptr_t *vfp = ms_params->vfp; + const MV_COST_PARAMS *mv_cost_params = &ms_params->mv_cost_params; + const struct buf_2d *const src = ms_params->ms_buffers.src; + const struct buf_2d *const ref = ms_params->ms_buffers.ref; + const int ref_stride = ref->stride;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/mcomp.c
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
{ { -128, -128 }, { 0, -128 }, { 128, -128 }, { 128, 0 }, { 128, 128 }, { 0, 128 }, { -128, 128 }, { -128, 0 } }, { { -256, -256 }, { 0, -256 }, { 256, -256 }, { 256, 0 }, { 256, 256 }, { 0, 256 }, { -256, 256 }, { -256, 0 } }, { { -512, -512 }, { 0, -512 }, { 512, -512 }, { 512, 0 }, { 512, 512 }, { 0, 512 }, { -512, 512 }, { -512, 0 } }, { { -1024, -1024 }, { 0, -1024 }, { 1024, -1024 }, { 1024, 0 }, { 1024, 1024 }, { 0, 1024 }, { -1024, 1024 }, { -1024, 0 } }, }; /* clang-format on */
+ show +
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
return pattern_search(x, start_mv, search_param, sad_per_bit, do_init_search, cost_list, vfp, use_mvcost, center_mv, square_num_candidates, square_candidates); } static int fast_hex_search(MACROBLOCK *x, MV *ref_mv, int search_param, int sad_per_bit, int do_init_search, // must be zero for fast_hex int *cost_list, const aom_variance_fn_ptr_t *vfp, int use_mvcost, const MV *center_mv) { return av1_hex_search(x, ref_mv, AOMMAX(MAX_MVSEARCH_STEPS - 2, search_param), sad_per_bit, do_init_search, cost_list, vfp, use_mvcost, center_mv); } static int fast_dia_search(MACROBLOCK *x, MV *ref_mv, int search_param, int sad_per_bit, int do_init_search, int *cost_list, const aom_variance_fn_ptr_t *vfp, int use_mvcost, const MV *center_mv) { return bigdia_search(x, ref_mv, AOMMAX(MAX_MVSEARCH_STEPS - 2, search_param), sad_per_bit, do_init_search, cost_list, vfp, use_mvcost, center_mv); } #undef CHECK_BETTER // Exhuastive motion search around a given centre position with a given // step size. static int exhuastive_mesh_search(MACROBLOCK *x, MV *ref_mv, MV *best_mv, int range, int step, int sad_per_bit, const aom_variance_fn_ptr_t *fn_ptr, const MV *center_mv) { const MACROBLOCKD *const xd = &x->e_mbd; const struct buf_2d *const what = &x->plane[0].src; const struct buf_2d *const in_what = &xd->plane[0].pre[0]; MV fcenter_mv = { center_mv->row, center_mv->col };
+ show +
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
unsigned int best_sad = INT_MAX; int r, c, i; int start_col, end_col, start_row, end_row; int col_step = (step > 1) ? step : 4; assert(step >= 1); clamp_mv(&fcenter_mv, x->mv_limits.col_min, x->mv_limits.col_max, x->mv_limits.row_min, x->mv_limits.row_max); *best_mv = fcenter_mv;

[CVE-2020-0478_1.diff] mcomp.c #20
-#define MIN_EX_SEARCH_LIMIT 128 -static int is_exhaustive_allowed(const AV1_COMP *const cpi, MACROBLOCK *x) { - const SPEED_FEATURES *const sf = &cpi->sf; - int is_allowed = sf->allow_exhaustive_searches && - (sf->exhaustive_searches_thresh < INT_MAX) && - !cpi->rc.is_src_frame_alt_ref; - if (x->m_search_count_ptr != NULL && x->ex_search_count_ptr != NULL) { - const int max_ex = - AOMMAX(MIN_EX_SEARCH_LIMIT, - (*x->m_search_count_ptr * sf->max_exaustive_pct) / 100); - is_allowed = *x->ex_search_count_ptr <= max_ex && is_allowed; +int av1_full_pixel_search(const FULLPEL_MV start_mv, + const FULLPEL_MOTION_SEARCH_PARAMS *ms_params, + const int step_param, int *cost_list, + FULLPEL_MV *best_mv, FULLPEL_MV *second_best_mv) { + const BLOCK_SIZE bsize = ms_params->bsize; + const SEARCH_METHODS search_method = ms_params->search_method; + + const int is_intra_mode = ms_params->is_intra_mode; + int run_mesh_search = ms_params->run_mesh_search; + + int var = 0; + MARK_MV_INVALID(best_mv); + if (second_best_mv) { + MARK_MV_INVALID(second_best_mv); - return is_allowed; + + assert(ms_params->ms_buffers.second_pred == NULL && + ms_params->ms_buffers.mask == NULL && + "av1_full_pixel_search does not support compound pred"); + + if (cost_list) { + cost_list[0] = INT_MAX; + cost_list[1] = INT_MAX; + cost_list[2] = INT_MAX; + cost_list[3] = INT_MAX; + cost_list[4] = INT_MAX; + } + + switch (search_method) { + case FAST_DIAMOND: + var = fast_dia_search(start_mv, ms_params, step_param, 0, cost_list, + best_mv); + break; + case FAST_HEX: + var = fast_hex_search(start_mv, ms_params, step_param, 0, cost_list, + best_mv); + break; + case HEX: + var = hex_search(start_mv, ms_params, step_param, 1, cost_list, best_mv); + break; + case SQUARE: + var = + square_search(start_mv, ms_params, step_param, 1, cost_list, best_mv); + break; + case BIGDIA: + var = + bigdia_search(start_mv, ms_params, step_param, 1, cost_list, best_mv); + break; + case NSTEP: + case DIAMOND: + var = full_pixel_diamond(start_mv, ms_params, step_param, cost_list, + best_mv, second_best_mv); + break; + default: assert(0 && "Invalid search method."); + } + + // Should we allow a follow on exhaustive search? + if (!run_mesh_search && search_method == NSTEP) { + int exhuastive_thr = ms_params->force_mesh_thresh; + exhuastive_thr >>= + 10 - (mi_size_wide_log2[bsize] + mi_size_high_log2[bsize]); + // Threshold variance for an exhaustive full search. + if (var > exhuastive_thr) run_mesh_search = 1; + } + + // TODO(yunqing): the following is used to reduce mesh search in temporal + // filtering. Can extend it to intrabc. + if (!is_intra_mode && ms_params->prune_mesh_search) { + const int full_pel_mv_diff = AOMMAX(abs(start_mv.row - best_mv->row), + abs(start_mv.col - best_mv->col)); + if (full_pel_mv_diff <= 4) { + run_mesh_search = 0; + } + } + + if (run_mesh_search) { + int var_ex; + FULLPEL_MV tmp_mv_ex; + // Pick the mesh pattern for exhaustive search based on the toolset (intraBC + // or non-intraBC) + // TODO(chiyotsai@google.com): There is a bug here where the second best mv + // gets overwritten without actually comparing the rdcost. + const MESH_PATTERN *const mesh_patterns = + ms_params->mesh_patterns[is_intra_mode]; + // TODO(chiyotsai@google.com): the second best mv is not set correctly by + // full_pixel_exhaustive, which can incorrectly override it. + var_ex = full_pixel_exhaustive(*best_mv, ms_params, mesh_patterns, + cost_list, &tmp_mv_ex, second_best_mv); + if (var_ex < var) { + var = var_ex; + *best_mv = tmp_mv_ex; + } + } + + return var; +} + +int av1_intrabc_hash_search(const AV1_COMP *cpi, const MACROBLOCKD *xd, + const FULLPEL_MOTION_SEARCH_PARAMS *ms_params, + IntraBCHashInfo *intrabc_hash_info, + FULLPEL_MV *best_mv) { + if (!av1_use_hash_me(cpi)) return INT_MAX; + + const BLOCK_SIZE bsize = ms_params->bsize; + const int block_width = block_size_wide[bsize]; + const int block_height = block_size_high[bsize]; + + if (block_width != block_height) return INT_MAX; + + const FullMvLimits *mv_limits = &ms_params->mv_limits; + const MSBuffers *ms_buffer = &ms_params->ms_buffers; + + const uint8_t *src = ms_buffer->src->buf; + const int src_stride = ms_buffer->src->stride; + + const int mi_row = xd->mi_row; + const int mi_col = xd->mi_col; + const int x_pos = mi_col * MI_SIZE; + const int y_pos = mi_row * MI_SIZE; + + uint32_t hash_value1, hash_value2; + int best_hash_cost = INT_MAX; + + // for the hashMap + hash_table *ref_frame_hash = &intrabc_hash_info->intrabc_hash_table; + + av1_get_block_hash_value(intrabc_hash_info, src, src_stride, block_width, + &hash_value1, &hash_value2, is_cur_buf_hbd(xd)); + + const int count = av1_hash_table_count(ref_frame_hash, hash_value1); + if (count <= 1) { + return INT_MAX; + } + + Iterator iterator = av1_hash_get_first_iterator(ref_frame_hash, hash_value1); + for (int i = 0; i < count; i++, aom_iterator_increment(&iterator)) { + block_hash ref_block_hash = *(block_hash *)(aom_iterator_get(&iterator)); + if (hash_value2 == ref_block_hash.hash_value2) { + // Make sure the prediction is from valid area. + const MV dv = { GET_MV_SUBPEL(ref_block_hash.y - y_pos), + GET_MV_SUBPEL(ref_block_hash.x - x_pos) }; + if (!av1_is_dv_valid(dv, &cpi->common, xd, mi_row, mi_col, bsize, + cpi->common.seq_params.mib_size_log2)) + continue; + + FULLPEL_MV hash_mv; + hash_mv.col = ref_block_hash.x - x_pos; + hash_mv.row = ref_block_hash.y - y_pos; + if (!av1_is_fullmv_in_range(mv_limits, hash_mv)) continue; + const int refCost = get_mvpred_var_cost(ms_params, &hash_mv); + if (refCost < best_hash_cost) { + best_hash_cost = refCost; + *best_mv = hash_mv; + } + } + } + + return best_hash_cost;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/mcomp.c
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
break; } else { best_mv->row += neighbors[best_site].coord.row; best_mv->col += neighbors[best_site].coord.col; grid_center += neighbors[best_site].coord_offset; } } return best_sad; }
+ show +
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
#define MIN_EX_SEARCH_LIMIT 128 static int is_exhaustive_allowed(const AV1_COMP *const cpi, MACROBLOCK *x) { const SPEED_FEATURES *const sf = &cpi->sf; int is_allowed = sf->allow_exhaustive_searches && (sf->exhaustive_searches_thresh < INT_MAX) && !cpi->rc.is_src_frame_alt_ref; if (x->m_search_count_ptr != NULL && x->ex_search_count_ptr != NULL) { const int max_ex = AOMMAX(MIN_EX_SEARCH_LIMIT, (*x->m_search_count_ptr * sf->max_exaustive_pct) / 100); is_allowed = *x->ex_search_count_ptr <= max_ex && is_allowed; } return is_allowed;
+ show +
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
} static int vector_match(int16_t *ref, int16_t *src, int bwl) { int best_sad = INT_MAX; int this_sad; int d; int center, offset = 0; int bw = 4 << bwl; // redundant variable, to be changed in the experiments. for (d = 0; d <= bw; d += 16) { this_sad = aom_vector_var(&ref[d], src, bwl);

[CVE-2020-0470_1.diff] mcomp.c #2
-static void set_subpel_mv_search_range(const MvLimits *mv_limits, int *col_min, - int *col_max, int *row_min, int *row_max, - const MV *ref_mv) { - const int max_mv = MAX_FULL_PEL_VAL * 8; - const int minc = AOMMAX(mv_limits->col_min * 8, ref_mv->col - max_mv); - const int maxc = AOMMIN(mv_limits->col_max * 8, ref_mv->col + max_mv); - const int minr = AOMMAX(mv_limits->row_min * 8, ref_mv->row - max_mv); - const int maxr = AOMMIN(mv_limits->row_max * 8, ref_mv->row + max_mv); - - *col_min = AOMMAX(MV_LOW + 1, minc); - *col_max = AOMMIN(MV_UPP - 1, maxc); - *row_min = AOMMAX(MV_LOW + 1, minr); - *row_max = AOMMIN(MV_UPP - 1, maxr); -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/mcomp.c
52
53
54
55
56
57
58
59
60
61
row_max = AOMMIN(row_max, (MV_UPP >> 3) - 1); // Get intersection of UMV window and valid MV window to reduce # of checks // in diamond search. if (mv_limits->col_min < col_min) mv_limits->col_min = col_min; if (mv_limits->col_max > col_max) mv_limits->col_max = col_max; if (mv_limits->row_min < row_min) mv_limits->row_min = row_min; if (mv_limits->row_max > row_max) mv_limits->row_max = row_max; }
+ show +
62
63
64
65
66
67
68
69
70
71
72
73
74
static void set_subpel_mv_search_range(const MvLimits *mv_limits, int *col_min, int *col_max, int *row_min, int *row_max, const MV *ref_mv) { const int max_mv = MAX_FULL_PEL_VAL * 8; const int minc = AOMMAX(mv_limits->col_min * 8, ref_mv->col - max_mv); const int maxc = AOMMIN(mv_limits->col_max * 8, ref_mv->col + max_mv); const int minr = AOMMAX(mv_limits->row_min * 8, ref_mv->row - max_mv); const int maxr = AOMMIN(mv_limits->row_max * 8, ref_mv->row + max_mv); *col_min = AOMMAX(MV_LOW + 1, minc); *col_max = AOMMIN(MV_UPP - 1, maxc); *row_min = AOMMAX(MV_LOW + 1, minr); *row_max = AOMMIN(MV_UPP - 1, maxr);
+ show +
75
76
77
78
79
80
81
82
83
84
} int av1_init_search_range(int size) { int sr = 0; // Minimum search size no matter what the passed in value. size = AOMMAX(16, size); while ((size << sr) < MAX_FULL_PEL_VAL) sr++; sr = AOMMIN(sr, MAX_MVSEARCH_STEPS - 2);

[CVE-2020-0470_1.diff] mcomp.c #12
- return pattern_search(x, start_mv, search_param, sad_per_bit, do_init_search, - cost_list, vfp, use_mvcost, center_mv, - hex_num_candidates, hex_candidates); + return pattern_search(start_mv, ms_params, search_param, do_init_search, + hex_num_candidates, hex_candidates, cost_list, best_mv); -static int bigdia_search(MACROBLOCK *x, MV *start_mv, int search_param, - int sad_per_bit, int do_init_search, int *cost_list, - const aom_variance_fn_ptr_t *vfp, int use_mvcost, - const MV *center_mv) { +static int bigdia_search(const FULLPEL_MV start_mv, + const FULLPEL_MOTION_SEARCH_PARAMS *ms_params, + const int search_param, const int do_init_search, + int *cost_list, FULLPEL_MV *best_mv) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/mcomp.c
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
{ { -64, -128 }, { 64, -128 }, { 128, 0 }, { 64, 128 }, { -64, 128 }, { -128, 0 } }, { { -128, -256 }, { 128, -256 }, { 256, 0 }, { 128, 256 }, { -128, 256 }, { -256, 0 } }, { { -256, -512 }, { 256, -512 }, { 512, 0 }, { 256, 512 }, { -256, 512 }, { -512, 0 } }, { { -512, -1024 }, { 512, -1024 }, { 1024, 0 }, { 512, 1024 }, { -512, 1024 }, { -1024, 0 } }, }; /* clang-format on */
+ show +
1454
1455
1456
1457
1458
1459
1460
1461
1462
return pattern_search(x, start_mv, search_param, sad_per_bit, do_init_search, cost_list, vfp, use_mvcost, center_mv, hex_num_candidates, hex_candidates); } static int bigdia_search(MACROBLOCK *x, MV *start_mv, int search_param, int sad_per_bit, int do_init_search, int *cost_list, const aom_variance_fn_ptr_t *vfp, int use_mvcost, const MV *center_mv) {
+ show +
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
// First scale has 4-closest points, the rest have 8 points in diamond // shape at increasing scales static const int bigdia_num_candidates[MAX_PATTERN_SCALES] = { 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, }; // Note that the largest candidate step at each scale is 2^scale /* clang-format off */ static const MV bigdia_candidates[MAX_PATTERN_SCALES][MAX_PATTERN_CANDIDATES] = { { { 0, -1 }, { 1, 0 }, { 0, 1 }, { -1, 0 } },

[CVE-2020-0470_1.diff] mcomp.c #13
- return pattern_search(x, start_mv, search_param, sad_per_bit, do_init_search, - cost_list, vfp, use_mvcost, center_mv, - bigdia_num_candidates, bigdia_candidates); + return pattern_search(start_mv, ms_params, search_param, do_init_search, + bigdia_num_candidates, bigdia_candidates, cost_list, + best_mv); -static int square_search(MACROBLOCK *x, MV *start_mv, int search_param, - int sad_per_bit, int do_init_search, int *cost_list, - const aom_variance_fn_ptr_t *vfp, int use_mvcost, - const MV *center_mv) { +static int square_search(const FULLPEL_MV start_mv, + const FULLPEL_MOTION_SEARCH_PARAMS *ms_params, + const int search_param, const int do_init_search, + int *cost_list, FULLPEL_MV *best_mv) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/mcomp.c
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
{ { -64, -64 }, { 0, -128 }, { 64, -64 }, { 128, 0 }, { 64, 64 }, { 0, 128 }, { -64, 64 }, { -128, 0 } }, { { -128, -128 }, { 0, -256 }, { 128, -128 }, { 256, 0 }, { 128, 128 }, { 0, 256 }, { -128, 128 }, { -256, 0 } }, { { -256, -256 }, { 0, -512 }, { 256, -256 }, { 512, 0 }, { 256, 256 }, { 0, 512 }, { -256, 256 }, { -512, 0 } }, { { -512, -512 }, { 0, -1024 }, { 512, -512 }, { 1024, 0 }, { 512, 512 }, { 0, 1024 }, { -512, 512 }, { -1024, 0 } }, }; /* clang-format on */
+ show +
1495
1496
1497
1498
1499
1500
1501
1502
1503
return pattern_search(x, start_mv, search_param, sad_per_bit, do_init_search, cost_list, vfp, use_mvcost, center_mv, bigdia_num_candidates, bigdia_candidates); } static int square_search(MACROBLOCK *x, MV *start_mv, int search_param, int sad_per_bit, int do_init_search, int *cost_list, const aom_variance_fn_ptr_t *vfp, int use_mvcost, const MV *center_mv) {
+ show +
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
// All scales have 8 closest points in square shape static const int square_num_candidates[MAX_PATTERN_SCALES] = { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, }; // Note that the largest candidate step at each scale is 2^scale /* clang-format off */ static const MV square_candidates[MAX_PATTERN_SCALES][MAX_PATTERN_CANDIDATES] = { { { -1, -1 }, { 0, -1 }, { 1, -1 }, { 1, 0 }, { 1, 1 }, { 0, 1 }, { -1, 1 }, { -1, 0 } },

[CVE-2020-0470_1.diff] mcomp.c #14
- return pattern_search(x, start_mv, search_param, sad_per_bit, do_init_search, - cost_list, vfp, use_mvcost, center_mv, - square_num_candidates, square_candidates); + return pattern_search(start_mv, ms_params, search_param, do_init_search, + square_num_candidates, square_candidates, cost_list, + best_mv); -static int fast_hex_search(MACROBLOCK *x, MV *ref_mv, int search_param, - int sad_per_bit, - int do_init_search, // must be zero for fast_hex - int *cost_list, const aom_variance_fn_ptr_t *vfp, - int use_mvcost, const MV *center_mv) { - return av1_hex_search(x, ref_mv, AOMMAX(MAX_MVSEARCH_STEPS - 2, search_param), - sad_per_bit, do_init_search, cost_list, vfp, use_mvcost, - center_mv); +static int fast_hex_search(const FULLPEL_MV start_mv, + const FULLPEL_MOTION_SEARCH_PARAMS *ms_params, + const int search_param, const int do_init_search, + int *cost_list, FULLPEL_MV *best_mv) { + return hex_search(start_mv, ms_params, + AOMMAX(MAX_MVSEARCH_STEPS - 2, search_param), + do_init_search, cost_list, best_mv); -static int fast_dia_search(MACROBLOCK *x, MV *ref_mv, int search_param, - int sad_per_bit, int do_init_search, int *cost_list, - const aom_variance_fn_ptr_t *vfp, int use_mvcost, - const MV *center_mv) { - return bigdia_search(x, ref_mv, AOMMAX(MAX_MVSEARCH_STEPS - 2, search_param), - sad_per_bit, do_init_search, cost_list, vfp, use_mvcost, - center_mv); +static int fast_dia_search(const FULLPEL_MV start_mv, + const FULLPEL_MOTION_SEARCH_PARAMS *ms_params, + const int search_param, const int do_init_search, + int *cost_list, FULLPEL_MV *best_mv) { + return bigdia_search(start_mv, ms_params, + AOMMAX(MAX_MVSEARCH_STEPS - 2, search_param), + do_init_search, cost_list, best_mv); -#undef CHECK_BETTER +static int diamond_search_sad(FULLPEL_MV start_mv, + const FULLPEL_MOTION_SEARCH_PARAMS *ms_params, + const int search_param, int *num00, + FULLPEL_MV *best_mv, FULLPEL_MV *second_best_mv) { + const struct buf_2d *const src = ms_params->ms_buffers.src; + const struct buf_2d *const ref = ms_params->ms_buffers.ref; -// Exhuastive motion search around a given centre position with a given + const int ref_stride = ref->stride; + const uint8_t *best_address; + + const aom_variance_fn_ptr_t *vfp = ms_params->vfp; + const uint8_t *mask = ms_params->ms_buffers.mask; + const uint8_t *second_pred = ms_params->ms_buffers.second_pred; + const MV_COST_PARAMS *mv_cost_params = &ms_params->mv_cost_params; + + const search_site_config *cfg = ms_params->search_sites; + + unsigned int bestsad = INT_MAX; + int best_site = 0; + int is_off_center = 0; + + clamp_fullmv(&start_mv, &ms_params->mv_limits); + + // search_param determines the length of the initial step and hence the number + // of iterations. + const int tot_steps = cfg->ss_count - search_param; + + *num00 = 0; + *best_mv = start_mv; + + // Check the starting position + best_address = get_buf_from_fullmv(ref, &start_mv); + bestsad = get_mvpred_compound_sad(ms_params, src, best_address, ref_stride); + bestsad += mvsad_err_cost_(best_mv, &ms_params->mv_cost_params); + + int next_step_size = tot_steps > 2 ? cfg->radius[tot_steps - 2] : 1; + for (int step = tot_steps - 1; step >= 0; --step) { + const search_site *ss = cfg->ss[step]; + best_site = 0; + if (step > 0) next_step_size = cfg->radius[step - 1]; + + int all_in = 1, j; + // Trap illegal vectors + all_in &= best_mv->row + ss[1].mv.row >= ms_params->mv_limits.row_min; + all_in &= best_mv->row + ss[2].mv.row <= ms_params->mv_limits.row_max; + all_in &= best_mv->col + ss[3].mv.col >= ms_params->mv_limits.col_min; + all_in &= best_mv->col + ss[4].mv.col <= ms_params->mv_limits.col_max; + + // TODO(anyone): Implement 4 points search for msdf&sdaf + if (all_in && !mask && !second_pred) { + const uint8_t *src_buf = src->buf; + const int src_stride = src->stride; + for (int idx = 1; idx <= cfg->searches_per_step[step]; idx += 4) { + unsigned char const *block_offset[4]; + unsigned int sads[4]; + + for (j = 0; j < 4; j++) + block_offset[j] = ss[idx + j].offset + best_address; + + vfp->sdx4df(src_buf, src_stride, block_offset, ref_stride, sads); + for (j = 0; j < 4; j++) { + if (sads[j] < bestsad) { + const FULLPEL_MV this_mv = { best_mv->row + ss[idx + j].mv.row, + best_mv->col + ss[idx + j].mv.col }; + unsigned int thissad = + sads[j] + mvsad_err_cost_(&this_mv, mv_cost_params); + if (thissad < bestsad) { + bestsad = thissad; + best_site = idx + j; + } + } + } + } + } else { + for (int idx = 1; idx <= cfg->searches_per_step[step]; idx++) { + const FULLPEL_MV this_mv = { best_mv->row + ss[idx].mv.row, + best_mv->col + ss[idx].mv.col }; + + if (av1_is_fullmv_in_range(&ms_params->mv_limits, this_mv)) { + const uint8_t *const check_here = ss[idx].offset + best_address; + unsigned int thissad; + + thissad = + get_mvpred_compound_sad(ms_params, src, check_here, ref_stride); + + if (thissad < bestsad) { + thissad += mvsad_err_cost_(&this_mv, mv_cost_params); + if (thissad < bestsad) { + bestsad = thissad; + best_site = idx; + } + } + } + } + } + + if (best_site != 0) { + if (second_best_mv) { + *second_best_mv = *best_mv; + } + best_mv->row += ss[best_site].mv.row; + best_mv->col += ss[best_site].mv.col; + best_address += ss[best_site].offset; + is_off_center = 1; + } + + if (is_off_center == 0) (*num00)++; + + if (best_site == 0) { + while (next_step_size == cfg->radius[step] && step > 2) { + ++(*num00); + --step; + next_step_size = cfg->radius[step - 1]; + } + } + } + + return bestsad; +} + +/* do_refine: If last step (1-away) of n-step search doesn't pick the center + point as the best match, we will do a final 1-away diamond + refining search */ +static int full_pixel_diamond(const FULLPEL_MV start_mv, + const FULLPEL_MOTION_SEARCH_PARAMS *ms_params, + const int step_param, int *cost_list, + FULLPEL_MV *best_mv, FULLPEL_MV *second_best_mv) { + const search_site_config *cfg = ms_params->search_sites; + int thissme, n, num00 = 0; + int bestsme = diamond_search_sad(start_mv, ms_params, step_param, &n, best_mv, + second_best_mv); + + if (bestsme < INT_MAX) { + bestsme = get_mvpred_compound_var_cost(ms_params, best_mv); + } + + // If there won't be more n-step search, check to see if refining search is + // needed. + const int further_steps = cfg->ss_count - 1 - step_param; + while (n < further_steps) { + ++n; + + if (num00) { + num00--; + } else { + // TODO(chiyotsai@google.com): There is another bug here where the second + // best mv gets incorrectly overwritten. Fix it later. + FULLPEL_MV tmp_best_mv; + thissme = diamond_search_sad(start_mv, ms_params, step_param + n, &num00, + &tmp_best_mv, second_best_mv); + + if (thissme < INT_MAX) { + thissme = get_mvpred_compound_var_cost(ms_params, &tmp_best_mv); + } + + if (thissme < bestsme) { + bestsme = thissme; + *best_mv = tmp_best_mv; + } + } + } + + // Return cost list. + if (cost_list) { + if (USE_SAD_COSTLIST) { + const int costlist_has_sad = 0; + calc_int_sad_list(*best_mv, ms_params, cost_list, costlist_has_sad); + } else { + calc_int_cost_list(*best_mv, ms_params, cost_list); + } + } + return bestsme; +} + +// Exhaustive motion search around a given centre position with a given -static int exhuastive_mesh_search(MACROBLOCK *x, MV *ref_mv, MV *best_mv, - int range, int step, int sad_per_bit, - const aom_variance_fn_ptr_t *fn_ptr, - const MV *center_mv) { - const MACROBLOCKD *const xd = &x->e_mbd; - const struct buf_2d *const what = &x->plane[0].src; - const struct buf_2d *const in_what = &xd->plane[0].pre[0]; - MV fcenter_mv = { center_mv->row, center_mv->col }; +static int exhaustive_mesh_search(FULLPEL_MV start_mv, + const FULLPEL_MOTION_SEARCH_PARAMS *ms_params, + const int range, const int step, + FULLPEL_MV *best_mv, + FULLPEL_MV *second_best_mv) { + const aom_variance_fn_ptr_t *vfp = ms_params->vfp; + const MV_COST_PARAMS *mv_cost_params = &ms_params->mv_cost_params; + const struct buf_2d *const src = ms_params->ms_buffers.src; + const struct buf_2d *const ref = ms_params->ms_buffers.ref; + const int ref_stride = ref->stride;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/mcomp.c
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
{ { -128, -128 }, { 0, -128 }, { 128, -128 }, { 128, 0 }, { 128, 128 }, { 0, 128 }, { -128, 128 }, { -128, 0 } }, { { -256, -256 }, { 0, -256 }, { 256, -256 }, { 256, 0 }, { 256, 256 }, { 0, 256 }, { -256, 256 }, { -256, 0 } }, { { -512, -512 }, { 0, -512 }, { 512, -512 }, { 512, 0 }, { 512, 512 }, { 0, 512 }, { -512, 512 }, { -512, 0 } }, { { -1024, -1024 }, { 0, -1024 }, { 1024, -1024 }, { 1024, 0 }, { 1024, 1024 }, { 0, 1024 }, { -1024, 1024 }, { -1024, 0 } }, }; /* clang-format on */
+ show +
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
return pattern_search(x, start_mv, search_param, sad_per_bit, do_init_search, cost_list, vfp, use_mvcost, center_mv, square_num_candidates, square_candidates); } static int fast_hex_search(MACROBLOCK *x, MV *ref_mv, int search_param, int sad_per_bit, int do_init_search, // must be zero for fast_hex int *cost_list, const aom_variance_fn_ptr_t *vfp, int use_mvcost, const MV *center_mv) { return av1_hex_search(x, ref_mv, AOMMAX(MAX_MVSEARCH_STEPS - 2, search_param), sad_per_bit, do_init_search, cost_list, vfp, use_mvcost, center_mv); } static int fast_dia_search(MACROBLOCK *x, MV *ref_mv, int search_param, int sad_per_bit, int do_init_search, int *cost_list, const aom_variance_fn_ptr_t *vfp, int use_mvcost, const MV *center_mv) { return bigdia_search(x, ref_mv, AOMMAX(MAX_MVSEARCH_STEPS - 2, search_param), sad_per_bit, do_init_search, cost_list, vfp, use_mvcost, center_mv); } #undef CHECK_BETTER // Exhuastive motion search around a given centre position with a given // step size. static int exhuastive_mesh_search(MACROBLOCK *x, MV *ref_mv, MV *best_mv, int range, int step, int sad_per_bit, const aom_variance_fn_ptr_t *fn_ptr, const MV *center_mv) { const MACROBLOCKD *const xd = &x->e_mbd; const struct buf_2d *const what = &x->plane[0].src; const struct buf_2d *const in_what = &xd->plane[0].pre[0]; MV fcenter_mv = { center_mv->row, center_mv->col };
+ show +
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
unsigned int best_sad = INT_MAX; int r, c, i; int start_col, end_col, start_row, end_row; int col_step = (step > 1) ? step : 4; assert(step >= 1); clamp_mv(&fcenter_mv, x->mv_limits.col_min, x->mv_limits.col_max, x->mv_limits.row_min, x->mv_limits.row_max); *best_mv = fcenter_mv;

[CVE-2020-0470_1.diff] mcomp.c #20
-#define MIN_EX_SEARCH_LIMIT 128 -static int is_exhaustive_allowed(const AV1_COMP *const cpi, MACROBLOCK *x) { - const SPEED_FEATURES *const sf = &cpi->sf; - int is_allowed = sf->allow_exhaustive_searches && - (sf->exhaustive_searches_thresh < INT_MAX) && - !cpi->rc.is_src_frame_alt_ref; - if (x->m_search_count_ptr != NULL && x->ex_search_count_ptr != NULL) { - const int max_ex = - AOMMAX(MIN_EX_SEARCH_LIMIT, - (*x->m_search_count_ptr * sf->max_exaustive_pct) / 100); - is_allowed = *x->ex_search_count_ptr <= max_ex && is_allowed; +int av1_full_pixel_search(const FULLPEL_MV start_mv, + const FULLPEL_MOTION_SEARCH_PARAMS *ms_params, + const int step_param, int *cost_list, + FULLPEL_MV *best_mv, FULLPEL_MV *second_best_mv) { + const BLOCK_SIZE bsize = ms_params->bsize; + const SEARCH_METHODS search_method = ms_params->search_method; + + const int is_intra_mode = ms_params->is_intra_mode; + int run_mesh_search = ms_params->run_mesh_search; + + int var = 0; + MARK_MV_INVALID(best_mv); + if (second_best_mv) { + MARK_MV_INVALID(second_best_mv); - return is_allowed; + + assert(ms_params->ms_buffers.second_pred == NULL && + ms_params->ms_buffers.mask == NULL && + "av1_full_pixel_search does not support compound pred"); + + if (cost_list) { + cost_list[0] = INT_MAX; + cost_list[1] = INT_MAX; + cost_list[2] = INT_MAX; + cost_list[3] = INT_MAX; + cost_list[4] = INT_MAX; + } + + switch (search_method) { + case FAST_DIAMOND: + var = fast_dia_search(start_mv, ms_params, step_param, 0, cost_list, + best_mv); + break; + case FAST_HEX: + var = fast_hex_search(start_mv, ms_params, step_param, 0, cost_list, + best_mv); + break; + case HEX: + var = hex_search(start_mv, ms_params, step_param, 1, cost_list, best_mv); + break; + case SQUARE: + var = + square_search(start_mv, ms_params, step_param, 1, cost_list, best_mv); + break; + case BIGDIA: + var = + bigdia_search(start_mv, ms_params, step_param, 1, cost_list, best_mv); + break; + case NSTEP: + case DIAMOND: + var = full_pixel_diamond(start_mv, ms_params, step_param, cost_list, + best_mv, second_best_mv); + break; + default: assert(0 && "Invalid search method."); + } + + // Should we allow a follow on exhaustive search? + if (!run_mesh_search && search_method == NSTEP) { + int exhuastive_thr = ms_params->force_mesh_thresh; + exhuastive_thr >>= + 10 - (mi_size_wide_log2[bsize] + mi_size_high_log2[bsize]); + // Threshold variance for an exhaustive full search. + if (var > exhuastive_thr) run_mesh_search = 1; + } + + // TODO(yunqing): the following is used to reduce mesh search in temporal + // filtering. Can extend it to intrabc. + if (!is_intra_mode && ms_params->prune_mesh_search) { + const int full_pel_mv_diff = AOMMAX(abs(start_mv.row - best_mv->row), + abs(start_mv.col - best_mv->col)); + if (full_pel_mv_diff <= 4) { + run_mesh_search = 0; + } + } + + if (run_mesh_search) { + int var_ex; + FULLPEL_MV tmp_mv_ex; + // Pick the mesh pattern for exhaustive search based on the toolset (intraBC + // or non-intraBC) + // TODO(chiyotsai@google.com): There is a bug here where the second best mv + // gets overwritten without actually comparing the rdcost. + const MESH_PATTERN *const mesh_patterns = + ms_params->mesh_patterns[is_intra_mode]; + // TODO(chiyotsai@google.com): the second best mv is not set correctly by + // full_pixel_exhaustive, which can incorrectly override it. + var_ex = full_pixel_exhaustive(*best_mv, ms_params, mesh_patterns, + cost_list, &tmp_mv_ex, second_best_mv); + if (var_ex < var) { + var = var_ex; + *best_mv = tmp_mv_ex; + } + } + + return var; +} + +int av1_intrabc_hash_search(const AV1_COMP *cpi, const MACROBLOCKD *xd, + const FULLPEL_MOTION_SEARCH_PARAMS *ms_params, + IntraBCHashInfo *intrabc_hash_info, + FULLPEL_MV *best_mv) { + if (!av1_use_hash_me(cpi)) return INT_MAX; + + const BLOCK_SIZE bsize = ms_params->bsize; + const int block_width = block_size_wide[bsize]; + const int block_height = block_size_high[bsize]; + + if (block_width != block_height) return INT_MAX; + + const FullMvLimits *mv_limits = &ms_params->mv_limits; + const MSBuffers *ms_buffer = &ms_params->ms_buffers; + + const uint8_t *src = ms_buffer->src->buf; + const int src_stride = ms_buffer->src->stride; + + const int mi_row = xd->mi_row; + const int mi_col = xd->mi_col; + const int x_pos = mi_col * MI_SIZE; + const int y_pos = mi_row * MI_SIZE; + + uint32_t hash_value1, hash_value2; + int best_hash_cost = INT_MAX; + + // for the hashMap + hash_table *ref_frame_hash = &intrabc_hash_info->intrabc_hash_table; + + av1_get_block_hash_value(intrabc_hash_info, src, src_stride, block_width, + &hash_value1, &hash_value2, is_cur_buf_hbd(xd)); + + const int count = av1_hash_table_count(ref_frame_hash, hash_value1); + if (count <= 1) { + return INT_MAX; + } + + Iterator iterator = av1_hash_get_first_iterator(ref_frame_hash, hash_value1); + for (int i = 0; i < count; i++, aom_iterator_increment(&iterator)) { + block_hash ref_block_hash = *(block_hash *)(aom_iterator_get(&iterator)); + if (hash_value2 == ref_block_hash.hash_value2) { + // Make sure the prediction is from valid area. + const MV dv = { GET_MV_SUBPEL(ref_block_hash.y - y_pos), + GET_MV_SUBPEL(ref_block_hash.x - x_pos) }; + if (!av1_is_dv_valid(dv, &cpi->common, xd, mi_row, mi_col, bsize, + cpi->common.seq_params.mib_size_log2)) + continue; + + FULLPEL_MV hash_mv; + hash_mv.col = ref_block_hash.x - x_pos; + hash_mv.row = ref_block_hash.y - y_pos; + if (!av1_is_fullmv_in_range(mv_limits, hash_mv)) continue; + const int refCost = get_mvpred_var_cost(ms_params, &hash_mv); + if (refCost < best_hash_cost) { + best_hash_cost = refCost; + *best_mv = hash_mv; + } + } + } + + return best_hash_cost;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/mcomp.c
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
break; } else { best_mv->row += neighbors[best_site].coord.row; best_mv->col += neighbors[best_site].coord.col; grid_center += neighbors[best_site].coord_offset; } } return best_sad; }
+ show +
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
#define MIN_EX_SEARCH_LIMIT 128 static int is_exhaustive_allowed(const AV1_COMP *const cpi, MACROBLOCK *x) { const SPEED_FEATURES *const sf = &cpi->sf; int is_allowed = sf->allow_exhaustive_searches && (sf->exhaustive_searches_thresh < INT_MAX) && !cpi->rc.is_src_frame_alt_ref; if (x->m_search_count_ptr != NULL && x->ex_search_count_ptr != NULL) { const int max_ex = AOMMAX(MIN_EX_SEARCH_LIMIT, (*x->m_search_count_ptr * sf->max_exaustive_pct) / 100); is_allowed = *x->ex_search_count_ptr <= max_ex && is_allowed; } return is_allowed;
+ show +
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
} static int vector_match(int16_t *ref, int16_t *src, int bwl) { int best_sad = INT_MAX; int this_sad; int d; int center, offset = 0; int bw = 4 << bwl; // redundant variable, to be changed in the experiments. for (d = 0; d <= bw; d += 16) { this_sad = aom_vector_var(&ref[d], src, bwl);

[CVE-2020-0478_1.diff] rdopt.c #7
- + IntraModeSearchState intra_search_state; -static int inter_mode_data_block_idx(BLOCK_SIZE bsize) { - if (bsize == BLOCK_4X4 || bsize == BLOCK_4X8 || bsize == BLOCK_8X4 || - bsize == BLOCK_4X16 || bsize == BLOCK_16X4) { - return -1; - } - return 1; -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rdopt.c
726
727
728
729
730
731
732
733
734
735
// Single search results by [directions][modes][reference frames] SingleInterModeState single_state[2][SINGLE_INTER_MODE_NUM][FWD_REFS]; int single_state_cnt[2][SINGLE_INTER_MODE_NUM]; SingleInterModeState single_state_modelled[2][SINGLE_INTER_MODE_NUM] [FWD_REFS]; int single_state_modelled_cnt[2][SINGLE_INTER_MODE_NUM]; MV_REFERENCE_FRAME single_rd_order[2][SINGLE_INTER_MODE_NUM][FWD_REFS]; } InterModeSearchState;
+ show +
736
737
738
739
740
741
static int inter_mode_data_block_idx(BLOCK_SIZE bsize) { if (bsize == BLOCK_4X4 || bsize == BLOCK_4X8 || bsize == BLOCK_8X4 || bsize == BLOCK_4X16 || bsize == BLOCK_16X4) { return -1; } return 1;
+ show +
742
743
744
745
746
747
748
749
750
751
} void av1_inter_mode_data_init(TileDataEnc *tile_data) { for (int i = 0; i < BLOCK_SIZES_ALL; ++i) { InterModeRdModel *md = &tile_data->inter_mode_rd_models[i]; md->ready = 0; md->num = 0; md->dist_sum = 0; md->ld_sum = 0; md->sse_sum = 0;

[CVE-2020-0478_1.diff] rdopt.c #11
-static INLINE int write_uniform_cost(int n, int v) { - const int l = get_unsigned_bits(n); - const int m = (1 << l) - n; - if (l == 0) return 0; - if (v < m) - return av1_cost_literal(l - 1); - else - return av1_cost_literal(l); -} - -// Similar to store_cfl_required(), but for use during the RDO process, -// where we haven't yet determined whether this block uses CfL. -static INLINE CFL_ALLOWED_TYPE store_cfl_required_rdo(const AV1_COMMON *cm, - const MACROBLOCK *x) { - const MACROBLOCKD *xd = &x->e_mbd; - - if (cm->seq_params.monochrome || x->skip_chroma_rd) return CFL_DISALLOWED; - - if (!xd->cfl.is_chroma_reference) { - // For non-chroma-reference blocks, we should always store the luma pixels, - // in case the corresponding chroma-reference block uses CfL. - // Note that this can only happen for block sizes which are <8 on - // their shortest side, as otherwise they would be chroma reference - // blocks. - return CFL_ALLOWED; - } - - // For chroma reference blocks, we should store data in the encoder iff we're - // allowed to try out CfL. - return is_cfl_allowed(xd); -} - -// constants for prune 1 and prune 2 decision boundaries -#define FAST_EXT_TX_CORR_MID 0.0 -#define FAST_EXT_TX_EDST_MID 0.1 -#define FAST_EXT_TX_CORR_MARGIN 0.5 -#define FAST_EXT_TX_EDST_MARGIN 0.3 - -static int inter_block_yrd(const AV1_COMP *cpi, MACROBLOCK *x, - RD_STATS *rd_stats, BLOCK_SIZE bsize, - int64_t ref_best_rd, FAST_TX_SEARCH_MODE ftxs_mode); - -static unsigned pixel_dist_visible_only( - const AV1_COMP *const cpi, const MACROBLOCK *x, const uint8_t *src, - const int src_stride, const uint8_t *dst, const int dst_stride, - const BLOCK_SIZE tx_bsize, int txb_rows, int txb_cols, int visible_rows, - int visible_cols) { - unsigned sse; - - if (txb_rows == visible_rows && txb_cols == visible_cols) { - cpi->fn_ptr[tx_bsize].vf(src, src_stride, dst, dst_stride, &sse); - return sse; - } - const MACROBLOCKD *xd = &x->e_mbd; - - if (is_cur_buf_hbd(xd)) { - uint64_t sse64 = aom_highbd_sse_odd_size(src, src_stride, dst, dst_stride, - visible_cols, visible_rows); - return (unsigned int)ROUND_POWER_OF_TWO(sse64, (xd->bd - 8) * 2); - } - sse = aom_sse_odd_size(src, src_stride, dst, dst_stride, visible_cols, - visible_rows); - return sse; -} - -#if CONFIG_DIST_8X8 -static uint64_t cdef_dist_8x8_16bit(uint16_t *dst, int dstride, uint16_t *src, - int sstride, int coeff_shift) { - uint64_t svar = 0; - uint64_t dvar = 0; - uint64_t sum_s = 0; - uint64_t sum_d = 0; - uint64_t sum_s2 = 0; - uint64_t sum_d2 = 0; - uint64_t sum_sd = 0; - uint64_t dist = 0; - - int i, j; - for (i = 0; i < 8; i++) { - for (j = 0; j < 8; j++) { - sum_s += src[i * sstride + j]; - sum_d += dst[i * dstride + j]; - sum_s2 += src[i * sstride + j] * src[i * sstride + j]; - sum_d2 += dst[i * dstride + j] * dst[i * dstride + j]; - sum_sd += src[i * sstride + j] * dst[i * dstride + j]; - } - } - /* Compute the variance -- the calculation cannot go negative. */ - svar = sum_s2 - ((sum_s * sum_s + 32) >> 6); - dvar = sum_d2 - ((sum_d * sum_d + 32) >> 6); - - // Tuning of jm's original dering distortion metric used in CDEF tool, - // suggested by jm - const uint64_t a = 4; - const uint64_t b = 2; - const uint64_t c1 = (400 * a << 2 * coeff_shift); - const uint64_t c2 = (b * 20000 * a * a << 4 * coeff_shift); - - dist = (uint64_t)floor(.5 + (sum_d2 + sum_s2 - 2 * sum_sd) * .5 * - (svar + dvar + c1) / - (sqrt(svar * (double)dvar + c2))); - - // Calibrate dist to have similar rate for the same QP with MSE only - // distortion (as in master branch) - dist = (uint64_t)((float)dist * 0.75); - - return dist; -} - -static int od_compute_var_4x4(uint16_t *x, int stride) { - int sum; - int s2; - int i; - sum = 0; - s2 = 0; - for (i = 0; i < 4; i++) { - int j; - for (j = 0; j < 4; j++) { - int t; - - t = x[i * stride + j]; - sum += t; - s2 += t * t; - } - } - - return (s2 - (sum * sum >> 4)) >> 4; -} - -/* OD_DIST_LP_MID controls the frequency weighting filter used for computing - the distortion. For a value X, the filter is [1 X 1]/(X + 2) and - is applied both horizontally and vertically. For X=5, the filter is - a good approximation for the OD_QM8_Q4_HVS quantization matrix. */ -#define OD_DIST_LP_MID (5) -#define OD_DIST_LP_NORM (OD_DIST_LP_MID + 2) - -static double od_compute_dist_8x8(int use_activity_masking, uint16_t *x, - uint16_t *y, od_coeff *e_lp, int stride) { - double sum; - int min_var; - double mean_var; - double var_stat; - double activity; - double calibration; - int i; - int j; - double vardist; - - vardist = 0; - -#if 1 - min_var = INT_MAX; - mean_var = 0; - for (i = 0; i < 3; i++) { - for (j = 0; j < 3; j++) { - int varx; - int vary; - varx = od_compute_var_4x4(x + 2 * i * stride + 2 * j, stride); - vary = od_compute_var_4x4(y + 2 * i * stride + 2 * j, stride); - min_var = OD_MINI(min_var, varx); - mean_var += 1. / (1 + varx); - /* The cast to (double) is to avoid an overflow before the sqrt.*/ - vardist += varx - 2 * sqrt(varx * (double)vary) + vary; - } - } - /* We use a different variance statistic depending on whether activity - masking is used, since the harmonic mean appeared slightly worse with - masking off. The calibration constant just ensures that we preserve the - rate compared to activity=1. */ - if (use_activity_masking) { - calibration = 1.95; - var_stat = 9. / mean_var; - } else { - calibration = 1.62; - var_stat = min_var; - } - /* 1.62 is a calibration constant, 0.25 is a noise floor and 1/6 is the - activity masking constant. */ - activity = calibration * pow(.25 + var_stat, -1. / 6); -#else - activity = 1; -#endif // 1 - sum = 0; - for (i = 0; i < 8; i++) { - for (j = 0; j < 8; j++) - sum += e_lp[i * stride + j] * (double)e_lp[i * stride + j]; - } - /* Normalize the filter to unit DC response. */ - sum *= 1. / (OD_DIST_LP_NORM * OD_DIST_LP_NORM * OD_DIST_LP_NORM * - OD_DIST_LP_NORM); - return activity * activity * (sum + vardist); -} - -// Note : Inputs x and y are in a pixel domain -static double od_compute_dist_common(int activity_masking, uint16_t *x, - uint16_t *y, int bsize_w, int bsize_h, - int qindex, od_coeff *tmp, - od_coeff *e_lp) { - int i, j; - double sum = 0; - const int mid = OD_DIST_LP_MID; - - for (j = 0; j < bsize_w; j++) { - e_lp[j] = mid * tmp[j] + 2 * tmp[bsize_w + j]; - e_lp[(bsize_h - 1) * bsize_w + j] = mid * tmp[(bsize_h - 1) * bsize_w + j] + - 2 * tmp[(bsize_h - 2) * bsize_w + j]; - } - for (i = 1; i < bsize_h - 1; i++) { - for (j = 0; j < bsize_w; j++) { - e_lp[i * bsize_w + j] = mid * tmp[i * bsize_w + j] + - tmp[(i - 1) * bsize_w + j] + - tmp[(i + 1) * bsize_w + j]; - } - } - for (i = 0; i < bsize_h; i += 8) { - for (j = 0; j < bsize_w; j += 8) { - sum += od_compute_dist_8x8(activity_masking, &x[i * bsize_w + j], - &y[i * bsize_w + j], &e_lp[i * bsize_w + j], - bsize_w); - } - } - /* Scale according to linear regression against SSE, for 8x8 blocks. */ - if (activity_masking) { - sum *= 2.2 + (1.7 - 2.2) * (qindex - 99) / (210 - 99) + - (qindex < 99 ? 2.5 * (qindex - 99) / 99 * (qindex - 99) / 99 : 0); - } else { - sum *= qindex >= 128 - ? 1.4 + (0.9 - 1.4) * (qindex - 128) / (209 - 128) - : qindex <= 43 ? 1.5 + (2.0 - 1.5) * (qindex - 43) / (16 - 43) - : 1.5 + (1.4 - 1.5) * (qindex - 43) / (128 - 43); - } - - return sum; -} - -static double od_compute_dist(uint16_t *x, uint16_t *y, int bsize_w, - int bsize_h, int qindex) { - assert(bsize_w >= 8 && bsize_h >= 8); - - int activity_masking = 0; - - int i, j; - DECLARE_ALIGNED(16, od_coeff, e[MAX_SB_SQUARE]); - DECLARE_ALIGNED(16, od_coeff, tmp[MAX_SB_SQUARE]); - DECLARE_ALIGNED(16, od_coeff, e_lp[MAX_SB_SQUARE]); - for (i = 0; i < bsize_h; i++) { - for (j = 0; j < bsize_w; j++) { - e[i * bsize_w + j] = x[i * bsize_w + j] - y[i * bsize_w + j]; - } - } - int mid = OD_DIST_LP_MID; - for (i = 0; i < bsize_h; i++) { - tmp[i * bsize_w] = mid * e[i * bsize_w] + 2 * e[i * bsize_w + 1]; - tmp[i * bsize_w + bsize_w - 1] = - mid * e[i * bsize_w + bsize_w - 1] + 2 * e[i * bsize_w + bsize_w - 2]; - for (j = 1; j < bsize_w - 1; j++) { - tmp[i * bsize_w + j] = mid * e[i * bsize_w + j] + e[i * bsize_w + j - 1] + - e[i * bsize_w + j + 1]; - } - } - return od_compute_dist_common(activity_masking, x, y, bsize_w, bsize_h, - qindex, tmp, e_lp); -} - -static double od_compute_dist_diff(uint16_t *x, int16_t *e, int bsize_w, - int bsize_h, int qindex) { - assert(bsize_w >= 8 && bsize_h >= 8); - - int activity_masking = 0; - - DECLARE_ALIGNED(16, uint16_t, y[MAX_SB_SQUARE]); - DECLARE_ALIGNED(16, od_coeff, tmp[MAX_SB_SQUARE]); - DECLARE_ALIGNED(16, od_coeff, e_lp[MAX_SB_SQUARE]); - int i, j; - for (i = 0; i < bsize_h; i++) { - for (j = 0; j < bsize_w; j++) { - y[i * bsize_w + j] = x[i * bsize_w + j] - e[i * bsize_w + j]; - } - } - int mid = OD_DIST_LP_MID; - for (i = 0; i < bsize_h; i++) { - tmp[i * bsize_w] = mid * e[i * bsize_w] + 2 * e[i * bsize_w + 1]; - tmp[i * bsize_w + bsize_w - 1] = - mid * e[i * bsize_w + bsize_w - 1] + 2 * e[i * bsize_w + bsize_w - 2]; - for (j = 1; j < bsize_w - 1; j++) { - tmp[i * bsize_w + j] = mid * e[i * bsize_w + j] + e[i * bsize_w + j - 1] + - e[i * bsize_w + j + 1]; - } - } - return od_compute_dist_common(activity_masking, x, y, bsize_w, bsize_h, - qindex, tmp, e_lp); -} - -int64_t av1_dist_8x8(const AV1_COMP *const cpi, const MACROBLOCK *x, - const uint8_t *src, int src_stride, const uint8_t *dst, - int dst_stride, const BLOCK_SIZE tx_bsize, int bsw, - int bsh, int visible_w, int visible_h, int qindex) { - int64_t d = 0; - int i, j; - const MACROBLOCKD *xd = &x->e_mbd; - - DECLARE_ALIGNED(16, uint16_t, orig[MAX_SB_SQUARE]); - DECLARE_ALIGNED(16, uint16_t, rec[MAX_SB_SQUARE]); - - assert(bsw >= 8); - assert(bsh >= 8); - assert((bsw & 0x07) == 0); - assert((bsh & 0x07) == 0); - - if (x->tune_metric == AOM_TUNE_CDEF_DIST || - x->tune_metric == AOM_TUNE_DAALA_DIST) { - if (is_cur_buf_hbd(xd)) { - for (j = 0; j < bsh; j++) - for (i = 0; i < bsw; i++) - orig[j * bsw + i] = CONVERT_TO_SHORTPTR(src)[j * src_stride + i]; - - if ((bsw == visible_w) && (bsh == visible_h)) { - for (j = 0; j < bsh; j++) - for (i = 0; i < bsw; i++) - rec[j * bsw + i] = CONVERT_TO_SHORTPTR(dst)[j * dst_stride + i]; - } else { - for (j = 0; j < visible_h; j++) - for (i = 0; i < visible_w; i++) - rec[j * bsw + i] = CONVERT_TO_SHORTPTR(dst)[j * dst_stride + i]; - - if (visible_w < bsw) { - for (j = 0; j < bsh; j++) - for (i = visible_w; i < bsw; i++) - rec[j * bsw + i] = CONVERT_TO_SHORTPTR(src)[j * src_stride + i]; - } - - if (visible_h < bsh) { - for (j = visible_h; j < bsh; j++) - for (i = 0; i < bsw; i++) - rec[j * bsw + i] = CONVERT_TO_SHORTPTR(src)[j * src_stride + i]; - } - } - } else { - for (j = 0; j < bsh; j++) - for (i = 0; i < bsw; i++) orig[j * bsw + i] = src[j * src_stride + i]; - - if ((bsw == visible_w) && (bsh == visible_h)) { - for (j = 0; j < bsh; j++) - for (i = 0; i < bsw; i++) rec[j * bsw + i] = dst[j * dst_stride + i]; - } else { - for (j = 0; j < visible_h; j++) - for (i = 0; i < visible_w; i++) - rec[j * bsw + i] = dst[j * dst_stride + i]; - - if (visible_w < bsw) { - for (j = 0; j < bsh; j++) - for (i = visible_w; i < bsw; i++) - rec[j * bsw + i] = src[j * src_stride + i]; - } - - if (visible_h < bsh) { - for (j = visible_h; j < bsh; j++) - for (i = 0; i < bsw; i++) - rec[j * bsw + i] = src[j * src_stride + i]; - } - } - } - } - - if (x->tune_metric == AOM_TUNE_DAALA_DIST) { - d = (int64_t)od_compute_dist(orig, rec, bsw, bsh, qindex); - } else if (x->tune_metric == AOM_TUNE_CDEF_DIST) { - int coeff_shift = AOMMAX(xd->bd - 8, 0); - - for (i = 0; i < bsh; i += 8) { - for (j = 0; j < bsw; j += 8) { - d += cdef_dist_8x8_16bit(&rec[i * bsw + j], bsw, &orig[i * bsw + j], - bsw, coeff_shift); - } - } - if (is_cur_buf_hbd(xd)) d = ((uint64_t)d) >> 2 * coeff_shift; - } else { - // Otherwise, MSE by default - d = pixel_dist_visible_only(cpi, x, src, src_stride, dst, dst_stride, - tx_bsize, bsh, bsw, visible_h, visible_w); - } - - return d; -} - -static int64_t dist_8x8_diff(const MACROBLOCK *x, const uint8_t *src, - int src_stride, const int16_t *diff, - int diff_stride, int bsw, int bsh, int visible_w, - int visible_h, int qindex) { - int64_t d = 0; - int i, j; - const MACROBLOCKD *xd = &x->e_mbd; - - DECLARE_ALIGNED(16, uint16_t, orig[MAX_SB_SQUARE]); - DECLARE_ALIGNED(16, int16_t, diff16[MAX_SB_SQUARE]); - - assert(bsw >= 8); - assert(bsh >= 8); - assert((bsw & 0x07) == 0); - assert((bsh & 0x07) == 0); - - if (x->tune_metric == AOM_TUNE_CDEF_DIST || - x->tune_metric == AOM_TUNE_DAALA_DIST) { - if (is_cur_buf_hbd(xd)) { - for (j = 0; j < bsh; j++) - for (i = 0; i < bsw; i++) - orig[j * bsw + i] = CONVERT_TO_SHORTPTR(src)[j * src_stride + i]; - } else { - for (j = 0; j < bsh; j++) - for (i = 0; i < bsw; i++) orig[j * bsw + i] = src[j * src_stride + i]; - } - - if ((bsw == visible_w) && (bsh == visible_h)) { - for (j = 0; j < bsh; j++) - for (i = 0; i < bsw; i++) - diff16[j * bsw + i] = diff[j * diff_stride + i]; - } else { - for (j = 0; j < visible_h; j++) - for (i = 0; i < visible_w; i++) - diff16[j * bsw + i] = diff[j * diff_stride + i]; - - if (visible_w < bsw) { - for (j = 0; j < bsh; j++) - for (i = visible_w; i < bsw; i++) diff16[j * bsw + i] = 0; - } - - if (visible_h < bsh) { - for (j = visible_h; j < bsh; j++) - for (i = 0; i < bsw; i++) diff16[j * bsw + i] = 0; - } - } - } - - if (x->tune_metric == AOM_TUNE_DAALA_DIST) { - d = (int64_t)od_compute_dist_diff(orig, diff16, bsw, bsh, qindex); - } else if (x->tune_metric == AOM_TUNE_CDEF_DIST) { - int coeff_shift = AOMMAX(xd->bd - 8, 0); - DECLARE_ALIGNED(16, uint16_t, dst16[MAX_SB_SQUARE]); - - for (i = 0; i < bsh; i++) { - for (j = 0; j < bsw; j++) { - dst16[i * bsw + j] = orig[i * bsw + j] - diff16[i * bsw + j]; - } - } - - for (i = 0; i < bsh; i += 8) { - for (j = 0; j < bsw; j += 8) { - d += cdef_dist_8x8_16bit(&dst16[i * bsw + j], bsw, &orig[i * bsw + j], - bsw, coeff_shift); - } - } - // Don't scale 'd' for HBD since it will be done by caller side for diff - // input - } else { - // Otherwise, MSE by default - d = aom_sum_squares_2d_i16(diff, diff_stride, visible_w, visible_h); - } - - return d; -} -#endif // CONFIG_DIST_8X8 - -static void get_energy_distribution_fine(const AV1_COMP *cpi, BLOCK_SIZE bsize, - const uint8_t *src, int src_stride, - const uint8_t *dst, int dst_stride, - int need_4th, double *hordist, - double *verdist) { - const int bw = block_size_wide[bsize]; - const int bh = block_size_high[bsize]; - unsigned int esq[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - - if (bsize < BLOCK_16X16 || (bsize >= BLOCK_4X16 && bsize <= BLOCK_32X8)) { - // Special cases: calculate 'esq' values manually, as we don't have 'vf' - // functions for the 16 (very small) sub-blocks of this block. - const int w_shift = (bw == 4) ? 0 : (bw == 8) ? 1 : (bw == 16) ? 2 : 3; - const int h_shift = (bh == 4) ? 0 : (bh == 8) ? 1 : (bh == 16) ? 2 : 3; - assert(bw <= 32); - assert(bh <= 32); - assert(((bw - 1) >> w_shift) + (((bh - 1) >> h_shift) << 2) == 15); - if (cpi->common.seq_params.use_highbitdepth) { - const uint16_t *src16 = CONVERT_TO_SHORTPTR(src); - const uint16_t *dst16 = CONVERT_TO_SHORTPTR(dst); - for (int i = 0; i < bh; ++i) - for (int j = 0; j < bw; ++j) { - const int index = (j >> w_shift) + ((i >> h_shift) << 2); - esq[index] += - (src16[j + i * src_stride] - dst16[j + i * dst_stride]) * - (src16[j + i * src_stride] - dst16[j + i * dst_stride]); - } - } else { - for (int i = 0; i < bh; ++i) - for (int j = 0; j < bw; ++j) { - const int index = (j >> w_shift) + ((i >> h_shift) << 2); - esq[index] += (src[j + i * src_stride] - dst[j + i * dst_stride]) * - (src[j + i * src_stride] - dst[j + i * dst_stride]); - } - } - } else { // Calculate 'esq' values using 'vf' functions on the 16 sub-blocks. - const int f_index = - (bsize < BLOCK_SIZES) ? bsize - BLOCK_16X16 : bsize - BLOCK_8X16; - assert(f_index >= 0 && f_index < BLOCK_SIZES_ALL); - const BLOCK_SIZE subsize = (BLOCK_SIZE)f_index; - assert(block_size_wide[bsize] == 4 * block_size_wide[subsize]); - assert(block_size_high[bsize] == 4 * block_size_high[subsize]); - cpi->fn_ptr[subsize].vf(src, src_stride, dst, dst_stride, &esq[0]); - cpi->fn_ptr[subsize].vf(src + bw / 4, src_stride, dst + bw / 4, dst_stride, - &esq[1]); - cpi->fn_ptr[subsize].vf(src + bw / 2, src_stride, dst + bw / 2, dst_stride, - &esq[2]); - cpi->fn_ptr[subsize].vf(src + 3 * bw / 4, src_stride, dst + 3 * bw / 4, - dst_stride, &esq[3]); - src += bh / 4 * src_stride; - dst += bh / 4 * dst_stride; - - cpi->fn_ptr[subsize].vf(src, src_stride, dst, dst_stride, &esq[4]); - cpi->fn_ptr[subsize].vf(src + bw / 4, src_stride, dst + bw / 4, dst_stride, - &esq[5]); - cpi->fn_ptr[subsize].vf(src + bw / 2, src_stride, dst + bw / 2, dst_stride, - &esq[6]); - cpi->fn_ptr[subsize].vf(src + 3 * bw / 4, src_stride, dst + 3 * bw / 4, - dst_stride, &esq[7]); - src += bh / 4 * src_stride; - dst += bh / 4 * dst_stride; - - cpi->fn_ptr[subsize].vf(src, src_stride, dst, dst_stride, &esq[8]); - cpi->fn_ptr[subsize].vf(src + bw / 4, src_stride, dst + bw / 4, dst_stride, - &esq[9]); - cpi->fn_ptr[subsize].vf(src + bw / 2, src_stride, dst + bw / 2, dst_stride, - &esq[10]); - cpi->fn_ptr[subsize].vf(src + 3 * bw / 4, src_stride, dst + 3 * bw / 4, - dst_stride, &esq[11]); - src += bh / 4 * src_stride; - dst += bh / 4 * dst_stride; - - cpi->fn_ptr[subsize].vf(src, src_stride, dst, dst_stride, &esq[12]); - cpi->fn_ptr[subsize].vf(src + bw / 4, src_stride, dst + bw / 4, dst_stride, - &esq[13]); - cpi->fn_ptr[subsize].vf(src + bw / 2, src_stride, dst + bw / 2, dst_stride, - &esq[14]); - cpi->fn_ptr[subsize].vf(src + 3 * bw / 4, src_stride, dst + 3 * bw / 4, - dst_stride, &esq[15]); - } - - double total = (double)esq[0] + esq[1] + esq[2] + esq[3] + esq[4] + esq[5] + - esq[6] + esq[7] + esq[8] + esq[9] + esq[10] + esq[11] + - esq[12] + esq[13] + esq[14] + esq[15]; - if (total > 0) { - const double e_recip = 1.0 / total; - hordist[0] = ((double)esq[0] + esq[4] + esq[8] + esq[12]) * e_recip; - hordist[1] = ((double)esq[1] + esq[5] + esq[9] + esq[13]) * e_recip; - hordist[2] = ((double)esq[2] + esq[6] + esq[10] + esq[14]) * e_recip; - if (need_4th) { - hordist[3] = ((double)esq[3] + esq[7] + esq[11] + esq[15]) * e_recip; - } - verdist[0] = ((double)esq[0] + esq[1] + esq[2] + esq[3]) * e_recip; - verdist[1] = ((double)esq[4] + esq[5] + esq[6] + esq[7]) * e_recip; - verdist[2] = ((double)esq[8] + esq[9] + esq[10] + esq[11]) * e_recip; - if (need_4th) { - verdist[3] = ((double)esq[12] + esq[13] + esq[14] + esq[15]) * e_recip; - } - } else { - hordist[0] = verdist[0] = 0.25; - hordist[1] = verdist[1] = 0.25; - hordist[2] = verdist[2] = 0.25; - if (need_4th) { - hordist[3] = verdist[3] = 0.25; - } - } -} - -static int adst_vs_flipadst(const AV1_COMP *cpi, BLOCK_SIZE bsize, - const uint8_t *src, int src_stride, - const uint8_t *dst, int dst_stride) { - int prune_bitmask = 0; - double svm_proj_h = 0, svm_proj_v = 0; - double hdist[3] = { 0, 0, 0 }, vdist[3] = { 0, 0, 0 }; - get_energy_distribution_fine(cpi, bsize, src, src_stride, dst, dst_stride, 0, - hdist, vdist); - - svm_proj_v = vdist[0] * ADST_FLIP_SVM[0] + vdist[1] * ADST_FLIP_SVM[1] + - vdist[2] * ADST_FLIP_SVM[2] + ADST_FLIP_SVM[3]; - svm_proj_h = hdist[0] * ADST_FLIP_SVM[4] + hdist[1] * ADST_FLIP_SVM[5] + - hdist[2] * ADST_FLIP_SVM[6] + ADST_FLIP_SVM[7]; - if (svm_proj_v > FAST_EXT_TX_EDST_MID + FAST_EXT_TX_EDST_MARGIN) - prune_bitmask |= 1 << FLIPADST_1D; - else if (svm_proj_v < FAST_EXT_TX_EDST_MID - FAST_EXT_TX_EDST_MARGIN) - prune_bitmask |= 1 << ADST_1D; - - if (svm_proj_h > FAST_EXT_TX_EDST_MID + FAST_EXT_TX_EDST_MARGIN) - prune_bitmask |= 1 << (FLIPADST_1D + 8); - else if (svm_proj_h < FAST_EXT_TX_EDST_MID - FAST_EXT_TX_EDST_MARGIN) - prune_bitmask |= 1 << (ADST_1D + 8); - - return prune_bitmask; -} - -static int dct_vs_idtx(const int16_t *diff, int stride, int w, int h) { - float hcorr, vcorr; - int prune_bitmask = 0; - av1_get_horver_correlation_full(diff, stride, w, h, &hcorr, &vcorr); - - if (vcorr > FAST_EXT_TX_CORR_MID + FAST_EXT_TX_CORR_MARGIN) - prune_bitmask |= 1 << IDTX_1D; - else if (vcorr < FAST_EXT_TX_CORR_MID - FAST_EXT_TX_CORR_MARGIN) - prune_bitmask |= 1 << DCT_1D; - - if (hcorr > FAST_EXT_TX_CORR_MID + FAST_EXT_TX_CORR_MARGIN) - prune_bitmask |= 1 << (IDTX_1D + 8); - else if (hcorr < FAST_EXT_TX_CORR_MID - FAST_EXT_TX_CORR_MARGIN) - prune_bitmask |= 1 << (DCT_1D + 8); - return prune_bitmask; -} - -// Performance drop: 0.5%, Speed improvement: 24% -static int prune_two_for_sby(const AV1_COMP *cpi, BLOCK_SIZE bsize, - MACROBLOCK *x, const MACROBLOCKD *xd, - int adst_flipadst, int dct_idtx) { - int prune = 0; - - if (adst_flipadst) { - const struct macroblock_plane *const p = &x->plane[0]; - const struct macroblockd_plane *const pd = &xd->plane[0]; - prune |= adst_vs_flipadst(cpi, bsize, p->src.buf, p->src.stride, - pd->dst.buf, pd->dst.stride); - } - if (dct_idtx) { - av1_subtract_plane(x, bsize, 0); - const struct macroblock_plane *const p = &x->plane[0]; - const int bw = block_size_wide[bsize]; - const int bh = block_size_high[bsize]; - prune |= dct_vs_idtx(p->src_diff, bw, bw, bh); - } - - return prune; -} - -// Performance drop: 0.3%, Speed improvement: 5% -static int prune_one_for_sby(const AV1_COMP *cpi, BLOCK_SIZE bsize, - const MACROBLOCK *x, const MACROBLOCKD *xd) { - const struct macroblock_plane *const p = &x->plane[0]; - const struct macroblockd_plane *const pd = &xd->plane[0]; - return adst_vs_flipadst(cpi, bsize, p->src.buf, p->src.stride, pd->dst.buf, - pd->dst.stride); -} - -// 1D Transforms used in inter set, this needs to be changed if -// ext_tx_used_inter is changed -static const int ext_tx_used_inter_1D[EXT_TX_SETS_INTER][TX_TYPES_1D] = { - { 1, 0, 0, 0 }, - { 1, 1, 1, 1 }, - { 1, 1, 1, 1 }, - { 1, 0, 0, 1 }, -}; - -static void get_energy_distribution_finer(const int16_t *diff, int stride, - int bw, int bh, float *hordist, - float *verdist) { - // First compute downscaled block energy values (esq); downscale factors - // are defined by w_shift and h_shift. - unsigned int esq[256]; - const int w_shift = bw <= 8 ? 0 : 1; - const int h_shift = bh <= 8 ? 0 : 1; - const int esq_w = bw >> w_shift; - const int esq_h = bh >> h_shift; - const int esq_sz = esq_w * esq_h; - int i, j; - memset(esq, 0, esq_sz * sizeof(esq[0])); - if (w_shift) { - for (i = 0; i < bh; i++) { - unsigned int *cur_esq_row = esq + (i >> h_shift) * esq_w; - const int16_t *cur_diff_row = diff + i * stride; - for (j = 0; j < bw; j += 2) { - cur_esq_row[j >> 1] += (cur_diff_row[j] * cur_diff_row[j] + - cur_diff_row[j + 1] * cur_diff_row[j + 1]); - } - } - } else { - for (i = 0; i < bh; i++) { - unsigned int *cur_esq_row = esq + (i >> h_shift) * esq_w; - const int16_t *cur_diff_row = diff + i * stride; - for (j = 0; j < bw; j++) { - cur_esq_row[j] += cur_diff_row[j] * cur_diff_row[j]; - } - } - } - - uint64_t total = 0; - for (i = 0; i < esq_sz; i++) total += esq[i]; - - // Output hordist and verdist arrays are normalized 1D projections of esq - if (total == 0) { - float hor_val = 1.0f / esq_w; - for (j = 0; j < esq_w - 1; j++) hordist[j] = hor_val; - float ver_val = 1.0f / esq_h; - for (i = 0; i < esq_h - 1; i++) verdist[i] = ver_val; - return; - } - - const float e_recip = 1.0f / (float)total; - memset(hordist, 0, (esq_w - 1) * sizeof(hordist[0])); - memset(verdist, 0, (esq_h - 1) * sizeof(verdist[0])); - const unsigned int *cur_esq_row; - for (i = 0; i < esq_h - 1; i++) { - cur_esq_row = esq + i * esq_w; - for (j = 0; j < esq_w - 1; j++) { - hordist[j] += (float)cur_esq_row[j]; - verdist[i] += (float)cur_esq_row[j]; - } - verdist[i] += (float)cur_esq_row[j]; - } - cur_esq_row = esq + i * esq_w; - for (j = 0; j < esq_w - 1; j++) hordist[j] += (float)cur_esq_row[j]; - - for (j = 0; j < esq_w - 1; j++) hordist[j] *= e_recip; - for (i = 0; i < esq_h - 1; i++) verdist[i] *= e_recip; -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rdopt.c
897
898
899
900
901
902
903
904
905
906
return; } for (int i = 0; i < inter_modes_info->num; ++i) { rd_idx_pair_arr[i].idx = i; rd_idx_pair_arr[i].rd = inter_modes_info->est_rd_arr[i]; } qsort(rd_idx_pair_arr, inter_modes_info->num, sizeof(rd_idx_pair_arr[0]), compare_rd_idx_pair); }
+ show +
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
static INLINE int write_uniform_cost(int n, int v) { const int l = get_unsigned_bits(n); const int m = (1 << l) - n; if (l == 0) return 0; if (v < m) return av1_cost_literal(l - 1); else return av1_cost_literal(l); } // Similar to store_cfl_required(), but for use during the RDO process, // where we haven't yet determined whether this block uses CfL. static INLINE CFL_ALLOWED_TYPE store_cfl_required_rdo(const AV1_COMMON *cm, const MACROBLOCK *x) { const MACROBLOCKD *xd = &x->e_mbd; if (cm->seq_params.monochrome || x->skip_chroma_rd) return CFL_DISALLOWED; if (!xd->cfl.is_chroma_reference) { // For non-chroma-reference blocks, we should always store the luma pixels, // in case the corresponding chroma-reference block uses CfL. // Note that this can only happen for block sizes which are <8 on // their shortest side, as otherwise they would be chroma reference // blocks. return CFL_ALLOWED; } // For chroma reference blocks, we should store data in the encoder iff we're // allowed to try out CfL. return is_cfl_allowed(xd); } // constants for prune 1 and prune 2 decision boundaries #define FAST_EXT_TX_CORR_MID 0.0 #define FAST_EXT_TX_EDST_MID 0.1 #define FAST_EXT_TX_CORR_MARGIN 0.5 #define FAST_EXT_TX_EDST_MARGIN 0.3 static int inter_block_yrd(const AV1_COMP *cpi, MACROBLOCK *x, RD_STATS *rd_stats, BLOCK_SIZE bsize, int64_t ref_best_rd, FAST_TX_SEARCH_MODE ftxs_mode); static unsigned pixel_dist_visible_only( const AV1_COMP *const cpi, const MACROBLOCK *x, const uint8_t *src, const int src_stride, const uint8_t *dst, const int dst_stride, const BLOCK_SIZE tx_bsize, int txb_rows, int txb_cols, int visible_rows, int visible_cols) { unsigned sse; if (txb_rows == visible_rows && txb_cols == visible_cols) { cpi->fn_ptr[tx_bsize].vf(src, src_stride, dst, dst_stride, &sse); return sse; } const MACROBLOCKD *xd = &x->e_mbd; if (is_cur_buf_hbd(xd)) { uint64_t sse64 = aom_highbd_sse_odd_size(src, src_stride, dst, dst_stride, visible_cols, visible_rows); return (unsigned int)ROUND_POWER_OF_TWO(sse64, (xd->bd - 8) * 2); } sse = aom_sse_odd_size(src, src_stride, dst, dst_stride, visible_cols, visible_rows); return sse; } #if CONFIG_DIST_8X8 static uint64_t cdef_dist_8x8_16bit(uint16_t *dst, int dstride, uint16_t *src, int sstride, int coeff_shift) { uint64_t svar = 0; uint64_t dvar = 0; uint64_t sum_s = 0; uint64_t sum_d = 0; uint64_t sum_s2 = 0; uint64_t sum_d2 = 0; uint64_t sum_sd = 0; uint64_t dist = 0; int i, j; for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { sum_s += src[i * sstride + j]; sum_d += dst[i * dstride + j]; sum_s2 += src[i * sstride + j] * src[i * sstride + j]; sum_d2 += dst[i * dstride + j] * dst[i * dstride + j]; sum_sd += src[i * sstride + j] * dst[i * dstride + j]; } } /* Compute the variance -- the calculation cannot go negative. */ svar = sum_s2 - ((sum_s * sum_s + 32) >> 6); dvar = sum_d2 - ((sum_d * sum_d + 32) >> 6); // Tuning of jm's original dering distortion metric used in CDEF tool, // suggested by jm const uint64_t a = 4; const uint64_t b = 2; const uint64_t c1 = (400 * a << 2 * coeff_shift); const uint64_t c2 = (b * 20000 * a * a << 4 * coeff_shift); dist = (uint64_t)floor(.5 + (sum_d2 + sum_s2 - 2 * sum_sd) * .5 * (svar + dvar + c1) / (sqrt(svar * (double)dvar + c2))); // Calibrate dist to have similar rate for the same QP with MSE only // distortion (as in master branch) dist = (uint64_t)((float)dist * 0.75); return dist; } static int od_compute_var_4x4(uint16_t *x, int stride) { int sum; int s2; int i; sum = 0; s2 = 0; for (i = 0; i < 4; i++) { int j; for (j = 0; j < 4; j++) { int t; t = x[i * stride + j]; sum += t; s2 += t * t; } } return (s2 - (sum * sum >> 4)) >> 4; } /* OD_DIST_LP_MID controls the frequency weighting filter used for computing the distortion. For a value X, the filter is [1 X 1]/(X + 2) and is applied both horizontally and vertically. For X=5, the filter is a good approximation for the OD_QM8_Q4_HVS quantization matrix. */ #define OD_DIST_LP_MID (5) #define OD_DIST_LP_NORM (OD_DIST_LP_MID + 2) static double od_compute_dist_8x8(int use_activity_masking, uint16_t *x, uint16_t *y, od_coeff *e_lp, int stride) { double sum; int min_var; double mean_var; double var_stat; double activity; double calibration; int i; int j; double vardist; vardist = 0; #if 1 min_var = INT_MAX; mean_var = 0; for (i = 0; i < 3; i++) { for (j = 0; j < 3; j++) { int varx; int vary; varx = od_compute_var_4x4(x + 2 * i * stride + 2 * j, stride); vary = od_compute_var_4x4(y + 2 * i * stride + 2 * j, stride); min_var = OD_MINI(min_var, varx); mean_var += 1. / (1 + varx); /* The cast to (double) is to avoid an overflow before the sqrt.*/ vardist += varx - 2 * sqrt(varx * (double)vary) + vary; } } /* We use a different variance statistic depending on whether activity masking is used, since the harmonic mean appeared slightly worse with masking off. The calibration constant just ensures that we preserve the rate compared to activity=1. */ if (use_activity_masking) { calibration = 1.95; var_stat = 9. / mean_var; } else { calibration = 1.62; var_stat = min_var; } /* 1.62 is a calibration constant, 0.25 is a noise floor and 1/6 is the activity masking constant. */ activity = calibration * pow(.25 + var_stat, -1. / 6); #else activity = 1; #endif // 1 sum = 0; for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) sum += e_lp[i * stride + j] * (double)e_lp[i * stride + j]; } /* Normalize the filter to unit DC response. */ sum *= 1. / (OD_DIST_LP_NORM * OD_DIST_LP_NORM * OD_DIST_LP_NORM * OD_DIST_LP_NORM); return activity * activity * (sum + vardist); } // Note : Inputs x and y are in a pixel domain static double od_compute_dist_common(int activity_masking, uint16_t *x, uint16_t *y, int bsize_w, int bsize_h, int qindex, od_coeff *tmp, od_coeff *e_lp) { int i, j; double sum = 0; const int mid = OD_DIST_LP_MID; for (j = 0; j < bsize_w; j++) { e_lp[j] = mid * tmp[j] + 2 * tmp[bsize_w + j]; e_lp[(bsize_h - 1) * bsize_w + j] = mid * tmp[(bsize_h - 1) * bsize_w + j] + 2 * tmp[(bsize_h - 2) * bsize_w + j]; } for (i = 1; i < bsize_h - 1; i++) { for (j = 0; j < bsize_w; j++) { e_lp[i * bsize_w + j] = mid * tmp[i * bsize_w + j] + tmp[(i - 1) * bsize_w + j] + tmp[(i + 1) * bsize_w + j]; } } for (i = 0; i < bsize_h; i += 8) { for (j = 0; j < bsize_w; j += 8) { sum += od_compute_dist_8x8(activity_masking, &x[i * bsize_w + j], &y[i * bsize_w + j], &e_lp[i * bsize_w + j], bsize_w); } } /* Scale according to linear regression against SSE, for 8x8 blocks. */ if (activity_masking) { sum *= 2.2 + (1.7 - 2.2) * (qindex - 99) / (210 - 99) + (qindex < 99 ? 2.5 * (qindex - 99) / 99 * (qindex - 99) / 99 : 0); } else { sum *= qindex >= 128 ? 1.4 + (0.9 - 1.4) * (qindex - 128) / (209 - 128) : qindex <= 43 ? 1.5 + (2.0 - 1.5) * (qindex - 43) / (16 - 43) : 1.5 + (1.4 - 1.5) * (qindex - 43) / (128 - 43); } return sum; } static double od_compute_dist(uint16_t *x, uint16_t *y, int bsize_w, int bsize_h, int qindex) { assert(bsize_w >= 8 && bsize_h >= 8); int activity_masking = 0; int i, j; DECLARE_ALIGNED(16, od_coeff, e[MAX_SB_SQUARE]); DECLARE_ALIGNED(16, od_coeff, tmp[MAX_SB_SQUARE]); DECLARE_ALIGNED(16, od_coeff, e_lp[MAX_SB_SQUARE]); for (i = 0; i < bsize_h; i++) { for (j = 0; j < bsize_w; j++) { e[i * bsize_w + j] = x[i * bsize_w + j] - y[i * bsize_w + j]; } } int mid = OD_DIST_LP_MID; for (i = 0; i < bsize_h; i++) { tmp[i * bsize_w] = mid * e[i * bsize_w] + 2 * e[i * bsize_w + 1]; tmp[i * bsize_w + bsize_w - 1] = mid * e[i * bsize_w + bsize_w - 1] + 2 * e[i * bsize_w + bsize_w - 2]; for (j = 1; j < bsize_w - 1; j++) { tmp[i * bsize_w + j] = mid * e[i * bsize_w + j] + e[i * bsize_w + j - 1] + e[i * bsize_w + j + 1]; } } return od_compute_dist_common(activity_masking, x, y, bsize_w, bsize_h, qindex, tmp, e_lp); } static double od_compute_dist_diff(uint16_t *x, int16_t *e, int bsize_w, int bsize_h, int qindex) { assert(bsize_w >= 8 && bsize_h >= 8); int activity_masking = 0; DECLARE_ALIGNED(16, uint16_t, y[MAX_SB_SQUARE]); DECLARE_ALIGNED(16, od_coeff, tmp[MAX_SB_SQUARE]); DECLARE_ALIGNED(16, od_coeff, e_lp[MAX_SB_SQUARE]); int i, j; for (i = 0; i < bsize_h; i++) { for (j = 0; j < bsize_w; j++) { y[i * bsize_w + j] = x[i * bsize_w + j] - e[i * bsize_w + j]; } } int mid = OD_DIST_LP_MID; for (i = 0; i < bsize_h; i++) { tmp[i * bsize_w] = mid * e[i * bsize_w] + 2 * e[i * bsize_w + 1]; tmp[i * bsize_w + bsize_w - 1] = mid * e[i * bsize_w + bsize_w - 1] + 2 * e[i * bsize_w + bsize_w - 2]; for (j = 1; j < bsize_w - 1; j++) { tmp[i * bsize_w + j] = mid * e[i * bsize_w + j] + e[i * bsize_w + j - 1] + e[i * bsize_w + j + 1]; } } return od_compute_dist_common(activity_masking, x, y, bsize_w, bsize_h, qindex, tmp, e_lp); } int64_t av1_dist_8x8(const AV1_COMP *const cpi, const MACROBLOCK *x, const uint8_t *src, int src_stride, const uint8_t *dst, int dst_stride, const BLOCK_SIZE tx_bsize, int bsw, int bsh, int visible_w, int visible_h, int qindex) { int64_t d = 0; int i, j; const MACROBLOCKD *xd = &x->e_mbd; DECLARE_ALIGNED(16, uint16_t, orig[MAX_SB_SQUARE]); DECLARE_ALIGNED(16, uint16_t, rec[MAX_SB_SQUARE]); assert(bsw >= 8); assert(bsh >= 8); assert((bsw & 0x07) == 0); assert((bsh & 0x07) == 0); if (x->tune_metric == AOM_TUNE_CDEF_DIST || x->tune_metric == AOM_TUNE_DAALA_DIST) { if (is_cur_buf_hbd(xd)) { for (j = 0; j < bsh; j++) for (i = 0; i < bsw; i++) orig[j * bsw + i] = CONVERT_TO_SHORTPTR(src)[j * src_stride + i]; if ((bsw == visible_w) && (bsh == visible_h)) { for (j = 0; j < bsh; j++) for (i = 0; i < bsw; i++) rec[j * bsw + i] = CONVERT_TO_SHORTPTR(dst)[j * dst_stride + i]; } else { for (j = 0; j < visible_h; j++) for (i = 0; i < visible_w; i++) rec[j * bsw + i] = CONVERT_TO_SHORTPTR(dst)[j * dst_stride + i]; if (visible_w < bsw) { for (j = 0; j < bsh; j++) for (i = visible_w; i < bsw; i++) rec[j * bsw + i] = CONVERT_TO_SHORTPTR(src)[j * src_stride + i]; } if (visible_h < bsh) { for (j = visible_h; j < bsh; j++) for (i = 0; i < bsw; i++) rec[j * bsw + i] = CONVERT_TO_SHORTPTR(src)[j * src_stride + i]; } } } else { for (j = 0; j < bsh; j++) for (i = 0; i < bsw; i++) orig[j * bsw + i] = src[j * src_stride + i]; if ((bsw == visible_w) && (bsh == visible_h)) { for (j = 0; j < bsh; j++) for (i = 0; i < bsw; i++) rec[j * bsw + i] = dst[j * dst_stride + i]; } else { for (j = 0; j < visible_h; j++) for (i = 0; i < visible_w; i++) rec[j * bsw + i] = dst[j * dst_stride + i]; if (visible_w < bsw) { for (j = 0; j < bsh; j++) for (i = visible_w; i < bsw; i++) rec[j * bsw + i] = src[j * src_stride + i]; } if (visible_h < bsh) { for (j = visible_h; j < bsh; j++) for (i = 0; i < bsw; i++) rec[j * bsw + i] = src[j * src_stride + i]; } } } } if (x->tune_metric == AOM_TUNE_DAALA_DIST) { d = (int64_t)od_compute_dist(orig, rec, bsw, bsh, qindex); } else if (x->tune_metric == AOM_TUNE_CDEF_DIST) { int coeff_shift = AOMMAX(xd->bd - 8, 0); for (i = 0; i < bsh; i += 8) { for (j = 0; j < bsw; j += 8) { d += cdef_dist_8x8_16bit(&rec[i * bsw + j], bsw, &orig[i * bsw + j], bsw, coeff_shift); } } if (is_cur_buf_hbd(xd)) d = ((uint64_t)d) >> 2 * coeff_shift; } else { // Otherwise, MSE by default d = pixel_dist_visible_only(cpi, x, src, src_stride, dst, dst_stride, tx_bsize, bsh, bsw, visible_h, visible_w); } return d; } static int64_t dist_8x8_diff(const MACROBLOCK *x, const uint8_t *src, int src_stride, const int16_t *diff, int diff_stride, int bsw, int bsh, int visible_w, int visible_h, int qindex) { int64_t d = 0; int i, j; const MACROBLOCKD *xd = &x->e_mbd; DECLARE_ALIGNED(16, uint16_t, orig[MAX_SB_SQUARE]); DECLARE_ALIGNED(16, int16_t, diff16[MAX_SB_SQUARE]); assert(bsw >= 8); assert(bsh >= 8); assert((bsw & 0x07) == 0); assert((bsh & 0x07) == 0); if (x->tune_metric == AOM_TUNE_CDEF_DIST || x->tune_metric == AOM_TUNE_DAALA_DIST) { if (is_cur_buf_hbd(xd)) { for (j = 0; j < bsh; j++) for (i = 0; i < bsw; i++) orig[j * bsw + i] = CONVERT_TO_SHORTPTR(src)[j * src_stride + i]; } else { for (j = 0; j < bsh; j++) for (i = 0; i < bsw; i++) orig[j * bsw + i] = src[j * src_stride + i]; } if ((bsw == visible_w) && (bsh == visible_h)) { for (j = 0; j < bsh; j++) for (i = 0; i < bsw; i++) diff16[j * bsw + i] = diff[j * diff_stride + i]; } else { for (j = 0; j < visible_h; j++) for (i = 0; i < visible_w; i++) diff16[j * bsw + i] = diff[j * diff_stride + i]; if (visible_w < bsw) { for (j = 0; j < bsh; j++) for (i = visible_w; i < bsw; i++) diff16[j * bsw + i] = 0; } if (visible_h < bsh) { for (j = visible_h; j < bsh; j++) for (i = 0; i < bsw; i++) diff16[j * bsw + i] = 0; } } } if (x->tune_metric == AOM_TUNE_DAALA_DIST) { d = (int64_t)od_compute_dist_diff(orig, diff16, bsw, bsh, qindex); } else if (x->tune_metric == AOM_TUNE_CDEF_DIST) { int coeff_shift = AOMMAX(xd->bd - 8, 0); DECLARE_ALIGNED(16, uint16_t, dst16[MAX_SB_SQUARE]); for (i = 0; i < bsh; i++) { for (j = 0; j < bsw; j++) { dst16[i * bsw + j] = orig[i * bsw + j] - diff16[i * bsw + j]; } } for (i = 0; i < bsh; i += 8) { for (j = 0; j < bsw; j += 8) { d += cdef_dist_8x8_16bit(&dst16[i * bsw + j], bsw, &orig[i * bsw + j], bsw, coeff_shift); } } // Don't scale 'd' for HBD since it will be done by caller side for diff // input } else { // Otherwise, MSE by default d = aom_sum_squares_2d_i16(diff, diff_stride, visible_w, visible_h); } return d; } #endif // CONFIG_DIST_8X8 static void get_energy_distribution_fine(const AV1_COMP *cpi, BLOCK_SIZE bsize, const uint8_t *src, int src_stride, const uint8_t *dst, int dst_stride, int need_4th, double *hordist, double *verdist) { const int bw = block_size_wide[bsize]; const int bh = block_size_high[bsize]; unsigned int esq[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; if (bsize < BLOCK_16X16 || (bsize >= BLOCK_4X16 && bsize <= BLOCK_32X8)) { // Special cases: calculate 'esq' values manually, as we don't have 'vf' // functions for the 16 (very small) sub-blocks of this block. const int w_shift = (bw == 4) ? 0 : (bw == 8) ? 1 : (bw == 16) ? 2 : 3; const int h_shift = (bh == 4) ? 0 : (bh == 8) ? 1 : (bh == 16) ? 2 : 3; assert(bw <= 32); assert(bh <= 32); assert(((bw - 1) >> w_shift) + (((bh - 1) >> h_shift) << 2) == 15); if (cpi->common.seq_params.use_highbitdepth) { const uint16_t *src16 = CONVERT_TO_SHORTPTR(src); const uint16_t *dst16 = CONVERT_TO_SHORTPTR(dst); for (int i = 0; i < bh; ++i) for (int j = 0; j < bw; ++j) { const int index = (j >> w_shift) + ((i >> h_shift) << 2); esq[index] += (src16[j + i * src_stride] - dst16[j + i * dst_stride]) * (src16[j + i * src_stride] - dst16[j + i * dst_stride]); } } else { for (int i = 0; i < bh; ++i) for (int j = 0; j < bw; ++j) { const int index = (j >> w_shift) + ((i >> h_shift) << 2); esq[index] += (src[j + i * src_stride] - dst[j + i * dst_stride]) * (src[j + i * src_stride] - dst[j + i * dst_stride]); } } } else { // Calculate 'esq' values using 'vf' functions on the 16 sub-blocks. const int f_index = (bsize < BLOCK_SIZES) ? bsize - BLOCK_16X16 : bsize - BLOCK_8X16; assert(f_index >= 0 && f_index < BLOCK_SIZES_ALL); const BLOCK_SIZE subsize = (BLOCK_SIZE)f_index; assert(block_size_wide[bsize] == 4 * block_size_wide[subsize]); assert(block_size_high[bsize] == 4 * block_size_high[subsize]); cpi->fn_ptr[subsize].vf(src, src_stride, dst, dst_stride, &esq[0]); cpi->fn_ptr[subsize].vf(src + bw / 4, src_stride, dst + bw / 4, dst_stride, &esq[1]); cpi->fn_ptr[subsize].vf(src + bw / 2, src_stride, dst + bw / 2, dst_stride, &esq[2]); cpi->fn_ptr[subsize].vf(src + 3 * bw / 4, src_stride, dst + 3 * bw / 4, dst_stride, &esq[3]); src += bh / 4 * src_stride; dst += bh / 4 * dst_stride; cpi->fn_ptr[subsize].vf(src, src_stride, dst, dst_stride, &esq[4]); cpi->fn_ptr[subsize].vf(src + bw / 4, src_stride, dst + bw / 4, dst_stride, &esq[5]); cpi->fn_ptr[subsize].vf(src + bw / 2, src_stride, dst + bw / 2, dst_stride, &esq[6]); cpi->fn_ptr[subsize].vf(src + 3 * bw / 4, src_stride, dst + 3 * bw / 4, dst_stride, &esq[7]); src += bh / 4 * src_stride; dst += bh / 4 * dst_stride; cpi->fn_ptr[subsize].vf(src, src_stride, dst, dst_stride, &esq[8]); cpi->fn_ptr[subsize].vf(src + bw / 4, src_stride, dst + bw / 4, dst_stride, &esq[9]); cpi->fn_ptr[subsize].vf(src + bw / 2, src_stride, dst + bw / 2, dst_stride, &esq[10]); cpi->fn_ptr[subsize].vf(src + 3 * bw / 4, src_stride, dst + 3 * bw / 4, dst_stride, &esq[11]); src += bh / 4 * src_stride; dst += bh / 4 * dst_stride; cpi->fn_ptr[subsize].vf(src, src_stride, dst, dst_stride, &esq[12]); cpi->fn_ptr[subsize].vf(src + bw / 4, src_stride, dst + bw / 4, dst_stride, &esq[13]); cpi->fn_ptr[subsize].vf(src + bw / 2, src_stride, dst + bw / 2, dst_stride, &esq[14]); cpi->fn_ptr[subsize].vf(src + 3 * bw / 4, src_stride, dst + 3 * bw / 4, dst_stride, &esq[15]); } double total = (double)esq[0] + esq[1] + esq[2] + esq[3] + esq[4] + esq[5] + esq[6] + esq[7] + esq[8] + esq[9] + esq[10] + esq[11] + esq[12] + esq[13] + esq[14] + esq[15]; if (total > 0) { const double e_recip = 1.0 / total; hordist[0] = ((double)esq[0] + esq[4] + esq[8] + esq[12]) * e_recip; hordist[1] = ((double)esq[1] + esq[5] + esq[9] + esq[13]) * e_recip; hordist[2] = ((double)esq[2] + esq[6] + esq[10] + esq[14]) * e_recip; if (need_4th) { hordist[3] = ((double)esq[3] + esq[7] + esq[11] + esq[15]) * e_recip; } verdist[0] = ((double)esq[0] + esq[1] + esq[2] + esq[3]) * e_recip; verdist[1] = ((double)esq[4] + esq[5] + esq[6] + esq[7]) * e_recip; verdist[2] = ((double)esq[8] + esq[9] + esq[10] + esq[11]) * e_recip; if (need_4th) { verdist[3] = ((double)esq[12] + esq[13] + esq[14] + esq[15]) * e_recip; } } else { hordist[0] = verdist[0] = 0.25; hordist[1] = verdist[1] = 0.25; hordist[2] = verdist[2] = 0.25; if (need_4th) { hordist[3] = verdist[3] = 0.25; } } } static int adst_vs_flipadst(const AV1_COMP *cpi, BLOCK_SIZE bsize, const uint8_t *src, int src_stride, const uint8_t *dst, int dst_stride) { int prune_bitmask = 0; double svm_proj_h = 0, svm_proj_v = 0; double hdist[3] = { 0, 0, 0 }, vdist[3] = { 0, 0, 0 }; get_energy_distribution_fine(cpi, bsize, src, src_stride, dst, dst_stride, 0, hdist, vdist); svm_proj_v = vdist[0] * ADST_FLIP_SVM[0] + vdist[1] * ADST_FLIP_SVM[1] + vdist[2] * ADST_FLIP_SVM[2] + ADST_FLIP_SVM[3]; svm_proj_h = hdist[0] * ADST_FLIP_SVM[4] + hdist[1] * ADST_FLIP_SVM[5] + hdist[2] * ADST_FLIP_SVM[6] + ADST_FLIP_SVM[7]; if (svm_proj_v > FAST_EXT_TX_EDST_MID + FAST_EXT_TX_EDST_MARGIN) prune_bitmask |= 1 << FLIPADST_1D; else if (svm_proj_v < FAST_EXT_TX_EDST_MID - FAST_EXT_TX_EDST_MARGIN) prune_bitmask |= 1 << ADST_1D; if (svm_proj_h > FAST_EXT_TX_EDST_MID + FAST_EXT_TX_EDST_MARGIN) prune_bitmask |= 1 << (FLIPADST_1D + 8); else if (svm_proj_h < FAST_EXT_TX_EDST_MID - FAST_EXT_TX_EDST_MARGIN) prune_bitmask |= 1 << (ADST_1D + 8); return prune_bitmask; } static int dct_vs_idtx(const int16_t *diff, int stride, int w, int h) { float hcorr, vcorr; int prune_bitmask = 0; av1_get_horver_correlation_full(diff, stride, w, h, &hcorr, &vcorr); if (vcorr > FAST_EXT_TX_CORR_MID + FAST_EXT_TX_CORR_MARGIN) prune_bitmask |= 1 << IDTX_1D; else if (vcorr < FAST_EXT_TX_CORR_MID - FAST_EXT_TX_CORR_MARGIN) prune_bitmask |= 1 << DCT_1D; if (hcorr > FAST_EXT_TX_CORR_MID + FAST_EXT_TX_CORR_MARGIN) prune_bitmask |= 1 << (IDTX_1D + 8); else if (hcorr < FAST_EXT_TX_CORR_MID - FAST_EXT_TX_CORR_MARGIN) prune_bitmask |= 1 << (DCT_1D + 8); return prune_bitmask; } // Performance drop: 0.5%, Speed improvement: 24% static int prune_two_for_sby(const AV1_COMP *cpi, BLOCK_SIZE bsize, MACROBLOCK *x, const MACROBLOCKD *xd, int adst_flipadst, int dct_idtx) { int prune = 0; if (adst_flipadst) { const struct macroblock_plane *const p = &x->plane[0]; const struct macroblockd_plane *const pd = &xd->plane[0]; prune |= adst_vs_flipadst(cpi, bsize, p->src.buf, p->src.stride, pd->dst.buf, pd->dst.stride); } if (dct_idtx) { av1_subtract_plane(x, bsize, 0); const struct macroblock_plane *const p = &x->plane[0]; const int bw = block_size_wide[bsize]; const int bh = block_size_high[bsize]; prune |= dct_vs_idtx(p->src_diff, bw, bw, bh); } return prune; } // Performance drop: 0.3%, Speed improvement: 5% static int prune_one_for_sby(const AV1_COMP *cpi, BLOCK_SIZE bsize, const MACROBLOCK *x, const MACROBLOCKD *xd) { const struct macroblock_plane *const p = &x->plane[0]; const struct macroblockd_plane *const pd = &xd->plane[0]; return adst_vs_flipadst(cpi, bsize, p->src.buf, p->src.stride, pd->dst.buf, pd->dst.stride); } // 1D Transforms used in inter set, this needs to be changed if // ext_tx_used_inter is changed static const int ext_tx_used_inter_1D[EXT_TX_SETS_INTER][TX_TYPES_1D] = { { 1, 0, 0, 0 }, { 1, 1, 1, 1 }, { 1, 1, 1, 1 }, { 1, 0, 0, 1 }, }; static void get_energy_distribution_finer(const int16_t *diff, int stride, int bw, int bh, float *hordist, float *verdist) { // First compute downscaled block energy values (esq); downscale factors // are defined by w_shift and h_shift. unsigned int esq[256]; const int w_shift = bw <= 8 ? 0 : 1; const int h_shift = bh <= 8 ? 0 : 1; const int esq_w = bw >> w_shift; const int esq_h = bh >> h_shift; const int esq_sz = esq_w * esq_h; int i, j; memset(esq, 0, esq_sz * sizeof(esq[0])); if (w_shift) { for (i = 0; i < bh; i++) { unsigned int *cur_esq_row = esq + (i >> h_shift) * esq_w; const int16_t *cur_diff_row = diff + i * stride; for (j = 0; j < bw; j += 2) { cur_esq_row[j >> 1] += (cur_diff_row[j] * cur_diff_row[j] + cur_diff_row[j + 1] * cur_diff_row[j + 1]); } } } else { for (i = 0; i < bh; i++) { unsigned int *cur_esq_row = esq + (i >> h_shift) * esq_w; const int16_t *cur_diff_row = diff + i * stride; for (j = 0; j < bw; j++) { cur_esq_row[j] += cur_diff_row[j] * cur_diff_row[j]; } } } uint64_t total = 0; for (i = 0; i < esq_sz; i++) total += esq[i]; // Output hordist and verdist arrays are normalized 1D projections of esq if (total == 0) { float hor_val = 1.0f / esq_w; for (j = 0; j < esq_w - 1; j++) hordist[j] = hor_val; float ver_val = 1.0f / esq_h; for (i = 0; i < esq_h - 1; i++) verdist[i] = ver_val; return; } const float e_recip = 1.0f / (float)total; memset(hordist, 0, (esq_w - 1) * sizeof(hordist[0])); memset(verdist, 0, (esq_h - 1) * sizeof(verdist[0])); const unsigned int *cur_esq_row; for (i = 0; i < esq_h - 1; i++) { cur_esq_row = esq + i * esq_w; for (j = 0; j < esq_w - 1; j++) { hordist[j] += (float)cur_esq_row[j]; verdist[i] += (float)cur_esq_row[j]; } verdist[i] += (float)cur_esq_row[j]; } cur_esq_row = esq + i * esq_w; for (j = 0; j < esq_w - 1; j++) hordist[j] += (float)cur_esq_row[j]; for (j = 0; j < esq_w - 1; j++) hordist[j] *= e_recip; for (i = 0; i < esq_h - 1; i++) verdist[i] *= e_recip;
+ show +
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
} // Similar to get_horver_correlation, but also takes into account first // row/column, when computing horizontal/vertical correlation. void av1_get_horver_correlation_full_c(const int16_t *diff, int stride, int width, int height, float *hcorr, float *vcorr) { // The following notation is used: // x - current pixel // y - left neighbor pixel

[CVE-2020-0478_1.diff] rdopt.c #15
-// Model based RD estimation for luma intra blocks. -static int64_t intra_model_yrd(const AV1_COMP *const cpi, MACROBLOCK *const x, - BLOCK_SIZE bsize, int mode_cost, int mi_row, - int mi_col) { - const AV1_COMMON *cm = &cpi->common; - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = xd->mi[0]; - assert(!is_inter_block(mbmi)); - RD_STATS this_rd_stats; - int row, col; - int64_t temp_sse, this_rd; - TX_SIZE tx_size = tx_size_from_tx_mode(bsize, cm->tx_mode); - const int stepr = tx_size_high_unit[tx_size]; - const int stepc = tx_size_wide_unit[tx_size]; - const int max_blocks_wide = max_block_wide(xd, bsize, 0); - const int max_blocks_high = max_block_high(xd, bsize, 0); - mbmi->tx_size = tx_size; - // Prediction. - for (row = 0; row < max_blocks_high; row += stepr) { - for (col = 0; col < max_blocks_wide; col += stepc) { - av1_predict_intra_block_facade(cm, xd, 0, col, row, tx_size); - } - } - // RD estimation. - model_rd_sb_fn[MODELRD_TYPE_INTRA]( - cpi, bsize, x, xd, 0, 0, mi_row, mi_col, &this_rd_stats.rate, - &this_rd_stats.dist, &this_rd_stats.skip, &temp_sse, NULL, NULL, NULL); - if (av1_is_directional_mode(mbmi->mode) && av1_use_angle_delta(bsize)) { - mode_cost += - x->angle_delta_cost[mbmi->mode - V_PRED] - [MAX_ANGLE_DELTA + mbmi->angle_delta[PLANE_TYPE_Y]]; - } - if (mbmi->mode == DC_PRED && - av1_filter_intra_allowed_bsize(cm, mbmi->sb_type)) { - if (mbmi->filter_intra_mode_info.use_filter_intra) { - const int mode = mbmi->filter_intra_mode_info.filter_intra_mode; - mode_cost += x->filter_intra_cost[mbmi->sb_type][1] + - x->filter_intra_mode_cost[mode]; - } else { - mode_cost += x->filter_intra_cost[mbmi->sb_type][0]; - } - } - this_rd = - RDCOST(x->rdmult, this_rd_stats.rate + mode_cost, this_rd_stats.dist); - return this_rd; -} - -// Extends 'color_map' array from 'orig_width x orig_height' to 'new_width x -// new_height'. Extra rows and columns are filled in by copying last valid -// row/column. -static void extend_palette_color_map(uint8_t *const color_map, int orig_width, - int orig_height, int new_width, - int new_height) { - int j; - assert(new_width >= orig_width); - assert(new_height >= orig_height); - if (new_width == orig_width && new_height == orig_height) return; - - for (j = orig_height - 1; j >= 0; --j) { - memmove(color_map + j * new_width, color_map + j * orig_width, orig_width); - // Copy last column to extra columns. - memset(color_map + j * new_width + orig_width, - color_map[j * new_width + orig_width - 1], new_width - orig_width); - } - // Copy last row to extra rows. - for (j = orig_height; j < new_height; ++j) { - memcpy(color_map + j * new_width, color_map + (orig_height - 1) * new_width, - new_width); - } -} - -// Bias toward using colors in the cache. -// TODO(huisu): Try other schemes to improve compression. -static void optimize_palette_colors(uint16_t *color_cache, int n_cache, - int n_colors, int stride, int *centroids) { - if (n_cache <= 0) return; - for (int i = 0; i < n_colors * stride; i += stride) { - int min_diff = abs(centroids[i] - (int)color_cache[0]); - int idx = 0; - for (int j = 1; j < n_cache; ++j) { - const int this_diff = abs(centroids[i] - color_cache[j]); - if (this_diff < min_diff) { - min_diff = this_diff; - idx = j; - } - } - if (min_diff <= 1) centroids[i] = color_cache[idx]; - } -} - -// Given the base colors as specified in centroids[], calculate the RD cost -// of palette mode. -static void palette_rd_y(const AV1_COMP *const cpi, MACROBLOCK *x, - MB_MODE_INFO *mbmi, BLOCK_SIZE bsize, int mi_row, - int mi_col, int dc_mode_cost, const int *data, - int *centroids, int n, uint16_t *color_cache, - int n_cache, MB_MODE_INFO *best_mbmi, - uint8_t *best_palette_color_map, int64_t *best_rd, - int64_t *best_model_rd, int *rate, int *rate_tokenonly, - int *rate_overhead, int64_t *distortion, - int *skippable, PICK_MODE_CONTEXT *ctx, - uint8_t *blk_skip) { - optimize_palette_colors(color_cache, n_cache, n, 1, centroids); - int k = av1_remove_duplicates(centroids, n); - if (k < PALETTE_MIN_SIZE) { - // Too few unique colors to create a palette. And DC_PRED will work - // well for that case anyway. So skip. - return; - } - PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info; - if (cpi->common.seq_params.use_highbitdepth) - for (int i = 0; i < k; ++i) - pmi->palette_colors[i] = clip_pixel_highbd( - (int)centroids[i], cpi->common.seq_params.bit_depth); - else - for (int i = 0; i < k; ++i) - pmi->palette_colors[i] = clip_pixel(centroids[i]); - pmi->palette_size[0] = k; - MACROBLOCKD *const xd = &x->e_mbd; - uint8_t *const color_map = xd->plane[0].color_index_map; - int block_width, block_height, rows, cols; - av1_get_block_dimensions(bsize, 0, xd, &block_width, &block_height, &rows, - &cols); - av1_calc_indices(data, centroids, color_map, rows * cols, k, 1); - extend_palette_color_map(color_map, cols, rows, block_width, block_height); - const int palette_mode_cost = - intra_mode_info_cost_y(cpi, x, mbmi, bsize, dc_mode_cost); - int64_t this_model_rd = - intra_model_yrd(cpi, x, bsize, palette_mode_cost, mi_row, mi_col); - if (*best_model_rd != INT64_MAX && - this_model_rd > *best_model_rd + (*best_model_rd >> 1)) - return; - if (this_model_rd < *best_model_rd) *best_model_rd = this_model_rd; - RD_STATS tokenonly_rd_stats; - super_block_yrd(cpi, x, &tokenonly_rd_stats, bsize, *best_rd); - if (tokenonly_rd_stats.rate == INT_MAX) return; - int this_rate = tokenonly_rd_stats.rate + palette_mode_cost; - int64_t this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); - if (!xd->lossless[mbmi->segment_id] && block_signals_txsize(mbmi->sb_type)) { - tokenonly_rd_stats.rate -= - tx_size_cost(&cpi->common, x, bsize, mbmi->tx_size); - } - if (this_rd < *best_rd) { - *best_rd = this_rd; - memcpy(best_palette_color_map, color_map, - block_width * block_height * sizeof(color_map[0])); - *best_mbmi = *mbmi; - memcpy(blk_skip, x->blk_skip, sizeof(x->blk_skip[0]) * ctx->num_4x4_blk); - *rate_overhead = this_rate - tokenonly_rd_stats.rate; - if (rate) *rate = this_rate; - if (rate_tokenonly) *rate_tokenonly = tokenonly_rd_stats.rate; - if (distortion) *distortion = tokenonly_rd_stats.dist; - if (skippable) *skippable = tokenonly_rd_stats.skip; - } -} - -static int rd_pick_palette_intra_sby( - const AV1_COMP *const cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row, - int mi_col, int dc_mode_cost, MB_MODE_INFO *best_mbmi, - uint8_t *best_palette_color_map, int64_t *best_rd, int64_t *best_model_rd, - int *rate, int *rate_tokenonly, int64_t *distortion, int *skippable, - PICK_MODE_CONTEXT *ctx, uint8_t *best_blk_skip) { - int rate_overhead = 0; - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = xd->mi[0]; - assert(!is_inter_block(mbmi)); - assert(av1_allow_palette(cpi->common.allow_screen_content_tools, bsize)); - const SequenceHeader *const seq_params = &cpi->common.seq_params; - int colors, n; - const int src_stride = x->plane[0].src.stride; - const uint8_t *const src = x->plane[0].src.buf; - uint8_t *const color_map = xd->plane[0].color_index_map; - int block_width, block_height, rows, cols; - av1_get_block_dimensions(bsize, 0, xd, &block_width, &block_height, &rows, - &cols); - - int count_buf[1 << 12]; // Maximum (1 << 12) color levels. - if (seq_params->use_highbitdepth) - colors = av1_count_colors_highbd(src, src_stride, rows, cols, - seq_params->bit_depth, count_buf); - else - colors = av1_count_colors(src, src_stride, rows, cols, count_buf); - mbmi->filter_intra_mode_info.use_filter_intra = 0; - - if (colors > 1 && colors <= 64) { - int r, c, i; - const int max_itr = 50; - int *const data = x->palette_buffer->kmeans_data_buf; - int centroids[PALETTE_MAX_SIZE]; - int lb, ub, val; - uint16_t *src16 = CONVERT_TO_SHORTPTR(src); - if (seq_params->use_highbitdepth) - lb = ub = src16[0]; - else - lb = ub = src[0]; - - if (seq_params->use_highbitdepth) { - for (r = 0; r < rows; ++r) { - for (c = 0; c < cols; ++c) { - val = src16[r * src_stride + c]; - data[r * cols + c] = val; - if (val < lb) - lb = val; - else if (val > ub) - ub = val; - } - } - } else { - for (r = 0; r < rows; ++r) { - for (c = 0; c < cols; ++c) { - val = src[r * src_stride + c]; - data[r * cols + c] = val; - if (val < lb) - lb = val; - else if (val > ub) - ub = val; - } - } - } - - mbmi->mode = DC_PRED; - mbmi->filter_intra_mode_info.use_filter_intra = 0; - - uint16_t color_cache[2 * PALETTE_MAX_SIZE]; - const int n_cache = av1_get_palette_cache(xd, 0, color_cache); - - // Find the dominant colors, stored in top_colors[]. - int top_colors[PALETTE_MAX_SIZE] = { 0 }; - for (i = 0; i < AOMMIN(colors, PALETTE_MAX_SIZE); ++i) { - int max_count = 0; - for (int j = 0; j < (1 << seq_params->bit_depth); ++j) { - if (count_buf[j] > max_count) { - max_count = count_buf[j]; - top_colors[i] = j; - } - } - assert(max_count > 0); - count_buf[top_colors[i]] = 0; - } - - // Try the dominant colors directly. - // TODO(huisu@google.com): Try to avoid duplicate computation in cases - // where the dominant colors and the k-means results are similar. - for (n = AOMMIN(colors, PALETTE_MAX_SIZE); n >= 2; --n) { - for (i = 0; i < n; ++i) centroids[i] = top_colors[i]; - palette_rd_y(cpi, x, mbmi, bsize, mi_row, mi_col, dc_mode_cost, data, - centroids, n, color_cache, n_cache, best_mbmi, - best_palette_color_map, best_rd, best_model_rd, rate, - rate_tokenonly, &rate_overhead, distortion, skippable, ctx, - best_blk_skip); - } - - // K-means clustering. - for (n = AOMMIN(colors, PALETTE_MAX_SIZE); n >= 2; --n) { - if (colors == PALETTE_MIN_SIZE) { - // Special case: These colors automatically become the centroids. - assert(colors == n); - assert(colors == 2); - centroids[0] = lb; - centroids[1] = ub; - } else { - for (i = 0; i < n; ++i) { - centroids[i] = lb + (2 * i + 1) * (ub - lb) / n / 2; - } - av1_k_means(data, centroids, color_map, rows * cols, n, 1, max_itr); - } - palette_rd_y(cpi, x, mbmi, bsize, mi_row, mi_col, dc_mode_cost, data, - centroids, n, color_cache, n_cache, best_mbmi, - best_palette_color_map, best_rd, best_model_rd, rate, - rate_tokenonly, &rate_overhead, distortion, skippable, ctx, - best_blk_skip); - } - } - - if (best_mbmi->palette_mode_info.palette_size[0] > 0) { - memcpy(color_map, best_palette_color_map, - block_width * block_height * sizeof(best_palette_color_map[0])); - } - *mbmi = *best_mbmi; - return rate_overhead; -} - -// Return 1 if an filter intra mode is selected; return 0 otherwise. -static int rd_pick_filter_intra_sby(const AV1_COMP *const cpi, MACROBLOCK *x, - int mi_row, int mi_col, int *rate, - int *rate_tokenonly, int64_t *distortion, - int *skippable, BLOCK_SIZE bsize, - int mode_cost, int64_t *best_rd, - int64_t *best_model_rd, - PICK_MODE_CONTEXT *ctx) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *mbmi = xd->mi[0]; - int filter_intra_selected_flag = 0; - FILTER_INTRA_MODE mode; - TX_SIZE best_tx_size = TX_8X8; - FILTER_INTRA_MODE_INFO filter_intra_mode_info; - TX_TYPE best_txk_type[TXK_TYPE_BUF_LEN]; - (void)ctx; - av1_zero(filter_intra_mode_info); - mbmi->filter_intra_mode_info.use_filter_intra = 1; - mbmi->mode = DC_PRED; - mbmi->palette_mode_info.palette_size[0] = 0; - - for (mode = 0; mode < FILTER_INTRA_MODES; ++mode) { - int64_t this_rd, this_model_rd; - RD_STATS tokenonly_rd_stats; - mbmi->filter_intra_mode_info.filter_intra_mode = mode; - this_model_rd = intra_model_yrd(cpi, x, bsize, mode_cost, mi_row, mi_col); - if (*best_model_rd != INT64_MAX && - this_model_rd > *best_model_rd + (*best_model_rd >> 1)) - continue; - if (this_model_rd < *best_model_rd) *best_model_rd = this_model_rd; - super_block_yrd(cpi, x, &tokenonly_rd_stats, bsize, *best_rd); - if (tokenonly_rd_stats.rate == INT_MAX) continue; - const int this_rate = - tokenonly_rd_stats.rate + - intra_mode_info_cost_y(cpi, x, mbmi, bsize, mode_cost); - this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); - - if (this_rd < *best_rd) { - *best_rd = this_rd; - best_tx_size = mbmi->tx_size; - filter_intra_mode_info = mbmi->filter_intra_mode_info; - memcpy(best_txk_type, mbmi->txk_type, - sizeof(best_txk_type[0]) * TXK_TYPE_BUF_LEN); - memcpy(ctx->blk_skip, x->blk_skip, - sizeof(x->blk_skip[0]) * ctx->num_4x4_blk); - *rate = this_rate; - *rate_tokenonly = tokenonly_rd_stats.rate; - *distortion = tokenonly_rd_stats.dist; - *skippable = tokenonly_rd_stats.skip; - filter_intra_selected_flag = 1; - } - } - - if (filter_intra_selected_flag) { - mbmi->mode = DC_PRED; - mbmi->tx_size = best_tx_size; - mbmi->filter_intra_mode_info = filter_intra_mode_info; - memcpy(mbmi->txk_type, best_txk_type, - sizeof(best_txk_type[0]) * TXK_TYPE_BUF_LEN); - return 1; - } else { - return 0; - } -} - -// Run RD calculation with given luma intra prediction angle., and return -// the RD cost. Update the best mode info. if the RD cost is the best so far. -static int64_t calc_rd_given_intra_angle( - const AV1_COMP *const cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row, - int mi_col, int mode_cost, int64_t best_rd_in, int8_t angle_delta, - int max_angle_delta, int *rate, RD_STATS *rd_stats, int *best_angle_delta, - TX_SIZE *best_tx_size, int64_t *best_rd, int64_t *best_model_rd, - TX_TYPE *best_txk_type, uint8_t *best_blk_skip) { - RD_STATS tokenonly_rd_stats; - int64_t this_rd, this_model_rd; - MB_MODE_INFO *mbmi = x->e_mbd.mi[0]; - const int n4 = bsize_to_num_blk(bsize); - assert(!is_inter_block(mbmi)); - mbmi->angle_delta[PLANE_TYPE_Y] = angle_delta; - this_model_rd = intra_model_yrd(cpi, x, bsize, mode_cost, mi_row, mi_col); - if (*best_model_rd != INT64_MAX && - this_model_rd > *best_model_rd + (*best_model_rd >> 1)) - return INT64_MAX; - if (this_model_rd < *best_model_rd) *best_model_rd = this_model_rd; - super_block_yrd(cpi, x, &tokenonly_rd_stats, bsize, best_rd_in); - if (tokenonly_rd_stats.rate == INT_MAX) return INT64_MAX; - - int this_rate = - mode_cost + tokenonly_rd_stats.rate + - x->angle_delta_cost[mbmi->mode - V_PRED][max_angle_delta + angle_delta]; - this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); - - if (this_rd < *best_rd) { - memcpy(best_txk_type, mbmi->txk_type, - sizeof(*best_txk_type) * TXK_TYPE_BUF_LEN); - memcpy(best_blk_skip, x->blk_skip, sizeof(best_blk_skip[0]) * n4); - *best_rd = this_rd; - *best_angle_delta = mbmi->angle_delta[PLANE_TYPE_Y]; - *best_tx_size = mbmi->tx_size; - *rate = this_rate; - rd_stats->rate = tokenonly_rd_stats.rate; - rd_stats->dist = tokenonly_rd_stats.dist; - rd_stats->skip = tokenonly_rd_stats.skip; - } - return this_rd; -} - -// With given luma directional intra prediction mode, pick the best angle delta -// Return the RD cost corresponding to the best angle delta. -static int64_t rd_pick_intra_angle_sby(const AV1_COMP *const cpi, MACROBLOCK *x, - int mi_row, int mi_col, int *rate, - RD_STATS *rd_stats, BLOCK_SIZE bsize, - int mode_cost, int64_t best_rd, - int64_t *best_model_rd) { - MB_MODE_INFO *mbmi = x->e_mbd.mi[0]; - assert(!is_inter_block(mbmi)); - - int best_angle_delta = 0; - int64_t rd_cost[2 * (MAX_ANGLE_DELTA + 2)]; - TX_SIZE best_tx_size = mbmi->tx_size; - TX_TYPE best_txk_type[TXK_TYPE_BUF_LEN]; - uint8_t best_blk_skip[MAX_MIB_SIZE * MAX_MIB_SIZE]; - - for (int i = 0; i < 2 * (MAX_ANGLE_DELTA + 2); ++i) rd_cost[i] = INT64_MAX; - - int first_try = 1; - for (int angle_delta = 0; angle_delta <= MAX_ANGLE_DELTA; angle_delta += 2) { - for (int i = 0; i < 2; ++i) { - const int64_t best_rd_in = - (best_rd == INT64_MAX) ? INT64_MAX - : (best_rd + (best_rd >> (first_try ? 3 : 5))); - const int64_t this_rd = calc_rd_given_intra_angle( - cpi, x, bsize, mi_row, mi_col, mode_cost, best_rd_in, - (1 - 2 * i) * angle_delta, MAX_ANGLE_DELTA, rate, rd_stats, - &best_angle_delta, &best_tx_size, &best_rd, best_model_rd, - best_txk_type, best_blk_skip); - rd_cost[2 * angle_delta + i] = this_rd; - if (first_try && this_rd == INT64_MAX) return best_rd; - first_try = 0; - if (angle_delta == 0) { - rd_cost[1] = this_rd; - break; - } - } - } - - assert(best_rd != INT64_MAX); - for (int angle_delta = 1; angle_delta <= MAX_ANGLE_DELTA; angle_delta += 2) { - for (int i = 0; i < 2; ++i) { - int skip_search = 0; - const int64_t rd_thresh = best_rd + (best_rd >> 5); - if (rd_cost[2 * (angle_delta + 1) + i] > rd_thresh && - rd_cost[2 * (angle_delta - 1) + i] > rd_thresh) - skip_search = 1; - if (!skip_search) { - calc_rd_given_intra_angle(cpi, x, bsize, mi_row, mi_col, mode_cost, - best_rd, (1 - 2 * i) * angle_delta, - MAX_ANGLE_DELTA, rate, rd_stats, - &best_angle_delta, &best_tx_size, &best_rd, - best_model_rd, best_txk_type, best_blk_skip); - } - } - } - - if (rd_stats->rate != INT_MAX) { - mbmi->tx_size = best_tx_size; - mbmi->angle_delta[PLANE_TYPE_Y] = best_angle_delta; - memcpy(mbmi->txk_type, best_txk_type, - sizeof(*best_txk_type) * TXK_TYPE_BUF_LEN); - memcpy(x->blk_skip, best_blk_skip, - sizeof(best_blk_skip[0]) * bsize_to_num_blk(bsize)); - } - return best_rd; -} - -// Indices are sign, integer, and fractional part of the gradient value -static const uint8_t gradient_to_angle_bin[2][7][16] = { - { - { 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, - { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, - { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, - }, - { - { 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4 }, - { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3 }, - { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, - { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, - { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, - { 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, - { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, - }, -}; - -/* clang-format off */ -static const uint8_t mode_to_angle_bin[INTRA_MODES] = { - 0, 2, 6, 0, 4, 3, 5, 7, 1, 0, - 0, -}; -/* clang-format on */ - -static void get_gradient_hist(const uint8_t *src, int src_stride, int rows, - int cols, uint64_t *hist) { - src += src_stride; - for (int r = 1; r < rows; ++r) { - for (int c = 1; c < cols; ++c) { - int dx = src[c] - src[c - 1]; - int dy = src[c] - src[c - src_stride]; - int index; - const int temp = dx * dx + dy * dy; - if (dy == 0) { - index = 2; - } else { - const int sn = (dx > 0) ^ (dy > 0); - dx = abs(dx); - dy = abs(dy); - const int remd = (dx % dy) * 16 / dy; - const int quot = dx / dy; - index = gradient_to_angle_bin[sn][AOMMIN(quot, 6)][AOMMIN(remd, 15)]; - } - hist[index] += temp; - } - src += src_stride; - } -} - -static void get_highbd_gradient_hist(const uint8_t *src8, int src_stride, - int rows, int cols, uint64_t *hist) { - uint16_t *src = CONVERT_TO_SHORTPTR(src8); - src += src_stride; - for (int r = 1; r < rows; ++r) { - for (int c = 1; c < cols; ++c) { - int dx = src[c] - src[c - 1]; - int dy = src[c] - src[c - src_stride]; - int index; - const int temp = dx * dx + dy * dy; - if (dy == 0) { - index = 2; - } else { - const int sn = (dx > 0) ^ (dy > 0); - dx = abs(dx); - dy = abs(dy); - const int remd = (dx % dy) * 16 / dy; - const int quot = dx / dy; - index = gradient_to_angle_bin[sn][AOMMIN(quot, 6)][AOMMIN(remd, 15)]; - } - hist[index] += temp; - } - src += src_stride; - } -} - -static void angle_estimation(const uint8_t *src, int src_stride, int rows, - int cols, BLOCK_SIZE bsize, int is_hbd, - uint8_t *directional_mode_skip_mask) { - // Check if angle_delta is used - if (!av1_use_angle_delta(bsize)) return; - - uint64_t hist[DIRECTIONAL_MODES] = { 0 }; - if (is_hbd) - get_highbd_gradient_hist(src, src_stride, rows, cols, hist); - else - get_gradient_hist(src, src_stride, rows, cols, hist); - - int i; - uint64_t hist_sum = 0; - for (i = 0; i < DIRECTIONAL_MODES; ++i) hist_sum += hist[i]; - for (i = 0; i < INTRA_MODES; ++i) { - if (av1_is_directional_mode(i)) { - const uint8_t angle_bin = mode_to_angle_bin[i]; - uint64_t score = 2 * hist[angle_bin]; - int weight = 2; - if (angle_bin > 0) { - score += hist[angle_bin - 1]; - ++weight; - } - if (angle_bin < DIRECTIONAL_MODES - 1) { - score += hist[angle_bin + 1]; - ++weight; - } - const int thresh = 10; - if (score * thresh < hist_sum * weight) directional_mode_skip_mask[i] = 1; - } - } -} - -// Given selected prediction mode, search for the best tx type and size. -static void intra_block_yrd(const AV1_COMP *const cpi, MACROBLOCK *x, - BLOCK_SIZE bsize, const int *bmode_costs, - int64_t *best_rd, int *rate, int *rate_tokenonly, - int64_t *distortion, int *skippable, - MB_MODE_INFO *best_mbmi, PICK_MODE_CONTEXT *ctx) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = xd->mi[0]; - RD_STATS rd_stats; - super_block_yrd(cpi, x, &rd_stats, bsize, *best_rd); - if (rd_stats.rate == INT_MAX) return; - int this_rate_tokenonly = rd_stats.rate; - if (!xd->lossless[mbmi->segment_id] && block_signals_txsize(mbmi->sb_type)) { - // super_block_yrd above includes the cost of the tx_size in the - // tokenonly rate, but for intra blocks, tx_size is always coded - // (prediction granularity), so we account for it in the full rate, - // not the tokenonly rate. - this_rate_tokenonly -= tx_size_cost(&cpi->common, x, bsize, mbmi->tx_size); - } - const int this_rate = - rd_stats.rate + - intra_mode_info_cost_y(cpi, x, mbmi, bsize, bmode_costs[mbmi->mode]); - const int64_t this_rd = RDCOST(x->rdmult, this_rate, rd_stats.dist); - if (this_rd < *best_rd) { - *best_mbmi = *mbmi; - *best_rd = this_rd; - *rate = this_rate; - *rate_tokenonly = this_rate_tokenonly; - *distortion = rd_stats.dist; - *skippable = rd_stats.skip; - memcpy(ctx->blk_skip, x->blk_skip, - sizeof(x->blk_skip[0]) * ctx->num_4x4_blk); - } -} - -// This function is used only for intra_only frames -static int64_t rd_pick_intra_sby_mode(const AV1_COMP *const cpi, MACROBLOCK *x, - int mi_row, int mi_col, int *rate, - int *rate_tokenonly, int64_t *distortion, - int *skippable, BLOCK_SIZE bsize, - int64_t best_rd, PICK_MODE_CONTEXT *ctx) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = xd->mi[0]; - assert(!is_inter_block(mbmi)); - int64_t best_model_rd = INT64_MAX; - const int rows = block_size_high[bsize]; - const int cols = block_size_wide[bsize]; - int is_directional_mode; - uint8_t directional_mode_skip_mask[INTRA_MODES] = { 0 }; - int beat_best_rd = 0; - const int *bmode_costs; - PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info; - const int try_palette = - cpi->oxcf.enable_palette && - av1_allow_palette(cpi->common.allow_screen_content_tools, mbmi->sb_type); - uint8_t *best_palette_color_map = - try_palette ? x->palette_buffer->best_palette_color_map : NULL; - const MB_MODE_INFO *above_mi = xd->above_mbmi; - const MB_MODE_INFO *left_mi = xd->left_mbmi; - const PREDICTION_MODE A = av1_above_block_mode(above_mi); - const PREDICTION_MODE L = av1_left_block_mode(left_mi); - const int above_ctx = intra_mode_context[A]; - const int left_ctx = intra_mode_context[L]; - bmode_costs = x->y_mode_costs[above_ctx][left_ctx]; - - mbmi->angle_delta[PLANE_TYPE_Y] = 0; - if (cpi->sf.intra_angle_estimation) { - const int src_stride = x->plane[0].src.stride; - const uint8_t *src = x->plane[0].src.buf; - angle_estimation(src, src_stride, rows, cols, bsize, is_cur_buf_hbd(xd), - directional_mode_skip_mask); - } - mbmi->filter_intra_mode_info.use_filter_intra = 0; - pmi->palette_size[0] = 0; - - if (cpi->sf.tx_type_search.fast_intra_tx_type_search) - x->use_default_intra_tx_type = 1; - else - x->use_default_intra_tx_type = 0; - - MB_MODE_INFO best_mbmi = *mbmi; - /* Y Search for intra prediction mode */ - for (int mode_idx = INTRA_MODE_START; mode_idx < INTRA_MODE_END; ++mode_idx) { - RD_STATS this_rd_stats; - int this_rate, this_rate_tokenonly, s; - int64_t this_distortion, this_rd, this_model_rd; - mbmi->mode = intra_rd_search_mode_order[mode_idx]; - if ((!cpi->oxcf.enable_smooth_intra || cpi->sf.disable_smooth_intra) && - (mbmi->mode == SMOOTH_PRED || mbmi->mode == SMOOTH_H_PRED || - mbmi->mode == SMOOTH_V_PRED)) - continue; - if (!cpi->oxcf.enable_paeth_intra && mbmi->mode == PAETH_PRED) continue; - mbmi->angle_delta[PLANE_TYPE_Y] = 0; - this_model_rd = - intra_model_yrd(cpi, x, bsize, bmode_costs[mbmi->mode], mi_row, mi_col); - if (best_model_rd != INT64_MAX && - this_model_rd > best_model_rd + (best_model_rd >> 1)) - continue; - if (this_model_rd < best_model_rd) best_model_rd = this_model_rd; - is_directional_mode = av1_is_directional_mode(mbmi->mode); - if (is_directional_mode && directional_mode_skip_mask[mbmi->mode]) continue; - if (is_directional_mode && av1_use_angle_delta(bsize) && - cpi->oxcf.enable_angle_delta) { - this_rd_stats.rate = INT_MAX; - rd_pick_intra_angle_sby(cpi, x, mi_row, mi_col, &this_rate, - &this_rd_stats, bsize, bmode_costs[mbmi->mode], - best_rd, &best_model_rd); - } else { - super_block_yrd(cpi, x, &this_rd_stats, bsize, best_rd); - } - this_rate_tokenonly = this_rd_stats.rate; - this_distortion = this_rd_stats.dist; - s = this_rd_stats.skip; - - if (this_rate_tokenonly == INT_MAX) continue; - - if (!xd->lossless[mbmi->segment_id] && - block_signals_txsize(mbmi->sb_type)) { - // super_block_yrd above includes the cost of the tx_size in the - // tokenonly rate, but for intra blocks, tx_size is always coded - // (prediction granularity), so we account for it in the full rate, - // not the tokenonly rate. - this_rate_tokenonly -= - tx_size_cost(&cpi->common, x, bsize, mbmi->tx_size); - } - this_rate = - this_rd_stats.rate + - intra_mode_info_cost_y(cpi, x, mbmi, bsize, bmode_costs[mbmi->mode]); - this_rd = RDCOST(x->rdmult, this_rate, this_distortion); - if (this_rd < best_rd) { - best_mbmi = *mbmi; - best_rd = this_rd; - beat_best_rd = 1; - *rate = this_rate; - *rate_tokenonly = this_rate_tokenonly; - *distortion = this_distortion; - *skippable = s; - memcpy(ctx->blk_skip, x->blk_skip, - sizeof(x->blk_skip[0]) * ctx->num_4x4_blk); - } - } - - if (try_palette) { - rd_pick_palette_intra_sby( - cpi, x, bsize, mi_row, mi_col, bmode_costs[DC_PRED], &best_mbmi, - best_palette_color_map, &best_rd, &best_model_rd, rate, rate_tokenonly, - distortion, skippable, ctx, ctx->blk_skip); - } - - if (beat_best_rd && av1_filter_intra_allowed_bsize(&cpi->common, bsize)) { - if (rd_pick_filter_intra_sby( - cpi, x, mi_row, mi_col, rate, rate_tokenonly, distortion, skippable, - bsize, bmode_costs[DC_PRED], &best_rd, &best_model_rd, ctx)) { - best_mbmi = *mbmi; - } - } - - // If previous searches use only the default tx type, do an extra search for - // the best tx type. - if (x->use_default_intra_tx_type) { - *mbmi = best_mbmi; - x->use_default_intra_tx_type = 0; - intra_block_yrd(cpi, x, bsize, bmode_costs, &best_rd, rate, rate_tokenonly, - distortion, skippable, &best_mbmi, ctx); - } - - *mbmi = best_mbmi; - return best_rd; -} - -// Return value 0: early termination triggered, no valid rd cost available; -// 1: rd cost values are valid. -static int super_block_uvrd(const AV1_COMP *const cpi, MACROBLOCK *x, - RD_STATS *rd_stats, BLOCK_SIZE bsize, - int64_t ref_best_rd) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = xd->mi[0]; - struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_U]; - const TX_SIZE uv_tx_size = av1_get_tx_size(AOM_PLANE_U, xd); - int plane; - int is_cost_valid = 1; - const int is_inter = is_inter_block(mbmi); - int64_t this_rd = 0, skip_rd = 0; - av1_init_rd_stats(rd_stats); - - if (ref_best_rd < 0) is_cost_valid = 0; - - if (x->skip_chroma_rd) return is_cost_valid; - - bsize = scale_chroma_bsize(bsize, pd->subsampling_x, pd->subsampling_y); - - if (is_inter && is_cost_valid) { - for (plane = 1; plane < MAX_MB_PLANE; ++plane) - av1_subtract_plane(x, bsize, plane); - } - - if (is_cost_valid) { - for (plane = 1; plane < MAX_MB_PLANE; ++plane) { - RD_STATS pn_rd_stats; - int64_t chroma_ref_best_rd = ref_best_rd; - // For inter blocks, refined ref_best_rd is used for early exit - // For intra blocks, even though current rd crosses ref_best_rd, early - // exit is not recommended as current rd is used for gating subsequent - // modes as well (say, for angular modes) - // TODO(any): Extend the early exit mechanism for intra modes as well - if (cpi->sf.perform_best_rd_based_gating_for_chroma && is_inter && - chroma_ref_best_rd != INT64_MAX) - chroma_ref_best_rd = ref_best_rd - AOMMIN(this_rd, skip_rd); - txfm_rd_in_plane(x, cpi, &pn_rd_stats, chroma_ref_best_rd, 0, plane, - bsize, uv_tx_size, cpi->sf.use_fast_coef_costing, - FTXS_NONE, 0); - if (pn_rd_stats.rate == INT_MAX) { - is_cost_valid = 0; - break; - } - av1_merge_rd_stats(rd_stats, &pn_rd_stats); - this_rd = RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist); - skip_rd = RDCOST(x->rdmult, 0, rd_stats->sse); - if (AOMMIN(this_rd, skip_rd) > ref_best_rd) { - is_cost_valid = 0; - break; - } - } - } - - if (!is_cost_valid) { - // reset cost value - av1_invalid_rd_stats(rd_stats); - } - - return is_cost_valid; -} - -// Pick transform type for a transform block of tx_size. -static void tx_type_rd(const AV1_COMP *cpi, MACROBLOCK *x, TX_SIZE tx_size, - int blk_row, int blk_col, int plane, int block, - int plane_bsize, TXB_CTX *txb_ctx, RD_STATS *rd_stats, - FAST_TX_SEARCH_MODE ftxs_mode, int64_t ref_rdcost, - TXB_RD_INFO *rd_info_array) { - const struct macroblock_plane *const p = &x->plane[plane]; - const uint16_t cur_joint_ctx = - (txb_ctx->dc_sign_ctx << 8) + txb_ctx->txb_skip_ctx; - const int txk_type_idx = - av1_get_txk_type_index(plane_bsize, blk_row, blk_col); - // Look up RD and terminate early in case when we've already processed exactly - // the same residual with exactly the same entropy context. - if (rd_info_array != NULL && rd_info_array->valid && - rd_info_array->entropy_context == cur_joint_ctx) { - if (plane == 0) - x->e_mbd.mi[0]->txk_type[txk_type_idx] = rd_info_array->tx_type; - const TX_TYPE ref_tx_type = - av1_get_tx_type(get_plane_type(plane), &x->e_mbd, blk_row, blk_col, - tx_size, cpi->common.reduced_tx_set_used); - if (ref_tx_type == rd_info_array->tx_type) { - rd_stats->rate += rd_info_array->rate; - rd_stats->dist += rd_info_array->dist; - rd_stats->sse += rd_info_array->sse; - rd_stats->skip &= rd_info_array->eob == 0; - p->eobs[block] = rd_info_array->eob; - p->txb_entropy_ctx[block] = rd_info_array->txb_entropy_ctx; - return; - } - } - - RD_STATS this_rd_stats; - search_txk_type(cpi, x, plane, block, blk_row, blk_col, plane_bsize, tx_size, - txb_ctx, ftxs_mode, 0, 0, ref_rdcost, &this_rd_stats); - - av1_merge_rd_stats(rd_stats, &this_rd_stats); - - // Save RD results for possible reuse in future. - if (rd_info_array != NULL) { - rd_info_array->valid = 1; - rd_info_array->entropy_context = cur_joint_ctx; - rd_info_array->rate = this_rd_stats.rate; - rd_info_array->dist = this_rd_stats.dist; - rd_info_array->sse = this_rd_stats.sse; - rd_info_array->eob = p->eobs[block]; - rd_info_array->txb_entropy_ctx = p->txb_entropy_ctx[block]; - if (plane == 0) { - rd_info_array->tx_type = x->e_mbd.mi[0]->txk_type[txk_type_idx]; - } - } -} - -static void get_mean_and_dev(const int16_t *data, int stride, int bw, int bh, - float *mean, float *dev) { - int x_sum = 0; - uint64_t x2_sum = 0; - for (int i = 0; i < bh; ++i) { - for (int j = 0; j < bw; ++j) { - const int val = data[j]; - x_sum += val; - x2_sum += val * val; - } - data += stride; - } - - const int num = bw * bh; - const float e_x = (float)x_sum / num; - const float e_x2 = (float)((double)x2_sum / num); - const float diff = e_x2 - e_x * e_x; - *dev = (diff > 0) ? sqrtf(diff) : 0; - *mean = e_x; -} - -static void get_mean_and_dev_float(const float *data, int stride, int bw, - int bh, float *mean, float *dev) { - float x_sum = 0; - float x2_sum = 0; - for (int i = 0; i < bh; ++i) { - for (int j = 0; j < bw; ++j) { - const float val = data[j]; - x_sum += val; - x2_sum += val * val; - } - data += stride; - } - - const int num = bw * bh; - const float e_x = x_sum / num; - const float e_x2 = x2_sum / num; - const float diff = e_x2 - e_x * e_x; - *dev = (diff > 0) ? sqrtf(diff) : 0; - *mean = e_x; -} - -// Feature used by the model to predict tx split: the mean and standard -// deviation values of the block and sub-blocks. -static void get_mean_dev_features(const int16_t *data, int stride, int bw, - int bh, int levels, float *feature) { - int feature_idx = 0; - int width = bw; - int height = bh; - const int16_t *const data_ptr = &data[0]; - for (int lv = 0; lv < levels; ++lv) { - if (width < 2 || height < 2) break; - float mean_buf[16]; - float dev_buf[16]; - int blk_idx = 0; - for (int row = 0; row < bh; row += height) { - for (int col = 0; col < bw; col += width) { - float mean, dev; - get_mean_and_dev(data_ptr + row * stride + col, stride, width, height, - &mean, &dev); - feature[feature_idx++] = mean; - feature[feature_idx++] = dev; - mean_buf[blk_idx] = mean; - dev_buf[blk_idx++] = dev; - } - } - if (blk_idx > 1) { - float mean, dev; - // Deviation of means. - get_mean_and_dev_float(mean_buf, 1, 1, blk_idx, &mean, &dev); - feature[feature_idx++] = dev; - // Mean of deviations. - get_mean_and_dev_float(dev_buf, 1, 1, blk_idx, &mean, &dev); - feature[feature_idx++] = mean; - } - // Reduce the block size when proceeding to the next level. - if (height == width) { - height = height >> 1; - width = width >> 1; - } else if (height > width) { - height = height >> 1; - } else { - width = width >> 1; - } - } -} - -static int ml_predict_tx_split(MACROBLOCK *x, BLOCK_SIZE bsize, int blk_row, - int blk_col, TX_SIZE tx_size) { - const NN_CONFIG *nn_config = av1_tx_split_nnconfig_map[tx_size]; - if (!nn_config) return -1; - - const int diff_stride = block_size_wide[bsize]; - const int16_t *diff = - x->plane[0].src_diff + 4 * blk_row * diff_stride + 4 * blk_col; - const int bw = tx_size_wide[tx_size]; - const int bh = tx_size_high[tx_size]; - aom_clear_system_state(); - - float features[64] = { 0.0f }; - get_mean_dev_features(diff, diff_stride, bw, bh, 2, features); - - float score = 0.0f; - av1_nn_predict(features, nn_config, &score); - aom_clear_system_state(); - if (score > 8.0f) return 100; - if (score < -8.0f) return 0; - score = 1.0f / (1.0f + (float)exp(-score)); - return (int)(score * 100); -} - -typedef struct { - int64_t rd; - int txb_entropy_ctx; - TX_TYPE tx_type; -} TxCandidateInfo; - -static void try_tx_block_no_split( - const AV1_COMP *cpi, MACROBLOCK *x, int blk_row, int blk_col, int block, - TX_SIZE tx_size, int depth, BLOCK_SIZE plane_bsize, - const ENTROPY_CONTEXT *ta, const ENTROPY_CONTEXT *tl, - int txfm_partition_ctx, RD_STATS *rd_stats, int64_t ref_best_rd, - FAST_TX_SEARCH_MODE ftxs_mode, TXB_RD_INFO_NODE *rd_info_node, - TxCandidateInfo *no_split) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = xd->mi[0]; - struct macroblock_plane *const p = &x->plane[0]; - const int bw = block_size_wide[plane_bsize] >> tx_size_wide_log2[0]; - - no_split->rd = INT64_MAX; - no_split->txb_entropy_ctx = 0; - no_split->tx_type = TX_TYPES; - - const ENTROPY_CONTEXT *const pta = ta + blk_col; - const ENTROPY_CONTEXT *const ptl = tl + blk_row; - - const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size); - TXB_CTX txb_ctx; - get_txb_ctx(plane_bsize, tx_size, 0, pta, ptl, &txb_ctx); - const int zero_blk_rate = x->coeff_costs[txs_ctx][PLANE_TYPE_Y] - .txb_skip_cost[txb_ctx.txb_skip_ctx][1]; - - rd_stats->ref_rdcost = ref_best_rd; - rd_stats->zero_rate = zero_blk_rate; - const int index = av1_get_txb_size_index(plane_bsize, blk_row, blk_col); - mbmi->inter_tx_size[index] = tx_size; - tx_type_rd(cpi, x, tx_size, blk_row, blk_col, 0, block, plane_bsize, &txb_ctx, - rd_stats, ftxs_mode, ref_best_rd, - rd_info_node != NULL ? rd_info_node->rd_info_array : NULL); - assert(rd_stats->rate < INT_MAX); - - if ((RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist) >= - RDCOST(x->rdmult, zero_blk_rate, rd_stats->sse) || - rd_stats->skip == 1) && - !xd->lossless[mbmi->segment_id]) { -#if CONFIG_RD_DEBUG - av1_update_txb_coeff_cost(rd_stats, 0, tx_size, blk_row, blk_col, - zero_blk_rate - rd_stats->rate); -#endif // CONFIG_RD_DEBUG - rd_stats->rate = zero_blk_rate; - rd_stats->dist = rd_stats->sse; - rd_stats->skip = 1; - set_blk_skip(x, 0, blk_row * bw + blk_col, 1); - p->eobs[block] = 0; - update_txk_array(mbmi->txk_type, plane_bsize, blk_row, blk_col, tx_size, - DCT_DCT); - } else { - set_blk_skip(x, 0, blk_row * bw + blk_col, 0); - rd_stats->skip = 0; - } - - if (tx_size > TX_4X4 && depth < MAX_VARTX_DEPTH) - rd_stats->rate += x->txfm_partition_cost[txfm_partition_ctx][0]; - - no_split->rd = RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist); - no_split->txb_entropy_ctx = p->txb_entropy_ctx[block]; - const int txk_type_idx = - av1_get_txk_type_index(plane_bsize, blk_row, blk_col); - no_split->tx_type = mbmi->txk_type[txk_type_idx]; -} - -static void select_tx_block(const AV1_COMP *cpi, MACROBLOCK *x, int blk_row, - int blk_col, int block, TX_SIZE tx_size, int depth, - BLOCK_SIZE plane_bsize, ENTROPY_CONTEXT *ta, - ENTROPY_CONTEXT *tl, TXFM_CONTEXT *tx_above, - TXFM_CONTEXT *tx_left, RD_STATS *rd_stats, - int64_t prev_level_rd, int64_t ref_best_rd, - int *is_cost_valid, FAST_TX_SEARCH_MODE ftxs_mode, - TXB_RD_INFO_NODE *rd_info_node); - -static void try_tx_block_split( - const AV1_COMP *cpi, MACROBLOCK *x, int blk_row, int blk_col, int block, - TX_SIZE tx_size, int depth, BLOCK_SIZE plane_bsize, ENTROPY_CONTEXT *ta, - ENTROPY_CONTEXT *tl, TXFM_CONTEXT *tx_above, TXFM_CONTEXT *tx_left, - int txfm_partition_ctx, int64_t no_split_rd, int64_t ref_best_rd, - FAST_TX_SEARCH_MODE ftxs_mode, TXB_RD_INFO_NODE *rd_info_node, - RD_STATS *split_rd_stats, int64_t *split_rd) { - assert(tx_size < TX_SIZES_ALL); - MACROBLOCKD *const xd = &x->e_mbd; - const int max_blocks_high = max_block_high(xd, plane_bsize, 0); - const int max_blocks_wide = max_block_wide(xd, plane_bsize, 0); - const TX_SIZE sub_txs = sub_tx_size_map[tx_size]; - const int bsw = tx_size_wide_unit[sub_txs]; - const int bsh = tx_size_high_unit[sub_txs]; - const int sub_step = bsw * bsh; - const int nblks = - (tx_size_high_unit[tx_size] / bsh) * (tx_size_wide_unit[tx_size] / bsw); - assert(nblks > 0); - int blk_idx = 0; - int64_t tmp_rd = 0; - *split_rd = INT64_MAX; - split_rd_stats->rate = x->txfm_partition_cost[txfm_partition_ctx][1]; - - for (int r = 0; r < tx_size_high_unit[tx_size]; r += bsh) { - for (int c = 0; c < tx_size_wide_unit[tx_size]; c += bsw, ++blk_idx) { - assert(blk_idx < 4); - const int offsetr = blk_row + r; - const int offsetc = blk_col + c; - if (offsetr >= max_blocks_high || offsetc >= max_blocks_wide) continue; - - RD_STATS this_rd_stats; - int this_cost_valid = 1; - select_tx_block( - cpi, x, offsetr, offsetc, block, sub_txs, depth + 1, plane_bsize, ta, - tl, tx_above, tx_left, &this_rd_stats, no_split_rd / nblks, - ref_best_rd - tmp_rd, &this_cost_valid, ftxs_mode, - (rd_info_node != NULL) ? rd_info_node->children[blk_idx] : NULL); - if (!this_cost_valid) return; - av1_merge_rd_stats(split_rd_stats, &this_rd_stats); - tmp_rd = RDCOST(x->rdmult, split_rd_stats->rate, split_rd_stats->dist); - if (no_split_rd < tmp_rd) return; - block += sub_step; - } - } - - *split_rd = tmp_rd; -} - -// Search for the best tx partition/type for a given luma block. -static void select_tx_block(const AV1_COMP *cpi, MACROBLOCK *x, int blk_row, - int blk_col, int block, TX_SIZE tx_size, int depth, - BLOCK_SIZE plane_bsize, ENTROPY_CONTEXT *ta, - ENTROPY_CONTEXT *tl, TXFM_CONTEXT *tx_above, - TXFM_CONTEXT *tx_left, RD_STATS *rd_stats, - int64_t prev_level_rd, int64_t ref_best_rd, - int *is_cost_valid, FAST_TX_SEARCH_MODE ftxs_mode, - TXB_RD_INFO_NODE *rd_info_node) { - assert(tx_size < TX_SIZES_ALL); - av1_init_rd_stats(rd_stats); - if (ref_best_rd < 0) { - *is_cost_valid = 0; - return; - } - - MACROBLOCKD *const xd = &x->e_mbd; - const int max_blocks_high = max_block_high(xd, plane_bsize, 0); - const int max_blocks_wide = max_block_wide(xd, plane_bsize, 0); - if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return; - - const int bw = block_size_wide[plane_bsize] >> tx_size_wide_log2[0]; - MB_MODE_INFO *const mbmi = xd->mi[0]; - const int ctx = txfm_partition_context(tx_above + blk_col, tx_left + blk_row, - mbmi->sb_type, tx_size); - struct macroblock_plane *const p = &x->plane[0]; - - const int try_no_split = - cpi->oxcf.enable_tx64 || txsize_sqr_up_map[tx_size] != TX_64X64; - int try_split = tx_size > TX_4X4 && depth < MAX_VARTX_DEPTH; -#if CONFIG_DIST_8X8 - if (x->using_dist_8x8) - try_split &= tx_size_wide[tx_size] >= 16 && tx_size_high[tx_size] >= 16; -#endif - TxCandidateInfo no_split = { INT64_MAX, 0, TX_TYPES }; - - // TX no split - if (try_no_split) { - try_tx_block_no_split(cpi, x, blk_row, blk_col, block, tx_size, depth, - plane_bsize, ta, tl, ctx, rd_stats, ref_best_rd, - ftxs_mode, rd_info_node, &no_split); - - if (cpi->sf.adaptive_txb_search_level && - (no_split.rd - - (no_split.rd >> (1 + cpi->sf.adaptive_txb_search_level))) > - ref_best_rd) { - *is_cost_valid = 0; - return; - } - - if (cpi->sf.txb_split_cap) { - if (p->eobs[block] == 0) try_split = 0; - } - - if (cpi->sf.adaptive_txb_search_level && - (no_split.rd - - (no_split.rd >> (2 + cpi->sf.adaptive_txb_search_level))) > - prev_level_rd) { - try_split = 0; - } - } - - if (x->e_mbd.bd == 8 && !x->cb_partition_scan && try_split) { - const int threshold = cpi->sf.tx_type_search.ml_tx_split_thresh; - if (threshold >= 0) { - const int split_score = - ml_predict_tx_split(x, plane_bsize, blk_row, blk_col, tx_size); - if (split_score >= 0 && split_score < threshold) try_split = 0; - } - } - - // TX split - int64_t split_rd = INT64_MAX; - RD_STATS split_rd_stats; - av1_init_rd_stats(&split_rd_stats); - if (try_split) { - try_tx_block_split(cpi, x, blk_row, blk_col, block, tx_size, depth, - plane_bsize, ta, tl, tx_above, tx_left, ctx, no_split.rd, - AOMMIN(no_split.rd, ref_best_rd), ftxs_mode, - rd_info_node, &split_rd_stats, &split_rd); - } - - if (no_split.rd < split_rd) { - ENTROPY_CONTEXT *pta = ta + blk_col; - ENTROPY_CONTEXT *ptl = tl + blk_row; - const TX_SIZE tx_size_selected = tx_size; - p->txb_entropy_ctx[block] = no_split.txb_entropy_ctx; - av1_set_txb_context(x, 0, block, tx_size_selected, pta, ptl); - txfm_partition_update(tx_above + blk_col, tx_left + blk_row, tx_size, - tx_size); - for (int idy = 0; idy < tx_size_high_unit[tx_size]; ++idy) { - for (int idx = 0; idx < tx_size_wide_unit[tx_size]; ++idx) { - const int index = - av1_get_txb_size_index(plane_bsize, blk_row + idy, blk_col + idx); - mbmi->inter_tx_size[index] = tx_size_selected; - } - } - mbmi->tx_size = tx_size_selected; - update_txk_array(mbmi->txk_type, plane_bsize, blk_row, blk_col, tx_size, - no_split.tx_type); - set_blk_skip(x, 0, blk_row * bw + blk_col, rd_stats->skip); - } else { - *rd_stats = split_rd_stats; - if (split_rd == INT64_MAX) *is_cost_valid = 0; - } -} - -static int64_t select_tx_size_and_type(const AV1_COMP *cpi, MACROBLOCK *x, - RD_STATS *rd_stats, BLOCK_SIZE bsize, - int64_t ref_best_rd, - TXB_RD_INFO_NODE *rd_info_tree) { - MACROBLOCKD *const xd = &x->e_mbd; - assert(is_inter_block(xd->mi[0])); - - // TODO(debargha): enable this as a speed feature where the - // select_inter_block_yrd() function above will use a simplified search - // such as not using full optimize, but the inter_block_yrd() function - // will use more complex search given that the transform partitions have - // already been decided. - - const int fast_tx_search = cpi->sf.tx_size_search_method > USE_FULL_RD; - int64_t rd_thresh = ref_best_rd; - if (fast_tx_search && rd_thresh < INT64_MAX) { - if (INT64_MAX - rd_thresh > (rd_thresh >> 3)) rd_thresh += (rd_thresh >> 3); - } - assert(rd_thresh > 0); - - const FAST_TX_SEARCH_MODE ftxs_mode = - fast_tx_search ? FTXS_DCT_AND_1D_DCT_ONLY : FTXS_NONE; - const struct macroblockd_plane *const pd = &xd->plane[0]; - const BLOCK_SIZE plane_bsize = - get_plane_block_size(bsize, pd->subsampling_x, pd->subsampling_y); - const int mi_width = mi_size_wide[plane_bsize]; - const int mi_height = mi_size_high[plane_bsize]; - ENTROPY_CONTEXT ctxa[MAX_MIB_SIZE]; - ENTROPY_CONTEXT ctxl[MAX_MIB_SIZE]; - TXFM_CONTEXT tx_above[MAX_MIB_SIZE]; - TXFM_CONTEXT tx_left[MAX_MIB_SIZE]; - av1_get_entropy_contexts(bsize, pd, ctxa, ctxl); - memcpy(tx_above, xd->above_txfm_context, sizeof(TXFM_CONTEXT) * mi_width); - memcpy(tx_left, xd->left_txfm_context, sizeof(TXFM_CONTEXT) * mi_height); - - const int skip_ctx = av1_get_skip_context(xd); - const int s0 = x->skip_cost[skip_ctx][0]; - const int s1 = x->skip_cost[skip_ctx][1]; - const int init_depth = - get_search_init_depth(mi_width, mi_height, 1, &cpi->sf); - const TX_SIZE max_tx_size = max_txsize_rect_lookup[plane_bsize]; - const int bh = tx_size_high_unit[max_tx_size]; - const int bw = tx_size_wide_unit[max_tx_size]; - const int step = bw * bh; - int64_t skip_rd = RDCOST(x->rdmult, s1, 0); - int64_t this_rd = RDCOST(x->rdmult, s0, 0); - int block = 0; - - av1_init_rd_stats(rd_stats); - for (int idy = 0; idy < mi_height; idy += bh) { - for (int idx = 0; idx < mi_width; idx += bw) { - const int64_t best_rd_sofar = - (rd_thresh == INT64_MAX) ? INT64_MAX - : (rd_thresh - (AOMMIN(skip_rd, this_rd))); - int is_cost_valid = 1; - RD_STATS pn_rd_stats; - select_tx_block(cpi, x, idy, idx, block, max_tx_size, init_depth, - plane_bsize, ctxa, ctxl, tx_above, tx_left, &pn_rd_stats, - INT64_MAX, best_rd_sofar, &is_cost_valid, ftxs_mode, - rd_info_tree); - if (!is_cost_valid || pn_rd_stats.rate == INT_MAX) { - av1_invalid_rd_stats(rd_stats); - return INT64_MAX; - } - av1_merge_rd_stats(rd_stats, &pn_rd_stats); - skip_rd = RDCOST(x->rdmult, s1, rd_stats->sse); - this_rd = RDCOST(x->rdmult, rd_stats->rate + s0, rd_stats->dist); - block += step; - if (rd_info_tree != NULL) rd_info_tree += 1; - } - } - - if (skip_rd <= this_rd) { - rd_stats->skip = 1; - } else { - rd_stats->skip = 0; - } - - if (rd_stats->rate == INT_MAX) return INT64_MAX; - - // If fast_tx_search is true, only DCT and 1D DCT were tested in - // select_inter_block_yrd() above. Do a better search for tx type with - // tx sizes already decided. - if (fast_tx_search) { - if (!inter_block_yrd(cpi, x, rd_stats, bsize, ref_best_rd, FTXS_NONE)) - return INT64_MAX; - } - - int64_t rd; - if (rd_stats->skip) { - rd = RDCOST(x->rdmult, s1, rd_stats->sse); - } else { - rd = RDCOST(x->rdmult, rd_stats->rate + s0, rd_stats->dist); - if (!xd->lossless[xd->mi[0]->segment_id]) - rd = AOMMIN(rd, RDCOST(x->rdmult, s1, rd_stats->sse)); - } - - return rd; -} - -// Finds rd cost for a y block, given the transform size partitions -static void tx_block_yrd(const AV1_COMP *cpi, MACROBLOCK *x, int blk_row, - int blk_col, int block, TX_SIZE tx_size, - BLOCK_SIZE plane_bsize, int depth, - ENTROPY_CONTEXT *above_ctx, ENTROPY_CONTEXT *left_ctx, - TXFM_CONTEXT *tx_above, TXFM_CONTEXT *tx_left, - int64_t ref_best_rd, RD_STATS *rd_stats, - FAST_TX_SEARCH_MODE ftxs_mode) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = xd->mi[0]; - const int max_blocks_high = max_block_high(xd, plane_bsize, 0); - const int max_blocks_wide = max_block_wide(xd, plane_bsize, 0); - - assert(tx_size < TX_SIZES_ALL); - - if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return; - - const TX_SIZE plane_tx_size = mbmi->inter_tx_size[av1_get_txb_size_index( - plane_bsize, blk_row, blk_col)]; - - int ctx = txfm_partition_context(tx_above + blk_col, tx_left + blk_row, - mbmi->sb_type, tx_size); - - av1_init_rd_stats(rd_stats); - if (tx_size == plane_tx_size) { - ENTROPY_CONTEXT *ta = above_ctx + blk_col; - ENTROPY_CONTEXT *tl = left_ctx + blk_row; - const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size); - TXB_CTX txb_ctx; - get_txb_ctx(plane_bsize, tx_size, 0, ta, tl, &txb_ctx); - - const int zero_blk_rate = x->coeff_costs[txs_ctx][get_plane_type(0)] - .txb_skip_cost[txb_ctx.txb_skip_ctx][1]; - rd_stats->zero_rate = zero_blk_rate; - rd_stats->ref_rdcost = ref_best_rd; - tx_type_rd(cpi, x, tx_size, blk_row, blk_col, 0, block, plane_bsize, - &txb_ctx, rd_stats, ftxs_mode, ref_best_rd, NULL); - const int mi_width = block_size_wide[plane_bsize] >> tx_size_wide_log2[0]; - if (RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist) >= - RDCOST(x->rdmult, zero_blk_rate, rd_stats->sse) || - rd_stats->skip == 1) { - rd_stats->rate = zero_blk_rate; - rd_stats->dist = rd_stats->sse; - rd_stats->skip = 1; - set_blk_skip(x, 0, blk_row * mi_width + blk_col, 1); - x->plane[0].eobs[block] = 0; - x->plane[0].txb_entropy_ctx[block] = 0; - update_txk_array(mbmi->txk_type, plane_bsize, blk_row, blk_col, tx_size, - DCT_DCT); - } else { - rd_stats->skip = 0; - set_blk_skip(x, 0, blk_row * mi_width + blk_col, 0); - } - if (tx_size > TX_4X4 && depth < MAX_VARTX_DEPTH) - rd_stats->rate += x->txfm_partition_cost[ctx][0]; - av1_set_txb_context(x, 0, block, tx_size, ta, tl); - txfm_partition_update(tx_above + blk_col, tx_left + blk_row, tx_size, - tx_size); - } else { - const TX_SIZE sub_txs = sub_tx_size_map[tx_size]; - const int bsw = tx_size_wide_unit[sub_txs]; - const int bsh = tx_size_high_unit[sub_txs]; - const int step = bsh * bsw; - RD_STATS pn_rd_stats; - int64_t this_rd = 0; - assert(bsw > 0 && bsh > 0); - - for (int row = 0; row < tx_size_high_unit[tx_size]; row += bsh) { - for (int col = 0; col < tx_size_wide_unit[tx_size]; col += bsw) { - const int offsetr = blk_row + row; - const int offsetc = blk_col + col; - - if (offsetr >= max_blocks_high || offsetc >= max_blocks_wide) continue; - - av1_init_rd_stats(&pn_rd_stats); - tx_block_yrd(cpi, x, offsetr, offsetc, block, sub_txs, plane_bsize, - depth + 1, above_ctx, left_ctx, tx_above, tx_left, - ref_best_rd - this_rd, &pn_rd_stats, ftxs_mode); - if (pn_rd_stats.rate == INT_MAX) { - av1_invalid_rd_stats(rd_stats); - return; - } - av1_merge_rd_stats(rd_stats, &pn_rd_stats); - this_rd += RDCOST(x->rdmult, pn_rd_stats.rate, pn_rd_stats.dist); - block += step; - } - } - - if (tx_size > TX_4X4 && depth < MAX_VARTX_DEPTH) - rd_stats->rate += x->txfm_partition_cost[ctx][1]; - } -} - -// Return value 0: early termination triggered, no valid rd cost available; -// 1: rd cost values are valid. -static int inter_block_yrd(const AV1_COMP *cpi, MACROBLOCK *x, - RD_STATS *rd_stats, BLOCK_SIZE bsize, - int64_t ref_best_rd, FAST_TX_SEARCH_MODE ftxs_mode) { - MACROBLOCKD *const xd = &x->e_mbd; - int is_cost_valid = 1; - int64_t this_rd = 0; - - if (ref_best_rd < 0) is_cost_valid = 0; - - av1_init_rd_stats(rd_stats); - - if (is_cost_valid) { - const struct macroblockd_plane *const pd = &xd->plane[0]; - const BLOCK_SIZE plane_bsize = - get_plane_block_size(bsize, pd->subsampling_x, pd->subsampling_y); - const int mi_width = mi_size_wide[plane_bsize]; - const int mi_height = mi_size_high[plane_bsize]; - const TX_SIZE max_tx_size = get_vartx_max_txsize(xd, plane_bsize, 0); - const int bh = tx_size_high_unit[max_tx_size]; - const int bw = tx_size_wide_unit[max_tx_size]; - const int init_depth = - get_search_init_depth(mi_width, mi_height, 1, &cpi->sf); - int idx, idy; - int block = 0; - int step = tx_size_wide_unit[max_tx_size] * tx_size_high_unit[max_tx_size]; - ENTROPY_CONTEXT ctxa[MAX_MIB_SIZE]; - ENTROPY_CONTEXT ctxl[MAX_MIB_SIZE]; - TXFM_CONTEXT tx_above[MAX_MIB_SIZE]; - TXFM_CONTEXT tx_left[MAX_MIB_SIZE]; - RD_STATS pn_rd_stats; - - av1_get_entropy_contexts(bsize, pd, ctxa, ctxl); - memcpy(tx_above, xd->above_txfm_context, sizeof(TXFM_CONTEXT) * mi_width); - memcpy(tx_left, xd->left_txfm_context, sizeof(TXFM_CONTEXT) * mi_height); - - for (idy = 0; idy < mi_height; idy += bh) { - for (idx = 0; idx < mi_width; idx += bw) { - av1_init_rd_stats(&pn_rd_stats); - tx_block_yrd(cpi, x, idy, idx, block, max_tx_size, plane_bsize, - init_depth, ctxa, ctxl, tx_above, tx_left, - ref_best_rd - this_rd, &pn_rd_stats, ftxs_mode); - if (pn_rd_stats.rate == INT_MAX) { - av1_invalid_rd_stats(rd_stats); - return 0; - } - av1_merge_rd_stats(rd_stats, &pn_rd_stats); - this_rd += - AOMMIN(RDCOST(x->rdmult, pn_rd_stats.rate, pn_rd_stats.dist), - RDCOST(x->rdmult, pn_rd_stats.zero_rate, pn_rd_stats.sse)); - block += step; - } - } - } - - const int skip_ctx = av1_get_skip_context(xd); - const int s0 = x->skip_cost[skip_ctx][0]; - const int s1 = x->skip_cost[skip_ctx][1]; - int64_t skip_rd = RDCOST(x->rdmult, s1, rd_stats->sse); - this_rd = RDCOST(x->rdmult, rd_stats->rate + s0, rd_stats->dist); - if (skip_rd < this_rd) { - this_rd = skip_rd; - rd_stats->rate = 0; - rd_stats->dist = rd_stats->sse; - rd_stats->skip = 1; - } - if (this_rd > ref_best_rd) is_cost_valid = 0; - - if (!is_cost_valid) { - // reset cost value - av1_invalid_rd_stats(rd_stats); - } - return is_cost_valid; -} - -static int find_tx_size_rd_info(TXB_RD_RECORD *cur_record, - const uint32_t hash) { - // Linear search through the circular buffer to find matching hash. - for (int i = cur_record->index_start - 1; i >= 0; i--) { - if (cur_record->hash_vals[i] == hash) return i; - } - for (int i = cur_record->num - 1; i >= cur_record->index_start; i--) { - if (cur_record->hash_vals[i] == hash) return i; - } - int index; - // If not found - add new RD info into the buffer and return its index - if (cur_record->num < TX_SIZE_RD_RECORD_BUFFER_LEN) { - index = (cur_record->index_start + cur_record->num) % - TX_SIZE_RD_RECORD_BUFFER_LEN; - cur_record->num++; - } else { - index = cur_record->index_start; - cur_record->index_start = - (cur_record->index_start + 1) % TX_SIZE_RD_RECORD_BUFFER_LEN; - } - - cur_record->hash_vals[index] = hash; - av1_zero(cur_record->tx_rd_info[index]); - return index; -} - -typedef struct { - int leaf; - int8_t children[4]; -} RD_RECORD_IDX_NODE; - -static const RD_RECORD_IDX_NODE rd_record_tree_8x8[] = { - { 1, { 0 } }, -}; - -static const RD_RECORD_IDX_NODE rd_record_tree_8x16[] = { - { 0, { 1, 2, -1, -1 } }, - { 1, { 0, 0, 0, 0 } }, - { 1, { 0, 0, 0, 0 } }, -}; - -static const RD_RECORD_IDX_NODE rd_record_tree_16x8[] = { - { 0, { 1, 2, -1, -1 } }, - { 1, { 0 } }, - { 1, { 0 } }, -}; - -static const RD_RECORD_IDX_NODE rd_record_tree_16x16[] = { - { 0, { 1, 2, 3, 4 } }, { 1, { 0 } }, { 1, { 0 } }, { 1, { 0 } }, { 1, { 0 } }, -}; - -static const RD_RECORD_IDX_NODE rd_record_tree_1_2[] = { - { 0, { 1, 2, -1, -1 } }, - { 0, { 3, 4, 5, 6 } }, - { 0, { 7, 8, 9, 10 } }, -}; - -static const RD_RECORD_IDX_NODE rd_record_tree_2_1[] = { - { 0, { 1, 2, -1, -1 } }, - { 0, { 3, 4, 7, 8 } }, - { 0, { 5, 6, 9, 10 } }, -}; - -static const RD_RECORD_IDX_NODE rd_record_tree_sqr[] = { - { 0, { 1, 2, 3, 4 } }, { 0, { 5, 6, 9, 10 } }, { 0, { 7, 8, 11, 12 } }, - { 0, { 13, 14, 17, 18 } }, { 0, { 15, 16, 19, 20 } }, -}; - -static const RD_RECORD_IDX_NODE rd_record_tree_64x128[] = { - { 0, { 2, 3, 4, 5 } }, { 0, { 6, 7, 8, 9 } }, - { 0, { 10, 11, 14, 15 } }, { 0, { 12, 13, 16, 17 } }, - { 0, { 18, 19, 22, 23 } }, { 0, { 20, 21, 24, 25 } }, - { 0, { 26, 27, 30, 31 } }, { 0, { 28, 29, 32, 33 } }, - { 0, { 34, 35, 38, 39 } }, { 0, { 36, 37, 40, 41 } }, -}; - -static const RD_RECORD_IDX_NODE rd_record_tree_128x64[] = { - { 0, { 2, 3, 6, 7 } }, { 0, { 4, 5, 8, 9 } }, - { 0, { 10, 11, 18, 19 } }, { 0, { 12, 13, 20, 21 } }, - { 0, { 14, 15, 22, 23 } }, { 0, { 16, 17, 24, 25 } }, - { 0, { 26, 27, 34, 35 } }, { 0, { 28, 29, 36, 37 } }, - { 0, { 30, 31, 38, 39 } }, { 0, { 32, 33, 40, 41 } }, -}; - -static const RD_RECORD_IDX_NODE rd_record_tree_128x128[] = { - { 0, { 4, 5, 8, 9 } }, { 0, { 6, 7, 10, 11 } }, - { 0, { 12, 13, 16, 17 } }, { 0, { 14, 15, 18, 19 } }, - { 0, { 20, 21, 28, 29 } }, { 0, { 22, 23, 30, 31 } }, - { 0, { 24, 25, 32, 33 } }, { 0, { 26, 27, 34, 35 } }, - { 0, { 36, 37, 44, 45 } }, { 0, { 38, 39, 46, 47 } }, - { 0, { 40, 41, 48, 49 } }, { 0, { 42, 43, 50, 51 } }, - { 0, { 52, 53, 60, 61 } }, { 0, { 54, 55, 62, 63 } }, - { 0, { 56, 57, 64, 65 } }, { 0, { 58, 59, 66, 67 } }, - { 0, { 68, 69, 76, 77 } }, { 0, { 70, 71, 78, 79 } }, - { 0, { 72, 73, 80, 81 } }, { 0, { 74, 75, 82, 83 } }, -}; - -static const RD_RECORD_IDX_NODE rd_record_tree_1_4[] = { - { 0, { 1, -1, 2, -1 } }, - { 0, { 3, 4, -1, -1 } }, - { 0, { 5, 6, -1, -1 } }, -}; - -static const RD_RECORD_IDX_NODE rd_record_tree_4_1[] = { - { 0, { 1, 2, -1, -1 } }, - { 0, { 3, 4, -1, -1 } }, - { 0, { 5, 6, -1, -1 } }, -}; - -static const RD_RECORD_IDX_NODE *rd_record_tree[BLOCK_SIZES_ALL] = { - NULL, // BLOCK_4X4 - NULL, // BLOCK_4X8 - NULL, // BLOCK_8X4 - rd_record_tree_8x8, // BLOCK_8X8 - rd_record_tree_8x16, // BLOCK_8X16 - rd_record_tree_16x8, // BLOCK_16X8 - rd_record_tree_16x16, // BLOCK_16X16 - rd_record_tree_1_2, // BLOCK_16X32 - rd_record_tree_2_1, // BLOCK_32X16 - rd_record_tree_sqr, // BLOCK_32X32 - rd_record_tree_1_2, // BLOCK_32X64 - rd_record_tree_2_1, // BLOCK_64X32 - rd_record_tree_sqr, // BLOCK_64X64 - rd_record_tree_64x128, // BLOCK_64X128 - rd_record_tree_128x64, // BLOCK_128X64 - rd_record_tree_128x128, // BLOCK_128X128 - NULL, // BLOCK_4X16 - NULL, // BLOCK_16X4 - rd_record_tree_1_4, // BLOCK_8X32 - rd_record_tree_4_1, // BLOCK_32X8 - rd_record_tree_1_4, // BLOCK_16X64 - rd_record_tree_4_1, // BLOCK_64X16 -}; - -static const int rd_record_tree_size[BLOCK_SIZES_ALL] = { - 0, // BLOCK_4X4 - 0, // BLOCK_4X8 - 0, // BLOCK_8X4 - sizeof(rd_record_tree_8x8) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_8X8 - sizeof(rd_record_tree_8x16) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_8X16 - sizeof(rd_record_tree_16x8) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_16X8 - sizeof(rd_record_tree_16x16) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_16X16 - sizeof(rd_record_tree_1_2) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_16X32 - sizeof(rd_record_tree_2_1) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_32X16 - sizeof(rd_record_tree_sqr) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_32X32 - sizeof(rd_record_tree_1_2) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_32X64 - sizeof(rd_record_tree_2_1) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_64X32 - sizeof(rd_record_tree_sqr) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_64X64 - sizeof(rd_record_tree_64x128) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_64X128 - sizeof(rd_record_tree_128x64) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_128X64 - sizeof(rd_record_tree_128x128) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_128X128 - 0, // BLOCK_4X16 - 0, // BLOCK_16X4 - sizeof(rd_record_tree_1_4) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_8X32 - sizeof(rd_record_tree_4_1) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_32X8 - sizeof(rd_record_tree_1_4) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_16X64 - sizeof(rd_record_tree_4_1) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_64X16 -}; - -static INLINE void init_rd_record_tree(TXB_RD_INFO_NODE *tree, - BLOCK_SIZE bsize) { - const RD_RECORD_IDX_NODE *rd_record = rd_record_tree[bsize]; - const int size = rd_record_tree_size[bsize]; - for (int i = 0; i < size; ++i) { - if (rd_record[i].leaf) { - av1_zero(tree[i].children); - } else { - for (int j = 0; j < 4; ++j) { - const int8_t idx = rd_record[i].children[j]; - tree[i].children[j] = idx > 0 ? &tree[idx] : NULL; - } - } - } -} - -// Go through all TX blocks that could be used in TX size search, compute -// residual hash values for them and find matching RD info that stores previous -// RD search results for these TX blocks. The idea is to prevent repeated -// rate/distortion computations that happen because of the combination of -// partition and TX size search. The resulting RD info records are returned in -// the form of a quadtree for easier access in actual TX size search. -static int find_tx_size_rd_records(MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row, - int mi_col, TXB_RD_INFO_NODE *dst_rd_info) { - TXB_RD_RECORD *rd_records_table[4] = { x->txb_rd_record_8X8, - x->txb_rd_record_16X16, - x->txb_rd_record_32X32, - x->txb_rd_record_64X64 }; - const TX_SIZE max_square_tx_size = max_txsize_lookup[bsize]; - const int bw = block_size_wide[bsize]; - const int bh = block_size_high[bsize]; - - // Hashing is performed only for square TX sizes larger than TX_4X4 - if (max_square_tx_size < TX_8X8) return 0; - const int diff_stride = bw; - const struct macroblock_plane *const p = &x->plane[0]; - const int16_t *diff = &p->src_diff[0]; - init_rd_record_tree(dst_rd_info, bsize); - // Coordinates of the top-left corner of current block within the superblock - // measured in pixels: - const int mi_row_in_sb = (mi_row % MAX_MIB_SIZE) << MI_SIZE_LOG2; - const int mi_col_in_sb = (mi_col % MAX_MIB_SIZE) << MI_SIZE_LOG2; - int cur_rd_info_idx = 0; - int cur_tx_depth = 0; - TX_SIZE cur_tx_size = max_txsize_rect_lookup[bsize]; - while (cur_tx_depth <= MAX_VARTX_DEPTH) { - const int cur_tx_bw = tx_size_wide[cur_tx_size]; - const int cur_tx_bh = tx_size_high[cur_tx_size]; - if (cur_tx_bw < 8 || cur_tx_bh < 8) break; - const TX_SIZE next_tx_size = sub_tx_size_map[cur_tx_size]; - const int tx_size_idx = cur_tx_size - TX_8X8; - for (int row = 0; row < bh; row += cur_tx_bh) { - for (int col = 0; col < bw; col += cur_tx_bw) { - if (cur_tx_bw != cur_tx_bh) { - // Use dummy nodes for all rectangular transforms within the - // TX size search tree. - dst_rd_info[cur_rd_info_idx].rd_info_array = NULL; - } else { - // Get spatial location of this TX block within the superblock - // (measured in cur_tx_bsize units). - const int row_in_sb = (mi_row_in_sb + row) / cur_tx_bh; - const int col_in_sb = (mi_col_in_sb + col) / cur_tx_bw; - - int16_t hash_data[MAX_SB_SQUARE]; - int16_t *cur_hash_row = hash_data; - const int16_t *cur_diff_row = diff + row * diff_stride + col; - for (int i = 0; i < cur_tx_bh; i++) { - memcpy(cur_hash_row, cur_diff_row, sizeof(*hash_data) * cur_tx_bw); - cur_hash_row += cur_tx_bw; - cur_diff_row += diff_stride; - } - const int hash = av1_get_crc32c_value(&x->mb_rd_record.crc_calculator, - (uint8_t *)hash_data, - 2 * cur_tx_bw * cur_tx_bh); - // Find corresponding RD info based on the hash value. - const int record_idx = - row_in_sb * (MAX_MIB_SIZE >> (tx_size_idx + 1)) + col_in_sb; - TXB_RD_RECORD *records = &rd_records_table[tx_size_idx][record_idx]; - int idx = find_tx_size_rd_info(records, hash); - dst_rd_info[cur_rd_info_idx].rd_info_array = - &records->tx_rd_info[idx]; - } - ++cur_rd_info_idx; - } - } - cur_tx_size = next_tx_size; - ++cur_tx_depth; - } - return 1; -} - -// Search for best transform size and type for luma inter blocks. -static void pick_tx_size_type_yrd(const AV1_COMP *cpi, MACROBLOCK *x, - RD_STATS *rd_stats, BLOCK_SIZE bsize, - int mi_row, int mi_col, int64_t ref_best_rd) { - const AV1_COMMON *cm = &cpi->common; - MACROBLOCKD *const xd = &x->e_mbd; - assert(is_inter_block(xd->mi[0])); - - av1_invalid_rd_stats(rd_stats); - - if (cpi->sf.model_based_prune_tx_search_level && ref_best_rd != INT64_MAX) { - int model_rate; - int64_t model_dist; - int model_skip; - model_rd_sb_fn[MODELRD_TYPE_TX_SEARCH_PRUNE]( - cpi, bsize, x, xd, 0, 0, mi_row, mi_col, &model_rate, &model_dist, - &model_skip, NULL, NULL, NULL, NULL); - const int64_t model_rd = RDCOST(x->rdmult, model_rate, model_dist); - // If the modeled rd is a lot worse than the best so far, breakout. - // TODO(debargha, urvang): Improve the model and make the check below - // tighter. - assert(cpi->sf.model_based_prune_tx_search_level >= 0 && - cpi->sf.model_based_prune_tx_search_level <= 2); - static const int prune_factor_by8[] = { 3, 5 }; - if (!model_skip && - ((model_rd * - prune_factor_by8[cpi->sf.model_based_prune_tx_search_level - 1]) >> - 3) > ref_best_rd) - return; - } - - uint32_t hash = 0; - int32_t match_index = -1; - MB_RD_RECORD *mb_rd_record = NULL; - const int within_border = - mi_row >= xd->tile.mi_row_start && - (mi_row + mi_size_high[bsize] < xd->tile.mi_row_end) && - mi_col >= xd->tile.mi_col_start && - (mi_col + mi_size_wide[bsize] < xd->tile.mi_col_end); - const int is_mb_rd_hash_enabled = (within_border && cpi->sf.use_mb_rd_hash); - const int n4 = bsize_to_num_blk(bsize); - if (is_mb_rd_hash_enabled) { - hash = get_block_residue_hash(x, bsize); - mb_rd_record = &x->mb_rd_record; - match_index = find_mb_rd_info(mb_rd_record, ref_best_rd, hash); - if (match_index != -1) { - MB_RD_INFO *tx_rd_info = &mb_rd_record->tx_rd_info[match_index]; - fetch_tx_rd_info(n4, tx_rd_info, rd_stats, x); - return; - } - } - - // If we predict that skip is the optimal RD decision - set the respective - // context and terminate early. - int64_t dist; - if (cpi->sf.tx_type_search.use_skip_flag_prediction && - predict_skip_flag(x, bsize, &dist, cm->reduced_tx_set_used)) { - set_skip_flag(x, rd_stats, bsize, dist); - // Save the RD search results into tx_rd_record. - if (is_mb_rd_hash_enabled) - save_tx_rd_info(n4, hash, x, rd_stats, mb_rd_record); - return; - } -#if CONFIG_SPEED_STATS - ++x->tx_search_count; -#endif // CONFIG_SPEED_STATS - - // Precompute residual hashes and find existing or add new RD records to - // store and reuse rate and distortion values to speed up TX size search. - TXB_RD_INFO_NODE matched_rd_info[4 + 16 + 64]; - int found_rd_info = 0; - if (ref_best_rd != INT64_MAX && within_border && cpi->sf.use_inter_txb_hash) { - found_rd_info = - find_tx_size_rd_records(x, bsize, mi_row, mi_col, matched_rd_info); - } - - // Get the tx_size 1 level down - const TX_SIZE min_tx_size = sub_tx_size_map[max_txsize_rect_lookup[bsize]]; - const TxSetType tx_set_type = - av1_get_ext_tx_set_type(min_tx_size, 1, cm->reduced_tx_set_used); - prune_tx(cpi, bsize, x, xd, tx_set_type); - - int found = 0; - RD_STATS this_rd_stats; - av1_init_rd_stats(&this_rd_stats); - const int64_t rd = - select_tx_size_and_type(cpi, x, &this_rd_stats, bsize, ref_best_rd, - found_rd_info ? matched_rd_info : NULL); - - if (rd < INT64_MAX) { - *rd_stats = this_rd_stats; - found = 1; - } - - // Reset the pruning flags. - av1_zero(x->tx_search_prune); - x->tx_split_prune_flag = 0; - - // We should always find at least one candidate unless ref_best_rd is less - // than INT64_MAX (in which case, all the calls to select_tx_size_fix_type - // might have failed to find something better) - assert(IMPLIES(!found, ref_best_rd != INT64_MAX)); - if (!found) return; - - // Save the RD search results into tx_rd_record. - if (is_mb_rd_hash_enabled) { - assert(mb_rd_record != NULL); - save_tx_rd_info(n4, hash, x, rd_stats, mb_rd_record); - } -} - -static void model_rd_for_sb_with_fullrdy( - const AV1_COMP *const cpi, BLOCK_SIZE bsize, MACROBLOCK *x, MACROBLOCKD *xd, - int plane_from, int plane_to, int mi_row, int mi_col, int *out_rate_sum, - int64_t *out_dist_sum, int *skip_txfm_sb, int64_t *skip_sse_sb, - int *plane_rate, int64_t *plane_sse, int64_t *plane_dist) { - const int ref = xd->mi[0]->ref_frame[0]; - - int64_t rate_sum = 0; - int64_t dist_sum = 0; - int64_t total_sse = 0; - - for (int plane = plane_from; plane <= plane_to; ++plane) { - struct macroblock_plane *const p = &x->plane[plane]; - struct macroblockd_plane *const pd = &xd->plane[plane]; - const BLOCK_SIZE plane_bsize = - get_plane_block_size(bsize, pd->subsampling_x, pd->subsampling_y); - const int bw = block_size_wide[plane_bsize]; - const int bh = block_size_high[plane_bsize]; - int64_t sse; - int rate; - int64_t dist; - - if (x->skip_chroma_rd && plane) continue; - - if (is_cur_buf_hbd(xd)) { - sse = aom_highbd_sse(p->src.buf, p->src.stride, pd->dst.buf, - pd->dst.stride, bw, bh); - } else { - sse = aom_sse(p->src.buf, p->src.stride, pd->dst.buf, pd->dst.stride, bw, - bh); - } - sse = ROUND_POWER_OF_TWO(sse, (xd->bd - 8) * 2); - - RD_STATS rd_stats; - if (plane == 0) { - pick_tx_size_type_yrd(cpi, x, &rd_stats, bsize, mi_row, mi_col, - INT64_MAX); - if (rd_stats.invalid_rate) { - rate = 0; - dist = sse << 4; - } else { - rate = rd_stats.rate; - dist = rd_stats.dist; - } - } else { - model_rd_with_curvfit(cpi, x, plane_bsize, plane, sse, bw * bh, &rate, - &dist); - } - - if (plane == 0) x->pred_sse[ref] = (unsigned int)AOMMIN(sse, UINT_MAX); - - total_sse += sse; - rate_sum += rate; - dist_sum += dist; - - if (plane_rate) plane_rate[plane] = rate; - if (plane_sse) plane_sse[plane] = sse; - if (plane_dist) plane_dist[plane] = dist; - } - - if (skip_txfm_sb) *skip_txfm_sb = total_sse == 0; - if (skip_sse_sb) *skip_sse_sb = total_sse << 4; - *out_rate_sum = (int)rate_sum; - *out_dist_sum = dist_sum; -} - -static void rd_pick_palette_intra_sbuv(const AV1_COMP *const cpi, MACROBLOCK *x, - int dc_mode_cost, - uint8_t *best_palette_color_map, - MB_MODE_INFO *const best_mbmi, - int64_t *best_rd, int *rate, - int *rate_tokenonly, int64_t *distortion, - int *skippable) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = xd->mi[0]; - assert(!is_inter_block(mbmi)); - assert( - av1_allow_palette(cpi->common.allow_screen_content_tools, mbmi->sb_type)); - PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info; - const BLOCK_SIZE bsize = mbmi->sb_type; - const SequenceHeader *const seq_params = &cpi->common.seq_params; - int this_rate; - int64_t this_rd; - int colors_u, colors_v, colors; - const int src_stride = x->plane[1].src.stride; - const uint8_t *const src_u = x->plane[1].src.buf; - const uint8_t *const src_v = x->plane[2].src.buf; - uint8_t *const color_map = xd->plane[1].color_index_map; - RD_STATS tokenonly_rd_stats; - int plane_block_width, plane_block_height, rows, cols; - av1_get_block_dimensions(bsize, 1, xd, &plane_block_width, - &plane_block_height, &rows, &cols); - - mbmi->uv_mode = UV_DC_PRED; - - int count_buf[1 << 12]; // Maximum (1 << 12) color levels. - if (seq_params->use_highbitdepth) { - colors_u = av1_count_colors_highbd(src_u, src_stride, rows, cols, - seq_params->bit_depth, count_buf); - colors_v = av1_count_colors_highbd(src_v, src_stride, rows, cols, - seq_params->bit_depth, count_buf); - } else { - colors_u = av1_count_colors(src_u, src_stride, rows, cols, count_buf); - colors_v = av1_count_colors(src_v, src_stride, rows, cols, count_buf); - } - - uint16_t color_cache[2 * PALETTE_MAX_SIZE]; - const int n_cache = av1_get_palette_cache(xd, 1, color_cache); - - colors = colors_u > colors_v ? colors_u : colors_v; - if (colors > 1 && colors <= 64) { - int r, c, n, i, j; - const int max_itr = 50; - int lb_u, ub_u, val_u; - int lb_v, ub_v, val_v; - int *const data = x->palette_buffer->kmeans_data_buf; - int centroids[2 * PALETTE_MAX_SIZE]; - - uint16_t *src_u16 = CONVERT_TO_SHORTPTR(src_u); - uint16_t *src_v16 = CONVERT_TO_SHORTPTR(src_v); - if (seq_params->use_highbitdepth) { - lb_u = src_u16[0]; - ub_u = src_u16[0]; - lb_v = src_v16[0]; - ub_v = src_v16[0]; - } else { - lb_u = src_u[0]; - ub_u = src_u[0]; - lb_v = src_v[0]; - ub_v = src_v[0]; - } - - for (r = 0; r < rows; ++r) { - for (c = 0; c < cols; ++c) { - if (seq_params->use_highbitdepth) { - val_u = src_u16[r * src_stride + c]; - val_v = src_v16[r * src_stride + c]; - data[(r * cols + c) * 2] = val_u; - data[(r * cols + c) * 2 + 1] = val_v; - } else { - val_u = src_u[r * src_stride + c]; - val_v = src_v[r * src_stride + c]; - data[(r * cols + c) * 2] = val_u; - data[(r * cols + c) * 2 + 1] = val_v; - } - if (val_u < lb_u) - lb_u = val_u; - else if (val_u > ub_u) - ub_u = val_u; - if (val_v < lb_v) - lb_v = val_v; - else if (val_v > ub_v) - ub_v = val_v; - } - } - - for (n = colors > PALETTE_MAX_SIZE ? PALETTE_MAX_SIZE : colors; n >= 2; - --n) { - for (i = 0; i < n; ++i) { - centroids[i * 2] = lb_u + (2 * i + 1) * (ub_u - lb_u) / n / 2; - centroids[i * 2 + 1] = lb_v + (2 * i + 1) * (ub_v - lb_v) / n / 2; - } - av1_k_means(data, centroids, color_map, rows * cols, n, 2, max_itr); - optimize_palette_colors(color_cache, n_cache, n, 2, centroids); - // Sort the U channel colors in ascending order. - for (i = 0; i < 2 * (n - 1); i += 2) { - int min_idx = i; - int min_val = centroids[i]; - for (j = i + 2; j < 2 * n; j += 2) - if (centroids[j] < min_val) min_val = centroids[j], min_idx = j; - if (min_idx != i) { - int temp_u = centroids[i], temp_v = centroids[i + 1]; - centroids[i] = centroids[min_idx]; - centroids[i + 1] = centroids[min_idx + 1]; - centroids[min_idx] = temp_u, centroids[min_idx + 1] = temp_v; - } - } - av1_calc_indices(data, centroids, color_map, rows * cols, n, 2); - extend_palette_color_map(color_map, cols, rows, plane_block_width, - plane_block_height); - pmi->palette_size[1] = n; - for (i = 1; i < 3; ++i) { - for (j = 0; j < n; ++j) { - if (seq_params->use_highbitdepth) - pmi->palette_colors[i * PALETTE_MAX_SIZE + j] = clip_pixel_highbd( - (int)centroids[j * 2 + i - 1], seq_params->bit_depth); - else - pmi->palette_colors[i * PALETTE_MAX_SIZE + j] = - clip_pixel((int)centroids[j * 2 + i - 1]); - } - } - - super_block_uvrd(cpi, x, &tokenonly_rd_stats, bsize, *best_rd); - if (tokenonly_rd_stats.rate == INT_MAX) continue; - this_rate = tokenonly_rd_stats.rate + - intra_mode_info_cost_uv(cpi, x, mbmi, bsize, dc_mode_cost); - this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); - if (this_rd < *best_rd) { - *best_rd = this_rd; - *best_mbmi = *mbmi; - memcpy(best_palette_color_map, color_map, - plane_block_width * plane_block_height * - sizeof(best_palette_color_map[0])); - *rate = this_rate; - *distortion = tokenonly_rd_stats.dist; - *rate_tokenonly = tokenonly_rd_stats.rate; - *skippable = tokenonly_rd_stats.skip; - } - } - } - if (best_mbmi->palette_mode_info.palette_size[1] > 0) { - memcpy(color_map, best_palette_color_map, - plane_block_width * plane_block_height * - sizeof(best_palette_color_map[0])); - } -} - -// Run RD calculation with given chroma intra prediction angle., and return -// the RD cost. Update the best mode info. if the RD cost is the best so far. -static int64_t pick_intra_angle_routine_sbuv( - const AV1_COMP *const cpi, MACROBLOCK *x, BLOCK_SIZE bsize, - int rate_overhead, int64_t best_rd_in, int *rate, RD_STATS *rd_stats, - int *best_angle_delta, int64_t *best_rd) { - MB_MODE_INFO *mbmi = x->e_mbd.mi[0]; - assert(!is_inter_block(mbmi)); - int this_rate; - int64_t this_rd; - RD_STATS tokenonly_rd_stats; - - if (!super_block_uvrd(cpi, x, &tokenonly_rd_stats, bsize, best_rd_in)) - return INT64_MAX; - this_rate = tokenonly_rd_stats.rate + - intra_mode_info_cost_uv(cpi, x, mbmi, bsize, rate_overhead); - this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); - if (this_rd < *best_rd) { - *best_rd = this_rd; - *best_angle_delta = mbmi->angle_delta[PLANE_TYPE_UV]; - *rate = this_rate; - rd_stats->rate = tokenonly_rd_stats.rate; - rd_stats->dist = tokenonly_rd_stats.dist; - rd_stats->skip = tokenonly_rd_stats.skip; - } - return this_rd; -} - -// With given chroma directional intra prediction mode, pick the best angle -// delta. Return true if a RD cost that is smaller than the input one is found. -static int rd_pick_intra_angle_sbuv(const AV1_COMP *const cpi, MACROBLOCK *x, - BLOCK_SIZE bsize, int rate_overhead, - int64_t best_rd, int *rate, - RD_STATS *rd_stats) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *mbmi = xd->mi[0]; - assert(!is_inter_block(mbmi)); - int i, angle_delta, best_angle_delta = 0; - int64_t this_rd, best_rd_in, rd_cost[2 * (MAX_ANGLE_DELTA + 2)]; - - rd_stats->rate = INT_MAX; - rd_stats->skip = 0; - rd_stats->dist = INT64_MAX; - for (i = 0; i < 2 * (MAX_ANGLE_DELTA + 2); ++i) rd_cost[i] = INT64_MAX; - - for (angle_delta = 0; angle_delta <= MAX_ANGLE_DELTA; angle_delta += 2) { - for (i = 0; i < 2; ++i) { - best_rd_in = (best_rd == INT64_MAX) - ? INT64_MAX - : (best_rd + (best_rd >> ((angle_delta == 0) ? 3 : 5))); - mbmi->angle_delta[PLANE_TYPE_UV] = (1 - 2 * i) * angle_delta; - this_rd = pick_intra_angle_routine_sbuv(cpi, x, bsize, rate_overhead, - best_rd_in, rate, rd_stats, - &best_angle_delta, &best_rd); - rd_cost[2 * angle_delta + i] = this_rd; - if (angle_delta == 0) { - if (this_rd == INT64_MAX) return 0; - rd_cost[1] = this_rd; - break; - } - } - } - - assert(best_rd != INT64_MAX); - for (angle_delta = 1; angle_delta <= MAX_ANGLE_DELTA; angle_delta += 2) { - int64_t rd_thresh; - for (i = 0; i < 2; ++i) { - int skip_search = 0; - rd_thresh = best_rd + (best_rd >> 5); - if (rd_cost[2 * (angle_delta + 1) + i] > rd_thresh && - rd_cost[2 * (angle_delta - 1) + i] > rd_thresh) - skip_search = 1; - if (!skip_search) { - mbmi->angle_delta[PLANE_TYPE_UV] = (1 - 2 * i) * angle_delta; - pick_intra_angle_routine_sbuv(cpi, x, bsize, rate_overhead, best_rd, - rate, rd_stats, &best_angle_delta, - &best_rd); - } - } - } - - mbmi->angle_delta[PLANE_TYPE_UV] = best_angle_delta; - return rd_stats->rate != INT_MAX; -} - -#define PLANE_SIGN_TO_JOINT_SIGN(plane, a, b) \ - (plane == CFL_PRED_U ? a * CFL_SIGNS + b - 1 : b * CFL_SIGNS + a - 1) -static int cfl_rd_pick_alpha(MACROBLOCK *const x, const AV1_COMP *const cpi, - TX_SIZE tx_size, int64_t best_rd) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = xd->mi[0]; - - const BLOCK_SIZE bsize = mbmi->sb_type; -#if CONFIG_DEBUG - assert(is_cfl_allowed(xd) && cpi->oxcf.enable_cfl_intra); - const int ssx = xd->plane[AOM_PLANE_U].subsampling_x; - const int ssy = xd->plane[AOM_PLANE_U].subsampling_y; - const BLOCK_SIZE plane_bsize = get_plane_block_size(mbmi->sb_type, ssx, ssy); - (void)plane_bsize; - assert(plane_bsize < BLOCK_SIZES_ALL); - if (!xd->lossless[mbmi->segment_id]) { - assert(block_size_wide[plane_bsize] == tx_size_wide[tx_size]); - assert(block_size_high[plane_bsize] == tx_size_high[tx_size]); - } -#endif // CONFIG_DEBUG - - xd->cfl.use_dc_pred_cache = 1; - const int64_t mode_rd = - RDCOST(x->rdmult, - x->intra_uv_mode_cost[CFL_ALLOWED][mbmi->mode][UV_CFL_PRED], 0); - int64_t best_rd_uv[CFL_JOINT_SIGNS][CFL_PRED_PLANES]; - int best_c[CFL_JOINT_SIGNS][CFL_PRED_PLANES]; -#if CONFIG_DEBUG - int best_rate_uv[CFL_JOINT_SIGNS][CFL_PRED_PLANES]; -#endif // CONFIG_DEBUG - - for (int plane = 0; plane < CFL_PRED_PLANES; plane++) { - RD_STATS rd_stats; - av1_init_rd_stats(&rd_stats); - for (int joint_sign = 0; joint_sign < CFL_JOINT_SIGNS; joint_sign++) { - best_rd_uv[joint_sign][plane] = INT64_MAX; - best_c[joint_sign][plane] = 0; - } - // Collect RD stats for an alpha value of zero in this plane. - // Skip i == CFL_SIGN_ZERO as (0, 0) is invalid. - for (int i = CFL_SIGN_NEG; i < CFL_SIGNS; i++) { - const int joint_sign = PLANE_SIGN_TO_JOINT_SIGN(plane, CFL_SIGN_ZERO, i); - if (i == CFL_SIGN_NEG) { - mbmi->cfl_alpha_idx = 0; - mbmi->cfl_alpha_signs = joint_sign; - txfm_rd_in_plane(x, cpi, &rd_stats, best_rd, 0, plane + 1, bsize, - tx_size, cpi->sf.use_fast_coef_costing, FTXS_NONE, 0); - if (rd_stats.rate == INT_MAX) break; - } - const int alpha_rate = x->cfl_cost[joint_sign][plane][0]; - best_rd_uv[joint_sign][plane] = - RDCOST(x->rdmult, rd_stats.rate + alpha_rate, rd_stats.dist); -#if CONFIG_DEBUG - best_rate_uv[joint_sign][plane] = rd_stats.rate; -#endif // CONFIG_DEBUG - } - } - - int best_joint_sign = -1; - - for (int plane = 0; plane < CFL_PRED_PLANES; plane++) { - for (int pn_sign = CFL_SIGN_NEG; pn_sign < CFL_SIGNS; pn_sign++) { - int progress = 0; - for (int c = 0; c < CFL_ALPHABET_SIZE; c++) { - int flag = 0; - RD_STATS rd_stats; - if (c > 2 && progress < c) break; - av1_init_rd_stats(&rd_stats); - for (int i = 0; i < CFL_SIGNS; i++) { - const int joint_sign = PLANE_SIGN_TO_JOINT_SIGN(plane, pn_sign, i); - if (i == 0) { - mbmi->cfl_alpha_idx = (c << CFL_ALPHABET_SIZE_LOG2) + c; - mbmi->cfl_alpha_signs = joint_sign; - txfm_rd_in_plane(x, cpi, &rd_stats, best_rd, 0, plane + 1, bsize, - tx_size, cpi->sf.use_fast_coef_costing, FTXS_NONE, - 0); - if (rd_stats.rate == INT_MAX) break; - } - const int alpha_rate = x->cfl_cost[joint_sign][plane][c]; - int64_t this_rd = - RDCOST(x->rdmult, rd_stats.rate + alpha_rate, rd_stats.dist); - if (this_rd >= best_rd_uv[joint_sign][plane]) continue; - best_rd_uv[joint_sign][plane] = this_rd; - best_c[joint_sign][plane] = c; -#if CONFIG_DEBUG - best_rate_uv[joint_sign][plane] = rd_stats.rate; -#endif // CONFIG_DEBUG - flag = 2; - if (best_rd_uv[joint_sign][!plane] == INT64_MAX) continue; - this_rd += mode_rd + best_rd_uv[joint_sign][!plane]; - if (this_rd >= best_rd) continue; - best_rd = this_rd; - best_joint_sign = joint_sign; - } - progress += flag; - } - } - } - - int best_rate_overhead = INT_MAX; - int ind = 0; - if (best_joint_sign >= 0) { - const int u = best_c[best_joint_sign][CFL_PRED_U]; - const int v = best_c[best_joint_sign][CFL_PRED_V]; - ind = (u << CFL_ALPHABET_SIZE_LOG2) + v; - best_rate_overhead = x->cfl_cost[best_joint_sign][CFL_PRED_U][u] + - x->cfl_cost[best_joint_sign][CFL_PRED_V][v]; -#if CONFIG_DEBUG - xd->cfl.rate = x->intra_uv_mode_cost[CFL_ALLOWED][mbmi->mode][UV_CFL_PRED] + - best_rate_overhead + - best_rate_uv[best_joint_sign][CFL_PRED_U] + - best_rate_uv[best_joint_sign][CFL_PRED_V]; -#endif // CONFIG_DEBUG - } else { - best_joint_sign = 0; - } - - mbmi->cfl_alpha_idx = ind; - mbmi->cfl_alpha_signs = best_joint_sign; - xd->cfl.use_dc_pred_cache = 0; - xd->cfl.dc_pred_is_cached[0] = 0; - xd->cfl.dc_pred_is_cached[1] = 0; - return best_rate_overhead; -} - -static void init_sbuv_mode(MB_MODE_INFO *const mbmi) { - mbmi->uv_mode = UV_DC_PRED; - mbmi->palette_mode_info.palette_size[1] = 0; -} - -static int64_t rd_pick_intra_sbuv_mode(const AV1_COMP *const cpi, MACROBLOCK *x, - int *rate, int *rate_tokenonly, - int64_t *distortion, int *skippable, - BLOCK_SIZE bsize, TX_SIZE max_tx_size) { - MACROBLOCKD *xd = &x->e_mbd; - MB_MODE_INFO *mbmi = xd->mi[0]; - assert(!is_inter_block(mbmi)); - MB_MODE_INFO best_mbmi = *mbmi; - int64_t best_rd = INT64_MAX, this_rd; - - for (int mode_idx = 0; mode_idx < UV_INTRA_MODES; ++mode_idx) { - int this_rate; - RD_STATS tokenonly_rd_stats; - UV_PREDICTION_MODE mode = uv_rd_search_mode_order[mode_idx]; - const int is_directional_mode = av1_is_directional_mode(get_uv_mode(mode)); - if (!(cpi->sf.intra_uv_mode_mask[txsize_sqr_up_map[max_tx_size]] & - (1 << mode))) - continue; - if (!cpi->oxcf.enable_smooth_intra && mode >= UV_SMOOTH_PRED && - mode <= UV_SMOOTH_H_PRED) - continue; - - if (!cpi->oxcf.enable_paeth_intra && mode == UV_PAETH_PRED) continue; - - mbmi->uv_mode = mode; - int cfl_alpha_rate = 0; - if (mode == UV_CFL_PRED) { - if (!is_cfl_allowed(xd) || !cpi->oxcf.enable_cfl_intra) continue; - assert(!is_directional_mode); - const TX_SIZE uv_tx_size = av1_get_tx_size(AOM_PLANE_U, xd); - cfl_alpha_rate = cfl_rd_pick_alpha(x, cpi, uv_tx_size, best_rd); - if (cfl_alpha_rate == INT_MAX) continue; - } - mbmi->angle_delta[PLANE_TYPE_UV] = 0; - if (is_directional_mode && av1_use_angle_delta(mbmi->sb_type) && - cpi->oxcf.enable_angle_delta) { - const int rate_overhead = - x->intra_uv_mode_cost[is_cfl_allowed(xd)][mbmi->mode][mode]; - if (!rd_pick_intra_angle_sbuv(cpi, x, bsize, rate_overhead, best_rd, - &this_rate, &tokenonly_rd_stats)) - continue; - } else { - if (!super_block_uvrd(cpi, x, &tokenonly_rd_stats, bsize, best_rd)) { - continue; - } - } - const int mode_cost = - x->intra_uv_mode_cost[is_cfl_allowed(xd)][mbmi->mode][mode] + - cfl_alpha_rate; - this_rate = tokenonly_rd_stats.rate + - intra_mode_info_cost_uv(cpi, x, mbmi, bsize, mode_cost); - if (mode == UV_CFL_PRED) { - assert(is_cfl_allowed(xd) && cpi->oxcf.enable_cfl_intra); -#if CONFIG_DEBUG - if (!xd->lossless[mbmi->segment_id]) - assert(xd->cfl.rate == tokenonly_rd_stats.rate + mode_cost); -#endif // CONFIG_DEBUG - } - this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); - - if (this_rd < best_rd) { - best_mbmi = *mbmi; - best_rd = this_rd; - *rate = this_rate; - *rate_tokenonly = tokenonly_rd_stats.rate; - *distortion = tokenonly_rd_stats.dist; - *skippable = tokenonly_rd_stats.skip; - } - } - - const int try_palette = - cpi->oxcf.enable_palette && - av1_allow_palette(cpi->common.allow_screen_content_tools, mbmi->sb_type); - if (try_palette) { - uint8_t *best_palette_color_map = x->palette_buffer->best_palette_color_map; - rd_pick_palette_intra_sbuv( - cpi, x, - x->intra_uv_mode_cost[is_cfl_allowed(xd)][mbmi->mode][UV_DC_PRED], - best_palette_color_map, &best_mbmi, &best_rd, rate, rate_tokenonly, - distortion, skippable); - } - - *mbmi = best_mbmi; - // Make sure we actually chose a mode - assert(best_rd < INT64_MAX); - return best_rd; -} - -static void choose_intra_uv_mode(const AV1_COMP *const cpi, MACROBLOCK *const x, - BLOCK_SIZE bsize, TX_SIZE max_tx_size, - int *rate_uv, int *rate_uv_tokenonly, - int64_t *dist_uv, int *skip_uv, - UV_PREDICTION_MODE *mode_uv) { - const AV1_COMMON *const cm = &cpi->common; - MACROBLOCKD *xd = &x->e_mbd; - MB_MODE_INFO *mbmi = xd->mi[0]; - const int mi_row = -xd->mb_to_top_edge >> (3 + MI_SIZE_LOG2); - const int mi_col = -xd->mb_to_left_edge >> (3 + MI_SIZE_LOG2); - // Use an estimated rd for uv_intra based on DC_PRED if the - // appropriate speed flag is set. - init_sbuv_mode(mbmi); - if (x->skip_chroma_rd) { - *rate_uv = 0; - *rate_uv_tokenonly = 0; - *dist_uv = 0; - *skip_uv = 1; - *mode_uv = UV_DC_PRED; - return; - } - xd->cfl.is_chroma_reference = - is_chroma_reference(mi_row, mi_col, bsize, cm->seq_params.subsampling_x, - cm->seq_params.subsampling_y); - bsize = scale_chroma_bsize(bsize, xd->plane[AOM_PLANE_U].subsampling_x, - xd->plane[AOM_PLANE_U].subsampling_y); - // Only store reconstructed luma when there's chroma RDO. When there's no - // chroma RDO, the reconstructed luma will be stored in encode_superblock(). - xd->cfl.store_y = store_cfl_required_rdo(cm, x); - if (xd->cfl.store_y) { - // Restore reconstructed luma values. - av1_encode_intra_block_plane(cpi, x, mbmi->sb_type, AOM_PLANE_Y, - cpi->optimize_seg_arr[mbmi->segment_id], - mi_row, mi_col); - xd->cfl.store_y = 0; - } - rd_pick_intra_sbuv_mode(cpi, x, rate_uv, rate_uv_tokenonly, dist_uv, skip_uv, - bsize, max_tx_size); - *mode_uv = mbmi->uv_mode; -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rdopt.c
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
if (mode == D203_PRED && best_intra_mode != H_PRED && best_intra_mode != D45_PRED) return 1; if (mode == D157_PRED && best_intra_mode != H_PRED && best_intra_mode != D135_PRED) return 1; return 0; } // Model based RD estimation for luma intra blocks.
+ show +
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
static int64_t intra_model_yrd(const AV1_COMP *const cpi, MACROBLOCK *const x, BLOCK_SIZE bsize, int mode_cost, int mi_row, int mi_col) { const AV1_COMMON *cm = &cpi->common; MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; assert(!is_inter_block(mbmi)); RD_STATS this_rd_stats; int row, col; int64_t temp_sse, this_rd; TX_SIZE tx_size = tx_size_from_tx_mode(bsize, cm->tx_mode); const int stepr = tx_size_high_unit[tx_size]; const int stepc = tx_size_wide_unit[tx_size]; const int max_blocks_wide = max_block_wide(xd, bsize, 0); const int max_blocks_high = max_block_high(xd, bsize, 0); mbmi->tx_size = tx_size; // Prediction. for (row = 0; row < max_blocks_high; row += stepr) { for (col = 0; col < max_blocks_wide; col += stepc) { av1_predict_intra_block_facade(cm, xd, 0, col, row, tx_size); } } // RD estimation. model_rd_sb_fn[MODELRD_TYPE_INTRA]( cpi, bsize, x, xd, 0, 0, mi_row, mi_col, &this_rd_stats.rate, &this_rd_stats.dist, &this_rd_stats.skip, &temp_sse, NULL, NULL, NULL); if (av1_is_directional_mode(mbmi->mode) && av1_use_angle_delta(bsize)) { mode_cost += x->angle_delta_cost[mbmi->mode - V_PRED] [MAX_ANGLE_DELTA + mbmi->angle_delta[PLANE_TYPE_Y]]; } if (mbmi->mode == DC_PRED && av1_filter_intra_allowed_bsize(cm, mbmi->sb_type)) { if (mbmi->filter_intra_mode_info.use_filter_intra) { const int mode = mbmi->filter_intra_mode_info.filter_intra_mode; mode_cost += x->filter_intra_cost[mbmi->sb_type][1] + x->filter_intra_mode_cost[mode]; } else { mode_cost += x->filter_intra_cost[mbmi->sb_type][0]; } } this_rd = RDCOST(x->rdmult, this_rd_stats.rate + mode_cost, this_rd_stats.dist); return this_rd; } // Extends 'color_map' array from 'orig_width x orig_height' to 'new_width x // new_height'. Extra rows and columns are filled in by copying last valid // row/column. static void extend_palette_color_map(uint8_t *const color_map, int orig_width, int orig_height, int new_width, int new_height) { int j; assert(new_width >= orig_width); assert(new_height >= orig_height); if (new_width == orig_width && new_height == orig_height) return; for (j = orig_height - 1; j >= 0; --j) { memmove(color_map + j * new_width, color_map + j * orig_width, orig_width); // Copy last column to extra columns. memset(color_map + j * new_width + orig_width, color_map[j * new_width + orig_width - 1], new_width - orig_width); } // Copy last row to extra rows. for (j = orig_height; j < new_height; ++j) { memcpy(color_map + j * new_width, color_map + (orig_height - 1) * new_width, new_width); } } // Bias toward using colors in the cache. // TODO(huisu): Try other schemes to improve compression. static void optimize_palette_colors(uint16_t *color_cache, int n_cache, int n_colors, int stride, int *centroids) { if (n_cache <= 0) return; for (int i = 0; i < n_colors * stride; i += stride) { int min_diff = abs(centroids[i] - (int)color_cache[0]); int idx = 0; for (int j = 1; j < n_cache; ++j) { const int this_diff = abs(centroids[i] - color_cache[j]); if (this_diff < min_diff) { min_diff = this_diff; idx = j; } } if (min_diff <= 1) centroids[i] = color_cache[idx]; } } // Given the base colors as specified in centroids[], calculate the RD cost // of palette mode. static void palette_rd_y(const AV1_COMP *const cpi, MACROBLOCK *x, MB_MODE_INFO *mbmi, BLOCK_SIZE bsize, int mi_row, int mi_col, int dc_mode_cost, const int *data, int *centroids, int n, uint16_t *color_cache, int n_cache, MB_MODE_INFO *best_mbmi, uint8_t *best_palette_color_map, int64_t *best_rd, int64_t *best_model_rd, int *rate, int *rate_tokenonly, int *rate_overhead, int64_t *distortion, int *skippable, PICK_MODE_CONTEXT *ctx, uint8_t *blk_skip) { optimize_palette_colors(color_cache, n_cache, n, 1, centroids); int k = av1_remove_duplicates(centroids, n); if (k < PALETTE_MIN_SIZE) { // Too few unique colors to create a palette. And DC_PRED will work // well for that case anyway. So skip. return; } PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info; if (cpi->common.seq_params.use_highbitdepth) for (int i = 0; i < k; ++i) pmi->palette_colors[i] = clip_pixel_highbd( (int)centroids[i], cpi->common.seq_params.bit_depth); else for (int i = 0; i < k; ++i) pmi->palette_colors[i] = clip_pixel(centroids[i]); pmi->palette_size[0] = k; MACROBLOCKD *const xd = &x->e_mbd; uint8_t *const color_map = xd->plane[0].color_index_map; int block_width, block_height, rows, cols; av1_get_block_dimensions(bsize, 0, xd, &block_width, &block_height, &rows, &cols); av1_calc_indices(data, centroids, color_map, rows * cols, k, 1); extend_palette_color_map(color_map, cols, rows, block_width, block_height); const int palette_mode_cost = intra_mode_info_cost_y(cpi, x, mbmi, bsize, dc_mode_cost); int64_t this_model_rd = intra_model_yrd(cpi, x, bsize, palette_mode_cost, mi_row, mi_col); if (*best_model_rd != INT64_MAX && this_model_rd > *best_model_rd + (*best_model_rd >> 1)) return; if (this_model_rd < *best_model_rd) *best_model_rd = this_model_rd; RD_STATS tokenonly_rd_stats; super_block_yrd(cpi, x, &tokenonly_rd_stats, bsize, *best_rd); if (tokenonly_rd_stats.rate == INT_MAX) return; int this_rate = tokenonly_rd_stats.rate + palette_mode_cost; int64_t this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); if (!xd->lossless[mbmi->segment_id] && block_signals_txsize(mbmi->sb_type)) { tokenonly_rd_stats.rate -= tx_size_cost(&cpi->common, x, bsize, mbmi->tx_size); } if (this_rd < *best_rd) { *best_rd = this_rd; memcpy(best_palette_color_map, color_map, block_width * block_height * sizeof(color_map[0])); *best_mbmi = *mbmi; memcpy(blk_skip, x->blk_skip, sizeof(x->blk_skip[0]) * ctx->num_4x4_blk); *rate_overhead = this_rate - tokenonly_rd_stats.rate; if (rate) *rate = this_rate; if (rate_tokenonly) *rate_tokenonly = tokenonly_rd_stats.rate; if (distortion) *distortion = tokenonly_rd_stats.dist; if (skippable) *skippable = tokenonly_rd_stats.skip; } } static int rd_pick_palette_intra_sby( const AV1_COMP *const cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row, int mi_col, int dc_mode_cost, MB_MODE_INFO *best_mbmi, uint8_t *best_palette_color_map, int64_t *best_rd, int64_t *best_model_rd, int *rate, int *rate_tokenonly, int64_t *distortion, int *skippable, PICK_MODE_CONTEXT *ctx, uint8_t *best_blk_skip) { int rate_overhead = 0; MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; assert(!is_inter_block(mbmi)); assert(av1_allow_palette(cpi->common.allow_screen_content_tools, bsize)); const SequenceHeader *const seq_params = &cpi->common.seq_params; int colors, n; const int src_stride = x->plane[0].src.stride; const uint8_t *const src = x->plane[0].src.buf; uint8_t *const color_map = xd->plane[0].color_index_map; int block_width, block_height, rows, cols; av1_get_block_dimensions(bsize, 0, xd, &block_width, &block_height, &rows, &cols); int count_buf[1 << 12]; // Maximum (1 << 12) color levels. if (seq_params->use_highbitdepth) colors = av1_count_colors_highbd(src, src_stride, rows, cols, seq_params->bit_depth, count_buf); else colors = av1_count_colors(src, src_stride, rows, cols, count_buf); mbmi->filter_intra_mode_info.use_filter_intra = 0; if (colors > 1 && colors <= 64) { int r, c, i; const int max_itr = 50; int *const data = x->palette_buffer->kmeans_data_buf; int centroids[PALETTE_MAX_SIZE]; int lb, ub, val; uint16_t *src16 = CONVERT_TO_SHORTPTR(src); if (seq_params->use_highbitdepth) lb = ub = src16[0]; else lb = ub = src[0]; if (seq_params->use_highbitdepth) { for (r = 0; r < rows; ++r) { for (c = 0; c < cols; ++c) { val = src16[r * src_stride + c]; data[r * cols + c] = val; if (val < lb) lb = val; else if (val > ub) ub = val; } } } else { for (r = 0; r < rows; ++r) { for (c = 0; c < cols; ++c) { val = src[r * src_stride + c]; data[r * cols + c] = val; if (val < lb) lb = val; else if (val > ub) ub = val; } } } mbmi->mode = DC_PRED; mbmi->filter_intra_mode_info.use_filter_intra = 0; uint16_t color_cache[2 * PALETTE_MAX_SIZE]; const int n_cache = av1_get_palette_cache(xd, 0, color_cache); // Find the dominant colors, stored in top_colors[]. int top_colors[PALETTE_MAX_SIZE] = { 0 }; for (i = 0; i < AOMMIN(colors, PALETTE_MAX_SIZE); ++i) { int max_count = 0; for (int j = 0; j < (1 << seq_params->bit_depth); ++j) { if (count_buf[j] > max_count) { max_count = count_buf[j]; top_colors[i] = j; } } assert(max_count > 0); count_buf[top_colors[i]] = 0; } // Try the dominant colors directly. // TODO(huisu@google.com): Try to avoid duplicate computation in cases // where the dominant colors and the k-means results are similar. for (n = AOMMIN(colors, PALETTE_MAX_SIZE); n >= 2; --n) { for (i = 0; i < n; ++i) centroids[i] = top_colors[i]; palette_rd_y(cpi, x, mbmi, bsize, mi_row, mi_col, dc_mode_cost, data, centroids, n, color_cache, n_cache, best_mbmi, best_palette_color_map, best_rd, best_model_rd, rate, rate_tokenonly, &rate_overhead, distortion, skippable, ctx, best_blk_skip); } // K-means clustering. for (n = AOMMIN(colors, PALETTE_MAX_SIZE); n >= 2; --n) { if (colors == PALETTE_MIN_SIZE) { // Special case: These colors automatically become the centroids. assert(colors == n); assert(colors == 2); centroids[0] = lb; centroids[1] = ub; } else { for (i = 0; i < n; ++i) { centroids[i] = lb + (2 * i + 1) * (ub - lb) / n / 2; } av1_k_means(data, centroids, color_map, rows * cols, n, 1, max_itr); } palette_rd_y(cpi, x, mbmi, bsize, mi_row, mi_col, dc_mode_cost, data, centroids, n, color_cache, n_cache, best_mbmi, best_palette_color_map, best_rd, best_model_rd, rate, rate_tokenonly, &rate_overhead, distortion, skippable, ctx, best_blk_skip); } } if (best_mbmi->palette_mode_info.palette_size[0] > 0) { memcpy(color_map, best_palette_color_map, block_width * block_height * sizeof(best_palette_color_map[0])); } *mbmi = *best_mbmi; return rate_overhead; } // Return 1 if an filter intra mode is selected; return 0 otherwise. static int rd_pick_filter_intra_sby(const AV1_COMP *const cpi, MACROBLOCK *x, int mi_row, int mi_col, int *rate, int *rate_tokenonly, int64_t *distortion, int *skippable, BLOCK_SIZE bsize, int mode_cost, int64_t *best_rd, int64_t *best_model_rd, PICK_MODE_CONTEXT *ctx) { MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *mbmi = xd->mi[0]; int filter_intra_selected_flag = 0; FILTER_INTRA_MODE mode; TX_SIZE best_tx_size = TX_8X8; FILTER_INTRA_MODE_INFO filter_intra_mode_info; TX_TYPE best_txk_type[TXK_TYPE_BUF_LEN]; (void)ctx; av1_zero(filter_intra_mode_info); mbmi->filter_intra_mode_info.use_filter_intra = 1; mbmi->mode = DC_PRED; mbmi->palette_mode_info.palette_size[0] = 0; for (mode = 0; mode < FILTER_INTRA_MODES; ++mode) { int64_t this_rd, this_model_rd; RD_STATS tokenonly_rd_stats; mbmi->filter_intra_mode_info.filter_intra_mode = mode; this_model_rd = intra_model_yrd(cpi, x, bsize, mode_cost, mi_row, mi_col); if (*best_model_rd != INT64_MAX && this_model_rd > *best_model_rd + (*best_model_rd >> 1)) continue; if (this_model_rd < *best_model_rd) *best_model_rd = this_model_rd; super_block_yrd(cpi, x, &tokenonly_rd_stats, bsize, *best_rd); if (tokenonly_rd_stats.rate == INT_MAX) continue; const int this_rate = tokenonly_rd_stats.rate + intra_mode_info_cost_y(cpi, x, mbmi, bsize, mode_cost); this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); if (this_rd < *best_rd) { *best_rd = this_rd; best_tx_size = mbmi->tx_size; filter_intra_mode_info = mbmi->filter_intra_mode_info; memcpy(best_txk_type, mbmi->txk_type, sizeof(best_txk_type[0]) * TXK_TYPE_BUF_LEN); memcpy(ctx->blk_skip, x->blk_skip, sizeof(x->blk_skip[0]) * ctx->num_4x4_blk); *rate = this_rate; *rate_tokenonly = tokenonly_rd_stats.rate; *distortion = tokenonly_rd_stats.dist; *skippable = tokenonly_rd_stats.skip; filter_intra_selected_flag = 1; } } if (filter_intra_selected_flag) { mbmi->mode = DC_PRED; mbmi->tx_size = best_tx_size; mbmi->filter_intra_mode_info = filter_intra_mode_info; memcpy(mbmi->txk_type, best_txk_type, sizeof(best_txk_type[0]) * TXK_TYPE_BUF_LEN); return 1; } else { return 0; } } // Run RD calculation with given luma intra prediction angle., and return // the RD cost. Update the best mode info. if the RD cost is the best so far. static int64_t calc_rd_given_intra_angle( const AV1_COMP *const cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row, int mi_col, int mode_cost, int64_t best_rd_in, int8_t angle_delta, int max_angle_delta, int *rate, RD_STATS *rd_stats, int *best_angle_delta, TX_SIZE *best_tx_size, int64_t *best_rd, int64_t *best_model_rd, TX_TYPE *best_txk_type, uint8_t *best_blk_skip) { RD_STATS tokenonly_rd_stats; int64_t this_rd, this_model_rd; MB_MODE_INFO *mbmi = x->e_mbd.mi[0]; const int n4 = bsize_to_num_blk(bsize); assert(!is_inter_block(mbmi)); mbmi->angle_delta[PLANE_TYPE_Y] = angle_delta; this_model_rd = intra_model_yrd(cpi, x, bsize, mode_cost, mi_row, mi_col); if (*best_model_rd != INT64_MAX && this_model_rd > *best_model_rd + (*best_model_rd >> 1)) return INT64_MAX; if (this_model_rd < *best_model_rd) *best_model_rd = this_model_rd; super_block_yrd(cpi, x, &tokenonly_rd_stats, bsize, best_rd_in); if (tokenonly_rd_stats.rate == INT_MAX) return INT64_MAX; int this_rate = mode_cost + tokenonly_rd_stats.rate + x->angle_delta_cost[mbmi->mode - V_PRED][max_angle_delta + angle_delta]; this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); if (this_rd < *best_rd) { memcpy(best_txk_type, mbmi->txk_type, sizeof(*best_txk_type) * TXK_TYPE_BUF_LEN); memcpy(best_blk_skip, x->blk_skip, sizeof(best_blk_skip[0]) * n4); *best_rd = this_rd; *best_angle_delta = mbmi->angle_delta[PLANE_TYPE_Y]; *best_tx_size = mbmi->tx_size; *rate = this_rate; rd_stats->rate = tokenonly_rd_stats.rate; rd_stats->dist = tokenonly_rd_stats.dist; rd_stats->skip = tokenonly_rd_stats.skip; } return this_rd; } // With given luma directional intra prediction mode, pick the best angle delta // Return the RD cost corresponding to the best angle delta. static int64_t rd_pick_intra_angle_sby(const AV1_COMP *const cpi, MACROBLOCK *x, int mi_row, int mi_col, int *rate, RD_STATS *rd_stats, BLOCK_SIZE bsize, int mode_cost, int64_t best_rd, int64_t *best_model_rd) { MB_MODE_INFO *mbmi = x->e_mbd.mi[0]; assert(!is_inter_block(mbmi)); int best_angle_delta = 0; int64_t rd_cost[2 * (MAX_ANGLE_DELTA + 2)]; TX_SIZE best_tx_size = mbmi->tx_size; TX_TYPE best_txk_type[TXK_TYPE_BUF_LEN]; uint8_t best_blk_skip[MAX_MIB_SIZE * MAX_MIB_SIZE]; for (int i = 0; i < 2 * (MAX_ANGLE_DELTA + 2); ++i) rd_cost[i] = INT64_MAX; int first_try = 1; for (int angle_delta = 0; angle_delta <= MAX_ANGLE_DELTA; angle_delta += 2) { for (int i = 0; i < 2; ++i) { const int64_t best_rd_in = (best_rd == INT64_MAX) ? INT64_MAX : (best_rd + (best_rd >> (first_try ? 3 : 5))); const int64_t this_rd = calc_rd_given_intra_angle( cpi, x, bsize, mi_row, mi_col, mode_cost, best_rd_in, (1 - 2 * i) * angle_delta, MAX_ANGLE_DELTA, rate, rd_stats, &best_angle_delta, &best_tx_size, &best_rd, best_model_rd, best_txk_type, best_blk_skip); rd_cost[2 * angle_delta + i] = this_rd; if (first_try && this_rd == INT64_MAX) return best_rd; first_try = 0; if (angle_delta == 0) { rd_cost[1] = this_rd; break; } } } assert(best_rd != INT64_MAX); for (int angle_delta = 1; angle_delta <= MAX_ANGLE_DELTA; angle_delta += 2) { for (int i = 0; i < 2; ++i) { int skip_search = 0; const int64_t rd_thresh = best_rd + (best_rd >> 5); if (rd_cost[2 * (angle_delta + 1) + i] > rd_thresh && rd_cost[2 * (angle_delta - 1) + i] > rd_thresh) skip_search = 1; if (!skip_search) { calc_rd_given_intra_angle(cpi, x, bsize, mi_row, mi_col, mode_cost, best_rd, (1 - 2 * i) * angle_delta, MAX_ANGLE_DELTA, rate, rd_stats, &best_angle_delta, &best_tx_size, &best_rd, best_model_rd, best_txk_type, best_blk_skip); } } } if (rd_stats->rate != INT_MAX) { mbmi->tx_size = best_tx_size; mbmi->angle_delta[PLANE_TYPE_Y] = best_angle_delta; memcpy(mbmi->txk_type, best_txk_type, sizeof(*best_txk_type) * TXK_TYPE_BUF_LEN); memcpy(x->blk_skip, best_blk_skip, sizeof(best_blk_skip[0]) * bsize_to_num_blk(bsize)); } return best_rd; } // Indices are sign, integer, and fractional part of the gradient value static const uint8_t gradient_to_angle_bin[2][7][16] = { { { 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1 }, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, }, { { 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4 }, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3 }, { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, { 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, }, }; /* clang-format off */ static const uint8_t mode_to_angle_bin[INTRA_MODES] = { 0, 2, 6, 0, 4, 3, 5, 7, 1, 0, 0, }; /* clang-format on */ static void get_gradient_hist(const uint8_t *src, int src_stride, int rows, int cols, uint64_t *hist) { src += src_stride; for (int r = 1; r < rows; ++r) { for (int c = 1; c < cols; ++c) { int dx = src[c] - src[c - 1]; int dy = src[c] - src[c - src_stride]; int index; const int temp = dx * dx + dy * dy; if (dy == 0) { index = 2; } else { const int sn = (dx > 0) ^ (dy > 0); dx = abs(dx); dy = abs(dy); const int remd = (dx % dy) * 16 / dy; const int quot = dx / dy; index = gradient_to_angle_bin[sn][AOMMIN(quot, 6)][AOMMIN(remd, 15)]; } hist[index] += temp; } src += src_stride; } } static void get_highbd_gradient_hist(const uint8_t *src8, int src_stride, int rows, int cols, uint64_t *hist) { uint16_t *src = CONVERT_TO_SHORTPTR(src8); src += src_stride; for (int r = 1; r < rows; ++r) { for (int c = 1; c < cols; ++c) { int dx = src[c] - src[c - 1]; int dy = src[c] - src[c - src_stride]; int index; const int temp = dx * dx + dy * dy; if (dy == 0) { index = 2; } else { const int sn = (dx > 0) ^ (dy > 0); dx = abs(dx); dy = abs(dy); const int remd = (dx % dy) * 16 / dy; const int quot = dx / dy; index = gradient_to_angle_bin[sn][AOMMIN(quot, 6)][AOMMIN(remd, 15)]; } hist[index] += temp; } src += src_stride; } } static void angle_estimation(const uint8_t *src, int src_stride, int rows, int cols, BLOCK_SIZE bsize, int is_hbd, uint8_t *directional_mode_skip_mask) { // Check if angle_delta is used if (!av1_use_angle_delta(bsize)) return; uint64_t hist[DIRECTIONAL_MODES] = { 0 }; if (is_hbd) get_highbd_gradient_hist(src, src_stride, rows, cols, hist); else get_gradient_hist(src, src_stride, rows, cols, hist); int i; uint64_t hist_sum = 0; for (i = 0; i < DIRECTIONAL_MODES; ++i) hist_sum += hist[i]; for (i = 0; i < INTRA_MODES; ++i) { if (av1_is_directional_mode(i)) { const uint8_t angle_bin = mode_to_angle_bin[i]; uint64_t score = 2 * hist[angle_bin]; int weight = 2; if (angle_bin > 0) { score += hist[angle_bin - 1]; ++weight; } if (angle_bin < DIRECTIONAL_MODES - 1) { score += hist[angle_bin + 1]; ++weight; } const int thresh = 10; if (score * thresh < hist_sum * weight) directional_mode_skip_mask[i] = 1; } } } // Given selected prediction mode, search for the best tx type and size. static void intra_block_yrd(const AV1_COMP *const cpi, MACROBLOCK *x, BLOCK_SIZE bsize, const int *bmode_costs, int64_t *best_rd, int *rate, int *rate_tokenonly, int64_t *distortion, int *skippable, MB_MODE_INFO *best_mbmi, PICK_MODE_CONTEXT *ctx) { MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; RD_STATS rd_stats; super_block_yrd(cpi, x, &rd_stats, bsize, *best_rd); if (rd_stats.rate == INT_MAX) return; int this_rate_tokenonly = rd_stats.rate; if (!xd->lossless[mbmi->segment_id] && block_signals_txsize(mbmi->sb_type)) { // super_block_yrd above includes the cost of the tx_size in the // tokenonly rate, but for intra blocks, tx_size is always coded // (prediction granularity), so we account for it in the full rate, // not the tokenonly rate. this_rate_tokenonly -= tx_size_cost(&cpi->common, x, bsize, mbmi->tx_size); } const int this_rate = rd_stats.rate + intra_mode_info_cost_y(cpi, x, mbmi, bsize, bmode_costs[mbmi->mode]); const int64_t this_rd = RDCOST(x->rdmult, this_rate, rd_stats.dist); if (this_rd < *best_rd) { *best_mbmi = *mbmi; *best_rd = this_rd; *rate = this_rate; *rate_tokenonly = this_rate_tokenonly; *distortion = rd_stats.dist; *skippable = rd_stats.skip; memcpy(ctx->blk_skip, x->blk_skip, sizeof(x->blk_skip[0]) * ctx->num_4x4_blk); } } // This function is used only for intra_only frames static int64_t rd_pick_intra_sby_mode(const AV1_COMP *const cpi, MACROBLOCK *x, int mi_row, int mi_col, int *rate, int *rate_tokenonly, int64_t *distortion, int *skippable, BLOCK_SIZE bsize, int64_t best_rd, PICK_MODE_CONTEXT *ctx) { MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; assert(!is_inter_block(mbmi)); int64_t best_model_rd = INT64_MAX; const int rows = block_size_high[bsize]; const int cols = block_size_wide[bsize]; int is_directional_mode; uint8_t directional_mode_skip_mask[INTRA_MODES] = { 0 }; int beat_best_rd = 0; const int *bmode_costs; PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info; const int try_palette = cpi->oxcf.enable_palette && av1_allow_palette(cpi->common.allow_screen_content_tools, mbmi->sb_type); uint8_t *best_palette_color_map = try_palette ? x->palette_buffer->best_palette_color_map : NULL; const MB_MODE_INFO *above_mi = xd->above_mbmi; const MB_MODE_INFO *left_mi = xd->left_mbmi; const PREDICTION_MODE A = av1_above_block_mode(above_mi); const PREDICTION_MODE L = av1_left_block_mode(left_mi); const int above_ctx = intra_mode_context[A]; const int left_ctx = intra_mode_context[L]; bmode_costs = x->y_mode_costs[above_ctx][left_ctx]; mbmi->angle_delta[PLANE_TYPE_Y] = 0; if (cpi->sf.intra_angle_estimation) { const int src_stride = x->plane[0].src.stride; const uint8_t *src = x->plane[0].src.buf; angle_estimation(src, src_stride, rows, cols, bsize, is_cur_buf_hbd(xd), directional_mode_skip_mask); } mbmi->filter_intra_mode_info.use_filter_intra = 0; pmi->palette_size[0] = 0; if (cpi->sf.tx_type_search.fast_intra_tx_type_search) x->use_default_intra_tx_type = 1; else x->use_default_intra_tx_type = 0; MB_MODE_INFO best_mbmi = *mbmi; /* Y Search for intra prediction mode */ for (int mode_idx = INTRA_MODE_START; mode_idx < INTRA_MODE_END; ++mode_idx) { RD_STATS this_rd_stats; int this_rate, this_rate_tokenonly, s; int64_t this_distortion, this_rd, this_model_rd; mbmi->mode = intra_rd_search_mode_order[mode_idx]; if ((!cpi->oxcf.enable_smooth_intra || cpi->sf.disable_smooth_intra) && (mbmi->mode == SMOOTH_PRED || mbmi->mode == SMOOTH_H_PRED || mbmi->mode == SMOOTH_V_PRED)) continue; if (!cpi->oxcf.enable_paeth_intra && mbmi->mode == PAETH_PRED) continue; mbmi->angle_delta[PLANE_TYPE_Y] = 0; this_model_rd = intra_model_yrd(cpi, x, bsize, bmode_costs[mbmi->mode], mi_row, mi_col); if (best_model_rd != INT64_MAX && this_model_rd > best_model_rd + (best_model_rd >> 1)) continue; if (this_model_rd < best_model_rd) best_model_rd = this_model_rd; is_directional_mode = av1_is_directional_mode(mbmi->mode); if (is_directional_mode && directional_mode_skip_mask[mbmi->mode]) continue; if (is_directional_mode && av1_use_angle_delta(bsize) && cpi->oxcf.enable_angle_delta) { this_rd_stats.rate = INT_MAX; rd_pick_intra_angle_sby(cpi, x, mi_row, mi_col, &this_rate, &this_rd_stats, bsize, bmode_costs[mbmi->mode], best_rd, &best_model_rd); } else { super_block_yrd(cpi, x, &this_rd_stats, bsize, best_rd); } this_rate_tokenonly = this_rd_stats.rate; this_distortion = this_rd_stats.dist; s = this_rd_stats.skip; if (this_rate_tokenonly == INT_MAX) continue; if (!xd->lossless[mbmi->segment_id] && block_signals_txsize(mbmi->sb_type)) { // super_block_yrd above includes the cost of the tx_size in the // tokenonly rate, but for intra blocks, tx_size is always coded // (prediction granularity), so we account for it in the full rate, // not the tokenonly rate. this_rate_tokenonly -= tx_size_cost(&cpi->common, x, bsize, mbmi->tx_size); } this_rate = this_rd_stats.rate + intra_mode_info_cost_y(cpi, x, mbmi, bsize, bmode_costs[mbmi->mode]); this_rd = RDCOST(x->rdmult, this_rate, this_distortion); if (this_rd < best_rd) { best_mbmi = *mbmi; best_rd = this_rd; beat_best_rd = 1; *rate = this_rate; *rate_tokenonly = this_rate_tokenonly; *distortion = this_distortion; *skippable = s; memcpy(ctx->blk_skip, x->blk_skip, sizeof(x->blk_skip[0]) * ctx->num_4x4_blk); } } if (try_palette) { rd_pick_palette_intra_sby( cpi, x, bsize, mi_row, mi_col, bmode_costs[DC_PRED], &best_mbmi, best_palette_color_map, &best_rd, &best_model_rd, rate, rate_tokenonly, distortion, skippable, ctx, ctx->blk_skip); } if (beat_best_rd && av1_filter_intra_allowed_bsize(&cpi->common, bsize)) { if (rd_pick_filter_intra_sby( cpi, x, mi_row, mi_col, rate, rate_tokenonly, distortion, skippable, bsize, bmode_costs[DC_PRED], &best_rd, &best_model_rd, ctx)) { best_mbmi = *mbmi; } } // If previous searches use only the default tx type, do an extra search for // the best tx type. if (x->use_default_intra_tx_type) { *mbmi = best_mbmi; x->use_default_intra_tx_type = 0; intra_block_yrd(cpi, x, bsize, bmode_costs, &best_rd, rate, rate_tokenonly, distortion, skippable, &best_mbmi, ctx); } *mbmi = best_mbmi; return best_rd; } // Return value 0: early termination triggered, no valid rd cost available; // 1: rd cost values are valid. static int super_block_uvrd(const AV1_COMP *const cpi, MACROBLOCK *x, RD_STATS *rd_stats, BLOCK_SIZE bsize, int64_t ref_best_rd) { MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_U]; const TX_SIZE uv_tx_size = av1_get_tx_size(AOM_PLANE_U, xd); int plane; int is_cost_valid = 1; const int is_inter = is_inter_block(mbmi); int64_t this_rd = 0, skip_rd = 0; av1_init_rd_stats(rd_stats); if (ref_best_rd < 0) is_cost_valid = 0; if (x->skip_chroma_rd) return is_cost_valid; bsize = scale_chroma_bsize(bsize, pd->subsampling_x, pd->subsampling_y); if (is_inter && is_cost_valid) { for (plane = 1; plane < MAX_MB_PLANE; ++plane) av1_subtract_plane(x, bsize, plane); } if (is_cost_valid) { for (plane = 1; plane < MAX_MB_PLANE; ++plane) { RD_STATS pn_rd_stats; int64_t chroma_ref_best_rd = ref_best_rd; // For inter blocks, refined ref_best_rd is used for early exit // For intra blocks, even though current rd crosses ref_best_rd, early // exit is not recommended as current rd is used for gating subsequent // modes as well (say, for angular modes) // TODO(any): Extend the early exit mechanism for intra modes as well if (cpi->sf.perform_best_rd_based_gating_for_chroma && is_inter && chroma_ref_best_rd != INT64_MAX) chroma_ref_best_rd = ref_best_rd - AOMMIN(this_rd, skip_rd); txfm_rd_in_plane(x, cpi, &pn_rd_stats, chroma_ref_best_rd, 0, plane, bsize, uv_tx_size, cpi->sf.use_fast_coef_costing, FTXS_NONE, 0); if (pn_rd_stats.rate == INT_MAX) { is_cost_valid = 0; break; } av1_merge_rd_stats(rd_stats, &pn_rd_stats); this_rd = RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist); skip_rd = RDCOST(x->rdmult, 0, rd_stats->sse); if (AOMMIN(this_rd, skip_rd) > ref_best_rd) { is_cost_valid = 0; break; } } } if (!is_cost_valid) { // reset cost value av1_invalid_rd_stats(rd_stats); } return is_cost_valid; } // Pick transform type for a transform block of tx_size. static void tx_type_rd(const AV1_COMP *cpi, MACROBLOCK *x, TX_SIZE tx_size, int blk_row, int blk_col, int plane, int block, int plane_bsize, TXB_CTX *txb_ctx, RD_STATS *rd_stats, FAST_TX_SEARCH_MODE ftxs_mode, int64_t ref_rdcost, TXB_RD_INFO *rd_info_array) { const struct macroblock_plane *const p = &x->plane[plane]; const uint16_t cur_joint_ctx = (txb_ctx->dc_sign_ctx << 8) + txb_ctx->txb_skip_ctx; const int txk_type_idx = av1_get_txk_type_index(plane_bsize, blk_row, blk_col); // Look up RD and terminate early in case when we've already processed exactly // the same residual with exactly the same entropy context. if (rd_info_array != NULL && rd_info_array->valid && rd_info_array->entropy_context == cur_joint_ctx) { if (plane == 0) x->e_mbd.mi[0]->txk_type[txk_type_idx] = rd_info_array->tx_type; const TX_TYPE ref_tx_type = av1_get_tx_type(get_plane_type(plane), &x->e_mbd, blk_row, blk_col, tx_size, cpi->common.reduced_tx_set_used); if (ref_tx_type == rd_info_array->tx_type) { rd_stats->rate += rd_info_array->rate; rd_stats->dist += rd_info_array->dist; rd_stats->sse += rd_info_array->sse; rd_stats->skip &= rd_info_array->eob == 0; p->eobs[block] = rd_info_array->eob; p->txb_entropy_ctx[block] = rd_info_array->txb_entropy_ctx; return; } } RD_STATS this_rd_stats; search_txk_type(cpi, x, plane, block, blk_row, blk_col, plane_bsize, tx_size, txb_ctx, ftxs_mode, 0, 0, ref_rdcost, &this_rd_stats); av1_merge_rd_stats(rd_stats, &this_rd_stats); // Save RD results for possible reuse in future. if (rd_info_array != NULL) { rd_info_array->valid = 1; rd_info_array->entropy_context = cur_joint_ctx; rd_info_array->rate = this_rd_stats.rate; rd_info_array->dist = this_rd_stats.dist; rd_info_array->sse = this_rd_stats.sse; rd_info_array->eob = p->eobs[block]; rd_info_array->txb_entropy_ctx = p->txb_entropy_ctx[block]; if (plane == 0) { rd_info_array->tx_type = x->e_mbd.mi[0]->txk_type[txk_type_idx]; } } } static void get_mean_and_dev(const int16_t *data, int stride, int bw, int bh, float *mean, float *dev) { int x_sum = 0; uint64_t x2_sum = 0; for (int i = 0; i < bh; ++i) { for (int j = 0; j < bw; ++j) { const int val = data[j]; x_sum += val; x2_sum += val * val; } data += stride; } const int num = bw * bh; const float e_x = (float)x_sum / num; const float e_x2 = (float)((double)x2_sum / num); const float diff = e_x2 - e_x * e_x; *dev = (diff > 0) ? sqrtf(diff) : 0; *mean = e_x; } static void get_mean_and_dev_float(const float *data, int stride, int bw, int bh, float *mean, float *dev) { float x_sum = 0; float x2_sum = 0; for (int i = 0; i < bh; ++i) { for (int j = 0; j < bw; ++j) { const float val = data[j]; x_sum += val; x2_sum += val * val; } data += stride; } const int num = bw * bh; const float e_x = x_sum / num; const float e_x2 = x2_sum / num; const float diff = e_x2 - e_x * e_x; *dev = (diff > 0) ? sqrtf(diff) : 0; *mean = e_x; } // Feature used by the model to predict tx split: the mean and standard // deviation values of the block and sub-blocks. static void get_mean_dev_features(const int16_t *data, int stride, int bw, int bh, int levels, float *feature) { int feature_idx = 0; int width = bw; int height = bh; const int16_t *const data_ptr = &data[0]; for (int lv = 0; lv < levels; ++lv) { if (width < 2 || height < 2) break; float mean_buf[16]; float dev_buf[16]; int blk_idx = 0; for (int row = 0; row < bh; row += height) { for (int col = 0; col < bw; col += width) { float mean, dev; get_mean_and_dev(data_ptr + row * stride + col, stride, width, height, &mean, &dev); feature[feature_idx++] = mean; feature[feature_idx++] = dev; mean_buf[blk_idx] = mean; dev_buf[blk_idx++] = dev; } } if (blk_idx > 1) { float mean, dev; // Deviation of means. get_mean_and_dev_float(mean_buf, 1, 1, blk_idx, &mean, &dev); feature[feature_idx++] = dev; // Mean of deviations. get_mean_and_dev_float(dev_buf, 1, 1, blk_idx, &mean, &dev); feature[feature_idx++] = mean; } // Reduce the block size when proceeding to the next level. if (height == width) { height = height >> 1; width = width >> 1; } else if (height > width) { height = height >> 1; } else { width = width >> 1; } } } static int ml_predict_tx_split(MACROBLOCK *x, BLOCK_SIZE bsize, int blk_row, int blk_col, TX_SIZE tx_size) { const NN_CONFIG *nn_config = av1_tx_split_nnconfig_map[tx_size]; if (!nn_config) return -1; const int diff_stride = block_size_wide[bsize]; const int16_t *diff = x->plane[0].src_diff + 4 * blk_row * diff_stride + 4 * blk_col; const int bw = tx_size_wide[tx_size]; const int bh = tx_size_high[tx_size]; aom_clear_system_state(); float features[64] = { 0.0f }; get_mean_dev_features(diff, diff_stride, bw, bh, 2, features); float score = 0.0f; av1_nn_predict(features, nn_config, &score); aom_clear_system_state(); if (score > 8.0f) return 100; if (score < -8.0f) return 0; score = 1.0f / (1.0f + (float)exp(-score)); return (int)(score * 100); } typedef struct { int64_t rd; int txb_entropy_ctx; TX_TYPE tx_type; } TxCandidateInfo; static void try_tx_block_no_split( const AV1_COMP *cpi, MACROBLOCK *x, int blk_row, int blk_col, int block, TX_SIZE tx_size, int depth, BLOCK_SIZE plane_bsize, const ENTROPY_CONTEXT *ta, const ENTROPY_CONTEXT *tl, int txfm_partition_ctx, RD_STATS *rd_stats, int64_t ref_best_rd, FAST_TX_SEARCH_MODE ftxs_mode, TXB_RD_INFO_NODE *rd_info_node, TxCandidateInfo *no_split) { MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; struct macroblock_plane *const p = &x->plane[0]; const int bw = block_size_wide[plane_bsize] >> tx_size_wide_log2[0]; no_split->rd = INT64_MAX; no_split->txb_entropy_ctx = 0; no_split->tx_type = TX_TYPES; const ENTROPY_CONTEXT *const pta = ta + blk_col; const ENTROPY_CONTEXT *const ptl = tl + blk_row; const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size); TXB_CTX txb_ctx; get_txb_ctx(plane_bsize, tx_size, 0, pta, ptl, &txb_ctx); const int zero_blk_rate = x->coeff_costs[txs_ctx][PLANE_TYPE_Y] .txb_skip_cost[txb_ctx.txb_skip_ctx][1]; rd_stats->ref_rdcost = ref_best_rd; rd_stats->zero_rate = zero_blk_rate; const int index = av1_get_txb_size_index(plane_bsize, blk_row, blk_col); mbmi->inter_tx_size[index] = tx_size; tx_type_rd(cpi, x, tx_size, blk_row, blk_col, 0, block, plane_bsize, &txb_ctx, rd_stats, ftxs_mode, ref_best_rd, rd_info_node != NULL ? rd_info_node->rd_info_array : NULL); assert(rd_stats->rate < INT_MAX); if ((RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist) >= RDCOST(x->rdmult, zero_blk_rate, rd_stats->sse) || rd_stats->skip == 1) && !xd->lossless[mbmi->segment_id]) { #if CONFIG_RD_DEBUG av1_update_txb_coeff_cost(rd_stats, 0, tx_size, blk_row, blk_col, zero_blk_rate - rd_stats->rate); #endif // CONFIG_RD_DEBUG rd_stats->rate = zero_blk_rate; rd_stats->dist = rd_stats->sse; rd_stats->skip = 1; set_blk_skip(x, 0, blk_row * bw + blk_col, 1); p->eobs[block] = 0; update_txk_array(mbmi->txk_type, plane_bsize, blk_row, blk_col, tx_size, DCT_DCT); } else { set_blk_skip(x, 0, blk_row * bw + blk_col, 0); rd_stats->skip = 0; } if (tx_size > TX_4X4 && depth < MAX_VARTX_DEPTH) rd_stats->rate += x->txfm_partition_cost[txfm_partition_ctx][0]; no_split->rd = RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist); no_split->txb_entropy_ctx = p->txb_entropy_ctx[block]; const int txk_type_idx = av1_get_txk_type_index(plane_bsize, blk_row, blk_col); no_split->tx_type = mbmi->txk_type[txk_type_idx]; } static void select_tx_block(const AV1_COMP *cpi, MACROBLOCK *x, int blk_row, int blk_col, int block, TX_SIZE tx_size, int depth, BLOCK_SIZE plane_bsize, ENTROPY_CONTEXT *ta, ENTROPY_CONTEXT *tl, TXFM_CONTEXT *tx_above, TXFM_CONTEXT *tx_left, RD_STATS *rd_stats, int64_t prev_level_rd, int64_t ref_best_rd, int *is_cost_valid, FAST_TX_SEARCH_MODE ftxs_mode, TXB_RD_INFO_NODE *rd_info_node); static void try_tx_block_split( const AV1_COMP *cpi, MACROBLOCK *x, int blk_row, int blk_col, int block, TX_SIZE tx_size, int depth, BLOCK_SIZE plane_bsize, ENTROPY_CONTEXT *ta, ENTROPY_CONTEXT *tl, TXFM_CONTEXT *tx_above, TXFM_CONTEXT *tx_left, int txfm_partition_ctx, int64_t no_split_rd, int64_t ref_best_rd, FAST_TX_SEARCH_MODE ftxs_mode, TXB_RD_INFO_NODE *rd_info_node, RD_STATS *split_rd_stats, int64_t *split_rd) { assert(tx_size < TX_SIZES_ALL); MACROBLOCKD *const xd = &x->e_mbd; const int max_blocks_high = max_block_high(xd, plane_bsize, 0); const int max_blocks_wide = max_block_wide(xd, plane_bsize, 0); const TX_SIZE sub_txs = sub_tx_size_map[tx_size]; const int bsw = tx_size_wide_unit[sub_txs]; const int bsh = tx_size_high_unit[sub_txs]; const int sub_step = bsw * bsh; const int nblks = (tx_size_high_unit[tx_size] / bsh) * (tx_size_wide_unit[tx_size] / bsw); assert(nblks > 0); int blk_idx = 0; int64_t tmp_rd = 0; *split_rd = INT64_MAX; split_rd_stats->rate = x->txfm_partition_cost[txfm_partition_ctx][1]; for (int r = 0; r < tx_size_high_unit[tx_size]; r += bsh) { for (int c = 0; c < tx_size_wide_unit[tx_size]; c += bsw, ++blk_idx) { assert(blk_idx < 4); const int offsetr = blk_row + r; const int offsetc = blk_col + c; if (offsetr >= max_blocks_high || offsetc >= max_blocks_wide) continue; RD_STATS this_rd_stats; int this_cost_valid = 1; select_tx_block( cpi, x, offsetr, offsetc, block, sub_txs, depth + 1, plane_bsize, ta, tl, tx_above, tx_left, &this_rd_stats, no_split_rd / nblks, ref_best_rd - tmp_rd, &this_cost_valid, ftxs_mode, (rd_info_node != NULL) ? rd_info_node->children[blk_idx] : NULL); if (!this_cost_valid) return; av1_merge_rd_stats(split_rd_stats, &this_rd_stats); tmp_rd = RDCOST(x->rdmult, split_rd_stats->rate, split_rd_stats->dist); if (no_split_rd < tmp_rd) return; block += sub_step; } } *split_rd = tmp_rd; } // Search for the best tx partition/type for a given luma block. static void select_tx_block(const AV1_COMP *cpi, MACROBLOCK *x, int blk_row, int blk_col, int block, TX_SIZE tx_size, int depth, BLOCK_SIZE plane_bsize, ENTROPY_CONTEXT *ta, ENTROPY_CONTEXT *tl, TXFM_CONTEXT *tx_above, TXFM_CONTEXT *tx_left, RD_STATS *rd_stats, int64_t prev_level_rd, int64_t ref_best_rd, int *is_cost_valid, FAST_TX_SEARCH_MODE ftxs_mode, TXB_RD_INFO_NODE *rd_info_node) { assert(tx_size < TX_SIZES_ALL); av1_init_rd_stats(rd_stats); if (ref_best_rd < 0) { *is_cost_valid = 0; return; } MACROBLOCKD *const xd = &x->e_mbd; const int max_blocks_high = max_block_high(xd, plane_bsize, 0); const int max_blocks_wide = max_block_wide(xd, plane_bsize, 0); if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return; const int bw = block_size_wide[plane_bsize] >> tx_size_wide_log2[0]; MB_MODE_INFO *const mbmi = xd->mi[0]; const int ctx = txfm_partition_context(tx_above + blk_col, tx_left + blk_row, mbmi->sb_type, tx_size); struct macroblock_plane *const p = &x->plane[0]; const int try_no_split = cpi->oxcf.enable_tx64 || txsize_sqr_up_map[tx_size] != TX_64X64; int try_split = tx_size > TX_4X4 && depth < MAX_VARTX_DEPTH; #if CONFIG_DIST_8X8 if (x->using_dist_8x8) try_split &= tx_size_wide[tx_size] >= 16 && tx_size_high[tx_size] >= 16; #endif TxCandidateInfo no_split = { INT64_MAX, 0, TX_TYPES }; // TX no split if (try_no_split) { try_tx_block_no_split(cpi, x, blk_row, blk_col, block, tx_size, depth, plane_bsize, ta, tl, ctx, rd_stats, ref_best_rd, ftxs_mode, rd_info_node, &no_split); if (cpi->sf.adaptive_txb_search_level && (no_split.rd - (no_split.rd >> (1 + cpi->sf.adaptive_txb_search_level))) > ref_best_rd) { *is_cost_valid = 0; return; } if (cpi->sf.txb_split_cap) { if (p->eobs[block] == 0) try_split = 0; } if (cpi->sf.adaptive_txb_search_level && (no_split.rd - (no_split.rd >> (2 + cpi->sf.adaptive_txb_search_level))) > prev_level_rd) { try_split = 0; } } if (x->e_mbd.bd == 8 && !x->cb_partition_scan && try_split) { const int threshold = cpi->sf.tx_type_search.ml_tx_split_thresh; if (threshold >= 0) { const int split_score = ml_predict_tx_split(x, plane_bsize, blk_row, blk_col, tx_size); if (split_score >= 0 && split_score < threshold) try_split = 0; } } // TX split int64_t split_rd = INT64_MAX; RD_STATS split_rd_stats; av1_init_rd_stats(&split_rd_stats); if (try_split) { try_tx_block_split(cpi, x, blk_row, blk_col, block, tx_size, depth, plane_bsize, ta, tl, tx_above, tx_left, ctx, no_split.rd, AOMMIN(no_split.rd, ref_best_rd), ftxs_mode, rd_info_node, &split_rd_stats, &split_rd); } if (no_split.rd < split_rd) { ENTROPY_CONTEXT *pta = ta + blk_col; ENTROPY_CONTEXT *ptl = tl + blk_row; const TX_SIZE tx_size_selected = tx_size; p->txb_entropy_ctx[block] = no_split.txb_entropy_ctx; av1_set_txb_context(x, 0, block, tx_size_selected, pta, ptl); txfm_partition_update(tx_above + blk_col, tx_left + blk_row, tx_size, tx_size); for (int idy = 0; idy < tx_size_high_unit[tx_size]; ++idy) { for (int idx = 0; idx < tx_size_wide_unit[tx_size]; ++idx) { const int index = av1_get_txb_size_index(plane_bsize, blk_row + idy, blk_col + idx); mbmi->inter_tx_size[index] = tx_size_selected; } } mbmi->tx_size = tx_size_selected; update_txk_array(mbmi->txk_type, plane_bsize, blk_row, blk_col, tx_size, no_split.tx_type); set_blk_skip(x, 0, blk_row * bw + blk_col, rd_stats->skip); } else { *rd_stats = split_rd_stats; if (split_rd == INT64_MAX) *is_cost_valid = 0; } } static int64_t select_tx_size_and_type(const AV1_COMP *cpi, MACROBLOCK *x, RD_STATS *rd_stats, BLOCK_SIZE bsize, int64_t ref_best_rd, TXB_RD_INFO_NODE *rd_info_tree) { MACROBLOCKD *const xd = &x->e_mbd; assert(is_inter_block(xd->mi[0])); // TODO(debargha): enable this as a speed feature where the // select_inter_block_yrd() function above will use a simplified search // such as not using full optimize, but the inter_block_yrd() function // will use more complex search given that the transform partitions have // already been decided. const int fast_tx_search = cpi->sf.tx_size_search_method > USE_FULL_RD; int64_t rd_thresh = ref_best_rd; if (fast_tx_search && rd_thresh < INT64_MAX) { if (INT64_MAX - rd_thresh > (rd_thresh >> 3)) rd_thresh += (rd_thresh >> 3); } assert(rd_thresh > 0); const FAST_TX_SEARCH_MODE ftxs_mode = fast_tx_search ? FTXS_DCT_AND_1D_DCT_ONLY : FTXS_NONE; const struct macroblockd_plane *const pd = &xd->plane[0]; const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd->subsampling_x, pd->subsampling_y); const int mi_width = mi_size_wide[plane_bsize]; const int mi_height = mi_size_high[plane_bsize]; ENTROPY_CONTEXT ctxa[MAX_MIB_SIZE]; ENTROPY_CONTEXT ctxl[MAX_MIB_SIZE]; TXFM_CONTEXT tx_above[MAX_MIB_SIZE]; TXFM_CONTEXT tx_left[MAX_MIB_SIZE]; av1_get_entropy_contexts(bsize, pd, ctxa, ctxl); memcpy(tx_above, xd->above_txfm_context, sizeof(TXFM_CONTEXT) * mi_width); memcpy(tx_left, xd->left_txfm_context, sizeof(TXFM_CONTEXT) * mi_height); const int skip_ctx = av1_get_skip_context(xd); const int s0 = x->skip_cost[skip_ctx][0]; const int s1 = x->skip_cost[skip_ctx][1]; const int init_depth = get_search_init_depth(mi_width, mi_height, 1, &cpi->sf); const TX_SIZE max_tx_size = max_txsize_rect_lookup[plane_bsize]; const int bh = tx_size_high_unit[max_tx_size]; const int bw = tx_size_wide_unit[max_tx_size]; const int step = bw * bh; int64_t skip_rd = RDCOST(x->rdmult, s1, 0); int64_t this_rd = RDCOST(x->rdmult, s0, 0); int block = 0; av1_init_rd_stats(rd_stats); for (int idy = 0; idy < mi_height; idy += bh) { for (int idx = 0; idx < mi_width; idx += bw) { const int64_t best_rd_sofar = (rd_thresh == INT64_MAX) ? INT64_MAX : (rd_thresh - (AOMMIN(skip_rd, this_rd))); int is_cost_valid = 1; RD_STATS pn_rd_stats; select_tx_block(cpi, x, idy, idx, block, max_tx_size, init_depth, plane_bsize, ctxa, ctxl, tx_above, tx_left, &pn_rd_stats, INT64_MAX, best_rd_sofar, &is_cost_valid, ftxs_mode, rd_info_tree); if (!is_cost_valid || pn_rd_stats.rate == INT_MAX) { av1_invalid_rd_stats(rd_stats); return INT64_MAX; } av1_merge_rd_stats(rd_stats, &pn_rd_stats); skip_rd = RDCOST(x->rdmult, s1, rd_stats->sse); this_rd = RDCOST(x->rdmult, rd_stats->rate + s0, rd_stats->dist); block += step; if (rd_info_tree != NULL) rd_info_tree += 1; } } if (skip_rd <= this_rd) { rd_stats->skip = 1; } else { rd_stats->skip = 0; } if (rd_stats->rate == INT_MAX) return INT64_MAX; // If fast_tx_search is true, only DCT and 1D DCT were tested in // select_inter_block_yrd() above. Do a better search for tx type with // tx sizes already decided. if (fast_tx_search) { if (!inter_block_yrd(cpi, x, rd_stats, bsize, ref_best_rd, FTXS_NONE)) return INT64_MAX; } int64_t rd; if (rd_stats->skip) { rd = RDCOST(x->rdmult, s1, rd_stats->sse); } else { rd = RDCOST(x->rdmult, rd_stats->rate + s0, rd_stats->dist); if (!xd->lossless[xd->mi[0]->segment_id]) rd = AOMMIN(rd, RDCOST(x->rdmult, s1, rd_stats->sse)); } return rd; } // Finds rd cost for a y block, given the transform size partitions static void tx_block_yrd(const AV1_COMP *cpi, MACROBLOCK *x, int blk_row, int blk_col, int block, TX_SIZE tx_size, BLOCK_SIZE plane_bsize, int depth, ENTROPY_CONTEXT *above_ctx, ENTROPY_CONTEXT *left_ctx, TXFM_CONTEXT *tx_above, TXFM_CONTEXT *tx_left, int64_t ref_best_rd, RD_STATS *rd_stats, FAST_TX_SEARCH_MODE ftxs_mode) { MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; const int max_blocks_high = max_block_high(xd, plane_bsize, 0); const int max_blocks_wide = max_block_wide(xd, plane_bsize, 0); assert(tx_size < TX_SIZES_ALL); if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return; const TX_SIZE plane_tx_size = mbmi->inter_tx_size[av1_get_txb_size_index( plane_bsize, blk_row, blk_col)]; int ctx = txfm_partition_context(tx_above + blk_col, tx_left + blk_row, mbmi->sb_type, tx_size); av1_init_rd_stats(rd_stats); if (tx_size == plane_tx_size) { ENTROPY_CONTEXT *ta = above_ctx + blk_col; ENTROPY_CONTEXT *tl = left_ctx + blk_row; const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size); TXB_CTX txb_ctx; get_txb_ctx(plane_bsize, tx_size, 0, ta, tl, &txb_ctx); const int zero_blk_rate = x->coeff_costs[txs_ctx][get_plane_type(0)] .txb_skip_cost[txb_ctx.txb_skip_ctx][1]; rd_stats->zero_rate = zero_blk_rate; rd_stats->ref_rdcost = ref_best_rd; tx_type_rd(cpi, x, tx_size, blk_row, blk_col, 0, block, plane_bsize, &txb_ctx, rd_stats, ftxs_mode, ref_best_rd, NULL); const int mi_width = block_size_wide[plane_bsize] >> tx_size_wide_log2[0]; if (RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist) >= RDCOST(x->rdmult, zero_blk_rate, rd_stats->sse) || rd_stats->skip == 1) { rd_stats->rate = zero_blk_rate; rd_stats->dist = rd_stats->sse; rd_stats->skip = 1; set_blk_skip(x, 0, blk_row * mi_width + blk_col, 1); x->plane[0].eobs[block] = 0; x->plane[0].txb_entropy_ctx[block] = 0; update_txk_array(mbmi->txk_type, plane_bsize, blk_row, blk_col, tx_size, DCT_DCT); } else { rd_stats->skip = 0; set_blk_skip(x, 0, blk_row * mi_width + blk_col, 0); } if (tx_size > TX_4X4 && depth < MAX_VARTX_DEPTH) rd_stats->rate += x->txfm_partition_cost[ctx][0]; av1_set_txb_context(x, 0, block, tx_size, ta, tl); txfm_partition_update(tx_above + blk_col, tx_left + blk_row, tx_size, tx_size); } else { const TX_SIZE sub_txs = sub_tx_size_map[tx_size]; const int bsw = tx_size_wide_unit[sub_txs]; const int bsh = tx_size_high_unit[sub_txs]; const int step = bsh * bsw; RD_STATS pn_rd_stats; int64_t this_rd = 0; assert(bsw > 0 && bsh > 0); for (int row = 0; row < tx_size_high_unit[tx_size]; row += bsh) { for (int col = 0; col < tx_size_wide_unit[tx_size]; col += bsw) { const int offsetr = blk_row + row; const int offsetc = blk_col + col; if (offsetr >= max_blocks_high || offsetc >= max_blocks_wide) continue; av1_init_rd_stats(&pn_rd_stats); tx_block_yrd(cpi, x, offsetr, offsetc, block, sub_txs, plane_bsize, depth + 1, above_ctx, left_ctx, tx_above, tx_left, ref_best_rd - this_rd, &pn_rd_stats, ftxs_mode); if (pn_rd_stats.rate == INT_MAX) { av1_invalid_rd_stats(rd_stats); return; } av1_merge_rd_stats(rd_stats, &pn_rd_stats); this_rd += RDCOST(x->rdmult, pn_rd_stats.rate, pn_rd_stats.dist); block += step; } } if (tx_size > TX_4X4 && depth < MAX_VARTX_DEPTH) rd_stats->rate += x->txfm_partition_cost[ctx][1]; } } // Return value 0: early termination triggered, no valid rd cost available; // 1: rd cost values are valid. static int inter_block_yrd(const AV1_COMP *cpi, MACROBLOCK *x, RD_STATS *rd_stats, BLOCK_SIZE bsize, int64_t ref_best_rd, FAST_TX_SEARCH_MODE ftxs_mode) { MACROBLOCKD *const xd = &x->e_mbd; int is_cost_valid = 1; int64_t this_rd = 0; if (ref_best_rd < 0) is_cost_valid = 0; av1_init_rd_stats(rd_stats); if (is_cost_valid) { const struct macroblockd_plane *const pd = &xd->plane[0]; const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd->subsampling_x, pd->subsampling_y); const int mi_width = mi_size_wide[plane_bsize]; const int mi_height = mi_size_high[plane_bsize]; const TX_SIZE max_tx_size = get_vartx_max_txsize(xd, plane_bsize, 0); const int bh = tx_size_high_unit[max_tx_size]; const int bw = tx_size_wide_unit[max_tx_size]; const int init_depth = get_search_init_depth(mi_width, mi_height, 1, &cpi->sf); int idx, idy; int block = 0; int step = tx_size_wide_unit[max_tx_size] * tx_size_high_unit[max_tx_size]; ENTROPY_CONTEXT ctxa[MAX_MIB_SIZE]; ENTROPY_CONTEXT ctxl[MAX_MIB_SIZE]; TXFM_CONTEXT tx_above[MAX_MIB_SIZE]; TXFM_CONTEXT tx_left[MAX_MIB_SIZE]; RD_STATS pn_rd_stats; av1_get_entropy_contexts(bsize, pd, ctxa, ctxl); memcpy(tx_above, xd->above_txfm_context, sizeof(TXFM_CONTEXT) * mi_width); memcpy(tx_left, xd->left_txfm_context, sizeof(TXFM_CONTEXT) * mi_height); for (idy = 0; idy < mi_height; idy += bh) { for (idx = 0; idx < mi_width; idx += bw) { av1_init_rd_stats(&pn_rd_stats); tx_block_yrd(cpi, x, idy, idx, block, max_tx_size, plane_bsize, init_depth, ctxa, ctxl, tx_above, tx_left, ref_best_rd - this_rd, &pn_rd_stats, ftxs_mode); if (pn_rd_stats.rate == INT_MAX) { av1_invalid_rd_stats(rd_stats); return 0; } av1_merge_rd_stats(rd_stats, &pn_rd_stats); this_rd += AOMMIN(RDCOST(x->rdmult, pn_rd_stats.rate, pn_rd_stats.dist), RDCOST(x->rdmult, pn_rd_stats.zero_rate, pn_rd_stats.sse)); block += step; } } } const int skip_ctx = av1_get_skip_context(xd); const int s0 = x->skip_cost[skip_ctx][0]; const int s1 = x->skip_cost[skip_ctx][1]; int64_t skip_rd = RDCOST(x->rdmult, s1, rd_stats->sse); this_rd = RDCOST(x->rdmult, rd_stats->rate + s0, rd_stats->dist); if (skip_rd < this_rd) { this_rd = skip_rd; rd_stats->rate = 0; rd_stats->dist = rd_stats->sse; rd_stats->skip = 1; } if (this_rd > ref_best_rd) is_cost_valid = 0; if (!is_cost_valid) { // reset cost value av1_invalid_rd_stats(rd_stats); } return is_cost_valid; } static int find_tx_size_rd_info(TXB_RD_RECORD *cur_record, const uint32_t hash) { // Linear search through the circular buffer to find matching hash. for (int i = cur_record->index_start - 1; i >= 0; i--) { if (cur_record->hash_vals[i] == hash) return i; } for (int i = cur_record->num - 1; i >= cur_record->index_start; i--) { if (cur_record->hash_vals[i] == hash) return i; } int index; // If not found - add new RD info into the buffer and return its index if (cur_record->num < TX_SIZE_RD_RECORD_BUFFER_LEN) { index = (cur_record->index_start + cur_record->num) % TX_SIZE_RD_RECORD_BUFFER_LEN; cur_record->num++; } else { index = cur_record->index_start; cur_record->index_start = (cur_record->index_start + 1) % TX_SIZE_RD_RECORD_BUFFER_LEN; } cur_record->hash_vals[index] = hash; av1_zero(cur_record->tx_rd_info[index]); return index; } typedef struct { int leaf; int8_t children[4]; } RD_RECORD_IDX_NODE; static const RD_RECORD_IDX_NODE rd_record_tree_8x8[] = { { 1, { 0 } }, }; static const RD_RECORD_IDX_NODE rd_record_tree_8x16[] = { { 0, { 1, 2, -1, -1 } }, { 1, { 0, 0, 0, 0 } }, { 1, { 0, 0, 0, 0 } }, }; static const RD_RECORD_IDX_NODE rd_record_tree_16x8[] = { { 0, { 1, 2, -1, -1 } }, { 1, { 0 } }, { 1, { 0 } }, }; static const RD_RECORD_IDX_NODE rd_record_tree_16x16[] = { { 0, { 1, 2, 3, 4 } }, { 1, { 0 } }, { 1, { 0 } }, { 1, { 0 } }, { 1, { 0 } }, }; static const RD_RECORD_IDX_NODE rd_record_tree_1_2[] = { { 0, { 1, 2, -1, -1 } }, { 0, { 3, 4, 5, 6 } }, { 0, { 7, 8, 9, 10 } }, }; static const RD_RECORD_IDX_NODE rd_record_tree_2_1[] = { { 0, { 1, 2, -1, -1 } }, { 0, { 3, 4, 7, 8 } }, { 0, { 5, 6, 9, 10 } }, }; static const RD_RECORD_IDX_NODE rd_record_tree_sqr[] = { { 0, { 1, 2, 3, 4 } }, { 0, { 5, 6, 9, 10 } }, { 0, { 7, 8, 11, 12 } }, { 0, { 13, 14, 17, 18 } }, { 0, { 15, 16, 19, 20 } }, }; static const RD_RECORD_IDX_NODE rd_record_tree_64x128[] = { { 0, { 2, 3, 4, 5 } }, { 0, { 6, 7, 8, 9 } }, { 0, { 10, 11, 14, 15 } }, { 0, { 12, 13, 16, 17 } }, { 0, { 18, 19, 22, 23 } }, { 0, { 20, 21, 24, 25 } }, { 0, { 26, 27, 30, 31 } }, { 0, { 28, 29, 32, 33 } }, { 0, { 34, 35, 38, 39 } }, { 0, { 36, 37, 40, 41 } }, }; static const RD_RECORD_IDX_NODE rd_record_tree_128x64[] = { { 0, { 2, 3, 6, 7 } }, { 0, { 4, 5, 8, 9 } }, { 0, { 10, 11, 18, 19 } }, { 0, { 12, 13, 20, 21 } }, { 0, { 14, 15, 22, 23 } }, { 0, { 16, 17, 24, 25 } }, { 0, { 26, 27, 34, 35 } }, { 0, { 28, 29, 36, 37 } }, { 0, { 30, 31, 38, 39 } }, { 0, { 32, 33, 40, 41 } }, }; static const RD_RECORD_IDX_NODE rd_record_tree_128x128[] = { { 0, { 4, 5, 8, 9 } }, { 0, { 6, 7, 10, 11 } }, { 0, { 12, 13, 16, 17 } }, { 0, { 14, 15, 18, 19 } }, { 0, { 20, 21, 28, 29 } }, { 0, { 22, 23, 30, 31 } }, { 0, { 24, 25, 32, 33 } }, { 0, { 26, 27, 34, 35 } }, { 0, { 36, 37, 44, 45 } }, { 0, { 38, 39, 46, 47 } }, { 0, { 40, 41, 48, 49 } }, { 0, { 42, 43, 50, 51 } }, { 0, { 52, 53, 60, 61 } }, { 0, { 54, 55, 62, 63 } }, { 0, { 56, 57, 64, 65 } }, { 0, { 58, 59, 66, 67 } }, { 0, { 68, 69, 76, 77 } }, { 0, { 70, 71, 78, 79 } }, { 0, { 72, 73, 80, 81 } }, { 0, { 74, 75, 82, 83 } }, }; static const RD_RECORD_IDX_NODE rd_record_tree_1_4[] = { { 0, { 1, -1, 2, -1 } }, { 0, { 3, 4, -1, -1 } }, { 0, { 5, 6, -1, -1 } }, }; static const RD_RECORD_IDX_NODE rd_record_tree_4_1[] = { { 0, { 1, 2, -1, -1 } }, { 0, { 3, 4, -1, -1 } }, { 0, { 5, 6, -1, -1 } }, }; static const RD_RECORD_IDX_NODE *rd_record_tree[BLOCK_SIZES_ALL] = { NULL, // BLOCK_4X4 NULL, // BLOCK_4X8 NULL, // BLOCK_8X4 rd_record_tree_8x8, // BLOCK_8X8 rd_record_tree_8x16, // BLOCK_8X16 rd_record_tree_16x8, // BLOCK_16X8 rd_record_tree_16x16, // BLOCK_16X16 rd_record_tree_1_2, // BLOCK_16X32 rd_record_tree_2_1, // BLOCK_32X16 rd_record_tree_sqr, // BLOCK_32X32 rd_record_tree_1_2, // BLOCK_32X64 rd_record_tree_2_1, // BLOCK_64X32 rd_record_tree_sqr, // BLOCK_64X64 rd_record_tree_64x128, // BLOCK_64X128 rd_record_tree_128x64, // BLOCK_128X64 rd_record_tree_128x128, // BLOCK_128X128 NULL, // BLOCK_4X16 NULL, // BLOCK_16X4 rd_record_tree_1_4, // BLOCK_8X32 rd_record_tree_4_1, // BLOCK_32X8 rd_record_tree_1_4, // BLOCK_16X64 rd_record_tree_4_1, // BLOCK_64X16 }; static const int rd_record_tree_size[BLOCK_SIZES_ALL] = { 0, // BLOCK_4X4 0, // BLOCK_4X8 0, // BLOCK_8X4 sizeof(rd_record_tree_8x8) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_8X8 sizeof(rd_record_tree_8x16) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_8X16 sizeof(rd_record_tree_16x8) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_16X8 sizeof(rd_record_tree_16x16) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_16X16 sizeof(rd_record_tree_1_2) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_16X32 sizeof(rd_record_tree_2_1) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_32X16 sizeof(rd_record_tree_sqr) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_32X32 sizeof(rd_record_tree_1_2) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_32X64 sizeof(rd_record_tree_2_1) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_64X32 sizeof(rd_record_tree_sqr) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_64X64 sizeof(rd_record_tree_64x128) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_64X128 sizeof(rd_record_tree_128x64) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_128X64 sizeof(rd_record_tree_128x128) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_128X128 0, // BLOCK_4X16 0, // BLOCK_16X4 sizeof(rd_record_tree_1_4) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_8X32 sizeof(rd_record_tree_4_1) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_32X8 sizeof(rd_record_tree_1_4) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_16X64 sizeof(rd_record_tree_4_1) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_64X16 }; static INLINE void init_rd_record_tree(TXB_RD_INFO_NODE *tree, BLOCK_SIZE bsize) { const RD_RECORD_IDX_NODE *rd_record = rd_record_tree[bsize]; const int size = rd_record_tree_size[bsize]; for (int i = 0; i < size; ++i) { if (rd_record[i].leaf) { av1_zero(tree[i].children); } else { for (int j = 0; j < 4; ++j) { const int8_t idx = rd_record[i].children[j]; tree[i].children[j] = idx > 0 ? &tree[idx] : NULL; } } } } // Go through all TX blocks that could be used in TX size search, compute // residual hash values for them and find matching RD info that stores previous // RD search results for these TX blocks. The idea is to prevent repeated // rate/distortion computations that happen because of the combination of // partition and TX size search. The resulting RD info records are returned in // the form of a quadtree for easier access in actual TX size search. static int find_tx_size_rd_records(MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row, int mi_col, TXB_RD_INFO_NODE *dst_rd_info) { TXB_RD_RECORD *rd_records_table[4] = { x->txb_rd_record_8X8, x->txb_rd_record_16X16, x->txb_rd_record_32X32, x->txb_rd_record_64X64 }; const TX_SIZE max_square_tx_size = max_txsize_lookup[bsize]; const int bw = block_size_wide[bsize]; const int bh = block_size_high[bsize]; // Hashing is performed only for square TX sizes larger than TX_4X4 if (max_square_tx_size < TX_8X8) return 0; const int diff_stride = bw; const struct macroblock_plane *const p = &x->plane[0]; const int16_t *diff = &p->src_diff[0]; init_rd_record_tree(dst_rd_info, bsize); // Coordinates of the top-left corner of current block within the superblock // measured in pixels: const int mi_row_in_sb = (mi_row % MAX_MIB_SIZE) << MI_SIZE_LOG2; const int mi_col_in_sb = (mi_col % MAX_MIB_SIZE) << MI_SIZE_LOG2; int cur_rd_info_idx = 0; int cur_tx_depth = 0; TX_SIZE cur_tx_size = max_txsize_rect_lookup[bsize]; while (cur_tx_depth <= MAX_VARTX_DEPTH) { const int cur_tx_bw = tx_size_wide[cur_tx_size]; const int cur_tx_bh = tx_size_high[cur_tx_size]; if (cur_tx_bw < 8 || cur_tx_bh < 8) break; const TX_SIZE next_tx_size = sub_tx_size_map[cur_tx_size]; const int tx_size_idx = cur_tx_size - TX_8X8; for (int row = 0; row < bh; row += cur_tx_bh) { for (int col = 0; col < bw; col += cur_tx_bw) { if (cur_tx_bw != cur_tx_bh) { // Use dummy nodes for all rectangular transforms within the // TX size search tree. dst_rd_info[cur_rd_info_idx].rd_info_array = NULL; } else { // Get spatial location of this TX block within the superblock // (measured in cur_tx_bsize units). const int row_in_sb = (mi_row_in_sb + row) / cur_tx_bh; const int col_in_sb = (mi_col_in_sb + col) / cur_tx_bw; int16_t hash_data[MAX_SB_SQUARE]; int16_t *cur_hash_row = hash_data; const int16_t *cur_diff_row = diff + row * diff_stride + col; for (int i = 0; i < cur_tx_bh; i++) { memcpy(cur_hash_row, cur_diff_row, sizeof(*hash_data) * cur_tx_bw); cur_hash_row += cur_tx_bw; cur_diff_row += diff_stride; } const int hash = av1_get_crc32c_value(&x->mb_rd_record.crc_calculator, (uint8_t *)hash_data, 2 * cur_tx_bw * cur_tx_bh); // Find corresponding RD info based on the hash value. const int record_idx = row_in_sb * (MAX_MIB_SIZE >> (tx_size_idx + 1)) + col_in_sb; TXB_RD_RECORD *records = &rd_records_table[tx_size_idx][record_idx]; int idx = find_tx_size_rd_info(records, hash); dst_rd_info[cur_rd_info_idx].rd_info_array = &records->tx_rd_info[idx]; } ++cur_rd_info_idx; } } cur_tx_size = next_tx_size; ++cur_tx_depth; } return 1; } // Search for best transform size and type for luma inter blocks. static void pick_tx_size_type_yrd(const AV1_COMP *cpi, MACROBLOCK *x, RD_STATS *rd_stats, BLOCK_SIZE bsize, int mi_row, int mi_col, int64_t ref_best_rd) { const AV1_COMMON *cm = &cpi->common; MACROBLOCKD *const xd = &x->e_mbd; assert(is_inter_block(xd->mi[0])); av1_invalid_rd_stats(rd_stats); if (cpi->sf.model_based_prune_tx_search_level && ref_best_rd != INT64_MAX) { int model_rate; int64_t model_dist; int model_skip; model_rd_sb_fn[MODELRD_TYPE_TX_SEARCH_PRUNE]( cpi, bsize, x, xd, 0, 0, mi_row, mi_col, &model_rate, &model_dist, &model_skip, NULL, NULL, NULL, NULL); const int64_t model_rd = RDCOST(x->rdmult, model_rate, model_dist); // If the modeled rd is a lot worse than the best so far, breakout. // TODO(debargha, urvang): Improve the model and make the check below // tighter. assert(cpi->sf.model_based_prune_tx_search_level >= 0 && cpi->sf.model_based_prune_tx_search_level <= 2); static const int prune_factor_by8[] = { 3, 5 }; if (!model_skip && ((model_rd * prune_factor_by8[cpi->sf.model_based_prune_tx_search_level - 1]) >> 3) > ref_best_rd) return; } uint32_t hash = 0; int32_t match_index = -1; MB_RD_RECORD *mb_rd_record = NULL; const int within_border = mi_row >= xd->tile.mi_row_start && (mi_row + mi_size_high[bsize] < xd->tile.mi_row_end) && mi_col >= xd->tile.mi_col_start && (mi_col + mi_size_wide[bsize] < xd->tile.mi_col_end); const int is_mb_rd_hash_enabled = (within_border && cpi->sf.use_mb_rd_hash); const int n4 = bsize_to_num_blk(bsize); if (is_mb_rd_hash_enabled) { hash = get_block_residue_hash(x, bsize); mb_rd_record = &x->mb_rd_record; match_index = find_mb_rd_info(mb_rd_record, ref_best_rd, hash); if (match_index != -1) { MB_RD_INFO *tx_rd_info = &mb_rd_record->tx_rd_info[match_index]; fetch_tx_rd_info(n4, tx_rd_info, rd_stats, x); return; } } // If we predict that skip is the optimal RD decision - set the respective // context and terminate early. int64_t dist; if (cpi->sf.tx_type_search.use_skip_flag_prediction && predict_skip_flag(x, bsize, &dist, cm->reduced_tx_set_used)) { set_skip_flag(x, rd_stats, bsize, dist); // Save the RD search results into tx_rd_record. if (is_mb_rd_hash_enabled) save_tx_rd_info(n4, hash, x, rd_stats, mb_rd_record); return; } #if CONFIG_SPEED_STATS ++x->tx_search_count; #endif // CONFIG_SPEED_STATS // Precompute residual hashes and find existing or add new RD records to // store and reuse rate and distortion values to speed up TX size search. TXB_RD_INFO_NODE matched_rd_info[4 + 16 + 64]; int found_rd_info = 0; if (ref_best_rd != INT64_MAX && within_border && cpi->sf.use_inter_txb_hash) { found_rd_info = find_tx_size_rd_records(x, bsize, mi_row, mi_col, matched_rd_info); } // Get the tx_size 1 level down const TX_SIZE min_tx_size = sub_tx_size_map[max_txsize_rect_lookup[bsize]]; const TxSetType tx_set_type = av1_get_ext_tx_set_type(min_tx_size, 1, cm->reduced_tx_set_used); prune_tx(cpi, bsize, x, xd, tx_set_type); int found = 0; RD_STATS this_rd_stats; av1_init_rd_stats(&this_rd_stats); const int64_t rd = select_tx_size_and_type(cpi, x, &this_rd_stats, bsize, ref_best_rd, found_rd_info ? matched_rd_info : NULL); if (rd < INT64_MAX) { *rd_stats = this_rd_stats; found = 1; } // Reset the pruning flags. av1_zero(x->tx_search_prune); x->tx_split_prune_flag = 0; // We should always find at least one candidate unless ref_best_rd is less // than INT64_MAX (in which case, all the calls to select_tx_size_fix_type // might have failed to find something better) assert(IMPLIES(!found, ref_best_rd != INT64_MAX)); if (!found) return; // Save the RD search results into tx_rd_record. if (is_mb_rd_hash_enabled) { assert(mb_rd_record != NULL); save_tx_rd_info(n4, hash, x, rd_stats, mb_rd_record); } } static void model_rd_for_sb_with_fullrdy( const AV1_COMP *const cpi, BLOCK_SIZE bsize, MACROBLOCK *x, MACROBLOCKD *xd, int plane_from, int plane_to, int mi_row, int mi_col, int *out_rate_sum, int64_t *out_dist_sum, int *skip_txfm_sb, int64_t *skip_sse_sb, int *plane_rate, int64_t *plane_sse, int64_t *plane_dist) { const int ref = xd->mi[0]->ref_frame[0]; int64_t rate_sum = 0; int64_t dist_sum = 0; int64_t total_sse = 0; for (int plane = plane_from; plane <= plane_to; ++plane) { struct macroblock_plane *const p = &x->plane[plane]; struct macroblockd_plane *const pd = &xd->plane[plane]; const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd->subsampling_x, pd->subsampling_y); const int bw = block_size_wide[plane_bsize]; const int bh = block_size_high[plane_bsize]; int64_t sse; int rate; int64_t dist; if (x->skip_chroma_rd && plane) continue; if (is_cur_buf_hbd(xd)) { sse = aom_highbd_sse(p->src.buf, p->src.stride, pd->dst.buf, pd->dst.stride, bw, bh); } else { sse = aom_sse(p->src.buf, p->src.stride, pd->dst.buf, pd->dst.stride, bw, bh); } sse = ROUND_POWER_OF_TWO(sse, (xd->bd - 8) * 2); RD_STATS rd_stats; if (plane == 0) { pick_tx_size_type_yrd(cpi, x, &rd_stats, bsize, mi_row, mi_col, INT64_MAX); if (rd_stats.invalid_rate) { rate = 0; dist = sse << 4; } else { rate = rd_stats.rate; dist = rd_stats.dist; } } else { model_rd_with_curvfit(cpi, x, plane_bsize, plane, sse, bw * bh, &rate, &dist); } if (plane == 0) x->pred_sse[ref] = (unsigned int)AOMMIN(sse, UINT_MAX); total_sse += sse; rate_sum += rate; dist_sum += dist; if (plane_rate) plane_rate[plane] = rate; if (plane_sse) plane_sse[plane] = sse; if (plane_dist) plane_dist[plane] = dist; } if (skip_txfm_sb) *skip_txfm_sb = total_sse == 0; if (skip_sse_sb) *skip_sse_sb = total_sse << 4; *out_rate_sum = (int)rate_sum; *out_dist_sum = dist_sum; } static void rd_pick_palette_intra_sbuv(const AV1_COMP *const cpi, MACROBLOCK *x, int dc_mode_cost, uint8_t *best_palette_color_map, MB_MODE_INFO *const best_mbmi, int64_t *best_rd, int *rate, int *rate_tokenonly, int64_t *distortion, int *skippable) { MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; assert(!is_inter_block(mbmi)); assert( av1_allow_palette(cpi->common.allow_screen_content_tools, mbmi->sb_type)); PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info; const BLOCK_SIZE bsize = mbmi->sb_type; const SequenceHeader *const seq_params = &cpi->common.seq_params; int this_rate; int64_t this_rd; int colors_u, colors_v, colors; const int src_stride = x->plane[1].src.stride; const uint8_t *const src_u = x->plane[1].src.buf; const uint8_t *const src_v = x->plane[2].src.buf; uint8_t *const color_map = xd->plane[1].color_index_map; RD_STATS tokenonly_rd_stats; int plane_block_width, plane_block_height, rows, cols; av1_get_block_dimensions(bsize, 1, xd, &plane_block_width, &plane_block_height, &rows, &cols); mbmi->uv_mode = UV_DC_PRED; int count_buf[1 << 12]; // Maximum (1 << 12) color levels. if (seq_params->use_highbitdepth) { colors_u = av1_count_colors_highbd(src_u, src_stride, rows, cols, seq_params->bit_depth, count_buf); colors_v = av1_count_colors_highbd(src_v, src_stride, rows, cols, seq_params->bit_depth, count_buf); } else { colors_u = av1_count_colors(src_u, src_stride, rows, cols, count_buf); colors_v = av1_count_colors(src_v, src_stride, rows, cols, count_buf); } uint16_t color_cache[2 * PALETTE_MAX_SIZE]; const int n_cache = av1_get_palette_cache(xd, 1, color_cache); colors = colors_u > colors_v ? colors_u : colors_v; if (colors > 1 && colors <= 64) { int r, c, n, i, j; const int max_itr = 50; int lb_u, ub_u, val_u; int lb_v, ub_v, val_v; int *const data = x->palette_buffer->kmeans_data_buf; int centroids[2 * PALETTE_MAX_SIZE]; uint16_t *src_u16 = CONVERT_TO_SHORTPTR(src_u); uint16_t *src_v16 = CONVERT_TO_SHORTPTR(src_v); if (seq_params->use_highbitdepth) { lb_u = src_u16[0]; ub_u = src_u16[0]; lb_v = src_v16[0]; ub_v = src_v16[0]; } else { lb_u = src_u[0]; ub_u = src_u[0]; lb_v = src_v[0]; ub_v = src_v[0]; } for (r = 0; r < rows; ++r) { for (c = 0; c < cols; ++c) { if (seq_params->use_highbitdepth) { val_u = src_u16[r * src_stride + c]; val_v = src_v16[r * src_stride + c]; data[(r * cols + c) * 2] = val_u; data[(r * cols + c) * 2 + 1] = val_v; } else { val_u = src_u[r * src_stride + c]; val_v = src_v[r * src_stride + c]; data[(r * cols + c) * 2] = val_u; data[(r * cols + c) * 2 + 1] = val_v; } if (val_u < lb_u) lb_u = val_u; else if (val_u > ub_u) ub_u = val_u; if (val_v < lb_v) lb_v = val_v; else if (val_v > ub_v) ub_v = val_v; } } for (n = colors > PALETTE_MAX_SIZE ? PALETTE_MAX_SIZE : colors; n >= 2; --n) { for (i = 0; i < n; ++i) { centroids[i * 2] = lb_u + (2 * i + 1) * (ub_u - lb_u) / n / 2; centroids[i * 2 + 1] = lb_v + (2 * i + 1) * (ub_v - lb_v) / n / 2; } av1_k_means(data, centroids, color_map, rows * cols, n, 2, max_itr); optimize_palette_colors(color_cache, n_cache, n, 2, centroids); // Sort the U channel colors in ascending order. for (i = 0; i < 2 * (n - 1); i += 2) { int min_idx = i; int min_val = centroids[i]; for (j = i + 2; j < 2 * n; j += 2) if (centroids[j] < min_val) min_val = centroids[j], min_idx = j; if (min_idx != i) { int temp_u = centroids[i], temp_v = centroids[i + 1]; centroids[i] = centroids[min_idx]; centroids[i + 1] = centroids[min_idx + 1]; centroids[min_idx] = temp_u, centroids[min_idx + 1] = temp_v; } } av1_calc_indices(data, centroids, color_map, rows * cols, n, 2); extend_palette_color_map(color_map, cols, rows, plane_block_width, plane_block_height); pmi->palette_size[1] = n; for (i = 1; i < 3; ++i) { for (j = 0; j < n; ++j) { if (seq_params->use_highbitdepth) pmi->palette_colors[i * PALETTE_MAX_SIZE + j] = clip_pixel_highbd( (int)centroids[j * 2 + i - 1], seq_params->bit_depth); else pmi->palette_colors[i * PALETTE_MAX_SIZE + j] = clip_pixel((int)centroids[j * 2 + i - 1]); } } super_block_uvrd(cpi, x, &tokenonly_rd_stats, bsize, *best_rd); if (tokenonly_rd_stats.rate == INT_MAX) continue; this_rate = tokenonly_rd_stats.rate + intra_mode_info_cost_uv(cpi, x, mbmi, bsize, dc_mode_cost); this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); if (this_rd < *best_rd) { *best_rd = this_rd; *best_mbmi = *mbmi; memcpy(best_palette_color_map, color_map, plane_block_width * plane_block_height * sizeof(best_palette_color_map[0])); *rate = this_rate; *distortion = tokenonly_rd_stats.dist; *rate_tokenonly = tokenonly_rd_stats.rate; *skippable = tokenonly_rd_stats.skip; } } } if (best_mbmi->palette_mode_info.palette_size[1] > 0) { memcpy(color_map, best_palette_color_map, plane_block_width * plane_block_height * sizeof(best_palette_color_map[0])); } } // Run RD calculation with given chroma intra prediction angle., and return // the RD cost. Update the best mode info. if the RD cost is the best so far. static int64_t pick_intra_angle_routine_sbuv( const AV1_COMP *const cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int rate_overhead, int64_t best_rd_in, int *rate, RD_STATS *rd_stats, int *best_angle_delta, int64_t *best_rd) { MB_MODE_INFO *mbmi = x->e_mbd.mi[0]; assert(!is_inter_block(mbmi)); int this_rate; int64_t this_rd; RD_STATS tokenonly_rd_stats; if (!super_block_uvrd(cpi, x, &tokenonly_rd_stats, bsize, best_rd_in)) return INT64_MAX; this_rate = tokenonly_rd_stats.rate + intra_mode_info_cost_uv(cpi, x, mbmi, bsize, rate_overhead); this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); if (this_rd < *best_rd) { *best_rd = this_rd; *best_angle_delta = mbmi->angle_delta[PLANE_TYPE_UV]; *rate = this_rate; rd_stats->rate = tokenonly_rd_stats.rate; rd_stats->dist = tokenonly_rd_stats.dist; rd_stats->skip = tokenonly_rd_stats.skip; } return this_rd; } // With given chroma directional intra prediction mode, pick the best angle // delta. Return true if a RD cost that is smaller than the input one is found. static int rd_pick_intra_angle_sbuv(const AV1_COMP *const cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int rate_overhead, int64_t best_rd, int *rate, RD_STATS *rd_stats) { MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *mbmi = xd->mi[0]; assert(!is_inter_block(mbmi)); int i, angle_delta, best_angle_delta = 0; int64_t this_rd, best_rd_in, rd_cost[2 * (MAX_ANGLE_DELTA + 2)]; rd_stats->rate = INT_MAX; rd_stats->skip = 0; rd_stats->dist = INT64_MAX; for (i = 0; i < 2 * (MAX_ANGLE_DELTA + 2); ++i) rd_cost[i] = INT64_MAX; for (angle_delta = 0; angle_delta <= MAX_ANGLE_DELTA; angle_delta += 2) { for (i = 0; i < 2; ++i) { best_rd_in = (best_rd == INT64_MAX) ? INT64_MAX : (best_rd + (best_rd >> ((angle_delta == 0) ? 3 : 5))); mbmi->angle_delta[PLANE_TYPE_UV] = (1 - 2 * i) * angle_delta; this_rd = pick_intra_angle_routine_sbuv(cpi, x, bsize, rate_overhead, best_rd_in, rate, rd_stats, &best_angle_delta, &best_rd); rd_cost[2 * angle_delta + i] = this_rd; if (angle_delta == 0) { if (this_rd == INT64_MAX) return 0; rd_cost[1] = this_rd; break; } } } assert(best_rd != INT64_MAX); for (angle_delta = 1; angle_delta <= MAX_ANGLE_DELTA; angle_delta += 2) { int64_t rd_thresh; for (i = 0; i < 2; ++i) { int skip_search = 0; rd_thresh = best_rd + (best_rd >> 5); if (rd_cost[2 * (angle_delta + 1) + i] > rd_thresh && rd_cost[2 * (angle_delta - 1) + i] > rd_thresh) skip_search = 1; if (!skip_search) { mbmi->angle_delta[PLANE_TYPE_UV] = (1 - 2 * i) * angle_delta; pick_intra_angle_routine_sbuv(cpi, x, bsize, rate_overhead, best_rd, rate, rd_stats, &best_angle_delta, &best_rd); } } } mbmi->angle_delta[PLANE_TYPE_UV] = best_angle_delta; return rd_stats->rate != INT_MAX; } #define PLANE_SIGN_TO_JOINT_SIGN(plane, a, b) \ (plane == CFL_PRED_U ? a * CFL_SIGNS + b - 1 : b * CFL_SIGNS + a - 1) static int cfl_rd_pick_alpha(MACROBLOCK *const x, const AV1_COMP *const cpi, TX_SIZE tx_size, int64_t best_rd) { MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; const BLOCK_SIZE bsize = mbmi->sb_type; #if CONFIG_DEBUG assert(is_cfl_allowed(xd) && cpi->oxcf.enable_cfl_intra); const int ssx = xd->plane[AOM_PLANE_U].subsampling_x; const int ssy = xd->plane[AOM_PLANE_U].subsampling_y; const BLOCK_SIZE plane_bsize = get_plane_block_size(mbmi->sb_type, ssx, ssy); (void)plane_bsize; assert(plane_bsize < BLOCK_SIZES_ALL); if (!xd->lossless[mbmi->segment_id]) { assert(block_size_wide[plane_bsize] == tx_size_wide[tx_size]); assert(block_size_high[plane_bsize] == tx_size_high[tx_size]); } #endif // CONFIG_DEBUG xd->cfl.use_dc_pred_cache = 1; const int64_t mode_rd = RDCOST(x->rdmult, x->intra_uv_mode_cost[CFL_ALLOWED][mbmi->mode][UV_CFL_PRED], 0); int64_t best_rd_uv[CFL_JOINT_SIGNS][CFL_PRED_PLANES]; int best_c[CFL_JOINT_SIGNS][CFL_PRED_PLANES]; #if CONFIG_DEBUG int best_rate_uv[CFL_JOINT_SIGNS][CFL_PRED_PLANES]; #endif // CONFIG_DEBUG for (int plane = 0; plane < CFL_PRED_PLANES; plane++) { RD_STATS rd_stats; av1_init_rd_stats(&rd_stats); for (int joint_sign = 0; joint_sign < CFL_JOINT_SIGNS; joint_sign++) { best_rd_uv[joint_sign][plane] = INT64_MAX; best_c[joint_sign][plane] = 0; } // Collect RD stats for an alpha value of zero in this plane. // Skip i == CFL_SIGN_ZERO as (0, 0) is invalid. for (int i = CFL_SIGN_NEG; i < CFL_SIGNS; i++) { const int joint_sign = PLANE_SIGN_TO_JOINT_SIGN(plane, CFL_SIGN_ZERO, i); if (i == CFL_SIGN_NEG) { mbmi->cfl_alpha_idx = 0; mbmi->cfl_alpha_signs = joint_sign; txfm_rd_in_plane(x, cpi, &rd_stats, best_rd, 0, plane + 1, bsize, tx_size, cpi->sf.use_fast_coef_costing, FTXS_NONE, 0); if (rd_stats.rate == INT_MAX) break; } const int alpha_rate = x->cfl_cost[joint_sign][plane][0]; best_rd_uv[joint_sign][plane] = RDCOST(x->rdmult, rd_stats.rate + alpha_rate, rd_stats.dist); #if CONFIG_DEBUG best_rate_uv[joint_sign][plane] = rd_stats.rate; #endif // CONFIG_DEBUG } } int best_joint_sign = -1; for (int plane = 0; plane < CFL_PRED_PLANES; plane++) { for (int pn_sign = CFL_SIGN_NEG; pn_sign < CFL_SIGNS; pn_sign++) { int progress = 0; for (int c = 0; c < CFL_ALPHABET_SIZE; c++) { int flag = 0; RD_STATS rd_stats; if (c > 2 && progress < c) break; av1_init_rd_stats(&rd_stats); for (int i = 0; i < CFL_SIGNS; i++) { const int joint_sign = PLANE_SIGN_TO_JOINT_SIGN(plane, pn_sign, i); if (i == 0) { mbmi->cfl_alpha_idx = (c << CFL_ALPHABET_SIZE_LOG2) + c; mbmi->cfl_alpha_signs = joint_sign; txfm_rd_in_plane(x, cpi, &rd_stats, best_rd, 0, plane + 1, bsize, tx_size, cpi->sf.use_fast_coef_costing, FTXS_NONE, 0); if (rd_stats.rate == INT_MAX) break; } const int alpha_rate = x->cfl_cost[joint_sign][plane][c]; int64_t this_rd = RDCOST(x->rdmult, rd_stats.rate + alpha_rate, rd_stats.dist); if (this_rd >= best_rd_uv[joint_sign][plane]) continue; best_rd_uv[joint_sign][plane] = this_rd; best_c[joint_sign][plane] = c; #if CONFIG_DEBUG best_rate_uv[joint_sign][plane] = rd_stats.rate; #endif // CONFIG_DEBUG flag = 2; if (best_rd_uv[joint_sign][!plane] == INT64_MAX) continue; this_rd += mode_rd + best_rd_uv[joint_sign][!plane]; if (this_rd >= best_rd) continue; best_rd = this_rd; best_joint_sign = joint_sign; } progress += flag; } } } int best_rate_overhead = INT_MAX; int ind = 0; if (best_joint_sign >= 0) { const int u = best_c[best_joint_sign][CFL_PRED_U]; const int v = best_c[best_joint_sign][CFL_PRED_V]; ind = (u << CFL_ALPHABET_SIZE_LOG2) + v; best_rate_overhead = x->cfl_cost[best_joint_sign][CFL_PRED_U][u] + x->cfl_cost[best_joint_sign][CFL_PRED_V][v]; #if CONFIG_DEBUG xd->cfl.rate = x->intra_uv_mode_cost[CFL_ALLOWED][mbmi->mode][UV_CFL_PRED] + best_rate_overhead + best_rate_uv[best_joint_sign][CFL_PRED_U] + best_rate_uv[best_joint_sign][CFL_PRED_V]; #endif // CONFIG_DEBUG } else { best_joint_sign = 0; } mbmi->cfl_alpha_idx = ind; mbmi->cfl_alpha_signs = best_joint_sign; xd->cfl.use_dc_pred_cache = 0; xd->cfl.dc_pred_is_cached[0] = 0; xd->cfl.dc_pred_is_cached[1] = 0; return best_rate_overhead; } static void init_sbuv_mode(MB_MODE_INFO *const mbmi) { mbmi->uv_mode = UV_DC_PRED; mbmi->palette_mode_info.palette_size[1] = 0; } static int64_t rd_pick_intra_sbuv_mode(const AV1_COMP *const cpi, MACROBLOCK *x, int *rate, int *rate_tokenonly, int64_t *distortion, int *skippable, BLOCK_SIZE bsize, TX_SIZE max_tx_size) { MACROBLOCKD *xd = &x->e_mbd; MB_MODE_INFO *mbmi = xd->mi[0]; assert(!is_inter_block(mbmi)); MB_MODE_INFO best_mbmi = *mbmi; int64_t best_rd = INT64_MAX, this_rd; for (int mode_idx = 0; mode_idx < UV_INTRA_MODES; ++mode_idx) { int this_rate; RD_STATS tokenonly_rd_stats; UV_PREDICTION_MODE mode = uv_rd_search_mode_order[mode_idx]; const int is_directional_mode = av1_is_directional_mode(get_uv_mode(mode)); if (!(cpi->sf.intra_uv_mode_mask[txsize_sqr_up_map[max_tx_size]] & (1 << mode))) continue; if (!cpi->oxcf.enable_smooth_intra && mode >= UV_SMOOTH_PRED && mode <= UV_SMOOTH_H_PRED) continue; if (!cpi->oxcf.enable_paeth_intra && mode == UV_PAETH_PRED) continue; mbmi->uv_mode = mode; int cfl_alpha_rate = 0; if (mode == UV_CFL_PRED) { if (!is_cfl_allowed(xd) || !cpi->oxcf.enable_cfl_intra) continue; assert(!is_directional_mode); const TX_SIZE uv_tx_size = av1_get_tx_size(AOM_PLANE_U, xd); cfl_alpha_rate = cfl_rd_pick_alpha(x, cpi, uv_tx_size, best_rd); if (cfl_alpha_rate == INT_MAX) continue; } mbmi->angle_delta[PLANE_TYPE_UV] = 0; if (is_directional_mode && av1_use_angle_delta(mbmi->sb_type) && cpi->oxcf.enable_angle_delta) { const int rate_overhead = x->intra_uv_mode_cost[is_cfl_allowed(xd)][mbmi->mode][mode]; if (!rd_pick_intra_angle_sbuv(cpi, x, bsize, rate_overhead, best_rd, &this_rate, &tokenonly_rd_stats)) continue; } else { if (!super_block_uvrd(cpi, x, &tokenonly_rd_stats, bsize, best_rd)) { continue; } } const int mode_cost = x->intra_uv_mode_cost[is_cfl_allowed(xd)][mbmi->mode][mode] + cfl_alpha_rate; this_rate = tokenonly_rd_stats.rate + intra_mode_info_cost_uv(cpi, x, mbmi, bsize, mode_cost); if (mode == UV_CFL_PRED) { assert(is_cfl_allowed(xd) && cpi->oxcf.enable_cfl_intra); #if CONFIG_DEBUG if (!xd->lossless[mbmi->segment_id]) assert(xd->cfl.rate == tokenonly_rd_stats.rate + mode_cost); #endif // CONFIG_DEBUG } this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); if (this_rd < best_rd) { best_mbmi = *mbmi; best_rd = this_rd; *rate = this_rate; *rate_tokenonly = tokenonly_rd_stats.rate; *distortion = tokenonly_rd_stats.dist; *skippable = tokenonly_rd_stats.skip; } } const int try_palette = cpi->oxcf.enable_palette && av1_allow_palette(cpi->common.allow_screen_content_tools, mbmi->sb_type); if (try_palette) { uint8_t *best_palette_color_map = x->palette_buffer->best_palette_color_map; rd_pick_palette_intra_sbuv( cpi, x, x->intra_uv_mode_cost[is_cfl_allowed(xd)][mbmi->mode][UV_DC_PRED], best_palette_color_map, &best_mbmi, &best_rd, rate, rate_tokenonly, distortion, skippable); } *mbmi = best_mbmi; // Make sure we actually chose a mode assert(best_rd < INT64_MAX); return best_rd; } static void choose_intra_uv_mode(const AV1_COMP *const cpi, MACROBLOCK *const x, BLOCK_SIZE bsize, TX_SIZE max_tx_size, int *rate_uv, int *rate_uv_tokenonly, int64_t *dist_uv, int *skip_uv, UV_PREDICTION_MODE *mode_uv) { const AV1_COMMON *const cm = &cpi->common; MACROBLOCKD *xd = &x->e_mbd; MB_MODE_INFO *mbmi = xd->mi[0]; const int mi_row = -xd->mb_to_top_edge >> (3 + MI_SIZE_LOG2); const int mi_col = -xd->mb_to_left_edge >> (3 + MI_SIZE_LOG2); // Use an estimated rd for uv_intra based on DC_PRED if the // appropriate speed flag is set. init_sbuv_mode(mbmi); if (x->skip_chroma_rd) { *rate_uv = 0; *rate_uv_tokenonly = 0; *dist_uv = 0; *skip_uv = 1; *mode_uv = UV_DC_PRED; return; } xd->cfl.is_chroma_reference = is_chroma_reference(mi_row, mi_col, bsize, cm->seq_params.subsampling_x, cm->seq_params.subsampling_y); bsize = scale_chroma_bsize(bsize, xd->plane[AOM_PLANE_U].subsampling_x, xd->plane[AOM_PLANE_U].subsampling_y); // Only store reconstructed luma when there's chroma RDO. When there's no // chroma RDO, the reconstructed luma will be stored in encode_superblock(). xd->cfl.store_y = store_cfl_required_rdo(cm, x); if (xd->cfl.store_y) { // Restore reconstructed luma values. av1_encode_intra_block_plane(cpi, x, mbmi->sb_type, AOM_PLANE_Y, cpi->optimize_seg_arr[mbmi->segment_id], mi_row, mi_col); xd->cfl.store_y = 0; } rd_pick_intra_sbuv_mode(cpi, x, rate_uv, rate_uv_tokenonly, dist_uv, skip_uv, bsize, max_tx_size); *mode_uv = mbmi->uv_mode;
+ show +
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
} static int cost_mv_ref(const MACROBLOCK *const x, PREDICTION_MODE mode, int16_t mode_context) { if (is_inter_compound_mode(mode)) { return x ->inter_compound_mode_cost[mode_context][INTER_COMPOUND_OFFSET(mode)]; } int mode_cost = 0;

[CVE-2020-0478_1.diff] rdopt.c #22
- cur_mv[1].as_int = args->single_newmv[ref_mv_idx][refs[1]].as_int; - if (cpi->sf.comp_inter_joint_search_thresh <= bsize) { - compound_single_motion_search_interinter( - cpi, x, bsize, cur_mv, mi_row, mi_col, NULL, 0, rate_mv, 0, 1); + if (valid_mv1) { + cur_mv[1].as_int = args->single_newmv[ref_mv_idx][refs[1]].as_int; + clamp_mv_in_range(x, &cur_mv[1], 1); + } + + // aomenc2 + if (cpi->sf.inter_sf.comp_inter_joint_search_thresh <= bsize || + !valid_mv1) { + av1_compound_single_motion_search_interinter(cpi, x, bsize, cur_mv, + NULL, 0, rate_mv, 1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rdopt.c
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
} else { *rate_mv = 0; for (i = 0; i < 2; ++i) { const int_mv ref_mv = av1_get_ref_mv(x, i); *rate_mv += av1_mv_bit_cost(&cur_mv[i].as_mv, &ref_mv.as_mv, x->nmv_vec_cost, x->mv_cost_stack, MV_COST_WEIGHT); } } } else if (this_mode == NEAREST_NEWMV || this_mode == NEAR_NEWMV) {
+ show +
8140
8141
8142
8143
cur_mv[1].as_int = args->single_newmv[ref_mv_idx][refs[1]].as_int; if (cpi->sf.comp_inter_joint_search_thresh <= bsize) { compound_single_motion_search_interinter( cpi, x, bsize, cur_mv, mi_row, mi_col, NULL, 0, rate_mv, 0, 1);
+ show +
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
} else { const int_mv ref_mv = av1_get_ref_mv(x, 1); *rate_mv = av1_mv_bit_cost(&cur_mv[1].as_mv, &ref_mv.as_mv, x->nmv_vec_cost, x->mv_cost_stack, MV_COST_WEIGHT); } } else { assert(this_mode == NEW_NEARESTMV || this_mode == NEW_NEARMV); cur_mv[0].as_int = args->single_newmv[ref_mv_idx][refs[0]].as_int; if (cpi->sf.comp_inter_joint_search_thresh <= bsize) {

[CVE-2020-0478_1.diff] rdopt.c #23
- cur_mv[0].as_int = args->single_newmv[ref_mv_idx][refs[0]].as_int; - if (cpi->sf.comp_inter_joint_search_thresh <= bsize) { - compound_single_motion_search_interinter( - cpi, x, bsize, cur_mv, mi_row, mi_col, NULL, 0, rate_mv, 0, 0); + if (valid_mv0) { + cur_mv[0].as_int = args->single_newmv[ref_mv_idx][refs[0]].as_int; + clamp_mv_in_range(x, &cur_mv[0], 0); + } + + // aomenc3 + if (cpi->sf.inter_sf.comp_inter_joint_search_thresh <= bsize || + !valid_mv0) { + av1_compound_single_motion_search_interinter(cpi, x, bsize, cur_mv, + NULL, 0, rate_mv, 0);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rdopt.c
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
compound_single_motion_search_interinter( cpi, x, bsize, cur_mv, mi_row, mi_col, NULL, 0, rate_mv, 0, 1); } else { const int_mv ref_mv = av1_get_ref_mv(x, 1); *rate_mv = av1_mv_bit_cost(&cur_mv[1].as_mv, &ref_mv.as_mv, x->nmv_vec_cost, x->mv_cost_stack, MV_COST_WEIGHT); } } else { assert(this_mode == NEW_NEARESTMV || this_mode == NEW_NEARMV);
+ show +
8152
8153
8154
8155
cur_mv[0].as_int = args->single_newmv[ref_mv_idx][refs[0]].as_int; if (cpi->sf.comp_inter_joint_search_thresh <= bsize) { compound_single_motion_search_interinter( cpi, x, bsize, cur_mv, mi_row, mi_col, NULL, 0, rate_mv, 0, 0);
+ show +
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
} else { const int_mv ref_mv = av1_get_ref_mv(x, 0); *rate_mv = av1_mv_bit_cost(&cur_mv[0].as_mv, &ref_mv.as_mv, x->nmv_vec_cost, x->mv_cost_stack, MV_COST_WEIGHT); } } } else { single_motion_search(cpi, x, bsize, mi_row, mi_col, 0, rate_mv); if (x->best_mv.as_int == INVALID_MV) return INT64_MAX;

[CVE-2020-0478_1.diff] rdopt.c #26
-struct obmc_check_mv_field_ctxt { - MB_MODE_INFO *current_mi; - int mv_field_check_result; -}; - -static INLINE void obmc_check_identical_mv(MACROBLOCKD *xd, int rel_mi_col, - uint8_t nb_mi_width, - MB_MODE_INFO *nb_mi, void *fun_ctxt, - const int num_planes) { - (void)xd; - (void)rel_mi_col; - (void)nb_mi_width; - (void)num_planes; - struct obmc_check_mv_field_ctxt *ctxt = - (struct obmc_check_mv_field_ctxt *)fun_ctxt; - const MB_MODE_INFO *current_mi = ctxt->current_mi; - - if (ctxt->mv_field_check_result == 0) return; - - if (nb_mi->ref_frame[0] != current_mi->ref_frame[0] || - nb_mi->mv[0].as_int != current_mi->mv[0].as_int || - nb_mi->interp_filters != current_mi->interp_filters) { - ctxt->mv_field_check_result = 0; - } -} - -// Check if the neighbors' motions used by obmc have same parameters as for -// the current block. If all the parameters are identical, obmc will produce -// the same prediction as from regular bmc, therefore we can skip the -// overlapping operations for less complexity. The parameters checked include -// reference frame, motion vector, and interpolation filter. -int check_identical_obmc_mv_field(const AV1_COMMON *cm, MACROBLOCKD *xd, - int mi_row, int mi_col) { - const BLOCK_SIZE bsize = xd->mi[0]->sb_type; - struct obmc_check_mv_field_ctxt mv_field_check_ctxt = { xd->mi[0], 1 }; - - foreach_overlappable_nb_above(cm, xd, mi_col, - max_neighbor_obmc[mi_size_wide_log2[bsize]], - obmc_check_identical_mv, &mv_field_check_ctxt); - foreach_overlappable_nb_left(cm, xd, mi_row, - max_neighbor_obmc[mi_size_high_log2[bsize]], - obmc_check_identical_mv, &mv_field_check_ctxt); - - return mv_field_check_ctxt.mv_field_check_result; -} - -static int skip_interintra_based_on_first_pass_stats(const AV1_COMP *const cpi, - MACROBLOCK *const x, - BLOCK_SIZE bsize, - int mi_row, int mi_col) { - MACROBLOCKD *xd = &x->e_mbd; - MB_MODE_INFO *mbmi = xd->mi[0]; - if (cpi->two_pass_partition_search && - cpi->sf.use_first_partition_pass_interintra_stats && - !x->cb_partition_scan) { - const int mi_width = mi_size_wide[bsize]; - const int mi_height = mi_size_high[bsize]; - // Search in the stats table to see if obmc motion mode was used in the - // first pass of partition search. - for (int row = mi_row; row < mi_row + mi_width; - row += FIRST_PARTITION_PASS_SAMPLE_REGION) { - for (int col = mi_col; col < mi_col + mi_height; - col += FIRST_PARTITION_PASS_SAMPLE_REGION) { - const int index = av1_first_partition_pass_stats_index(row, col); - const FIRST_PARTITION_PASS_STATS *const stats = - &x->first_partition_pass_stats[index]; - if (stats->interintra_motion_mode_count[mbmi->ref_frame[0]]) { - return 0; - } - } +static INLINE void update_mode_start_end_index(const AV1_COMP *const cpi, + int *mode_index_start, + int *mode_index_end, + int last_motion_mode_allowed, + int interintra_allowed, + int eval_motion_mode) { + *mode_index_start = (int)SIMPLE_TRANSLATION; + *mode_index_end = (int)last_motion_mode_allowed + interintra_allowed; + if (cpi->sf.winner_mode_sf.motion_mode_for_winner_cand) { + if (!eval_motion_mode) { + *mode_index_end = (int)SIMPLE_TRANSLATION; + } else { + // Set the start index appropriately to process motion modes other than + // simple translation + *mode_index_start = 1; - return 1; - return 0;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rdopt.c
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
TransformationType wmtype = get_wmtype(wm_params); if (num_proj_ref == 1) { if (wmtype != ROTZOOM) is_valid_warp = 0; } else { if (wmtype < ROTZOOM) is_valid_warp = 0; } } return is_valid_warp; }
+ show +
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
struct obmc_check_mv_field_ctxt { MB_MODE_INFO *current_mi; int mv_field_check_result; }; static INLINE void obmc_check_identical_mv(MACROBLOCKD *xd, int rel_mi_col, uint8_t nb_mi_width, MB_MODE_INFO *nb_mi, void *fun_ctxt, const int num_planes) { (void)xd; (void)rel_mi_col; (void)nb_mi_width; (void)num_planes; struct obmc_check_mv_field_ctxt *ctxt = (struct obmc_check_mv_field_ctxt *)fun_ctxt; const MB_MODE_INFO *current_mi = ctxt->current_mi; if (ctxt->mv_field_check_result == 0) return; if (nb_mi->ref_frame[0] != current_mi->ref_frame[0] || nb_mi->mv[0].as_int != current_mi->mv[0].as_int || nb_mi->interp_filters != current_mi->interp_filters) { ctxt->mv_field_check_result = 0; } } // Check if the neighbors' motions used by obmc have same parameters as for // the current block. If all the parameters are identical, obmc will produce // the same prediction as from regular bmc, therefore we can skip the // overlapping operations for less complexity. The parameters checked include // reference frame, motion vector, and interpolation filter. int check_identical_obmc_mv_field(const AV1_COMMON *cm, MACROBLOCKD *xd, int mi_row, int mi_col) { const BLOCK_SIZE bsize = xd->mi[0]->sb_type; struct obmc_check_mv_field_ctxt mv_field_check_ctxt = { xd->mi[0], 1 }; foreach_overlappable_nb_above(cm, xd, mi_col, max_neighbor_obmc[mi_size_wide_log2[bsize]], obmc_check_identical_mv, &mv_field_check_ctxt); foreach_overlappable_nb_left(cm, xd, mi_row, max_neighbor_obmc[mi_size_high_log2[bsize]], obmc_check_identical_mv, &mv_field_check_ctxt); return mv_field_check_ctxt.mv_field_check_result; } static int skip_interintra_based_on_first_pass_stats(const AV1_COMP *const cpi, MACROBLOCK *const x, BLOCK_SIZE bsize, int mi_row, int mi_col) { MACROBLOCKD *xd = &x->e_mbd; MB_MODE_INFO *mbmi = xd->mi[0]; if (cpi->two_pass_partition_search && cpi->sf.use_first_partition_pass_interintra_stats && !x->cb_partition_scan) { const int mi_width = mi_size_wide[bsize]; const int mi_height = mi_size_high[bsize]; // Search in the stats table to see if obmc motion mode was used in the // first pass of partition search. for (int row = mi_row; row < mi_row + mi_width; row += FIRST_PARTITION_PASS_SAMPLE_REGION) { for (int col = mi_col; col < mi_col + mi_height; col += FIRST_PARTITION_PASS_SAMPLE_REGION) { const int index = av1_first_partition_pass_stats_index(row, col); const FIRST_PARTITION_PASS_STATS *const stats = &x->first_partition_pass_stats[index]; if (stats->interintra_motion_mode_count[mbmi->ref_frame[0]]) { return 0; } } } return 1; } return 0;
+ show +
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
} // TODO(afergs): Refactor the MBMI references in here - there's four // TODO(afergs): Refactor optional args - add them to a struct or remove static int64_t motion_mode_rd( const AV1_COMP *const cpi, TileDataEnc *tile_data, MACROBLOCK *const x, BLOCK_SIZE bsize, RD_STATS *rd_stats, RD_STATS *rd_stats_y, RD_STATS *rd_stats_uv, int *disable_skip, int mi_row, int mi_col, HandleInterModeArgs *const args, int64_t ref_best_rd, const int *refs, int *rate_mv, const BUFFER_SET *orig_dst, int64_t *best_est_rd,

[CVE-2020-0478_1.diff] rdopt.c #27
- RD_STATS *rd_stats_uv, int *disable_skip, int mi_row, int mi_col, - HandleInterModeArgs *const args, int64_t ref_best_rd, const int *refs, - int *rate_mv, const BUFFER_SET *orig_dst, int64_t *best_est_rd, - int do_tx_search, InterModesInfo *inter_modes_info) { + RD_STATS *rd_stats_uv, int *disable_skip, HandleInterModeArgs *const args, + int64_t ref_best_rd, int64_t *ref_skip_rd, int *rate_mv, + const BUFFER_SET *orig_dst, int64_t *best_est_rd, int do_tx_search, + InterModesInfo *inter_modes_info, int eval_motion_mode) { + const FeatureFlags *const features = &cm->features;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rdopt.c
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
return 1; } return 0; } // TODO(afergs): Refactor the MBMI references in here - there's four // TODO(afergs): Refactor optional args - add them to a struct or remove static int64_t motion_mode_rd( const AV1_COMP *const cpi, TileDataEnc *tile_data, MACROBLOCK *const x, BLOCK_SIZE bsize, RD_STATS *rd_stats, RD_STATS *rd_stats_y,
+ show +
9343
9344
9345
9346
RD_STATS *rd_stats_uv, int *disable_skip, int mi_row, int mi_col, HandleInterModeArgs *const args, int64_t ref_best_rd, const int *refs, int *rate_mv, const BUFFER_SET *orig_dst, int64_t *best_est_rd, int do_tx_search, InterModesInfo *inter_modes_info) {
+ show +
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
const AV1_COMMON *const cm = &cpi->common; const int num_planes = av1_num_planes(cm); MACROBLOCKD *xd = &x->e_mbd; MB_MODE_INFO *mbmi = xd->mi[0]; const int is_comp_pred = has_second_ref(mbmi); const PREDICTION_MODE this_mode = mbmi->mode; const int rate2_nocoeff = rd_stats->rate; int best_xskip = 0, best_disable_skip = 0; RD_STATS best_rd_stats, best_rd_stats_y, best_rd_stats_uv; uint8_t best_blk_skip[MAX_MIB_SIZE * MAX_MIB_SIZE];

[CVE-2020-0478_1.diff] rdopt.c #36
- if (mbmi->ref_frame[1] == INTRA_FRAME) { - rd_stats->rate += x->interintra_mode_cost[size_group_lookup[bsize]] - [mbmi->interintra_mode]; - if (is_interintra_wedge_used(bsize)) { - rd_stats->rate += - x->wedge_interintra_cost[bsize][mbmi->use_wedge_interintra]; - if (mbmi->use_wedge_interintra) { - rd_stats->rate += - av1_cost_literal(get_interintra_wedge_bits(bsize)); - } - } - }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rdopt.c
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
x->skip = 0; rd_stats->dist = 0; rd_stats->sse = 0; rd_stats->skip = 1; rd_stats->rate = tmp_rate2; if (mbmi->motion_mode != WARPED_CAUSAL) rd_stats->rate += switchable_rate; if (interintra_allowed) { rd_stats->rate += x->interintra_cost[size_group_lookup[bsize]] [mbmi->ref_frame[1] == INTRA_FRAME];
+ show +
9557
9558
9559
9560
9561
9562
9563
9564
9565
if (mbmi->ref_frame[1] == INTRA_FRAME) { rd_stats->rate += x->interintra_mode_cost[size_group_lookup[bsize]] [mbmi->interintra_mode]; if (is_interintra_wedge_used(bsize)) { rd_stats->rate += x->wedge_interintra_cost[bsize][mbmi->use_wedge_interintra]; if (mbmi->use_wedge_interintra) { rd_stats->rate += av1_cost_literal(get_interintra_wedge_bits(bsize));
+ show +
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
} } } } if ((last_motion_mode_allowed > SIMPLE_TRANSLATION) && (mbmi->ref_frame[1] != INTRA_FRAME)) { if (last_motion_mode_allowed == WARPED_CAUSAL) { rd_stats->rate += x->motion_mode_cost[bsize][mbmi->motion_mode]; } else { rd_stats->rate += x->motion_mode_cost1[bsize][mbmi->motion_mode];

[CVE-2020-0478_1.diff] rdopt.c #62
- ctx->mbmi_ext = *x->mbmi_ext; + av1_copy_mbmi_ext_to_mbmi_ext_frame(&ctx->mbmi_ext_best, x->mbmi_ext, + av1_ref_frame_type(xd->mi[0]->ref_frame)); + av1_copy_array(ctx->tx_type_map, xd->tx_type_map, ctx->num_4x4_blk); -static void restore_uv_color_map(const AV1_COMP *const cpi, MACROBLOCK *x) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = xd->mi[0]; - PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info; - const BLOCK_SIZE bsize = mbmi->sb_type; - int src_stride = x->plane[1].src.stride; - const uint8_t *const src_u = x->plane[1].src.buf; - const uint8_t *const src_v = x->plane[2].src.buf; - int *const data = x->palette_buffer->kmeans_data_buf; - int centroids[2 * PALETTE_MAX_SIZE]; - uint8_t *const color_map = xd->plane[1].color_index_map; - int r, c; - const uint16_t *const src_u16 = CONVERT_TO_SHORTPTR(src_u); - const uint16_t *const src_v16 = CONVERT_TO_SHORTPTR(src_v); - int plane_block_width, plane_block_height, rows, cols; - av1_get_block_dimensions(bsize, 1, xd, &plane_block_width, - &plane_block_height, &rows, &cols); +static AOM_INLINE void calc_target_weighted_pred( + const AV1_COMMON *cm, const MACROBLOCK *x, const MACROBLOCKD *xd, + const uint8_t *above, int above_stride, const uint8_t *left, + int left_stride); - for (r = 0; r < rows; ++r) { - for (c = 0; c < cols; ++c) { - if (cpi->common.seq_params.use_highbitdepth) { - data[(r * cols + c) * 2] = src_u16[r * src_stride + c]; - data[(r * cols + c) * 2 + 1] = src_v16[r * src_stride + c]; - } else { - data[(r * cols + c) * 2] = src_u[r * src_stride + c]; - data[(r * cols + c) * 2 + 1] = src_v[r * src_stride + c]; - } - } - } - - for (r = 1; r < 3; ++r) { - for (c = 0; c < pmi->palette_size[1]; ++c) { - centroids[c * 2 + r - 1] = pmi->palette_colors[r * PALETTE_MAX_SIZE + c]; - } - } - - av1_calc_indices(data, centroids, color_map, rows * cols, - pmi->palette_size[1], 2); - extend_palette_color_map(color_map, cols, rows, plane_block_width, - plane_block_height); -} - -static void calc_target_weighted_pred(const AV1_COMMON *cm, const MACROBLOCK *x, - const MACROBLOCKD *xd, int mi_row, - int mi_col, const uint8_t *above, - int above_stride, const uint8_t *left, - int left_stride); - -static void rd_pick_skip_mode(RD_STATS *rd_cost, - InterModeSearchState *search_state, - const AV1_COMP *const cpi, MACROBLOCK *const x, - BLOCK_SIZE bsize, int mi_row, int mi_col, - struct buf_2d yv12_mb[REF_FRAMES][MAX_MB_PLANE]) { +static AOM_INLINE void rd_pick_skip_mode( + RD_STATS *rd_cost, InterModeSearchState *search_state, + const AV1_COMP *const cpi, MACROBLOCK *const x, BLOCK_SIZE bsize, + struct buf_2d yv12_mb[REF_FRAMES][MAX_MB_PLANE]) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rdopt.c
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
best_rd = rd_cost->rdcost; if (rd_pick_intrabc_mode_sb(cpi, x, rd_cost, bsize, best_rd) < best_rd) { ctx->skip = x->skip; memcpy(ctx->blk_skip, x->blk_skip, sizeof(x->blk_skip[0]) * ctx->num_4x4_blk); assert(rd_cost->rate != INT_MAX); } if (rd_cost->rate == INT_MAX) return; ctx->mic = *xd->mi[0];
+ show +
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
ctx->mbmi_ext = *x->mbmi_ext; } static void restore_uv_color_map(const AV1_COMP *const cpi, MACROBLOCK *x) { MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info; const BLOCK_SIZE bsize = mbmi->sb_type; int src_stride = x->plane[1].src.stride; const uint8_t *const src_u = x->plane[1].src.buf; const uint8_t *const src_v = x->plane[2].src.buf; int *const data = x->palette_buffer->kmeans_data_buf; int centroids[2 * PALETTE_MAX_SIZE]; uint8_t *const color_map = xd->plane[1].color_index_map; int r, c; const uint16_t *const src_u16 = CONVERT_TO_SHORTPTR(src_u); const uint16_t *const src_v16 = CONVERT_TO_SHORTPTR(src_v); int plane_block_width, plane_block_height, rows, cols; av1_get_block_dimensions(bsize, 1, xd, &plane_block_width, &plane_block_height, &rows, &cols); for (r = 0; r < rows; ++r) { for (c = 0; c < cols; ++c) { if (cpi->common.seq_params.use_highbitdepth) { data[(r * cols + c) * 2] = src_u16[r * src_stride + c]; data[(r * cols + c) * 2 + 1] = src_v16[r * src_stride + c]; } else { data[(r * cols + c) * 2] = src_u[r * src_stride + c]; data[(r * cols + c) * 2 + 1] = src_v[r * src_stride + c]; } } } for (r = 1; r < 3; ++r) { for (c = 0; c < pmi->palette_size[1]; ++c) { centroids[c * 2 + r - 1] = pmi->palette_colors[r * PALETTE_MAX_SIZE + c]; } } av1_calc_indices(data, centroids, color_map, rows * cols, pmi->palette_size[1], 2); extend_palette_color_map(color_map, cols, rows, plane_block_width, plane_block_height); } static void calc_target_weighted_pred(const AV1_COMMON *cm, const MACROBLOCK *x, const MACROBLOCKD *xd, int mi_row, int mi_col, const uint8_t *above, int above_stride, const uint8_t *left, int left_stride); static void rd_pick_skip_mode(RD_STATS *rd_cost, InterModeSearchState *search_state, const AV1_COMP *const cpi, MACROBLOCK *const x, BLOCK_SIZE bsize, int mi_row, int mi_col, struct buf_2d yv12_mb[REF_FRAMES][MAX_MB_PLANE]) {
+ show +
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
const AV1_COMMON *const cm = &cpi->common; const SkipModeInfo *const skip_mode_info = &cm->current_frame.skip_mode_info; const int num_planes = av1_num_planes(cm); MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; x->compound_idx = 1; // COMPOUND_AVERAGE RD_STATS skip_mode_rd_stats; av1_invalid_rd_stats(&skip_mode_rd_stats);

[CVE-2020-0478_1.diff] rdopt.c #98
- assert((cm->interp_filter == SWITCHABLE) || - (cm->interp_filter == - av1_extract_interp_filter(mbmi->interp_filters, 0))); + assert((interp_filter == SWITCHABLE) || + (interp_filter == mbmi->interp_filters.as_filters.y_filter)); - av1_update_rd_thresh_fact(cm, tile_data->thresh_freq_fact, - cpi->sf.adaptive_rd_thresh, bsize, THR_GLOBALMV); + if (cpi->sf.inter_sf.adaptive_rd_thresh) { + av1_update_rd_thresh_fact(cm, x->thresh_freq_fact, + cpi->sf.inter_sf.adaptive_rd_thresh, bsize, + THR_GLOBALMV); + } +#if CONFIG_INTERNAL_STATS +#else + store_coding_context(x, ctx, best_pred_diff, 0); +#endif // CONFIG_INTERNAL_STATS
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rdopt.c
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
rd_cost->rate = rate2; rd_cost->dist = distortion2; rd_cost->rdcost = this_rd; if (this_rd >= best_rd_so_far) { rd_cost->rate = INT_MAX; rd_cost->rdcost = INT64_MAX; return; }
+ show +
13809
13810
13811
13812
13813
13814
assert((cm->interp_filter == SWITCHABLE) || (cm->interp_filter == av1_extract_interp_filter(mbmi->interp_filters, 0))); av1_update_rd_thresh_fact(cm, tile_data->thresh_freq_fact, cpi->sf.adaptive_rd_thresh, bsize, THR_GLOBALMV);
+ show +
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
av1_zero(best_pred_diff); store_coding_context(x, ctx, THR_GLOBALMV, best_pred_diff, 0); } struct calc_target_weighted_pred_ctxt { const MACROBLOCK *x; const uint8_t *tmp; int tmp_stride;

[CVE-2020-0470_1.diff] rdopt.c #7
- + IntraModeSearchState intra_search_state; -static int inter_mode_data_block_idx(BLOCK_SIZE bsize) { - if (bsize == BLOCK_4X4 || bsize == BLOCK_4X8 || bsize == BLOCK_8X4 || - bsize == BLOCK_4X16 || bsize == BLOCK_16X4) { - return -1; - } - return 1; -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rdopt.c
726
727
728
729
730
731
732
733
734
735
// Single search results by [directions][modes][reference frames] SingleInterModeState single_state[2][SINGLE_INTER_MODE_NUM][FWD_REFS]; int single_state_cnt[2][SINGLE_INTER_MODE_NUM]; SingleInterModeState single_state_modelled[2][SINGLE_INTER_MODE_NUM] [FWD_REFS]; int single_state_modelled_cnt[2][SINGLE_INTER_MODE_NUM]; MV_REFERENCE_FRAME single_rd_order[2][SINGLE_INTER_MODE_NUM][FWD_REFS]; } InterModeSearchState;
+ show +
736
737
738
739
740
741
static int inter_mode_data_block_idx(BLOCK_SIZE bsize) { if (bsize == BLOCK_4X4 || bsize == BLOCK_4X8 || bsize == BLOCK_8X4 || bsize == BLOCK_4X16 || bsize == BLOCK_16X4) { return -1; } return 1;
+ show +
742
743
744
745
746
747
748
749
750
751
} void av1_inter_mode_data_init(TileDataEnc *tile_data) { for (int i = 0; i < BLOCK_SIZES_ALL; ++i) { InterModeRdModel *md = &tile_data->inter_mode_rd_models[i]; md->ready = 0; md->num = 0; md->dist_sum = 0; md->ld_sum = 0; md->sse_sum = 0;

[CVE-2020-0470_1.diff] rdopt.c #11
-static INLINE int write_uniform_cost(int n, int v) { - const int l = get_unsigned_bits(n); - const int m = (1 << l) - n; - if (l == 0) return 0; - if (v < m) - return av1_cost_literal(l - 1); - else - return av1_cost_literal(l); -} - -// Similar to store_cfl_required(), but for use during the RDO process, -// where we haven't yet determined whether this block uses CfL. -static INLINE CFL_ALLOWED_TYPE store_cfl_required_rdo(const AV1_COMMON *cm, - const MACROBLOCK *x) { - const MACROBLOCKD *xd = &x->e_mbd; - - if (cm->seq_params.monochrome || x->skip_chroma_rd) return CFL_DISALLOWED; - - if (!xd->cfl.is_chroma_reference) { - // For non-chroma-reference blocks, we should always store the luma pixels, - // in case the corresponding chroma-reference block uses CfL. - // Note that this can only happen for block sizes which are <8 on - // their shortest side, as otherwise they would be chroma reference - // blocks. - return CFL_ALLOWED; - } - - // For chroma reference blocks, we should store data in the encoder iff we're - // allowed to try out CfL. - return is_cfl_allowed(xd); -} - -// constants for prune 1 and prune 2 decision boundaries -#define FAST_EXT_TX_CORR_MID 0.0 -#define FAST_EXT_TX_EDST_MID 0.1 -#define FAST_EXT_TX_CORR_MARGIN 0.5 -#define FAST_EXT_TX_EDST_MARGIN 0.3 - -static int inter_block_yrd(const AV1_COMP *cpi, MACROBLOCK *x, - RD_STATS *rd_stats, BLOCK_SIZE bsize, - int64_t ref_best_rd, FAST_TX_SEARCH_MODE ftxs_mode); - -static unsigned pixel_dist_visible_only( - const AV1_COMP *const cpi, const MACROBLOCK *x, const uint8_t *src, - const int src_stride, const uint8_t *dst, const int dst_stride, - const BLOCK_SIZE tx_bsize, int txb_rows, int txb_cols, int visible_rows, - int visible_cols) { - unsigned sse; - - if (txb_rows == visible_rows && txb_cols == visible_cols) { - cpi->fn_ptr[tx_bsize].vf(src, src_stride, dst, dst_stride, &sse); - return sse; - } - const MACROBLOCKD *xd = &x->e_mbd; - - if (is_cur_buf_hbd(xd)) { - uint64_t sse64 = aom_highbd_sse_odd_size(src, src_stride, dst, dst_stride, - visible_cols, visible_rows); - return (unsigned int)ROUND_POWER_OF_TWO(sse64, (xd->bd - 8) * 2); - } - sse = aom_sse_odd_size(src, src_stride, dst, dst_stride, visible_cols, - visible_rows); - return sse; -} - -#if CONFIG_DIST_8X8 -static uint64_t cdef_dist_8x8_16bit(uint16_t *dst, int dstride, uint16_t *src, - int sstride, int coeff_shift) { - uint64_t svar = 0; - uint64_t dvar = 0; - uint64_t sum_s = 0; - uint64_t sum_d = 0; - uint64_t sum_s2 = 0; - uint64_t sum_d2 = 0; - uint64_t sum_sd = 0; - uint64_t dist = 0; - - int i, j; - for (i = 0; i < 8; i++) { - for (j = 0; j < 8; j++) { - sum_s += src[i * sstride + j]; - sum_d += dst[i * dstride + j]; - sum_s2 += src[i * sstride + j] * src[i * sstride + j]; - sum_d2 += dst[i * dstride + j] * dst[i * dstride + j]; - sum_sd += src[i * sstride + j] * dst[i * dstride + j]; - } - } - /* Compute the variance -- the calculation cannot go negative. */ - svar = sum_s2 - ((sum_s * sum_s + 32) >> 6); - dvar = sum_d2 - ((sum_d * sum_d + 32) >> 6); - - // Tuning of jm's original dering distortion metric used in CDEF tool, - // suggested by jm - const uint64_t a = 4; - const uint64_t b = 2; - const uint64_t c1 = (400 * a << 2 * coeff_shift); - const uint64_t c2 = (b * 20000 * a * a << 4 * coeff_shift); - - dist = (uint64_t)floor(.5 + (sum_d2 + sum_s2 - 2 * sum_sd) * .5 * - (svar + dvar + c1) / - (sqrt(svar * (double)dvar + c2))); - - // Calibrate dist to have similar rate for the same QP with MSE only - // distortion (as in master branch) - dist = (uint64_t)((float)dist * 0.75); - - return dist; -} - -static int od_compute_var_4x4(uint16_t *x, int stride) { - int sum; - int s2; - int i; - sum = 0; - s2 = 0; - for (i = 0; i < 4; i++) { - int j; - for (j = 0; j < 4; j++) { - int t; - - t = x[i * stride + j]; - sum += t; - s2 += t * t; - } - } - - return (s2 - (sum * sum >> 4)) >> 4; -} - -/* OD_DIST_LP_MID controls the frequency weighting filter used for computing - the distortion. For a value X, the filter is [1 X 1]/(X + 2) and - is applied both horizontally and vertically. For X=5, the filter is - a good approximation for the OD_QM8_Q4_HVS quantization matrix. */ -#define OD_DIST_LP_MID (5) -#define OD_DIST_LP_NORM (OD_DIST_LP_MID + 2) - -static double od_compute_dist_8x8(int use_activity_masking, uint16_t *x, - uint16_t *y, od_coeff *e_lp, int stride) { - double sum; - int min_var; - double mean_var; - double var_stat; - double activity; - double calibration; - int i; - int j; - double vardist; - - vardist = 0; - -#if 1 - min_var = INT_MAX; - mean_var = 0; - for (i = 0; i < 3; i++) { - for (j = 0; j < 3; j++) { - int varx; - int vary; - varx = od_compute_var_4x4(x + 2 * i * stride + 2 * j, stride); - vary = od_compute_var_4x4(y + 2 * i * stride + 2 * j, stride); - min_var = OD_MINI(min_var, varx); - mean_var += 1. / (1 + varx); - /* The cast to (double) is to avoid an overflow before the sqrt.*/ - vardist += varx - 2 * sqrt(varx * (double)vary) + vary; - } - } - /* We use a different variance statistic depending on whether activity - masking is used, since the harmonic mean appeared slightly worse with - masking off. The calibration constant just ensures that we preserve the - rate compared to activity=1. */ - if (use_activity_masking) { - calibration = 1.95; - var_stat = 9. / mean_var; - } else { - calibration = 1.62; - var_stat = min_var; - } - /* 1.62 is a calibration constant, 0.25 is a noise floor and 1/6 is the - activity masking constant. */ - activity = calibration * pow(.25 + var_stat, -1. / 6); -#else - activity = 1; -#endif // 1 - sum = 0; - for (i = 0; i < 8; i++) { - for (j = 0; j < 8; j++) - sum += e_lp[i * stride + j] * (double)e_lp[i * stride + j]; - } - /* Normalize the filter to unit DC response. */ - sum *= 1. / (OD_DIST_LP_NORM * OD_DIST_LP_NORM * OD_DIST_LP_NORM * - OD_DIST_LP_NORM); - return activity * activity * (sum + vardist); -} - -// Note : Inputs x and y are in a pixel domain -static double od_compute_dist_common(int activity_masking, uint16_t *x, - uint16_t *y, int bsize_w, int bsize_h, - int qindex, od_coeff *tmp, - od_coeff *e_lp) { - int i, j; - double sum = 0; - const int mid = OD_DIST_LP_MID; - - for (j = 0; j < bsize_w; j++) { - e_lp[j] = mid * tmp[j] + 2 * tmp[bsize_w + j]; - e_lp[(bsize_h - 1) * bsize_w + j] = mid * tmp[(bsize_h - 1) * bsize_w + j] + - 2 * tmp[(bsize_h - 2) * bsize_w + j]; - } - for (i = 1; i < bsize_h - 1; i++) { - for (j = 0; j < bsize_w; j++) { - e_lp[i * bsize_w + j] = mid * tmp[i * bsize_w + j] + - tmp[(i - 1) * bsize_w + j] + - tmp[(i + 1) * bsize_w + j]; - } - } - for (i = 0; i < bsize_h; i += 8) { - for (j = 0; j < bsize_w; j += 8) { - sum += od_compute_dist_8x8(activity_masking, &x[i * bsize_w + j], - &y[i * bsize_w + j], &e_lp[i * bsize_w + j], - bsize_w); - } - } - /* Scale according to linear regression against SSE, for 8x8 blocks. */ - if (activity_masking) { - sum *= 2.2 + (1.7 - 2.2) * (qindex - 99) / (210 - 99) + - (qindex < 99 ? 2.5 * (qindex - 99) / 99 * (qindex - 99) / 99 : 0); - } else { - sum *= qindex >= 128 - ? 1.4 + (0.9 - 1.4) * (qindex - 128) / (209 - 128) - : qindex <= 43 ? 1.5 + (2.0 - 1.5) * (qindex - 43) / (16 - 43) - : 1.5 + (1.4 - 1.5) * (qindex - 43) / (128 - 43); - } - - return sum; -} - -static double od_compute_dist(uint16_t *x, uint16_t *y, int bsize_w, - int bsize_h, int qindex) { - assert(bsize_w >= 8 && bsize_h >= 8); - - int activity_masking = 0; - - int i, j; - DECLARE_ALIGNED(16, od_coeff, e[MAX_SB_SQUARE]); - DECLARE_ALIGNED(16, od_coeff, tmp[MAX_SB_SQUARE]); - DECLARE_ALIGNED(16, od_coeff, e_lp[MAX_SB_SQUARE]); - for (i = 0; i < bsize_h; i++) { - for (j = 0; j < bsize_w; j++) { - e[i * bsize_w + j] = x[i * bsize_w + j] - y[i * bsize_w + j]; - } - } - int mid = OD_DIST_LP_MID; - for (i = 0; i < bsize_h; i++) { - tmp[i * bsize_w] = mid * e[i * bsize_w] + 2 * e[i * bsize_w + 1]; - tmp[i * bsize_w + bsize_w - 1] = - mid * e[i * bsize_w + bsize_w - 1] + 2 * e[i * bsize_w + bsize_w - 2]; - for (j = 1; j < bsize_w - 1; j++) { - tmp[i * bsize_w + j] = mid * e[i * bsize_w + j] + e[i * bsize_w + j - 1] + - e[i * bsize_w + j + 1]; - } - } - return od_compute_dist_common(activity_masking, x, y, bsize_w, bsize_h, - qindex, tmp, e_lp); -} - -static double od_compute_dist_diff(uint16_t *x, int16_t *e, int bsize_w, - int bsize_h, int qindex) { - assert(bsize_w >= 8 && bsize_h >= 8); - - int activity_masking = 0; - - DECLARE_ALIGNED(16, uint16_t, y[MAX_SB_SQUARE]); - DECLARE_ALIGNED(16, od_coeff, tmp[MAX_SB_SQUARE]); - DECLARE_ALIGNED(16, od_coeff, e_lp[MAX_SB_SQUARE]); - int i, j; - for (i = 0; i < bsize_h; i++) { - for (j = 0; j < bsize_w; j++) { - y[i * bsize_w + j] = x[i * bsize_w + j] - e[i * bsize_w + j]; - } - } - int mid = OD_DIST_LP_MID; - for (i = 0; i < bsize_h; i++) { - tmp[i * bsize_w] = mid * e[i * bsize_w] + 2 * e[i * bsize_w + 1]; - tmp[i * bsize_w + bsize_w - 1] = - mid * e[i * bsize_w + bsize_w - 1] + 2 * e[i * bsize_w + bsize_w - 2]; - for (j = 1; j < bsize_w - 1; j++) { - tmp[i * bsize_w + j] = mid * e[i * bsize_w + j] + e[i * bsize_w + j - 1] + - e[i * bsize_w + j + 1]; - } - } - return od_compute_dist_common(activity_masking, x, y, bsize_w, bsize_h, - qindex, tmp, e_lp); -} - -int64_t av1_dist_8x8(const AV1_COMP *const cpi, const MACROBLOCK *x, - const uint8_t *src, int src_stride, const uint8_t *dst, - int dst_stride, const BLOCK_SIZE tx_bsize, int bsw, - int bsh, int visible_w, int visible_h, int qindex) { - int64_t d = 0; - int i, j; - const MACROBLOCKD *xd = &x->e_mbd; - - DECLARE_ALIGNED(16, uint16_t, orig[MAX_SB_SQUARE]); - DECLARE_ALIGNED(16, uint16_t, rec[MAX_SB_SQUARE]); - - assert(bsw >= 8); - assert(bsh >= 8); - assert((bsw & 0x07) == 0); - assert((bsh & 0x07) == 0); - - if (x->tune_metric == AOM_TUNE_CDEF_DIST || - x->tune_metric == AOM_TUNE_DAALA_DIST) { - if (is_cur_buf_hbd(xd)) { - for (j = 0; j < bsh; j++) - for (i = 0; i < bsw; i++) - orig[j * bsw + i] = CONVERT_TO_SHORTPTR(src)[j * src_stride + i]; - - if ((bsw == visible_w) && (bsh == visible_h)) { - for (j = 0; j < bsh; j++) - for (i = 0; i < bsw; i++) - rec[j * bsw + i] = CONVERT_TO_SHORTPTR(dst)[j * dst_stride + i]; - } else { - for (j = 0; j < visible_h; j++) - for (i = 0; i < visible_w; i++) - rec[j * bsw + i] = CONVERT_TO_SHORTPTR(dst)[j * dst_stride + i]; - - if (visible_w < bsw) { - for (j = 0; j < bsh; j++) - for (i = visible_w; i < bsw; i++) - rec[j * bsw + i] = CONVERT_TO_SHORTPTR(src)[j * src_stride + i]; - } - - if (visible_h < bsh) { - for (j = visible_h; j < bsh; j++) - for (i = 0; i < bsw; i++) - rec[j * bsw + i] = CONVERT_TO_SHORTPTR(src)[j * src_stride + i]; - } - } - } else { - for (j = 0; j < bsh; j++) - for (i = 0; i < bsw; i++) orig[j * bsw + i] = src[j * src_stride + i]; - - if ((bsw == visible_w) && (bsh == visible_h)) { - for (j = 0; j < bsh; j++) - for (i = 0; i < bsw; i++) rec[j * bsw + i] = dst[j * dst_stride + i]; - } else { - for (j = 0; j < visible_h; j++) - for (i = 0; i < visible_w; i++) - rec[j * bsw + i] = dst[j * dst_stride + i]; - - if (visible_w < bsw) { - for (j = 0; j < bsh; j++) - for (i = visible_w; i < bsw; i++) - rec[j * bsw + i] = src[j * src_stride + i]; - } - - if (visible_h < bsh) { - for (j = visible_h; j < bsh; j++) - for (i = 0; i < bsw; i++) - rec[j * bsw + i] = src[j * src_stride + i]; - } - } - } - } - - if (x->tune_metric == AOM_TUNE_DAALA_DIST) { - d = (int64_t)od_compute_dist(orig, rec, bsw, bsh, qindex); - } else if (x->tune_metric == AOM_TUNE_CDEF_DIST) { - int coeff_shift = AOMMAX(xd->bd - 8, 0); - - for (i = 0; i < bsh; i += 8) { - for (j = 0; j < bsw; j += 8) { - d += cdef_dist_8x8_16bit(&rec[i * bsw + j], bsw, &orig[i * bsw + j], - bsw, coeff_shift); - } - } - if (is_cur_buf_hbd(xd)) d = ((uint64_t)d) >> 2 * coeff_shift; - } else { - // Otherwise, MSE by default - d = pixel_dist_visible_only(cpi, x, src, src_stride, dst, dst_stride, - tx_bsize, bsh, bsw, visible_h, visible_w); - } - - return d; -} - -static int64_t dist_8x8_diff(const MACROBLOCK *x, const uint8_t *src, - int src_stride, const int16_t *diff, - int diff_stride, int bsw, int bsh, int visible_w, - int visible_h, int qindex) { - int64_t d = 0; - int i, j; - const MACROBLOCKD *xd = &x->e_mbd; - - DECLARE_ALIGNED(16, uint16_t, orig[MAX_SB_SQUARE]); - DECLARE_ALIGNED(16, int16_t, diff16[MAX_SB_SQUARE]); - - assert(bsw >= 8); - assert(bsh >= 8); - assert((bsw & 0x07) == 0); - assert((bsh & 0x07) == 0); - - if (x->tune_metric == AOM_TUNE_CDEF_DIST || - x->tune_metric == AOM_TUNE_DAALA_DIST) { - if (is_cur_buf_hbd(xd)) { - for (j = 0; j < bsh; j++) - for (i = 0; i < bsw; i++) - orig[j * bsw + i] = CONVERT_TO_SHORTPTR(src)[j * src_stride + i]; - } else { - for (j = 0; j < bsh; j++) - for (i = 0; i < bsw; i++) orig[j * bsw + i] = src[j * src_stride + i]; - } - - if ((bsw == visible_w) && (bsh == visible_h)) { - for (j = 0; j < bsh; j++) - for (i = 0; i < bsw; i++) - diff16[j * bsw + i] = diff[j * diff_stride + i]; - } else { - for (j = 0; j < visible_h; j++) - for (i = 0; i < visible_w; i++) - diff16[j * bsw + i] = diff[j * diff_stride + i]; - - if (visible_w < bsw) { - for (j = 0; j < bsh; j++) - for (i = visible_w; i < bsw; i++) diff16[j * bsw + i] = 0; - } - - if (visible_h < bsh) { - for (j = visible_h; j < bsh; j++) - for (i = 0; i < bsw; i++) diff16[j * bsw + i] = 0; - } - } - } - - if (x->tune_metric == AOM_TUNE_DAALA_DIST) { - d = (int64_t)od_compute_dist_diff(orig, diff16, bsw, bsh, qindex); - } else if (x->tune_metric == AOM_TUNE_CDEF_DIST) { - int coeff_shift = AOMMAX(xd->bd - 8, 0); - DECLARE_ALIGNED(16, uint16_t, dst16[MAX_SB_SQUARE]); - - for (i = 0; i < bsh; i++) { - for (j = 0; j < bsw; j++) { - dst16[i * bsw + j] = orig[i * bsw + j] - diff16[i * bsw + j]; - } - } - - for (i = 0; i < bsh; i += 8) { - for (j = 0; j < bsw; j += 8) { - d += cdef_dist_8x8_16bit(&dst16[i * bsw + j], bsw, &orig[i * bsw + j], - bsw, coeff_shift); - } - } - // Don't scale 'd' for HBD since it will be done by caller side for diff - // input - } else { - // Otherwise, MSE by default - d = aom_sum_squares_2d_i16(diff, diff_stride, visible_w, visible_h); - } - - return d; -} -#endif // CONFIG_DIST_8X8 - -static void get_energy_distribution_fine(const AV1_COMP *cpi, BLOCK_SIZE bsize, - const uint8_t *src, int src_stride, - const uint8_t *dst, int dst_stride, - int need_4th, double *hordist, - double *verdist) { - const int bw = block_size_wide[bsize]; - const int bh = block_size_high[bsize]; - unsigned int esq[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - - if (bsize < BLOCK_16X16 || (bsize >= BLOCK_4X16 && bsize <= BLOCK_32X8)) { - // Special cases: calculate 'esq' values manually, as we don't have 'vf' - // functions for the 16 (very small) sub-blocks of this block. - const int w_shift = (bw == 4) ? 0 : (bw == 8) ? 1 : (bw == 16) ? 2 : 3; - const int h_shift = (bh == 4) ? 0 : (bh == 8) ? 1 : (bh == 16) ? 2 : 3; - assert(bw <= 32); - assert(bh <= 32); - assert(((bw - 1) >> w_shift) + (((bh - 1) >> h_shift) << 2) == 15); - if (cpi->common.seq_params.use_highbitdepth) { - const uint16_t *src16 = CONVERT_TO_SHORTPTR(src); - const uint16_t *dst16 = CONVERT_TO_SHORTPTR(dst); - for (int i = 0; i < bh; ++i) - for (int j = 0; j < bw; ++j) { - const int index = (j >> w_shift) + ((i >> h_shift) << 2); - esq[index] += - (src16[j + i * src_stride] - dst16[j + i * dst_stride]) * - (src16[j + i * src_stride] - dst16[j + i * dst_stride]); - } - } else { - for (int i = 0; i < bh; ++i) - for (int j = 0; j < bw; ++j) { - const int index = (j >> w_shift) + ((i >> h_shift) << 2); - esq[index] += (src[j + i * src_stride] - dst[j + i * dst_stride]) * - (src[j + i * src_stride] - dst[j + i * dst_stride]); - } - } - } else { // Calculate 'esq' values using 'vf' functions on the 16 sub-blocks. - const int f_index = - (bsize < BLOCK_SIZES) ? bsize - BLOCK_16X16 : bsize - BLOCK_8X16; - assert(f_index >= 0 && f_index < BLOCK_SIZES_ALL); - const BLOCK_SIZE subsize = (BLOCK_SIZE)f_index; - assert(block_size_wide[bsize] == 4 * block_size_wide[subsize]); - assert(block_size_high[bsize] == 4 * block_size_high[subsize]); - cpi->fn_ptr[subsize].vf(src, src_stride, dst, dst_stride, &esq[0]); - cpi->fn_ptr[subsize].vf(src + bw / 4, src_stride, dst + bw / 4, dst_stride, - &esq[1]); - cpi->fn_ptr[subsize].vf(src + bw / 2, src_stride, dst + bw / 2, dst_stride, - &esq[2]); - cpi->fn_ptr[subsize].vf(src + 3 * bw / 4, src_stride, dst + 3 * bw / 4, - dst_stride, &esq[3]); - src += bh / 4 * src_stride; - dst += bh / 4 * dst_stride; - - cpi->fn_ptr[subsize].vf(src, src_stride, dst, dst_stride, &esq[4]); - cpi->fn_ptr[subsize].vf(src + bw / 4, src_stride, dst + bw / 4, dst_stride, - &esq[5]); - cpi->fn_ptr[subsize].vf(src + bw / 2, src_stride, dst + bw / 2, dst_stride, - &esq[6]); - cpi->fn_ptr[subsize].vf(src + 3 * bw / 4, src_stride, dst + 3 * bw / 4, - dst_stride, &esq[7]); - src += bh / 4 * src_stride; - dst += bh / 4 * dst_stride; - - cpi->fn_ptr[subsize].vf(src, src_stride, dst, dst_stride, &esq[8]); - cpi->fn_ptr[subsize].vf(src + bw / 4, src_stride, dst + bw / 4, dst_stride, - &esq[9]); - cpi->fn_ptr[subsize].vf(src + bw / 2, src_stride, dst + bw / 2, dst_stride, - &esq[10]); - cpi->fn_ptr[subsize].vf(src + 3 * bw / 4, src_stride, dst + 3 * bw / 4, - dst_stride, &esq[11]); - src += bh / 4 * src_stride; - dst += bh / 4 * dst_stride; - - cpi->fn_ptr[subsize].vf(src, src_stride, dst, dst_stride, &esq[12]); - cpi->fn_ptr[subsize].vf(src + bw / 4, src_stride, dst + bw / 4, dst_stride, - &esq[13]); - cpi->fn_ptr[subsize].vf(src + bw / 2, src_stride, dst + bw / 2, dst_stride, - &esq[14]); - cpi->fn_ptr[subsize].vf(src + 3 * bw / 4, src_stride, dst + 3 * bw / 4, - dst_stride, &esq[15]); - } - - double total = (double)esq[0] + esq[1] + esq[2] + esq[3] + esq[4] + esq[5] + - esq[6] + esq[7] + esq[8] + esq[9] + esq[10] + esq[11] + - esq[12] + esq[13] + esq[14] + esq[15]; - if (total > 0) { - const double e_recip = 1.0 / total; - hordist[0] = ((double)esq[0] + esq[4] + esq[8] + esq[12]) * e_recip; - hordist[1] = ((double)esq[1] + esq[5] + esq[9] + esq[13]) * e_recip; - hordist[2] = ((double)esq[2] + esq[6] + esq[10] + esq[14]) * e_recip; - if (need_4th) { - hordist[3] = ((double)esq[3] + esq[7] + esq[11] + esq[15]) * e_recip; - } - verdist[0] = ((double)esq[0] + esq[1] + esq[2] + esq[3]) * e_recip; - verdist[1] = ((double)esq[4] + esq[5] + esq[6] + esq[7]) * e_recip; - verdist[2] = ((double)esq[8] + esq[9] + esq[10] + esq[11]) * e_recip; - if (need_4th) { - verdist[3] = ((double)esq[12] + esq[13] + esq[14] + esq[15]) * e_recip; - } - } else { - hordist[0] = verdist[0] = 0.25; - hordist[1] = verdist[1] = 0.25; - hordist[2] = verdist[2] = 0.25; - if (need_4th) { - hordist[3] = verdist[3] = 0.25; - } - } -} - -static int adst_vs_flipadst(const AV1_COMP *cpi, BLOCK_SIZE bsize, - const uint8_t *src, int src_stride, - const uint8_t *dst, int dst_stride) { - int prune_bitmask = 0; - double svm_proj_h = 0, svm_proj_v = 0; - double hdist[3] = { 0, 0, 0 }, vdist[3] = { 0, 0, 0 }; - get_energy_distribution_fine(cpi, bsize, src, src_stride, dst, dst_stride, 0, - hdist, vdist); - - svm_proj_v = vdist[0] * ADST_FLIP_SVM[0] + vdist[1] * ADST_FLIP_SVM[1] + - vdist[2] * ADST_FLIP_SVM[2] + ADST_FLIP_SVM[3]; - svm_proj_h = hdist[0] * ADST_FLIP_SVM[4] + hdist[1] * ADST_FLIP_SVM[5] + - hdist[2] * ADST_FLIP_SVM[6] + ADST_FLIP_SVM[7]; - if (svm_proj_v > FAST_EXT_TX_EDST_MID + FAST_EXT_TX_EDST_MARGIN) - prune_bitmask |= 1 << FLIPADST_1D; - else if (svm_proj_v < FAST_EXT_TX_EDST_MID - FAST_EXT_TX_EDST_MARGIN) - prune_bitmask |= 1 << ADST_1D; - - if (svm_proj_h > FAST_EXT_TX_EDST_MID + FAST_EXT_TX_EDST_MARGIN) - prune_bitmask |= 1 << (FLIPADST_1D + 8); - else if (svm_proj_h < FAST_EXT_TX_EDST_MID - FAST_EXT_TX_EDST_MARGIN) - prune_bitmask |= 1 << (ADST_1D + 8); - - return prune_bitmask; -} - -static int dct_vs_idtx(const int16_t *diff, int stride, int w, int h) { - float hcorr, vcorr; - int prune_bitmask = 0; - av1_get_horver_correlation_full(diff, stride, w, h, &hcorr, &vcorr); - - if (vcorr > FAST_EXT_TX_CORR_MID + FAST_EXT_TX_CORR_MARGIN) - prune_bitmask |= 1 << IDTX_1D; - else if (vcorr < FAST_EXT_TX_CORR_MID - FAST_EXT_TX_CORR_MARGIN) - prune_bitmask |= 1 << DCT_1D; - - if (hcorr > FAST_EXT_TX_CORR_MID + FAST_EXT_TX_CORR_MARGIN) - prune_bitmask |= 1 << (IDTX_1D + 8); - else if (hcorr < FAST_EXT_TX_CORR_MID - FAST_EXT_TX_CORR_MARGIN) - prune_bitmask |= 1 << (DCT_1D + 8); - return prune_bitmask; -} - -// Performance drop: 0.5%, Speed improvement: 24% -static int prune_two_for_sby(const AV1_COMP *cpi, BLOCK_SIZE bsize, - MACROBLOCK *x, const MACROBLOCKD *xd, - int adst_flipadst, int dct_idtx) { - int prune = 0; - - if (adst_flipadst) { - const struct macroblock_plane *const p = &x->plane[0]; - const struct macroblockd_plane *const pd = &xd->plane[0]; - prune |= adst_vs_flipadst(cpi, bsize, p->src.buf, p->src.stride, - pd->dst.buf, pd->dst.stride); - } - if (dct_idtx) { - av1_subtract_plane(x, bsize, 0); - const struct macroblock_plane *const p = &x->plane[0]; - const int bw = block_size_wide[bsize]; - const int bh = block_size_high[bsize]; - prune |= dct_vs_idtx(p->src_diff, bw, bw, bh); - } - - return prune; -} - -// Performance drop: 0.3%, Speed improvement: 5% -static int prune_one_for_sby(const AV1_COMP *cpi, BLOCK_SIZE bsize, - const MACROBLOCK *x, const MACROBLOCKD *xd) { - const struct macroblock_plane *const p = &x->plane[0]; - const struct macroblockd_plane *const pd = &xd->plane[0]; - return adst_vs_flipadst(cpi, bsize, p->src.buf, p->src.stride, pd->dst.buf, - pd->dst.stride); -} - -// 1D Transforms used in inter set, this needs to be changed if -// ext_tx_used_inter is changed -static const int ext_tx_used_inter_1D[EXT_TX_SETS_INTER][TX_TYPES_1D] = { - { 1, 0, 0, 0 }, - { 1, 1, 1, 1 }, - { 1, 1, 1, 1 }, - { 1, 0, 0, 1 }, -}; - -static void get_energy_distribution_finer(const int16_t *diff, int stride, - int bw, int bh, float *hordist, - float *verdist) { - // First compute downscaled block energy values (esq); downscale factors - // are defined by w_shift and h_shift. - unsigned int esq[256]; - const int w_shift = bw <= 8 ? 0 : 1; - const int h_shift = bh <= 8 ? 0 : 1; - const int esq_w = bw >> w_shift; - const int esq_h = bh >> h_shift; - const int esq_sz = esq_w * esq_h; - int i, j; - memset(esq, 0, esq_sz * sizeof(esq[0])); - if (w_shift) { - for (i = 0; i < bh; i++) { - unsigned int *cur_esq_row = esq + (i >> h_shift) * esq_w; - const int16_t *cur_diff_row = diff + i * stride; - for (j = 0; j < bw; j += 2) { - cur_esq_row[j >> 1] += (cur_diff_row[j] * cur_diff_row[j] + - cur_diff_row[j + 1] * cur_diff_row[j + 1]); - } - } - } else { - for (i = 0; i < bh; i++) { - unsigned int *cur_esq_row = esq + (i >> h_shift) * esq_w; - const int16_t *cur_diff_row = diff + i * stride; - for (j = 0; j < bw; j++) { - cur_esq_row[j] += cur_diff_row[j] * cur_diff_row[j]; - } - } - } - - uint64_t total = 0; - for (i = 0; i < esq_sz; i++) total += esq[i]; - - // Output hordist and verdist arrays are normalized 1D projections of esq - if (total == 0) { - float hor_val = 1.0f / esq_w; - for (j = 0; j < esq_w - 1; j++) hordist[j] = hor_val; - float ver_val = 1.0f / esq_h; - for (i = 0; i < esq_h - 1; i++) verdist[i] = ver_val; - return; - } - - const float e_recip = 1.0f / (float)total; - memset(hordist, 0, (esq_w - 1) * sizeof(hordist[0])); - memset(verdist, 0, (esq_h - 1) * sizeof(verdist[0])); - const unsigned int *cur_esq_row; - for (i = 0; i < esq_h - 1; i++) { - cur_esq_row = esq + i * esq_w; - for (j = 0; j < esq_w - 1; j++) { - hordist[j] += (float)cur_esq_row[j]; - verdist[i] += (float)cur_esq_row[j]; - } - verdist[i] += (float)cur_esq_row[j]; - } - cur_esq_row = esq + i * esq_w; - for (j = 0; j < esq_w - 1; j++) hordist[j] += (float)cur_esq_row[j]; - - for (j = 0; j < esq_w - 1; j++) hordist[j] *= e_recip; - for (i = 0; i < esq_h - 1; i++) verdist[i] *= e_recip; -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rdopt.c
897
898
899
900
901
902
903
904
905
906
return; } for (int i = 0; i < inter_modes_info->num; ++i) { rd_idx_pair_arr[i].idx = i; rd_idx_pair_arr[i].rd = inter_modes_info->est_rd_arr[i]; } qsort(rd_idx_pair_arr, inter_modes_info->num, sizeof(rd_idx_pair_arr[0]), compare_rd_idx_pair); }
+ show +
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
static INLINE int write_uniform_cost(int n, int v) { const int l = get_unsigned_bits(n); const int m = (1 << l) - n; if (l == 0) return 0; if (v < m) return av1_cost_literal(l - 1); else return av1_cost_literal(l); } // Similar to store_cfl_required(), but for use during the RDO process, // where we haven't yet determined whether this block uses CfL. static INLINE CFL_ALLOWED_TYPE store_cfl_required_rdo(const AV1_COMMON *cm, const MACROBLOCK *x) { const MACROBLOCKD *xd = &x->e_mbd; if (cm->seq_params.monochrome || x->skip_chroma_rd) return CFL_DISALLOWED; if (!xd->cfl.is_chroma_reference) { // For non-chroma-reference blocks, we should always store the luma pixels, // in case the corresponding chroma-reference block uses CfL. // Note that this can only happen for block sizes which are <8 on // their shortest side, as otherwise they would be chroma reference // blocks. return CFL_ALLOWED; } // For chroma reference blocks, we should store data in the encoder iff we're // allowed to try out CfL. return is_cfl_allowed(xd); } // constants for prune 1 and prune 2 decision boundaries #define FAST_EXT_TX_CORR_MID 0.0 #define FAST_EXT_TX_EDST_MID 0.1 #define FAST_EXT_TX_CORR_MARGIN 0.5 #define FAST_EXT_TX_EDST_MARGIN 0.3 static int inter_block_yrd(const AV1_COMP *cpi, MACROBLOCK *x, RD_STATS *rd_stats, BLOCK_SIZE bsize, int64_t ref_best_rd, FAST_TX_SEARCH_MODE ftxs_mode); static unsigned pixel_dist_visible_only( const AV1_COMP *const cpi, const MACROBLOCK *x, const uint8_t *src, const int src_stride, const uint8_t *dst, const int dst_stride, const BLOCK_SIZE tx_bsize, int txb_rows, int txb_cols, int visible_rows, int visible_cols) { unsigned sse; if (txb_rows == visible_rows && txb_cols == visible_cols) { cpi->fn_ptr[tx_bsize].vf(src, src_stride, dst, dst_stride, &sse); return sse; } const MACROBLOCKD *xd = &x->e_mbd; if (is_cur_buf_hbd(xd)) { uint64_t sse64 = aom_highbd_sse_odd_size(src, src_stride, dst, dst_stride, visible_cols, visible_rows); return (unsigned int)ROUND_POWER_OF_TWO(sse64, (xd->bd - 8) * 2); } sse = aom_sse_odd_size(src, src_stride, dst, dst_stride, visible_cols, visible_rows); return sse; } #if CONFIG_DIST_8X8 static uint64_t cdef_dist_8x8_16bit(uint16_t *dst, int dstride, uint16_t *src, int sstride, int coeff_shift) { uint64_t svar = 0; uint64_t dvar = 0; uint64_t sum_s = 0; uint64_t sum_d = 0; uint64_t sum_s2 = 0; uint64_t sum_d2 = 0; uint64_t sum_sd = 0; uint64_t dist = 0; int i, j; for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { sum_s += src[i * sstride + j]; sum_d += dst[i * dstride + j]; sum_s2 += src[i * sstride + j] * src[i * sstride + j]; sum_d2 += dst[i * dstride + j] * dst[i * dstride + j]; sum_sd += src[i * sstride + j] * dst[i * dstride + j]; } } /* Compute the variance -- the calculation cannot go negative. */ svar = sum_s2 - ((sum_s * sum_s + 32) >> 6); dvar = sum_d2 - ((sum_d * sum_d + 32) >> 6); // Tuning of jm's original dering distortion metric used in CDEF tool, // suggested by jm const uint64_t a = 4; const uint64_t b = 2; const uint64_t c1 = (400 * a << 2 * coeff_shift); const uint64_t c2 = (b * 20000 * a * a << 4 * coeff_shift); dist = (uint64_t)floor(.5 + (sum_d2 + sum_s2 - 2 * sum_sd) * .5 * (svar + dvar + c1) / (sqrt(svar * (double)dvar + c2))); // Calibrate dist to have similar rate for the same QP with MSE only // distortion (as in master branch) dist = (uint64_t)((float)dist * 0.75); return dist; } static int od_compute_var_4x4(uint16_t *x, int stride) { int sum; int s2; int i; sum = 0; s2 = 0; for (i = 0; i < 4; i++) { int j; for (j = 0; j < 4; j++) { int t; t = x[i * stride + j]; sum += t; s2 += t * t; } } return (s2 - (sum * sum >> 4)) >> 4; } /* OD_DIST_LP_MID controls the frequency weighting filter used for computing the distortion. For a value X, the filter is [1 X 1]/(X + 2) and is applied both horizontally and vertically. For X=5, the filter is a good approximation for the OD_QM8_Q4_HVS quantization matrix. */ #define OD_DIST_LP_MID (5) #define OD_DIST_LP_NORM (OD_DIST_LP_MID + 2) static double od_compute_dist_8x8(int use_activity_masking, uint16_t *x, uint16_t *y, od_coeff *e_lp, int stride) { double sum; int min_var; double mean_var; double var_stat; double activity; double calibration; int i; int j; double vardist; vardist = 0; #if 1 min_var = INT_MAX; mean_var = 0; for (i = 0; i < 3; i++) { for (j = 0; j < 3; j++) { int varx; int vary; varx = od_compute_var_4x4(x + 2 * i * stride + 2 * j, stride); vary = od_compute_var_4x4(y + 2 * i * stride + 2 * j, stride); min_var = OD_MINI(min_var, varx); mean_var += 1. / (1 + varx); /* The cast to (double) is to avoid an overflow before the sqrt.*/ vardist += varx - 2 * sqrt(varx * (double)vary) + vary; } } /* We use a different variance statistic depending on whether activity masking is used, since the harmonic mean appeared slightly worse with masking off. The calibration constant just ensures that we preserve the rate compared to activity=1. */ if (use_activity_masking) { calibration = 1.95; var_stat = 9. / mean_var; } else { calibration = 1.62; var_stat = min_var; } /* 1.62 is a calibration constant, 0.25 is a noise floor and 1/6 is the activity masking constant. */ activity = calibration * pow(.25 + var_stat, -1. / 6); #else activity = 1; #endif // 1 sum = 0; for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) sum += e_lp[i * stride + j] * (double)e_lp[i * stride + j]; } /* Normalize the filter to unit DC response. */ sum *= 1. / (OD_DIST_LP_NORM * OD_DIST_LP_NORM * OD_DIST_LP_NORM * OD_DIST_LP_NORM); return activity * activity * (sum + vardist); } // Note : Inputs x and y are in a pixel domain static double od_compute_dist_common(int activity_masking, uint16_t *x, uint16_t *y, int bsize_w, int bsize_h, int qindex, od_coeff *tmp, od_coeff *e_lp) { int i, j; double sum = 0; const int mid = OD_DIST_LP_MID; for (j = 0; j < bsize_w; j++) { e_lp[j] = mid * tmp[j] + 2 * tmp[bsize_w + j]; e_lp[(bsize_h - 1) * bsize_w + j] = mid * tmp[(bsize_h - 1) * bsize_w + j] + 2 * tmp[(bsize_h - 2) * bsize_w + j]; } for (i = 1; i < bsize_h - 1; i++) { for (j = 0; j < bsize_w; j++) { e_lp[i * bsize_w + j] = mid * tmp[i * bsize_w + j] + tmp[(i - 1) * bsize_w + j] + tmp[(i + 1) * bsize_w + j]; } } for (i = 0; i < bsize_h; i += 8) { for (j = 0; j < bsize_w; j += 8) { sum += od_compute_dist_8x8(activity_masking, &x[i * bsize_w + j], &y[i * bsize_w + j], &e_lp[i * bsize_w + j], bsize_w); } } /* Scale according to linear regression against SSE, for 8x8 blocks. */ if (activity_masking) { sum *= 2.2 + (1.7 - 2.2) * (qindex - 99) / (210 - 99) + (qindex < 99 ? 2.5 * (qindex - 99) / 99 * (qindex - 99) / 99 : 0); } else { sum *= qindex >= 128 ? 1.4 + (0.9 - 1.4) * (qindex - 128) / (209 - 128) : qindex <= 43 ? 1.5 + (2.0 - 1.5) * (qindex - 43) / (16 - 43) : 1.5 + (1.4 - 1.5) * (qindex - 43) / (128 - 43); } return sum; } static double od_compute_dist(uint16_t *x, uint16_t *y, int bsize_w, int bsize_h, int qindex) { assert(bsize_w >= 8 && bsize_h >= 8); int activity_masking = 0; int i, j; DECLARE_ALIGNED(16, od_coeff, e[MAX_SB_SQUARE]); DECLARE_ALIGNED(16, od_coeff, tmp[MAX_SB_SQUARE]); DECLARE_ALIGNED(16, od_coeff, e_lp[MAX_SB_SQUARE]); for (i = 0; i < bsize_h; i++) { for (j = 0; j < bsize_w; j++) { e[i * bsize_w + j] = x[i * bsize_w + j] - y[i * bsize_w + j]; } } int mid = OD_DIST_LP_MID; for (i = 0; i < bsize_h; i++) { tmp[i * bsize_w] = mid * e[i * bsize_w] + 2 * e[i * bsize_w + 1]; tmp[i * bsize_w + bsize_w - 1] = mid * e[i * bsize_w + bsize_w - 1] + 2 * e[i * bsize_w + bsize_w - 2]; for (j = 1; j < bsize_w - 1; j++) { tmp[i * bsize_w + j] = mid * e[i * bsize_w + j] + e[i * bsize_w + j - 1] + e[i * bsize_w + j + 1]; } } return od_compute_dist_common(activity_masking, x, y, bsize_w, bsize_h, qindex, tmp, e_lp); } static double od_compute_dist_diff(uint16_t *x, int16_t *e, int bsize_w, int bsize_h, int qindex) { assert(bsize_w >= 8 && bsize_h >= 8); int activity_masking = 0; DECLARE_ALIGNED(16, uint16_t, y[MAX_SB_SQUARE]); DECLARE_ALIGNED(16, od_coeff, tmp[MAX_SB_SQUARE]); DECLARE_ALIGNED(16, od_coeff, e_lp[MAX_SB_SQUARE]); int i, j; for (i = 0; i < bsize_h; i++) { for (j = 0; j < bsize_w; j++) { y[i * bsize_w + j] = x[i * bsize_w + j] - e[i * bsize_w + j]; } } int mid = OD_DIST_LP_MID; for (i = 0; i < bsize_h; i++) { tmp[i * bsize_w] = mid * e[i * bsize_w] + 2 * e[i * bsize_w + 1]; tmp[i * bsize_w + bsize_w - 1] = mid * e[i * bsize_w + bsize_w - 1] + 2 * e[i * bsize_w + bsize_w - 2]; for (j = 1; j < bsize_w - 1; j++) { tmp[i * bsize_w + j] = mid * e[i * bsize_w + j] + e[i * bsize_w + j - 1] + e[i * bsize_w + j + 1]; } } return od_compute_dist_common(activity_masking, x, y, bsize_w, bsize_h, qindex, tmp, e_lp); } int64_t av1_dist_8x8(const AV1_COMP *const cpi, const MACROBLOCK *x, const uint8_t *src, int src_stride, const uint8_t *dst, int dst_stride, const BLOCK_SIZE tx_bsize, int bsw, int bsh, int visible_w, int visible_h, int qindex) { int64_t d = 0; int i, j; const MACROBLOCKD *xd = &x->e_mbd; DECLARE_ALIGNED(16, uint16_t, orig[MAX_SB_SQUARE]); DECLARE_ALIGNED(16, uint16_t, rec[MAX_SB_SQUARE]); assert(bsw >= 8); assert(bsh >= 8); assert((bsw & 0x07) == 0); assert((bsh & 0x07) == 0); if (x->tune_metric == AOM_TUNE_CDEF_DIST || x->tune_metric == AOM_TUNE_DAALA_DIST) { if (is_cur_buf_hbd(xd)) { for (j = 0; j < bsh; j++) for (i = 0; i < bsw; i++) orig[j * bsw + i] = CONVERT_TO_SHORTPTR(src)[j * src_stride + i]; if ((bsw == visible_w) && (bsh == visible_h)) { for (j = 0; j < bsh; j++) for (i = 0; i < bsw; i++) rec[j * bsw + i] = CONVERT_TO_SHORTPTR(dst)[j * dst_stride + i]; } else { for (j = 0; j < visible_h; j++) for (i = 0; i < visible_w; i++) rec[j * bsw + i] = CONVERT_TO_SHORTPTR(dst)[j * dst_stride + i]; if (visible_w < bsw) { for (j = 0; j < bsh; j++) for (i = visible_w; i < bsw; i++) rec[j * bsw + i] = CONVERT_TO_SHORTPTR(src)[j * src_stride + i]; } if (visible_h < bsh) { for (j = visible_h; j < bsh; j++) for (i = 0; i < bsw; i++) rec[j * bsw + i] = CONVERT_TO_SHORTPTR(src)[j * src_stride + i]; } } } else { for (j = 0; j < bsh; j++) for (i = 0; i < bsw; i++) orig[j * bsw + i] = src[j * src_stride + i]; if ((bsw == visible_w) && (bsh == visible_h)) { for (j = 0; j < bsh; j++) for (i = 0; i < bsw; i++) rec[j * bsw + i] = dst[j * dst_stride + i]; } else { for (j = 0; j < visible_h; j++) for (i = 0; i < visible_w; i++) rec[j * bsw + i] = dst[j * dst_stride + i]; if (visible_w < bsw) { for (j = 0; j < bsh; j++) for (i = visible_w; i < bsw; i++) rec[j * bsw + i] = src[j * src_stride + i]; } if (visible_h < bsh) { for (j = visible_h; j < bsh; j++) for (i = 0; i < bsw; i++) rec[j * bsw + i] = src[j * src_stride + i]; } } } } if (x->tune_metric == AOM_TUNE_DAALA_DIST) { d = (int64_t)od_compute_dist(orig, rec, bsw, bsh, qindex); } else if (x->tune_metric == AOM_TUNE_CDEF_DIST) { int coeff_shift = AOMMAX(xd->bd - 8, 0); for (i = 0; i < bsh; i += 8) { for (j = 0; j < bsw; j += 8) { d += cdef_dist_8x8_16bit(&rec[i * bsw + j], bsw, &orig[i * bsw + j], bsw, coeff_shift); } } if (is_cur_buf_hbd(xd)) d = ((uint64_t)d) >> 2 * coeff_shift; } else { // Otherwise, MSE by default d = pixel_dist_visible_only(cpi, x, src, src_stride, dst, dst_stride, tx_bsize, bsh, bsw, visible_h, visible_w); } return d; } static int64_t dist_8x8_diff(const MACROBLOCK *x, const uint8_t *src, int src_stride, const int16_t *diff, int diff_stride, int bsw, int bsh, int visible_w, int visible_h, int qindex) { int64_t d = 0; int i, j; const MACROBLOCKD *xd = &x->e_mbd; DECLARE_ALIGNED(16, uint16_t, orig[MAX_SB_SQUARE]); DECLARE_ALIGNED(16, int16_t, diff16[MAX_SB_SQUARE]); assert(bsw >= 8); assert(bsh >= 8); assert((bsw & 0x07) == 0); assert((bsh & 0x07) == 0); if (x->tune_metric == AOM_TUNE_CDEF_DIST || x->tune_metric == AOM_TUNE_DAALA_DIST) { if (is_cur_buf_hbd(xd)) { for (j = 0; j < bsh; j++) for (i = 0; i < bsw; i++) orig[j * bsw + i] = CONVERT_TO_SHORTPTR(src)[j * src_stride + i]; } else { for (j = 0; j < bsh; j++) for (i = 0; i < bsw; i++) orig[j * bsw + i] = src[j * src_stride + i]; } if ((bsw == visible_w) && (bsh == visible_h)) { for (j = 0; j < bsh; j++) for (i = 0; i < bsw; i++) diff16[j * bsw + i] = diff[j * diff_stride + i]; } else { for (j = 0; j < visible_h; j++) for (i = 0; i < visible_w; i++) diff16[j * bsw + i] = diff[j * diff_stride + i]; if (visible_w < bsw) { for (j = 0; j < bsh; j++) for (i = visible_w; i < bsw; i++) diff16[j * bsw + i] = 0; } if (visible_h < bsh) { for (j = visible_h; j < bsh; j++) for (i = 0; i < bsw; i++) diff16[j * bsw + i] = 0; } } } if (x->tune_metric == AOM_TUNE_DAALA_DIST) { d = (int64_t)od_compute_dist_diff(orig, diff16, bsw, bsh, qindex); } else if (x->tune_metric == AOM_TUNE_CDEF_DIST) { int coeff_shift = AOMMAX(xd->bd - 8, 0); DECLARE_ALIGNED(16, uint16_t, dst16[MAX_SB_SQUARE]); for (i = 0; i < bsh; i++) { for (j = 0; j < bsw; j++) { dst16[i * bsw + j] = orig[i * bsw + j] - diff16[i * bsw + j]; } } for (i = 0; i < bsh; i += 8) { for (j = 0; j < bsw; j += 8) { d += cdef_dist_8x8_16bit(&dst16[i * bsw + j], bsw, &orig[i * bsw + j], bsw, coeff_shift); } } // Don't scale 'd' for HBD since it will be done by caller side for diff // input } else { // Otherwise, MSE by default d = aom_sum_squares_2d_i16(diff, diff_stride, visible_w, visible_h); } return d; } #endif // CONFIG_DIST_8X8 static void get_energy_distribution_fine(const AV1_COMP *cpi, BLOCK_SIZE bsize, const uint8_t *src, int src_stride, const uint8_t *dst, int dst_stride, int need_4th, double *hordist, double *verdist) { const int bw = block_size_wide[bsize]; const int bh = block_size_high[bsize]; unsigned int esq[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; if (bsize < BLOCK_16X16 || (bsize >= BLOCK_4X16 && bsize <= BLOCK_32X8)) { // Special cases: calculate 'esq' values manually, as we don't have 'vf' // functions for the 16 (very small) sub-blocks of this block. const int w_shift = (bw == 4) ? 0 : (bw == 8) ? 1 : (bw == 16) ? 2 : 3; const int h_shift = (bh == 4) ? 0 : (bh == 8) ? 1 : (bh == 16) ? 2 : 3; assert(bw <= 32); assert(bh <= 32); assert(((bw - 1) >> w_shift) + (((bh - 1) >> h_shift) << 2) == 15); if (cpi->common.seq_params.use_highbitdepth) { const uint16_t *src16 = CONVERT_TO_SHORTPTR(src); const uint16_t *dst16 = CONVERT_TO_SHORTPTR(dst); for (int i = 0; i < bh; ++i) for (int j = 0; j < bw; ++j) { const int index = (j >> w_shift) + ((i >> h_shift) << 2); esq[index] += (src16[j + i * src_stride] - dst16[j + i * dst_stride]) * (src16[j + i * src_stride] - dst16[j + i * dst_stride]); } } else { for (int i = 0; i < bh; ++i) for (int j = 0; j < bw; ++j) { const int index = (j >> w_shift) + ((i >> h_shift) << 2); esq[index] += (src[j + i * src_stride] - dst[j + i * dst_stride]) * (src[j + i * src_stride] - dst[j + i * dst_stride]); } } } else { // Calculate 'esq' values using 'vf' functions on the 16 sub-blocks. const int f_index = (bsize < BLOCK_SIZES) ? bsize - BLOCK_16X16 : bsize - BLOCK_8X16; assert(f_index >= 0 && f_index < BLOCK_SIZES_ALL); const BLOCK_SIZE subsize = (BLOCK_SIZE)f_index; assert(block_size_wide[bsize] == 4 * block_size_wide[subsize]); assert(block_size_high[bsize] == 4 * block_size_high[subsize]); cpi->fn_ptr[subsize].vf(src, src_stride, dst, dst_stride, &esq[0]); cpi->fn_ptr[subsize].vf(src + bw / 4, src_stride, dst + bw / 4, dst_stride, &esq[1]); cpi->fn_ptr[subsize].vf(src + bw / 2, src_stride, dst + bw / 2, dst_stride, &esq[2]); cpi->fn_ptr[subsize].vf(src + 3 * bw / 4, src_stride, dst + 3 * bw / 4, dst_stride, &esq[3]); src += bh / 4 * src_stride; dst += bh / 4 * dst_stride; cpi->fn_ptr[subsize].vf(src, src_stride, dst, dst_stride, &esq[4]); cpi->fn_ptr[subsize].vf(src + bw / 4, src_stride, dst + bw / 4, dst_stride, &esq[5]); cpi->fn_ptr[subsize].vf(src + bw / 2, src_stride, dst + bw / 2, dst_stride, &esq[6]); cpi->fn_ptr[subsize].vf(src + 3 * bw / 4, src_stride, dst + 3 * bw / 4, dst_stride, &esq[7]); src += bh / 4 * src_stride; dst += bh / 4 * dst_stride; cpi->fn_ptr[subsize].vf(src, src_stride, dst, dst_stride, &esq[8]); cpi->fn_ptr[subsize].vf(src + bw / 4, src_stride, dst + bw / 4, dst_stride, &esq[9]); cpi->fn_ptr[subsize].vf(src + bw / 2, src_stride, dst + bw / 2, dst_stride, &esq[10]); cpi->fn_ptr[subsize].vf(src + 3 * bw / 4, src_stride, dst + 3 * bw / 4, dst_stride, &esq[11]); src += bh / 4 * src_stride; dst += bh / 4 * dst_stride; cpi->fn_ptr[subsize].vf(src, src_stride, dst, dst_stride, &esq[12]); cpi->fn_ptr[subsize].vf(src + bw / 4, src_stride, dst + bw / 4, dst_stride, &esq[13]); cpi->fn_ptr[subsize].vf(src + bw / 2, src_stride, dst + bw / 2, dst_stride, &esq[14]); cpi->fn_ptr[subsize].vf(src + 3 * bw / 4, src_stride, dst + 3 * bw / 4, dst_stride, &esq[15]); } double total = (double)esq[0] + esq[1] + esq[2] + esq[3] + esq[4] + esq[5] + esq[6] + esq[7] + esq[8] + esq[9] + esq[10] + esq[11] + esq[12] + esq[13] + esq[14] + esq[15]; if (total > 0) { const double e_recip = 1.0 / total; hordist[0] = ((double)esq[0] + esq[4] + esq[8] + esq[12]) * e_recip; hordist[1] = ((double)esq[1] + esq[5] + esq[9] + esq[13]) * e_recip; hordist[2] = ((double)esq[2] + esq[6] + esq[10] + esq[14]) * e_recip; if (need_4th) { hordist[3] = ((double)esq[3] + esq[7] + esq[11] + esq[15]) * e_recip; } verdist[0] = ((double)esq[0] + esq[1] + esq[2] + esq[3]) * e_recip; verdist[1] = ((double)esq[4] + esq[5] + esq[6] + esq[7]) * e_recip; verdist[2] = ((double)esq[8] + esq[9] + esq[10] + esq[11]) * e_recip; if (need_4th) { verdist[3] = ((double)esq[12] + esq[13] + esq[14] + esq[15]) * e_recip; } } else { hordist[0] = verdist[0] = 0.25; hordist[1] = verdist[1] = 0.25; hordist[2] = verdist[2] = 0.25; if (need_4th) { hordist[3] = verdist[3] = 0.25; } } } static int adst_vs_flipadst(const AV1_COMP *cpi, BLOCK_SIZE bsize, const uint8_t *src, int src_stride, const uint8_t *dst, int dst_stride) { int prune_bitmask = 0; double svm_proj_h = 0, svm_proj_v = 0; double hdist[3] = { 0, 0, 0 }, vdist[3] = { 0, 0, 0 }; get_energy_distribution_fine(cpi, bsize, src, src_stride, dst, dst_stride, 0, hdist, vdist); svm_proj_v = vdist[0] * ADST_FLIP_SVM[0] + vdist[1] * ADST_FLIP_SVM[1] + vdist[2] * ADST_FLIP_SVM[2] + ADST_FLIP_SVM[3]; svm_proj_h = hdist[0] * ADST_FLIP_SVM[4] + hdist[1] * ADST_FLIP_SVM[5] + hdist[2] * ADST_FLIP_SVM[6] + ADST_FLIP_SVM[7]; if (svm_proj_v > FAST_EXT_TX_EDST_MID + FAST_EXT_TX_EDST_MARGIN) prune_bitmask |= 1 << FLIPADST_1D; else if (svm_proj_v < FAST_EXT_TX_EDST_MID - FAST_EXT_TX_EDST_MARGIN) prune_bitmask |= 1 << ADST_1D; if (svm_proj_h > FAST_EXT_TX_EDST_MID + FAST_EXT_TX_EDST_MARGIN) prune_bitmask |= 1 << (FLIPADST_1D + 8); else if (svm_proj_h < FAST_EXT_TX_EDST_MID - FAST_EXT_TX_EDST_MARGIN) prune_bitmask |= 1 << (ADST_1D + 8); return prune_bitmask; } static int dct_vs_idtx(const int16_t *diff, int stride, int w, int h) { float hcorr, vcorr; int prune_bitmask = 0; av1_get_horver_correlation_full(diff, stride, w, h, &hcorr, &vcorr); if (vcorr > FAST_EXT_TX_CORR_MID + FAST_EXT_TX_CORR_MARGIN) prune_bitmask |= 1 << IDTX_1D; else if (vcorr < FAST_EXT_TX_CORR_MID - FAST_EXT_TX_CORR_MARGIN) prune_bitmask |= 1 << DCT_1D; if (hcorr > FAST_EXT_TX_CORR_MID + FAST_EXT_TX_CORR_MARGIN) prune_bitmask |= 1 << (IDTX_1D + 8); else if (hcorr < FAST_EXT_TX_CORR_MID - FAST_EXT_TX_CORR_MARGIN) prune_bitmask |= 1 << (DCT_1D + 8); return prune_bitmask; } // Performance drop: 0.5%, Speed improvement: 24% static int prune_two_for_sby(const AV1_COMP *cpi, BLOCK_SIZE bsize, MACROBLOCK *x, const MACROBLOCKD *xd, int adst_flipadst, int dct_idtx) { int prune = 0; if (adst_flipadst) { const struct macroblock_plane *const p = &x->plane[0]; const struct macroblockd_plane *const pd = &xd->plane[0]; prune |= adst_vs_flipadst(cpi, bsize, p->src.buf, p->src.stride, pd->dst.buf, pd->dst.stride); } if (dct_idtx) { av1_subtract_plane(x, bsize, 0); const struct macroblock_plane *const p = &x->plane[0]; const int bw = block_size_wide[bsize]; const int bh = block_size_high[bsize]; prune |= dct_vs_idtx(p->src_diff, bw, bw, bh); } return prune; } // Performance drop: 0.3%, Speed improvement: 5% static int prune_one_for_sby(const AV1_COMP *cpi, BLOCK_SIZE bsize, const MACROBLOCK *x, const MACROBLOCKD *xd) { const struct macroblock_plane *const p = &x->plane[0]; const struct macroblockd_plane *const pd = &xd->plane[0]; return adst_vs_flipadst(cpi, bsize, p->src.buf, p->src.stride, pd->dst.buf, pd->dst.stride); } // 1D Transforms used in inter set, this needs to be changed if // ext_tx_used_inter is changed static const int ext_tx_used_inter_1D[EXT_TX_SETS_INTER][TX_TYPES_1D] = { { 1, 0, 0, 0 }, { 1, 1, 1, 1 }, { 1, 1, 1, 1 }, { 1, 0, 0, 1 }, }; static void get_energy_distribution_finer(const int16_t *diff, int stride, int bw, int bh, float *hordist, float *verdist) { // First compute downscaled block energy values (esq); downscale factors // are defined by w_shift and h_shift. unsigned int esq[256]; const int w_shift = bw <= 8 ? 0 : 1; const int h_shift = bh <= 8 ? 0 : 1; const int esq_w = bw >> w_shift; const int esq_h = bh >> h_shift; const int esq_sz = esq_w * esq_h; int i, j; memset(esq, 0, esq_sz * sizeof(esq[0])); if (w_shift) { for (i = 0; i < bh; i++) { unsigned int *cur_esq_row = esq + (i >> h_shift) * esq_w; const int16_t *cur_diff_row = diff + i * stride; for (j = 0; j < bw; j += 2) { cur_esq_row[j >> 1] += (cur_diff_row[j] * cur_diff_row[j] + cur_diff_row[j + 1] * cur_diff_row[j + 1]); } } } else { for (i = 0; i < bh; i++) { unsigned int *cur_esq_row = esq + (i >> h_shift) * esq_w; const int16_t *cur_diff_row = diff + i * stride; for (j = 0; j < bw; j++) { cur_esq_row[j] += cur_diff_row[j] * cur_diff_row[j]; } } } uint64_t total = 0; for (i = 0; i < esq_sz; i++) total += esq[i]; // Output hordist and verdist arrays are normalized 1D projections of esq if (total == 0) { float hor_val = 1.0f / esq_w; for (j = 0; j < esq_w - 1; j++) hordist[j] = hor_val; float ver_val = 1.0f / esq_h; for (i = 0; i < esq_h - 1; i++) verdist[i] = ver_val; return; } const float e_recip = 1.0f / (float)total; memset(hordist, 0, (esq_w - 1) * sizeof(hordist[0])); memset(verdist, 0, (esq_h - 1) * sizeof(verdist[0])); const unsigned int *cur_esq_row; for (i = 0; i < esq_h - 1; i++) { cur_esq_row = esq + i * esq_w; for (j = 0; j < esq_w - 1; j++) { hordist[j] += (float)cur_esq_row[j]; verdist[i] += (float)cur_esq_row[j]; } verdist[i] += (float)cur_esq_row[j]; } cur_esq_row = esq + i * esq_w; for (j = 0; j < esq_w - 1; j++) hordist[j] += (float)cur_esq_row[j]; for (j = 0; j < esq_w - 1; j++) hordist[j] *= e_recip; for (i = 0; i < esq_h - 1; i++) verdist[i] *= e_recip;
+ show +
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
} // Similar to get_horver_correlation, but also takes into account first // row/column, when computing horizontal/vertical correlation. void av1_get_horver_correlation_full_c(const int16_t *diff, int stride, int width, int height, float *hcorr, float *vcorr) { // The following notation is used: // x - current pixel // y - left neighbor pixel

[CVE-2020-0470_1.diff] rdopt.c #15
-// Model based RD estimation for luma intra blocks. -static int64_t intra_model_yrd(const AV1_COMP *const cpi, MACROBLOCK *const x, - BLOCK_SIZE bsize, int mode_cost, int mi_row, - int mi_col) { - const AV1_COMMON *cm = &cpi->common; - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = xd->mi[0]; - assert(!is_inter_block(mbmi)); - RD_STATS this_rd_stats; - int row, col; - int64_t temp_sse, this_rd; - TX_SIZE tx_size = tx_size_from_tx_mode(bsize, cm->tx_mode); - const int stepr = tx_size_high_unit[tx_size]; - const int stepc = tx_size_wide_unit[tx_size]; - const int max_blocks_wide = max_block_wide(xd, bsize, 0); - const int max_blocks_high = max_block_high(xd, bsize, 0); - mbmi->tx_size = tx_size; - // Prediction. - for (row = 0; row < max_blocks_high; row += stepr) { - for (col = 0; col < max_blocks_wide; col += stepc) { - av1_predict_intra_block_facade(cm, xd, 0, col, row, tx_size); - } - } - // RD estimation. - model_rd_sb_fn[MODELRD_TYPE_INTRA]( - cpi, bsize, x, xd, 0, 0, mi_row, mi_col, &this_rd_stats.rate, - &this_rd_stats.dist, &this_rd_stats.skip, &temp_sse, NULL, NULL, NULL); - if (av1_is_directional_mode(mbmi->mode) && av1_use_angle_delta(bsize)) { - mode_cost += - x->angle_delta_cost[mbmi->mode - V_PRED] - [MAX_ANGLE_DELTA + mbmi->angle_delta[PLANE_TYPE_Y]]; - } - if (mbmi->mode == DC_PRED && - av1_filter_intra_allowed_bsize(cm, mbmi->sb_type)) { - if (mbmi->filter_intra_mode_info.use_filter_intra) { - const int mode = mbmi->filter_intra_mode_info.filter_intra_mode; - mode_cost += x->filter_intra_cost[mbmi->sb_type][1] + - x->filter_intra_mode_cost[mode]; - } else { - mode_cost += x->filter_intra_cost[mbmi->sb_type][0]; - } - } - this_rd = - RDCOST(x->rdmult, this_rd_stats.rate + mode_cost, this_rd_stats.dist); - return this_rd; -} - -// Extends 'color_map' array from 'orig_width x orig_height' to 'new_width x -// new_height'. Extra rows and columns are filled in by copying last valid -// row/column. -static void extend_palette_color_map(uint8_t *const color_map, int orig_width, - int orig_height, int new_width, - int new_height) { - int j; - assert(new_width >= orig_width); - assert(new_height >= orig_height); - if (new_width == orig_width && new_height == orig_height) return; - - for (j = orig_height - 1; j >= 0; --j) { - memmove(color_map + j * new_width, color_map + j * orig_width, orig_width); - // Copy last column to extra columns. - memset(color_map + j * new_width + orig_width, - color_map[j * new_width + orig_width - 1], new_width - orig_width); - } - // Copy last row to extra rows. - for (j = orig_height; j < new_height; ++j) { - memcpy(color_map + j * new_width, color_map + (orig_height - 1) * new_width, - new_width); - } -} - -// Bias toward using colors in the cache. -// TODO(huisu): Try other schemes to improve compression. -static void optimize_palette_colors(uint16_t *color_cache, int n_cache, - int n_colors, int stride, int *centroids) { - if (n_cache <= 0) return; - for (int i = 0; i < n_colors * stride; i += stride) { - int min_diff = abs(centroids[i] - (int)color_cache[0]); - int idx = 0; - for (int j = 1; j < n_cache; ++j) { - const int this_diff = abs(centroids[i] - color_cache[j]); - if (this_diff < min_diff) { - min_diff = this_diff; - idx = j; - } - } - if (min_diff <= 1) centroids[i] = color_cache[idx]; - } -} - -// Given the base colors as specified in centroids[], calculate the RD cost -// of palette mode. -static void palette_rd_y(const AV1_COMP *const cpi, MACROBLOCK *x, - MB_MODE_INFO *mbmi, BLOCK_SIZE bsize, int mi_row, - int mi_col, int dc_mode_cost, const int *data, - int *centroids, int n, uint16_t *color_cache, - int n_cache, MB_MODE_INFO *best_mbmi, - uint8_t *best_palette_color_map, int64_t *best_rd, - int64_t *best_model_rd, int *rate, int *rate_tokenonly, - int *rate_overhead, int64_t *distortion, - int *skippable, PICK_MODE_CONTEXT *ctx, - uint8_t *blk_skip) { - optimize_palette_colors(color_cache, n_cache, n, 1, centroids); - int k = av1_remove_duplicates(centroids, n); - if (k < PALETTE_MIN_SIZE) { - // Too few unique colors to create a palette. And DC_PRED will work - // well for that case anyway. So skip. - return; - } - PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info; - if (cpi->common.seq_params.use_highbitdepth) - for (int i = 0; i < k; ++i) - pmi->palette_colors[i] = clip_pixel_highbd( - (int)centroids[i], cpi->common.seq_params.bit_depth); - else - for (int i = 0; i < k; ++i) - pmi->palette_colors[i] = clip_pixel(centroids[i]); - pmi->palette_size[0] = k; - MACROBLOCKD *const xd = &x->e_mbd; - uint8_t *const color_map = xd->plane[0].color_index_map; - int block_width, block_height, rows, cols; - av1_get_block_dimensions(bsize, 0, xd, &block_width, &block_height, &rows, - &cols); - av1_calc_indices(data, centroids, color_map, rows * cols, k, 1); - extend_palette_color_map(color_map, cols, rows, block_width, block_height); - const int palette_mode_cost = - intra_mode_info_cost_y(cpi, x, mbmi, bsize, dc_mode_cost); - int64_t this_model_rd = - intra_model_yrd(cpi, x, bsize, palette_mode_cost, mi_row, mi_col); - if (*best_model_rd != INT64_MAX && - this_model_rd > *best_model_rd + (*best_model_rd >> 1)) - return; - if (this_model_rd < *best_model_rd) *best_model_rd = this_model_rd; - RD_STATS tokenonly_rd_stats; - super_block_yrd(cpi, x, &tokenonly_rd_stats, bsize, *best_rd); - if (tokenonly_rd_stats.rate == INT_MAX) return; - int this_rate = tokenonly_rd_stats.rate + palette_mode_cost; - int64_t this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); - if (!xd->lossless[mbmi->segment_id] && block_signals_txsize(mbmi->sb_type)) { - tokenonly_rd_stats.rate -= - tx_size_cost(&cpi->common, x, bsize, mbmi->tx_size); - } - if (this_rd < *best_rd) { - *best_rd = this_rd; - memcpy(best_palette_color_map, color_map, - block_width * block_height * sizeof(color_map[0])); - *best_mbmi = *mbmi; - memcpy(blk_skip, x->blk_skip, sizeof(x->blk_skip[0]) * ctx->num_4x4_blk); - *rate_overhead = this_rate - tokenonly_rd_stats.rate; - if (rate) *rate = this_rate; - if (rate_tokenonly) *rate_tokenonly = tokenonly_rd_stats.rate; - if (distortion) *distortion = tokenonly_rd_stats.dist; - if (skippable) *skippable = tokenonly_rd_stats.skip; - } -} - -static int rd_pick_palette_intra_sby( - const AV1_COMP *const cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row, - int mi_col, int dc_mode_cost, MB_MODE_INFO *best_mbmi, - uint8_t *best_palette_color_map, int64_t *best_rd, int64_t *best_model_rd, - int *rate, int *rate_tokenonly, int64_t *distortion, int *skippable, - PICK_MODE_CONTEXT *ctx, uint8_t *best_blk_skip) { - int rate_overhead = 0; - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = xd->mi[0]; - assert(!is_inter_block(mbmi)); - assert(av1_allow_palette(cpi->common.allow_screen_content_tools, bsize)); - const SequenceHeader *const seq_params = &cpi->common.seq_params; - int colors, n; - const int src_stride = x->plane[0].src.stride; - const uint8_t *const src = x->plane[0].src.buf; - uint8_t *const color_map = xd->plane[0].color_index_map; - int block_width, block_height, rows, cols; - av1_get_block_dimensions(bsize, 0, xd, &block_width, &block_height, &rows, - &cols); - - int count_buf[1 << 12]; // Maximum (1 << 12) color levels. - if (seq_params->use_highbitdepth) - colors = av1_count_colors_highbd(src, src_stride, rows, cols, - seq_params->bit_depth, count_buf); - else - colors = av1_count_colors(src, src_stride, rows, cols, count_buf); - mbmi->filter_intra_mode_info.use_filter_intra = 0; - - if (colors > 1 && colors <= 64) { - int r, c, i; - const int max_itr = 50; - int *const data = x->palette_buffer->kmeans_data_buf; - int centroids[PALETTE_MAX_SIZE]; - int lb, ub, val; - uint16_t *src16 = CONVERT_TO_SHORTPTR(src); - if (seq_params->use_highbitdepth) - lb = ub = src16[0]; - else - lb = ub = src[0]; - - if (seq_params->use_highbitdepth) { - for (r = 0; r < rows; ++r) { - for (c = 0; c < cols; ++c) { - val = src16[r * src_stride + c]; - data[r * cols + c] = val; - if (val < lb) - lb = val; - else if (val > ub) - ub = val; - } - } - } else { - for (r = 0; r < rows; ++r) { - for (c = 0; c < cols; ++c) { - val = src[r * src_stride + c]; - data[r * cols + c] = val; - if (val < lb) - lb = val; - else if (val > ub) - ub = val; - } - } - } - - mbmi->mode = DC_PRED; - mbmi->filter_intra_mode_info.use_filter_intra = 0; - - uint16_t color_cache[2 * PALETTE_MAX_SIZE]; - const int n_cache = av1_get_palette_cache(xd, 0, color_cache); - - // Find the dominant colors, stored in top_colors[]. - int top_colors[PALETTE_MAX_SIZE] = { 0 }; - for (i = 0; i < AOMMIN(colors, PALETTE_MAX_SIZE); ++i) { - int max_count = 0; - for (int j = 0; j < (1 << seq_params->bit_depth); ++j) { - if (count_buf[j] > max_count) { - max_count = count_buf[j]; - top_colors[i] = j; - } - } - assert(max_count > 0); - count_buf[top_colors[i]] = 0; - } - - // Try the dominant colors directly. - // TODO(huisu@google.com): Try to avoid duplicate computation in cases - // where the dominant colors and the k-means results are similar. - for (n = AOMMIN(colors, PALETTE_MAX_SIZE); n >= 2; --n) { - for (i = 0; i < n; ++i) centroids[i] = top_colors[i]; - palette_rd_y(cpi, x, mbmi, bsize, mi_row, mi_col, dc_mode_cost, data, - centroids, n, color_cache, n_cache, best_mbmi, - best_palette_color_map, best_rd, best_model_rd, rate, - rate_tokenonly, &rate_overhead, distortion, skippable, ctx, - best_blk_skip); - } - - // K-means clustering. - for (n = AOMMIN(colors, PALETTE_MAX_SIZE); n >= 2; --n) { - if (colors == PALETTE_MIN_SIZE) { - // Special case: These colors automatically become the centroids. - assert(colors == n); - assert(colors == 2); - centroids[0] = lb; - centroids[1] = ub; - } else { - for (i = 0; i < n; ++i) { - centroids[i] = lb + (2 * i + 1) * (ub - lb) / n / 2; - } - av1_k_means(data, centroids, color_map, rows * cols, n, 1, max_itr); - } - palette_rd_y(cpi, x, mbmi, bsize, mi_row, mi_col, dc_mode_cost, data, - centroids, n, color_cache, n_cache, best_mbmi, - best_palette_color_map, best_rd, best_model_rd, rate, - rate_tokenonly, &rate_overhead, distortion, skippable, ctx, - best_blk_skip); - } - } - - if (best_mbmi->palette_mode_info.palette_size[0] > 0) { - memcpy(color_map, best_palette_color_map, - block_width * block_height * sizeof(best_palette_color_map[0])); - } - *mbmi = *best_mbmi; - return rate_overhead; -} - -// Return 1 if an filter intra mode is selected; return 0 otherwise. -static int rd_pick_filter_intra_sby(const AV1_COMP *const cpi, MACROBLOCK *x, - int mi_row, int mi_col, int *rate, - int *rate_tokenonly, int64_t *distortion, - int *skippable, BLOCK_SIZE bsize, - int mode_cost, int64_t *best_rd, - int64_t *best_model_rd, - PICK_MODE_CONTEXT *ctx) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *mbmi = xd->mi[0]; - int filter_intra_selected_flag = 0; - FILTER_INTRA_MODE mode; - TX_SIZE best_tx_size = TX_8X8; - FILTER_INTRA_MODE_INFO filter_intra_mode_info; - TX_TYPE best_txk_type[TXK_TYPE_BUF_LEN]; - (void)ctx; - av1_zero(filter_intra_mode_info); - mbmi->filter_intra_mode_info.use_filter_intra = 1; - mbmi->mode = DC_PRED; - mbmi->palette_mode_info.palette_size[0] = 0; - - for (mode = 0; mode < FILTER_INTRA_MODES; ++mode) { - int64_t this_rd, this_model_rd; - RD_STATS tokenonly_rd_stats; - mbmi->filter_intra_mode_info.filter_intra_mode = mode; - this_model_rd = intra_model_yrd(cpi, x, bsize, mode_cost, mi_row, mi_col); - if (*best_model_rd != INT64_MAX && - this_model_rd > *best_model_rd + (*best_model_rd >> 1)) - continue; - if (this_model_rd < *best_model_rd) *best_model_rd = this_model_rd; - super_block_yrd(cpi, x, &tokenonly_rd_stats, bsize, *best_rd); - if (tokenonly_rd_stats.rate == INT_MAX) continue; - const int this_rate = - tokenonly_rd_stats.rate + - intra_mode_info_cost_y(cpi, x, mbmi, bsize, mode_cost); - this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); - - if (this_rd < *best_rd) { - *best_rd = this_rd; - best_tx_size = mbmi->tx_size; - filter_intra_mode_info = mbmi->filter_intra_mode_info; - memcpy(best_txk_type, mbmi->txk_type, - sizeof(best_txk_type[0]) * TXK_TYPE_BUF_LEN); - memcpy(ctx->blk_skip, x->blk_skip, - sizeof(x->blk_skip[0]) * ctx->num_4x4_blk); - *rate = this_rate; - *rate_tokenonly = tokenonly_rd_stats.rate; - *distortion = tokenonly_rd_stats.dist; - *skippable = tokenonly_rd_stats.skip; - filter_intra_selected_flag = 1; - } - } - - if (filter_intra_selected_flag) { - mbmi->mode = DC_PRED; - mbmi->tx_size = best_tx_size; - mbmi->filter_intra_mode_info = filter_intra_mode_info; - memcpy(mbmi->txk_type, best_txk_type, - sizeof(best_txk_type[0]) * TXK_TYPE_BUF_LEN); - return 1; - } else { - return 0; - } -} - -// Run RD calculation with given luma intra prediction angle., and return -// the RD cost. Update the best mode info. if the RD cost is the best so far. -static int64_t calc_rd_given_intra_angle( - const AV1_COMP *const cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row, - int mi_col, int mode_cost, int64_t best_rd_in, int8_t angle_delta, - int max_angle_delta, int *rate, RD_STATS *rd_stats, int *best_angle_delta, - TX_SIZE *best_tx_size, int64_t *best_rd, int64_t *best_model_rd, - TX_TYPE *best_txk_type, uint8_t *best_blk_skip) { - RD_STATS tokenonly_rd_stats; - int64_t this_rd, this_model_rd; - MB_MODE_INFO *mbmi = x->e_mbd.mi[0]; - const int n4 = bsize_to_num_blk(bsize); - assert(!is_inter_block(mbmi)); - mbmi->angle_delta[PLANE_TYPE_Y] = angle_delta; - this_model_rd = intra_model_yrd(cpi, x, bsize, mode_cost, mi_row, mi_col); - if (*best_model_rd != INT64_MAX && - this_model_rd > *best_model_rd + (*best_model_rd >> 1)) - return INT64_MAX; - if (this_model_rd < *best_model_rd) *best_model_rd = this_model_rd; - super_block_yrd(cpi, x, &tokenonly_rd_stats, bsize, best_rd_in); - if (tokenonly_rd_stats.rate == INT_MAX) return INT64_MAX; - - int this_rate = - mode_cost + tokenonly_rd_stats.rate + - x->angle_delta_cost[mbmi->mode - V_PRED][max_angle_delta + angle_delta]; - this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); - - if (this_rd < *best_rd) { - memcpy(best_txk_type, mbmi->txk_type, - sizeof(*best_txk_type) * TXK_TYPE_BUF_LEN); - memcpy(best_blk_skip, x->blk_skip, sizeof(best_blk_skip[0]) * n4); - *best_rd = this_rd; - *best_angle_delta = mbmi->angle_delta[PLANE_TYPE_Y]; - *best_tx_size = mbmi->tx_size; - *rate = this_rate; - rd_stats->rate = tokenonly_rd_stats.rate; - rd_stats->dist = tokenonly_rd_stats.dist; - rd_stats->skip = tokenonly_rd_stats.skip; - } - return this_rd; -} - -// With given luma directional intra prediction mode, pick the best angle delta -// Return the RD cost corresponding to the best angle delta. -static int64_t rd_pick_intra_angle_sby(const AV1_COMP *const cpi, MACROBLOCK *x, - int mi_row, int mi_col, int *rate, - RD_STATS *rd_stats, BLOCK_SIZE bsize, - int mode_cost, int64_t best_rd, - int64_t *best_model_rd) { - MB_MODE_INFO *mbmi = x->e_mbd.mi[0]; - assert(!is_inter_block(mbmi)); - - int best_angle_delta = 0; - int64_t rd_cost[2 * (MAX_ANGLE_DELTA + 2)]; - TX_SIZE best_tx_size = mbmi->tx_size; - TX_TYPE best_txk_type[TXK_TYPE_BUF_LEN]; - uint8_t best_blk_skip[MAX_MIB_SIZE * MAX_MIB_SIZE]; - - for (int i = 0; i < 2 * (MAX_ANGLE_DELTA + 2); ++i) rd_cost[i] = INT64_MAX; - - int first_try = 1; - for (int angle_delta = 0; angle_delta <= MAX_ANGLE_DELTA; angle_delta += 2) { - for (int i = 0; i < 2; ++i) { - const int64_t best_rd_in = - (best_rd == INT64_MAX) ? INT64_MAX - : (best_rd + (best_rd >> (first_try ? 3 : 5))); - const int64_t this_rd = calc_rd_given_intra_angle( - cpi, x, bsize, mi_row, mi_col, mode_cost, best_rd_in, - (1 - 2 * i) * angle_delta, MAX_ANGLE_DELTA, rate, rd_stats, - &best_angle_delta, &best_tx_size, &best_rd, best_model_rd, - best_txk_type, best_blk_skip); - rd_cost[2 * angle_delta + i] = this_rd; - if (first_try && this_rd == INT64_MAX) return best_rd; - first_try = 0; - if (angle_delta == 0) { - rd_cost[1] = this_rd; - break; - } - } - } - - assert(best_rd != INT64_MAX); - for (int angle_delta = 1; angle_delta <= MAX_ANGLE_DELTA; angle_delta += 2) { - for (int i = 0; i < 2; ++i) { - int skip_search = 0; - const int64_t rd_thresh = best_rd + (best_rd >> 5); - if (rd_cost[2 * (angle_delta + 1) + i] > rd_thresh && - rd_cost[2 * (angle_delta - 1) + i] > rd_thresh) - skip_search = 1; - if (!skip_search) { - calc_rd_given_intra_angle(cpi, x, bsize, mi_row, mi_col, mode_cost, - best_rd, (1 - 2 * i) * angle_delta, - MAX_ANGLE_DELTA, rate, rd_stats, - &best_angle_delta, &best_tx_size, &best_rd, - best_model_rd, best_txk_type, best_blk_skip); - } - } - } - - if (rd_stats->rate != INT_MAX) { - mbmi->tx_size = best_tx_size; - mbmi->angle_delta[PLANE_TYPE_Y] = best_angle_delta; - memcpy(mbmi->txk_type, best_txk_type, - sizeof(*best_txk_type) * TXK_TYPE_BUF_LEN); - memcpy(x->blk_skip, best_blk_skip, - sizeof(best_blk_skip[0]) * bsize_to_num_blk(bsize)); - } - return best_rd; -} - -// Indices are sign, integer, and fractional part of the gradient value -static const uint8_t gradient_to_angle_bin[2][7][16] = { - { - { 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, - { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, - { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, - }, - { - { 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4 }, - { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3 }, - { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, - { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, - { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, - { 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, - { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, - }, -}; - -/* clang-format off */ -static const uint8_t mode_to_angle_bin[INTRA_MODES] = { - 0, 2, 6, 0, 4, 3, 5, 7, 1, 0, - 0, -}; -/* clang-format on */ - -static void get_gradient_hist(const uint8_t *src, int src_stride, int rows, - int cols, uint64_t *hist) { - src += src_stride; - for (int r = 1; r < rows; ++r) { - for (int c = 1; c < cols; ++c) { - int dx = src[c] - src[c - 1]; - int dy = src[c] - src[c - src_stride]; - int index; - const int temp = dx * dx + dy * dy; - if (dy == 0) { - index = 2; - } else { - const int sn = (dx > 0) ^ (dy > 0); - dx = abs(dx); - dy = abs(dy); - const int remd = (dx % dy) * 16 / dy; - const int quot = dx / dy; - index = gradient_to_angle_bin[sn][AOMMIN(quot, 6)][AOMMIN(remd, 15)]; - } - hist[index] += temp; - } - src += src_stride; - } -} - -static void get_highbd_gradient_hist(const uint8_t *src8, int src_stride, - int rows, int cols, uint64_t *hist) { - uint16_t *src = CONVERT_TO_SHORTPTR(src8); - src += src_stride; - for (int r = 1; r < rows; ++r) { - for (int c = 1; c < cols; ++c) { - int dx = src[c] - src[c - 1]; - int dy = src[c] - src[c - src_stride]; - int index; - const int temp = dx * dx + dy * dy; - if (dy == 0) { - index = 2; - } else { - const int sn = (dx > 0) ^ (dy > 0); - dx = abs(dx); - dy = abs(dy); - const int remd = (dx % dy) * 16 / dy; - const int quot = dx / dy; - index = gradient_to_angle_bin[sn][AOMMIN(quot, 6)][AOMMIN(remd, 15)]; - } - hist[index] += temp; - } - src += src_stride; - } -} - -static void angle_estimation(const uint8_t *src, int src_stride, int rows, - int cols, BLOCK_SIZE bsize, int is_hbd, - uint8_t *directional_mode_skip_mask) { - // Check if angle_delta is used - if (!av1_use_angle_delta(bsize)) return; - - uint64_t hist[DIRECTIONAL_MODES] = { 0 }; - if (is_hbd) - get_highbd_gradient_hist(src, src_stride, rows, cols, hist); - else - get_gradient_hist(src, src_stride, rows, cols, hist); - - int i; - uint64_t hist_sum = 0; - for (i = 0; i < DIRECTIONAL_MODES; ++i) hist_sum += hist[i]; - for (i = 0; i < INTRA_MODES; ++i) { - if (av1_is_directional_mode(i)) { - const uint8_t angle_bin = mode_to_angle_bin[i]; - uint64_t score = 2 * hist[angle_bin]; - int weight = 2; - if (angle_bin > 0) { - score += hist[angle_bin - 1]; - ++weight; - } - if (angle_bin < DIRECTIONAL_MODES - 1) { - score += hist[angle_bin + 1]; - ++weight; - } - const int thresh = 10; - if (score * thresh < hist_sum * weight) directional_mode_skip_mask[i] = 1; - } - } -} - -// Given selected prediction mode, search for the best tx type and size. -static void intra_block_yrd(const AV1_COMP *const cpi, MACROBLOCK *x, - BLOCK_SIZE bsize, const int *bmode_costs, - int64_t *best_rd, int *rate, int *rate_tokenonly, - int64_t *distortion, int *skippable, - MB_MODE_INFO *best_mbmi, PICK_MODE_CONTEXT *ctx) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = xd->mi[0]; - RD_STATS rd_stats; - super_block_yrd(cpi, x, &rd_stats, bsize, *best_rd); - if (rd_stats.rate == INT_MAX) return; - int this_rate_tokenonly = rd_stats.rate; - if (!xd->lossless[mbmi->segment_id] && block_signals_txsize(mbmi->sb_type)) { - // super_block_yrd above includes the cost of the tx_size in the - // tokenonly rate, but for intra blocks, tx_size is always coded - // (prediction granularity), so we account for it in the full rate, - // not the tokenonly rate. - this_rate_tokenonly -= tx_size_cost(&cpi->common, x, bsize, mbmi->tx_size); - } - const int this_rate = - rd_stats.rate + - intra_mode_info_cost_y(cpi, x, mbmi, bsize, bmode_costs[mbmi->mode]); - const int64_t this_rd = RDCOST(x->rdmult, this_rate, rd_stats.dist); - if (this_rd < *best_rd) { - *best_mbmi = *mbmi; - *best_rd = this_rd; - *rate = this_rate; - *rate_tokenonly = this_rate_tokenonly; - *distortion = rd_stats.dist; - *skippable = rd_stats.skip; - memcpy(ctx->blk_skip, x->blk_skip, - sizeof(x->blk_skip[0]) * ctx->num_4x4_blk); - } -} - -// This function is used only for intra_only frames -static int64_t rd_pick_intra_sby_mode(const AV1_COMP *const cpi, MACROBLOCK *x, - int mi_row, int mi_col, int *rate, - int *rate_tokenonly, int64_t *distortion, - int *skippable, BLOCK_SIZE bsize, - int64_t best_rd, PICK_MODE_CONTEXT *ctx) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = xd->mi[0]; - assert(!is_inter_block(mbmi)); - int64_t best_model_rd = INT64_MAX; - const int rows = block_size_high[bsize]; - const int cols = block_size_wide[bsize]; - int is_directional_mode; - uint8_t directional_mode_skip_mask[INTRA_MODES] = { 0 }; - int beat_best_rd = 0; - const int *bmode_costs; - PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info; - const int try_palette = - cpi->oxcf.enable_palette && - av1_allow_palette(cpi->common.allow_screen_content_tools, mbmi->sb_type); - uint8_t *best_palette_color_map = - try_palette ? x->palette_buffer->best_palette_color_map : NULL; - const MB_MODE_INFO *above_mi = xd->above_mbmi; - const MB_MODE_INFO *left_mi = xd->left_mbmi; - const PREDICTION_MODE A = av1_above_block_mode(above_mi); - const PREDICTION_MODE L = av1_left_block_mode(left_mi); - const int above_ctx = intra_mode_context[A]; - const int left_ctx = intra_mode_context[L]; - bmode_costs = x->y_mode_costs[above_ctx][left_ctx]; - - mbmi->angle_delta[PLANE_TYPE_Y] = 0; - if (cpi->sf.intra_angle_estimation) { - const int src_stride = x->plane[0].src.stride; - const uint8_t *src = x->plane[0].src.buf; - angle_estimation(src, src_stride, rows, cols, bsize, is_cur_buf_hbd(xd), - directional_mode_skip_mask); - } - mbmi->filter_intra_mode_info.use_filter_intra = 0; - pmi->palette_size[0] = 0; - - if (cpi->sf.tx_type_search.fast_intra_tx_type_search) - x->use_default_intra_tx_type = 1; - else - x->use_default_intra_tx_type = 0; - - MB_MODE_INFO best_mbmi = *mbmi; - /* Y Search for intra prediction mode */ - for (int mode_idx = INTRA_MODE_START; mode_idx < INTRA_MODE_END; ++mode_idx) { - RD_STATS this_rd_stats; - int this_rate, this_rate_tokenonly, s; - int64_t this_distortion, this_rd, this_model_rd; - mbmi->mode = intra_rd_search_mode_order[mode_idx]; - if ((!cpi->oxcf.enable_smooth_intra || cpi->sf.disable_smooth_intra) && - (mbmi->mode == SMOOTH_PRED || mbmi->mode == SMOOTH_H_PRED || - mbmi->mode == SMOOTH_V_PRED)) - continue; - if (!cpi->oxcf.enable_paeth_intra && mbmi->mode == PAETH_PRED) continue; - mbmi->angle_delta[PLANE_TYPE_Y] = 0; - this_model_rd = - intra_model_yrd(cpi, x, bsize, bmode_costs[mbmi->mode], mi_row, mi_col); - if (best_model_rd != INT64_MAX && - this_model_rd > best_model_rd + (best_model_rd >> 1)) - continue; - if (this_model_rd < best_model_rd) best_model_rd = this_model_rd; - is_directional_mode = av1_is_directional_mode(mbmi->mode); - if (is_directional_mode && directional_mode_skip_mask[mbmi->mode]) continue; - if (is_directional_mode && av1_use_angle_delta(bsize) && - cpi->oxcf.enable_angle_delta) { - this_rd_stats.rate = INT_MAX; - rd_pick_intra_angle_sby(cpi, x, mi_row, mi_col, &this_rate, - &this_rd_stats, bsize, bmode_costs[mbmi->mode], - best_rd, &best_model_rd); - } else { - super_block_yrd(cpi, x, &this_rd_stats, bsize, best_rd); - } - this_rate_tokenonly = this_rd_stats.rate; - this_distortion = this_rd_stats.dist; - s = this_rd_stats.skip; - - if (this_rate_tokenonly == INT_MAX) continue; - - if (!xd->lossless[mbmi->segment_id] && - block_signals_txsize(mbmi->sb_type)) { - // super_block_yrd above includes the cost of the tx_size in the - // tokenonly rate, but for intra blocks, tx_size is always coded - // (prediction granularity), so we account for it in the full rate, - // not the tokenonly rate. - this_rate_tokenonly -= - tx_size_cost(&cpi->common, x, bsize, mbmi->tx_size); - } - this_rate = - this_rd_stats.rate + - intra_mode_info_cost_y(cpi, x, mbmi, bsize, bmode_costs[mbmi->mode]); - this_rd = RDCOST(x->rdmult, this_rate, this_distortion); - if (this_rd < best_rd) { - best_mbmi = *mbmi; - best_rd = this_rd; - beat_best_rd = 1; - *rate = this_rate; - *rate_tokenonly = this_rate_tokenonly; - *distortion = this_distortion; - *skippable = s; - memcpy(ctx->blk_skip, x->blk_skip, - sizeof(x->blk_skip[0]) * ctx->num_4x4_blk); - } - } - - if (try_palette) { - rd_pick_palette_intra_sby( - cpi, x, bsize, mi_row, mi_col, bmode_costs[DC_PRED], &best_mbmi, - best_palette_color_map, &best_rd, &best_model_rd, rate, rate_tokenonly, - distortion, skippable, ctx, ctx->blk_skip); - } - - if (beat_best_rd && av1_filter_intra_allowed_bsize(&cpi->common, bsize)) { - if (rd_pick_filter_intra_sby( - cpi, x, mi_row, mi_col, rate, rate_tokenonly, distortion, skippable, - bsize, bmode_costs[DC_PRED], &best_rd, &best_model_rd, ctx)) { - best_mbmi = *mbmi; - } - } - - // If previous searches use only the default tx type, do an extra search for - // the best tx type. - if (x->use_default_intra_tx_type) { - *mbmi = best_mbmi; - x->use_default_intra_tx_type = 0; - intra_block_yrd(cpi, x, bsize, bmode_costs, &best_rd, rate, rate_tokenonly, - distortion, skippable, &best_mbmi, ctx); - } - - *mbmi = best_mbmi; - return best_rd; -} - -// Return value 0: early termination triggered, no valid rd cost available; -// 1: rd cost values are valid. -static int super_block_uvrd(const AV1_COMP *const cpi, MACROBLOCK *x, - RD_STATS *rd_stats, BLOCK_SIZE bsize, - int64_t ref_best_rd) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = xd->mi[0]; - struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_U]; - const TX_SIZE uv_tx_size = av1_get_tx_size(AOM_PLANE_U, xd); - int plane; - int is_cost_valid = 1; - const int is_inter = is_inter_block(mbmi); - int64_t this_rd = 0, skip_rd = 0; - av1_init_rd_stats(rd_stats); - - if (ref_best_rd < 0) is_cost_valid = 0; - - if (x->skip_chroma_rd) return is_cost_valid; - - bsize = scale_chroma_bsize(bsize, pd->subsampling_x, pd->subsampling_y); - - if (is_inter && is_cost_valid) { - for (plane = 1; plane < MAX_MB_PLANE; ++plane) - av1_subtract_plane(x, bsize, plane); - } - - if (is_cost_valid) { - for (plane = 1; plane < MAX_MB_PLANE; ++plane) { - RD_STATS pn_rd_stats; - int64_t chroma_ref_best_rd = ref_best_rd; - // For inter blocks, refined ref_best_rd is used for early exit - // For intra blocks, even though current rd crosses ref_best_rd, early - // exit is not recommended as current rd is used for gating subsequent - // modes as well (say, for angular modes) - // TODO(any): Extend the early exit mechanism for intra modes as well - if (cpi->sf.perform_best_rd_based_gating_for_chroma && is_inter && - chroma_ref_best_rd != INT64_MAX) - chroma_ref_best_rd = ref_best_rd - AOMMIN(this_rd, skip_rd); - txfm_rd_in_plane(x, cpi, &pn_rd_stats, chroma_ref_best_rd, 0, plane, - bsize, uv_tx_size, cpi->sf.use_fast_coef_costing, - FTXS_NONE, 0); - if (pn_rd_stats.rate == INT_MAX) { - is_cost_valid = 0; - break; - } - av1_merge_rd_stats(rd_stats, &pn_rd_stats); - this_rd = RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist); - skip_rd = RDCOST(x->rdmult, 0, rd_stats->sse); - if (AOMMIN(this_rd, skip_rd) > ref_best_rd) { - is_cost_valid = 0; - break; - } - } - } - - if (!is_cost_valid) { - // reset cost value - av1_invalid_rd_stats(rd_stats); - } - - return is_cost_valid; -} - -// Pick transform type for a transform block of tx_size. -static void tx_type_rd(const AV1_COMP *cpi, MACROBLOCK *x, TX_SIZE tx_size, - int blk_row, int blk_col, int plane, int block, - int plane_bsize, TXB_CTX *txb_ctx, RD_STATS *rd_stats, - FAST_TX_SEARCH_MODE ftxs_mode, int64_t ref_rdcost, - TXB_RD_INFO *rd_info_array) { - const struct macroblock_plane *const p = &x->plane[plane]; - const uint16_t cur_joint_ctx = - (txb_ctx->dc_sign_ctx << 8) + txb_ctx->txb_skip_ctx; - const int txk_type_idx = - av1_get_txk_type_index(plane_bsize, blk_row, blk_col); - // Look up RD and terminate early in case when we've already processed exactly - // the same residual with exactly the same entropy context. - if (rd_info_array != NULL && rd_info_array->valid && - rd_info_array->entropy_context == cur_joint_ctx) { - if (plane == 0) - x->e_mbd.mi[0]->txk_type[txk_type_idx] = rd_info_array->tx_type; - const TX_TYPE ref_tx_type = - av1_get_tx_type(get_plane_type(plane), &x->e_mbd, blk_row, blk_col, - tx_size, cpi->common.reduced_tx_set_used); - if (ref_tx_type == rd_info_array->tx_type) { - rd_stats->rate += rd_info_array->rate; - rd_stats->dist += rd_info_array->dist; - rd_stats->sse += rd_info_array->sse; - rd_stats->skip &= rd_info_array->eob == 0; - p->eobs[block] = rd_info_array->eob; - p->txb_entropy_ctx[block] = rd_info_array->txb_entropy_ctx; - return; - } - } - - RD_STATS this_rd_stats; - search_txk_type(cpi, x, plane, block, blk_row, blk_col, plane_bsize, tx_size, - txb_ctx, ftxs_mode, 0, 0, ref_rdcost, &this_rd_stats); - - av1_merge_rd_stats(rd_stats, &this_rd_stats); - - // Save RD results for possible reuse in future. - if (rd_info_array != NULL) { - rd_info_array->valid = 1; - rd_info_array->entropy_context = cur_joint_ctx; - rd_info_array->rate = this_rd_stats.rate; - rd_info_array->dist = this_rd_stats.dist; - rd_info_array->sse = this_rd_stats.sse; - rd_info_array->eob = p->eobs[block]; - rd_info_array->txb_entropy_ctx = p->txb_entropy_ctx[block]; - if (plane == 0) { - rd_info_array->tx_type = x->e_mbd.mi[0]->txk_type[txk_type_idx]; - } - } -} - -static void get_mean_and_dev(const int16_t *data, int stride, int bw, int bh, - float *mean, float *dev) { - int x_sum = 0; - uint64_t x2_sum = 0; - for (int i = 0; i < bh; ++i) { - for (int j = 0; j < bw; ++j) { - const int val = data[j]; - x_sum += val; - x2_sum += val * val; - } - data += stride; - } - - const int num = bw * bh; - const float e_x = (float)x_sum / num; - const float e_x2 = (float)((double)x2_sum / num); - const float diff = e_x2 - e_x * e_x; - *dev = (diff > 0) ? sqrtf(diff) : 0; - *mean = e_x; -} - -static void get_mean_and_dev_float(const float *data, int stride, int bw, - int bh, float *mean, float *dev) { - float x_sum = 0; - float x2_sum = 0; - for (int i = 0; i < bh; ++i) { - for (int j = 0; j < bw; ++j) { - const float val = data[j]; - x_sum += val; - x2_sum += val * val; - } - data += stride; - } - - const int num = bw * bh; - const float e_x = x_sum / num; - const float e_x2 = x2_sum / num; - const float diff = e_x2 - e_x * e_x; - *dev = (diff > 0) ? sqrtf(diff) : 0; - *mean = e_x; -} - -// Feature used by the model to predict tx split: the mean and standard -// deviation values of the block and sub-blocks. -static void get_mean_dev_features(const int16_t *data, int stride, int bw, - int bh, int levels, float *feature) { - int feature_idx = 0; - int width = bw; - int height = bh; - const int16_t *const data_ptr = &data[0]; - for (int lv = 0; lv < levels; ++lv) { - if (width < 2 || height < 2) break; - float mean_buf[16]; - float dev_buf[16]; - int blk_idx = 0; - for (int row = 0; row < bh; row += height) { - for (int col = 0; col < bw; col += width) { - float mean, dev; - get_mean_and_dev(data_ptr + row * stride + col, stride, width, height, - &mean, &dev); - feature[feature_idx++] = mean; - feature[feature_idx++] = dev; - mean_buf[blk_idx] = mean; - dev_buf[blk_idx++] = dev; - } - } - if (blk_idx > 1) { - float mean, dev; - // Deviation of means. - get_mean_and_dev_float(mean_buf, 1, 1, blk_idx, &mean, &dev); - feature[feature_idx++] = dev; - // Mean of deviations. - get_mean_and_dev_float(dev_buf, 1, 1, blk_idx, &mean, &dev); - feature[feature_idx++] = mean; - } - // Reduce the block size when proceeding to the next level. - if (height == width) { - height = height >> 1; - width = width >> 1; - } else if (height > width) { - height = height >> 1; - } else { - width = width >> 1; - } - } -} - -static int ml_predict_tx_split(MACROBLOCK *x, BLOCK_SIZE bsize, int blk_row, - int blk_col, TX_SIZE tx_size) { - const NN_CONFIG *nn_config = av1_tx_split_nnconfig_map[tx_size]; - if (!nn_config) return -1; - - const int diff_stride = block_size_wide[bsize]; - const int16_t *diff = - x->plane[0].src_diff + 4 * blk_row * diff_stride + 4 * blk_col; - const int bw = tx_size_wide[tx_size]; - const int bh = tx_size_high[tx_size]; - aom_clear_system_state(); - - float features[64] = { 0.0f }; - get_mean_dev_features(diff, diff_stride, bw, bh, 2, features); - - float score = 0.0f; - av1_nn_predict(features, nn_config, &score); - aom_clear_system_state(); - if (score > 8.0f) return 100; - if (score < -8.0f) return 0; - score = 1.0f / (1.0f + (float)exp(-score)); - return (int)(score * 100); -} - -typedef struct { - int64_t rd; - int txb_entropy_ctx; - TX_TYPE tx_type; -} TxCandidateInfo; - -static void try_tx_block_no_split( - const AV1_COMP *cpi, MACROBLOCK *x, int blk_row, int blk_col, int block, - TX_SIZE tx_size, int depth, BLOCK_SIZE plane_bsize, - const ENTROPY_CONTEXT *ta, const ENTROPY_CONTEXT *tl, - int txfm_partition_ctx, RD_STATS *rd_stats, int64_t ref_best_rd, - FAST_TX_SEARCH_MODE ftxs_mode, TXB_RD_INFO_NODE *rd_info_node, - TxCandidateInfo *no_split) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = xd->mi[0]; - struct macroblock_plane *const p = &x->plane[0]; - const int bw = block_size_wide[plane_bsize] >> tx_size_wide_log2[0]; - - no_split->rd = INT64_MAX; - no_split->txb_entropy_ctx = 0; - no_split->tx_type = TX_TYPES; - - const ENTROPY_CONTEXT *const pta = ta + blk_col; - const ENTROPY_CONTEXT *const ptl = tl + blk_row; - - const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size); - TXB_CTX txb_ctx; - get_txb_ctx(plane_bsize, tx_size, 0, pta, ptl, &txb_ctx); - const int zero_blk_rate = x->coeff_costs[txs_ctx][PLANE_TYPE_Y] - .txb_skip_cost[txb_ctx.txb_skip_ctx][1]; - - rd_stats->ref_rdcost = ref_best_rd; - rd_stats->zero_rate = zero_blk_rate; - const int index = av1_get_txb_size_index(plane_bsize, blk_row, blk_col); - mbmi->inter_tx_size[index] = tx_size; - tx_type_rd(cpi, x, tx_size, blk_row, blk_col, 0, block, plane_bsize, &txb_ctx, - rd_stats, ftxs_mode, ref_best_rd, - rd_info_node != NULL ? rd_info_node->rd_info_array : NULL); - assert(rd_stats->rate < INT_MAX); - - if ((RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist) >= - RDCOST(x->rdmult, zero_blk_rate, rd_stats->sse) || - rd_stats->skip == 1) && - !xd->lossless[mbmi->segment_id]) { -#if CONFIG_RD_DEBUG - av1_update_txb_coeff_cost(rd_stats, 0, tx_size, blk_row, blk_col, - zero_blk_rate - rd_stats->rate); -#endif // CONFIG_RD_DEBUG - rd_stats->rate = zero_blk_rate; - rd_stats->dist = rd_stats->sse; - rd_stats->skip = 1; - set_blk_skip(x, 0, blk_row * bw + blk_col, 1); - p->eobs[block] = 0; - update_txk_array(mbmi->txk_type, plane_bsize, blk_row, blk_col, tx_size, - DCT_DCT); - } else { - set_blk_skip(x, 0, blk_row * bw + blk_col, 0); - rd_stats->skip = 0; - } - - if (tx_size > TX_4X4 && depth < MAX_VARTX_DEPTH) - rd_stats->rate += x->txfm_partition_cost[txfm_partition_ctx][0]; - - no_split->rd = RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist); - no_split->txb_entropy_ctx = p->txb_entropy_ctx[block]; - const int txk_type_idx = - av1_get_txk_type_index(plane_bsize, blk_row, blk_col); - no_split->tx_type = mbmi->txk_type[txk_type_idx]; -} - -static void select_tx_block(const AV1_COMP *cpi, MACROBLOCK *x, int blk_row, - int blk_col, int block, TX_SIZE tx_size, int depth, - BLOCK_SIZE plane_bsize, ENTROPY_CONTEXT *ta, - ENTROPY_CONTEXT *tl, TXFM_CONTEXT *tx_above, - TXFM_CONTEXT *tx_left, RD_STATS *rd_stats, - int64_t prev_level_rd, int64_t ref_best_rd, - int *is_cost_valid, FAST_TX_SEARCH_MODE ftxs_mode, - TXB_RD_INFO_NODE *rd_info_node); - -static void try_tx_block_split( - const AV1_COMP *cpi, MACROBLOCK *x, int blk_row, int blk_col, int block, - TX_SIZE tx_size, int depth, BLOCK_SIZE plane_bsize, ENTROPY_CONTEXT *ta, - ENTROPY_CONTEXT *tl, TXFM_CONTEXT *tx_above, TXFM_CONTEXT *tx_left, - int txfm_partition_ctx, int64_t no_split_rd, int64_t ref_best_rd, - FAST_TX_SEARCH_MODE ftxs_mode, TXB_RD_INFO_NODE *rd_info_node, - RD_STATS *split_rd_stats, int64_t *split_rd) { - assert(tx_size < TX_SIZES_ALL); - MACROBLOCKD *const xd = &x->e_mbd; - const int max_blocks_high = max_block_high(xd, plane_bsize, 0); - const int max_blocks_wide = max_block_wide(xd, plane_bsize, 0); - const TX_SIZE sub_txs = sub_tx_size_map[tx_size]; - const int bsw = tx_size_wide_unit[sub_txs]; - const int bsh = tx_size_high_unit[sub_txs]; - const int sub_step = bsw * bsh; - const int nblks = - (tx_size_high_unit[tx_size] / bsh) * (tx_size_wide_unit[tx_size] / bsw); - assert(nblks > 0); - int blk_idx = 0; - int64_t tmp_rd = 0; - *split_rd = INT64_MAX; - split_rd_stats->rate = x->txfm_partition_cost[txfm_partition_ctx][1]; - - for (int r = 0; r < tx_size_high_unit[tx_size]; r += bsh) { - for (int c = 0; c < tx_size_wide_unit[tx_size]; c += bsw, ++blk_idx) { - assert(blk_idx < 4); - const int offsetr = blk_row + r; - const int offsetc = blk_col + c; - if (offsetr >= max_blocks_high || offsetc >= max_blocks_wide) continue; - - RD_STATS this_rd_stats; - int this_cost_valid = 1; - select_tx_block( - cpi, x, offsetr, offsetc, block, sub_txs, depth + 1, plane_bsize, ta, - tl, tx_above, tx_left, &this_rd_stats, no_split_rd / nblks, - ref_best_rd - tmp_rd, &this_cost_valid, ftxs_mode, - (rd_info_node != NULL) ? rd_info_node->children[blk_idx] : NULL); - if (!this_cost_valid) return; - av1_merge_rd_stats(split_rd_stats, &this_rd_stats); - tmp_rd = RDCOST(x->rdmult, split_rd_stats->rate, split_rd_stats->dist); - if (no_split_rd < tmp_rd) return; - block += sub_step; - } - } - - *split_rd = tmp_rd; -} - -// Search for the best tx partition/type for a given luma block. -static void select_tx_block(const AV1_COMP *cpi, MACROBLOCK *x, int blk_row, - int blk_col, int block, TX_SIZE tx_size, int depth, - BLOCK_SIZE plane_bsize, ENTROPY_CONTEXT *ta, - ENTROPY_CONTEXT *tl, TXFM_CONTEXT *tx_above, - TXFM_CONTEXT *tx_left, RD_STATS *rd_stats, - int64_t prev_level_rd, int64_t ref_best_rd, - int *is_cost_valid, FAST_TX_SEARCH_MODE ftxs_mode, - TXB_RD_INFO_NODE *rd_info_node) { - assert(tx_size < TX_SIZES_ALL); - av1_init_rd_stats(rd_stats); - if (ref_best_rd < 0) { - *is_cost_valid = 0; - return; - } - - MACROBLOCKD *const xd = &x->e_mbd; - const int max_blocks_high = max_block_high(xd, plane_bsize, 0); - const int max_blocks_wide = max_block_wide(xd, plane_bsize, 0); - if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return; - - const int bw = block_size_wide[plane_bsize] >> tx_size_wide_log2[0]; - MB_MODE_INFO *const mbmi = xd->mi[0]; - const int ctx = txfm_partition_context(tx_above + blk_col, tx_left + blk_row, - mbmi->sb_type, tx_size); - struct macroblock_plane *const p = &x->plane[0]; - - const int try_no_split = - cpi->oxcf.enable_tx64 || txsize_sqr_up_map[tx_size] != TX_64X64; - int try_split = tx_size > TX_4X4 && depth < MAX_VARTX_DEPTH; -#if CONFIG_DIST_8X8 - if (x->using_dist_8x8) - try_split &= tx_size_wide[tx_size] >= 16 && tx_size_high[tx_size] >= 16; -#endif - TxCandidateInfo no_split = { INT64_MAX, 0, TX_TYPES }; - - // TX no split - if (try_no_split) { - try_tx_block_no_split(cpi, x, blk_row, blk_col, block, tx_size, depth, - plane_bsize, ta, tl, ctx, rd_stats, ref_best_rd, - ftxs_mode, rd_info_node, &no_split); - - if (cpi->sf.adaptive_txb_search_level && - (no_split.rd - - (no_split.rd >> (1 + cpi->sf.adaptive_txb_search_level))) > - ref_best_rd) { - *is_cost_valid = 0; - return; - } - - if (cpi->sf.txb_split_cap) { - if (p->eobs[block] == 0) try_split = 0; - } - - if (cpi->sf.adaptive_txb_search_level && - (no_split.rd - - (no_split.rd >> (2 + cpi->sf.adaptive_txb_search_level))) > - prev_level_rd) { - try_split = 0; - } - } - - if (x->e_mbd.bd == 8 && !x->cb_partition_scan && try_split) { - const int threshold = cpi->sf.tx_type_search.ml_tx_split_thresh; - if (threshold >= 0) { - const int split_score = - ml_predict_tx_split(x, plane_bsize, blk_row, blk_col, tx_size); - if (split_score >= 0 && split_score < threshold) try_split = 0; - } - } - - // TX split - int64_t split_rd = INT64_MAX; - RD_STATS split_rd_stats; - av1_init_rd_stats(&split_rd_stats); - if (try_split) { - try_tx_block_split(cpi, x, blk_row, blk_col, block, tx_size, depth, - plane_bsize, ta, tl, tx_above, tx_left, ctx, no_split.rd, - AOMMIN(no_split.rd, ref_best_rd), ftxs_mode, - rd_info_node, &split_rd_stats, &split_rd); - } - - if (no_split.rd < split_rd) { - ENTROPY_CONTEXT *pta = ta + blk_col; - ENTROPY_CONTEXT *ptl = tl + blk_row; - const TX_SIZE tx_size_selected = tx_size; - p->txb_entropy_ctx[block] = no_split.txb_entropy_ctx; - av1_set_txb_context(x, 0, block, tx_size_selected, pta, ptl); - txfm_partition_update(tx_above + blk_col, tx_left + blk_row, tx_size, - tx_size); - for (int idy = 0; idy < tx_size_high_unit[tx_size]; ++idy) { - for (int idx = 0; idx < tx_size_wide_unit[tx_size]; ++idx) { - const int index = - av1_get_txb_size_index(plane_bsize, blk_row + idy, blk_col + idx); - mbmi->inter_tx_size[index] = tx_size_selected; - } - } - mbmi->tx_size = tx_size_selected; - update_txk_array(mbmi->txk_type, plane_bsize, blk_row, blk_col, tx_size, - no_split.tx_type); - set_blk_skip(x, 0, blk_row * bw + blk_col, rd_stats->skip); - } else { - *rd_stats = split_rd_stats; - if (split_rd == INT64_MAX) *is_cost_valid = 0; - } -} - -static int64_t select_tx_size_and_type(const AV1_COMP *cpi, MACROBLOCK *x, - RD_STATS *rd_stats, BLOCK_SIZE bsize, - int64_t ref_best_rd, - TXB_RD_INFO_NODE *rd_info_tree) { - MACROBLOCKD *const xd = &x->e_mbd; - assert(is_inter_block(xd->mi[0])); - - // TODO(debargha): enable this as a speed feature where the - // select_inter_block_yrd() function above will use a simplified search - // such as not using full optimize, but the inter_block_yrd() function - // will use more complex search given that the transform partitions have - // already been decided. - - const int fast_tx_search = cpi->sf.tx_size_search_method > USE_FULL_RD; - int64_t rd_thresh = ref_best_rd; - if (fast_tx_search && rd_thresh < INT64_MAX) { - if (INT64_MAX - rd_thresh > (rd_thresh >> 3)) rd_thresh += (rd_thresh >> 3); - } - assert(rd_thresh > 0); - - const FAST_TX_SEARCH_MODE ftxs_mode = - fast_tx_search ? FTXS_DCT_AND_1D_DCT_ONLY : FTXS_NONE; - const struct macroblockd_plane *const pd = &xd->plane[0]; - const BLOCK_SIZE plane_bsize = - get_plane_block_size(bsize, pd->subsampling_x, pd->subsampling_y); - const int mi_width = mi_size_wide[plane_bsize]; - const int mi_height = mi_size_high[plane_bsize]; - ENTROPY_CONTEXT ctxa[MAX_MIB_SIZE]; - ENTROPY_CONTEXT ctxl[MAX_MIB_SIZE]; - TXFM_CONTEXT tx_above[MAX_MIB_SIZE]; - TXFM_CONTEXT tx_left[MAX_MIB_SIZE]; - av1_get_entropy_contexts(bsize, pd, ctxa, ctxl); - memcpy(tx_above, xd->above_txfm_context, sizeof(TXFM_CONTEXT) * mi_width); - memcpy(tx_left, xd->left_txfm_context, sizeof(TXFM_CONTEXT) * mi_height); - - const int skip_ctx = av1_get_skip_context(xd); - const int s0 = x->skip_cost[skip_ctx][0]; - const int s1 = x->skip_cost[skip_ctx][1]; - const int init_depth = - get_search_init_depth(mi_width, mi_height, 1, &cpi->sf); - const TX_SIZE max_tx_size = max_txsize_rect_lookup[plane_bsize]; - const int bh = tx_size_high_unit[max_tx_size]; - const int bw = tx_size_wide_unit[max_tx_size]; - const int step = bw * bh; - int64_t skip_rd = RDCOST(x->rdmult, s1, 0); - int64_t this_rd = RDCOST(x->rdmult, s0, 0); - int block = 0; - - av1_init_rd_stats(rd_stats); - for (int idy = 0; idy < mi_height; idy += bh) { - for (int idx = 0; idx < mi_width; idx += bw) { - const int64_t best_rd_sofar = - (rd_thresh == INT64_MAX) ? INT64_MAX - : (rd_thresh - (AOMMIN(skip_rd, this_rd))); - int is_cost_valid = 1; - RD_STATS pn_rd_stats; - select_tx_block(cpi, x, idy, idx, block, max_tx_size, init_depth, - plane_bsize, ctxa, ctxl, tx_above, tx_left, &pn_rd_stats, - INT64_MAX, best_rd_sofar, &is_cost_valid, ftxs_mode, - rd_info_tree); - if (!is_cost_valid || pn_rd_stats.rate == INT_MAX) { - av1_invalid_rd_stats(rd_stats); - return INT64_MAX; - } - av1_merge_rd_stats(rd_stats, &pn_rd_stats); - skip_rd = RDCOST(x->rdmult, s1, rd_stats->sse); - this_rd = RDCOST(x->rdmult, rd_stats->rate + s0, rd_stats->dist); - block += step; - if (rd_info_tree != NULL) rd_info_tree += 1; - } - } - - if (skip_rd <= this_rd) { - rd_stats->skip = 1; - } else { - rd_stats->skip = 0; - } - - if (rd_stats->rate == INT_MAX) return INT64_MAX; - - // If fast_tx_search is true, only DCT and 1D DCT were tested in - // select_inter_block_yrd() above. Do a better search for tx type with - // tx sizes already decided. - if (fast_tx_search) { - if (!inter_block_yrd(cpi, x, rd_stats, bsize, ref_best_rd, FTXS_NONE)) - return INT64_MAX; - } - - int64_t rd; - if (rd_stats->skip) { - rd = RDCOST(x->rdmult, s1, rd_stats->sse); - } else { - rd = RDCOST(x->rdmult, rd_stats->rate + s0, rd_stats->dist); - if (!xd->lossless[xd->mi[0]->segment_id]) - rd = AOMMIN(rd, RDCOST(x->rdmult, s1, rd_stats->sse)); - } - - return rd; -} - -// Finds rd cost for a y block, given the transform size partitions -static void tx_block_yrd(const AV1_COMP *cpi, MACROBLOCK *x, int blk_row, - int blk_col, int block, TX_SIZE tx_size, - BLOCK_SIZE plane_bsize, int depth, - ENTROPY_CONTEXT *above_ctx, ENTROPY_CONTEXT *left_ctx, - TXFM_CONTEXT *tx_above, TXFM_CONTEXT *tx_left, - int64_t ref_best_rd, RD_STATS *rd_stats, - FAST_TX_SEARCH_MODE ftxs_mode) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = xd->mi[0]; - const int max_blocks_high = max_block_high(xd, plane_bsize, 0); - const int max_blocks_wide = max_block_wide(xd, plane_bsize, 0); - - assert(tx_size < TX_SIZES_ALL); - - if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return; - - const TX_SIZE plane_tx_size = mbmi->inter_tx_size[av1_get_txb_size_index( - plane_bsize, blk_row, blk_col)]; - - int ctx = txfm_partition_context(tx_above + blk_col, tx_left + blk_row, - mbmi->sb_type, tx_size); - - av1_init_rd_stats(rd_stats); - if (tx_size == plane_tx_size) { - ENTROPY_CONTEXT *ta = above_ctx + blk_col; - ENTROPY_CONTEXT *tl = left_ctx + blk_row; - const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size); - TXB_CTX txb_ctx; - get_txb_ctx(plane_bsize, tx_size, 0, ta, tl, &txb_ctx); - - const int zero_blk_rate = x->coeff_costs[txs_ctx][get_plane_type(0)] - .txb_skip_cost[txb_ctx.txb_skip_ctx][1]; - rd_stats->zero_rate = zero_blk_rate; - rd_stats->ref_rdcost = ref_best_rd; - tx_type_rd(cpi, x, tx_size, blk_row, blk_col, 0, block, plane_bsize, - &txb_ctx, rd_stats, ftxs_mode, ref_best_rd, NULL); - const int mi_width = block_size_wide[plane_bsize] >> tx_size_wide_log2[0]; - if (RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist) >= - RDCOST(x->rdmult, zero_blk_rate, rd_stats->sse) || - rd_stats->skip == 1) { - rd_stats->rate = zero_blk_rate; - rd_stats->dist = rd_stats->sse; - rd_stats->skip = 1; - set_blk_skip(x, 0, blk_row * mi_width + blk_col, 1); - x->plane[0].eobs[block] = 0; - x->plane[0].txb_entropy_ctx[block] = 0; - update_txk_array(mbmi->txk_type, plane_bsize, blk_row, blk_col, tx_size, - DCT_DCT); - } else { - rd_stats->skip = 0; - set_blk_skip(x, 0, blk_row * mi_width + blk_col, 0); - } - if (tx_size > TX_4X4 && depth < MAX_VARTX_DEPTH) - rd_stats->rate += x->txfm_partition_cost[ctx][0]; - av1_set_txb_context(x, 0, block, tx_size, ta, tl); - txfm_partition_update(tx_above + blk_col, tx_left + blk_row, tx_size, - tx_size); - } else { - const TX_SIZE sub_txs = sub_tx_size_map[tx_size]; - const int bsw = tx_size_wide_unit[sub_txs]; - const int bsh = tx_size_high_unit[sub_txs]; - const int step = bsh * bsw; - RD_STATS pn_rd_stats; - int64_t this_rd = 0; - assert(bsw > 0 && bsh > 0); - - for (int row = 0; row < tx_size_high_unit[tx_size]; row += bsh) { - for (int col = 0; col < tx_size_wide_unit[tx_size]; col += bsw) { - const int offsetr = blk_row + row; - const int offsetc = blk_col + col; - - if (offsetr >= max_blocks_high || offsetc >= max_blocks_wide) continue; - - av1_init_rd_stats(&pn_rd_stats); - tx_block_yrd(cpi, x, offsetr, offsetc, block, sub_txs, plane_bsize, - depth + 1, above_ctx, left_ctx, tx_above, tx_left, - ref_best_rd - this_rd, &pn_rd_stats, ftxs_mode); - if (pn_rd_stats.rate == INT_MAX) { - av1_invalid_rd_stats(rd_stats); - return; - } - av1_merge_rd_stats(rd_stats, &pn_rd_stats); - this_rd += RDCOST(x->rdmult, pn_rd_stats.rate, pn_rd_stats.dist); - block += step; - } - } - - if (tx_size > TX_4X4 && depth < MAX_VARTX_DEPTH) - rd_stats->rate += x->txfm_partition_cost[ctx][1]; - } -} - -// Return value 0: early termination triggered, no valid rd cost available; -// 1: rd cost values are valid. -static int inter_block_yrd(const AV1_COMP *cpi, MACROBLOCK *x, - RD_STATS *rd_stats, BLOCK_SIZE bsize, - int64_t ref_best_rd, FAST_TX_SEARCH_MODE ftxs_mode) { - MACROBLOCKD *const xd = &x->e_mbd; - int is_cost_valid = 1; - int64_t this_rd = 0; - - if (ref_best_rd < 0) is_cost_valid = 0; - - av1_init_rd_stats(rd_stats); - - if (is_cost_valid) { - const struct macroblockd_plane *const pd = &xd->plane[0]; - const BLOCK_SIZE plane_bsize = - get_plane_block_size(bsize, pd->subsampling_x, pd->subsampling_y); - const int mi_width = mi_size_wide[plane_bsize]; - const int mi_height = mi_size_high[plane_bsize]; - const TX_SIZE max_tx_size = get_vartx_max_txsize(xd, plane_bsize, 0); - const int bh = tx_size_high_unit[max_tx_size]; - const int bw = tx_size_wide_unit[max_tx_size]; - const int init_depth = - get_search_init_depth(mi_width, mi_height, 1, &cpi->sf); - int idx, idy; - int block = 0; - int step = tx_size_wide_unit[max_tx_size] * tx_size_high_unit[max_tx_size]; - ENTROPY_CONTEXT ctxa[MAX_MIB_SIZE]; - ENTROPY_CONTEXT ctxl[MAX_MIB_SIZE]; - TXFM_CONTEXT tx_above[MAX_MIB_SIZE]; - TXFM_CONTEXT tx_left[MAX_MIB_SIZE]; - RD_STATS pn_rd_stats; - - av1_get_entropy_contexts(bsize, pd, ctxa, ctxl); - memcpy(tx_above, xd->above_txfm_context, sizeof(TXFM_CONTEXT) * mi_width); - memcpy(tx_left, xd->left_txfm_context, sizeof(TXFM_CONTEXT) * mi_height); - - for (idy = 0; idy < mi_height; idy += bh) { - for (idx = 0; idx < mi_width; idx += bw) { - av1_init_rd_stats(&pn_rd_stats); - tx_block_yrd(cpi, x, idy, idx, block, max_tx_size, plane_bsize, - init_depth, ctxa, ctxl, tx_above, tx_left, - ref_best_rd - this_rd, &pn_rd_stats, ftxs_mode); - if (pn_rd_stats.rate == INT_MAX) { - av1_invalid_rd_stats(rd_stats); - return 0; - } - av1_merge_rd_stats(rd_stats, &pn_rd_stats); - this_rd += - AOMMIN(RDCOST(x->rdmult, pn_rd_stats.rate, pn_rd_stats.dist), - RDCOST(x->rdmult, pn_rd_stats.zero_rate, pn_rd_stats.sse)); - block += step; - } - } - } - - const int skip_ctx = av1_get_skip_context(xd); - const int s0 = x->skip_cost[skip_ctx][0]; - const int s1 = x->skip_cost[skip_ctx][1]; - int64_t skip_rd = RDCOST(x->rdmult, s1, rd_stats->sse); - this_rd = RDCOST(x->rdmult, rd_stats->rate + s0, rd_stats->dist); - if (skip_rd < this_rd) { - this_rd = skip_rd; - rd_stats->rate = 0; - rd_stats->dist = rd_stats->sse; - rd_stats->skip = 1; - } - if (this_rd > ref_best_rd) is_cost_valid = 0; - - if (!is_cost_valid) { - // reset cost value - av1_invalid_rd_stats(rd_stats); - } - return is_cost_valid; -} - -static int find_tx_size_rd_info(TXB_RD_RECORD *cur_record, - const uint32_t hash) { - // Linear search through the circular buffer to find matching hash. - for (int i = cur_record->index_start - 1; i >= 0; i--) { - if (cur_record->hash_vals[i] == hash) return i; - } - for (int i = cur_record->num - 1; i >= cur_record->index_start; i--) { - if (cur_record->hash_vals[i] == hash) return i; - } - int index; - // If not found - add new RD info into the buffer and return its index - if (cur_record->num < TX_SIZE_RD_RECORD_BUFFER_LEN) { - index = (cur_record->index_start + cur_record->num) % - TX_SIZE_RD_RECORD_BUFFER_LEN; - cur_record->num++; - } else { - index = cur_record->index_start; - cur_record->index_start = - (cur_record->index_start + 1) % TX_SIZE_RD_RECORD_BUFFER_LEN; - } - - cur_record->hash_vals[index] = hash; - av1_zero(cur_record->tx_rd_info[index]); - return index; -} - -typedef struct { - int leaf; - int8_t children[4]; -} RD_RECORD_IDX_NODE; - -static const RD_RECORD_IDX_NODE rd_record_tree_8x8[] = { - { 1, { 0 } }, -}; - -static const RD_RECORD_IDX_NODE rd_record_tree_8x16[] = { - { 0, { 1, 2, -1, -1 } }, - { 1, { 0, 0, 0, 0 } }, - { 1, { 0, 0, 0, 0 } }, -}; - -static const RD_RECORD_IDX_NODE rd_record_tree_16x8[] = { - { 0, { 1, 2, -1, -1 } }, - { 1, { 0 } }, - { 1, { 0 } }, -}; - -static const RD_RECORD_IDX_NODE rd_record_tree_16x16[] = { - { 0, { 1, 2, 3, 4 } }, { 1, { 0 } }, { 1, { 0 } }, { 1, { 0 } }, { 1, { 0 } }, -}; - -static const RD_RECORD_IDX_NODE rd_record_tree_1_2[] = { - { 0, { 1, 2, -1, -1 } }, - { 0, { 3, 4, 5, 6 } }, - { 0, { 7, 8, 9, 10 } }, -}; - -static const RD_RECORD_IDX_NODE rd_record_tree_2_1[] = { - { 0, { 1, 2, -1, -1 } }, - { 0, { 3, 4, 7, 8 } }, - { 0, { 5, 6, 9, 10 } }, -}; - -static const RD_RECORD_IDX_NODE rd_record_tree_sqr[] = { - { 0, { 1, 2, 3, 4 } }, { 0, { 5, 6, 9, 10 } }, { 0, { 7, 8, 11, 12 } }, - { 0, { 13, 14, 17, 18 } }, { 0, { 15, 16, 19, 20 } }, -}; - -static const RD_RECORD_IDX_NODE rd_record_tree_64x128[] = { - { 0, { 2, 3, 4, 5 } }, { 0, { 6, 7, 8, 9 } }, - { 0, { 10, 11, 14, 15 } }, { 0, { 12, 13, 16, 17 } }, - { 0, { 18, 19, 22, 23 } }, { 0, { 20, 21, 24, 25 } }, - { 0, { 26, 27, 30, 31 } }, { 0, { 28, 29, 32, 33 } }, - { 0, { 34, 35, 38, 39 } }, { 0, { 36, 37, 40, 41 } }, -}; - -static const RD_RECORD_IDX_NODE rd_record_tree_128x64[] = { - { 0, { 2, 3, 6, 7 } }, { 0, { 4, 5, 8, 9 } }, - { 0, { 10, 11, 18, 19 } }, { 0, { 12, 13, 20, 21 } }, - { 0, { 14, 15, 22, 23 } }, { 0, { 16, 17, 24, 25 } }, - { 0, { 26, 27, 34, 35 } }, { 0, { 28, 29, 36, 37 } }, - { 0, { 30, 31, 38, 39 } }, { 0, { 32, 33, 40, 41 } }, -}; - -static const RD_RECORD_IDX_NODE rd_record_tree_128x128[] = { - { 0, { 4, 5, 8, 9 } }, { 0, { 6, 7, 10, 11 } }, - { 0, { 12, 13, 16, 17 } }, { 0, { 14, 15, 18, 19 } }, - { 0, { 20, 21, 28, 29 } }, { 0, { 22, 23, 30, 31 } }, - { 0, { 24, 25, 32, 33 } }, { 0, { 26, 27, 34, 35 } }, - { 0, { 36, 37, 44, 45 } }, { 0, { 38, 39, 46, 47 } }, - { 0, { 40, 41, 48, 49 } }, { 0, { 42, 43, 50, 51 } }, - { 0, { 52, 53, 60, 61 } }, { 0, { 54, 55, 62, 63 } }, - { 0, { 56, 57, 64, 65 } }, { 0, { 58, 59, 66, 67 } }, - { 0, { 68, 69, 76, 77 } }, { 0, { 70, 71, 78, 79 } }, - { 0, { 72, 73, 80, 81 } }, { 0, { 74, 75, 82, 83 } }, -}; - -static const RD_RECORD_IDX_NODE rd_record_tree_1_4[] = { - { 0, { 1, -1, 2, -1 } }, - { 0, { 3, 4, -1, -1 } }, - { 0, { 5, 6, -1, -1 } }, -}; - -static const RD_RECORD_IDX_NODE rd_record_tree_4_1[] = { - { 0, { 1, 2, -1, -1 } }, - { 0, { 3, 4, -1, -1 } }, - { 0, { 5, 6, -1, -1 } }, -}; - -static const RD_RECORD_IDX_NODE *rd_record_tree[BLOCK_SIZES_ALL] = { - NULL, // BLOCK_4X4 - NULL, // BLOCK_4X8 - NULL, // BLOCK_8X4 - rd_record_tree_8x8, // BLOCK_8X8 - rd_record_tree_8x16, // BLOCK_8X16 - rd_record_tree_16x8, // BLOCK_16X8 - rd_record_tree_16x16, // BLOCK_16X16 - rd_record_tree_1_2, // BLOCK_16X32 - rd_record_tree_2_1, // BLOCK_32X16 - rd_record_tree_sqr, // BLOCK_32X32 - rd_record_tree_1_2, // BLOCK_32X64 - rd_record_tree_2_1, // BLOCK_64X32 - rd_record_tree_sqr, // BLOCK_64X64 - rd_record_tree_64x128, // BLOCK_64X128 - rd_record_tree_128x64, // BLOCK_128X64 - rd_record_tree_128x128, // BLOCK_128X128 - NULL, // BLOCK_4X16 - NULL, // BLOCK_16X4 - rd_record_tree_1_4, // BLOCK_8X32 - rd_record_tree_4_1, // BLOCK_32X8 - rd_record_tree_1_4, // BLOCK_16X64 - rd_record_tree_4_1, // BLOCK_64X16 -}; - -static const int rd_record_tree_size[BLOCK_SIZES_ALL] = { - 0, // BLOCK_4X4 - 0, // BLOCK_4X8 - 0, // BLOCK_8X4 - sizeof(rd_record_tree_8x8) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_8X8 - sizeof(rd_record_tree_8x16) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_8X16 - sizeof(rd_record_tree_16x8) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_16X8 - sizeof(rd_record_tree_16x16) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_16X16 - sizeof(rd_record_tree_1_2) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_16X32 - sizeof(rd_record_tree_2_1) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_32X16 - sizeof(rd_record_tree_sqr) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_32X32 - sizeof(rd_record_tree_1_2) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_32X64 - sizeof(rd_record_tree_2_1) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_64X32 - sizeof(rd_record_tree_sqr) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_64X64 - sizeof(rd_record_tree_64x128) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_64X128 - sizeof(rd_record_tree_128x64) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_128X64 - sizeof(rd_record_tree_128x128) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_128X128 - 0, // BLOCK_4X16 - 0, // BLOCK_16X4 - sizeof(rd_record_tree_1_4) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_8X32 - sizeof(rd_record_tree_4_1) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_32X8 - sizeof(rd_record_tree_1_4) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_16X64 - sizeof(rd_record_tree_4_1) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_64X16 -}; - -static INLINE void init_rd_record_tree(TXB_RD_INFO_NODE *tree, - BLOCK_SIZE bsize) { - const RD_RECORD_IDX_NODE *rd_record = rd_record_tree[bsize]; - const int size = rd_record_tree_size[bsize]; - for (int i = 0; i < size; ++i) { - if (rd_record[i].leaf) { - av1_zero(tree[i].children); - } else { - for (int j = 0; j < 4; ++j) { - const int8_t idx = rd_record[i].children[j]; - tree[i].children[j] = idx > 0 ? &tree[idx] : NULL; - } - } - } -} - -// Go through all TX blocks that could be used in TX size search, compute -// residual hash values for them and find matching RD info that stores previous -// RD search results for these TX blocks. The idea is to prevent repeated -// rate/distortion computations that happen because of the combination of -// partition and TX size search. The resulting RD info records are returned in -// the form of a quadtree for easier access in actual TX size search. -static int find_tx_size_rd_records(MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row, - int mi_col, TXB_RD_INFO_NODE *dst_rd_info) { - TXB_RD_RECORD *rd_records_table[4] = { x->txb_rd_record_8X8, - x->txb_rd_record_16X16, - x->txb_rd_record_32X32, - x->txb_rd_record_64X64 }; - const TX_SIZE max_square_tx_size = max_txsize_lookup[bsize]; - const int bw = block_size_wide[bsize]; - const int bh = block_size_high[bsize]; - - // Hashing is performed only for square TX sizes larger than TX_4X4 - if (max_square_tx_size < TX_8X8) return 0; - const int diff_stride = bw; - const struct macroblock_plane *const p = &x->plane[0]; - const int16_t *diff = &p->src_diff[0]; - init_rd_record_tree(dst_rd_info, bsize); - // Coordinates of the top-left corner of current block within the superblock - // measured in pixels: - const int mi_row_in_sb = (mi_row % MAX_MIB_SIZE) << MI_SIZE_LOG2; - const int mi_col_in_sb = (mi_col % MAX_MIB_SIZE) << MI_SIZE_LOG2; - int cur_rd_info_idx = 0; - int cur_tx_depth = 0; - TX_SIZE cur_tx_size = max_txsize_rect_lookup[bsize]; - while (cur_tx_depth <= MAX_VARTX_DEPTH) { - const int cur_tx_bw = tx_size_wide[cur_tx_size]; - const int cur_tx_bh = tx_size_high[cur_tx_size]; - if (cur_tx_bw < 8 || cur_tx_bh < 8) break; - const TX_SIZE next_tx_size = sub_tx_size_map[cur_tx_size]; - const int tx_size_idx = cur_tx_size - TX_8X8; - for (int row = 0; row < bh; row += cur_tx_bh) { - for (int col = 0; col < bw; col += cur_tx_bw) { - if (cur_tx_bw != cur_tx_bh) { - // Use dummy nodes for all rectangular transforms within the - // TX size search tree. - dst_rd_info[cur_rd_info_idx].rd_info_array = NULL; - } else { - // Get spatial location of this TX block within the superblock - // (measured in cur_tx_bsize units). - const int row_in_sb = (mi_row_in_sb + row) / cur_tx_bh; - const int col_in_sb = (mi_col_in_sb + col) / cur_tx_bw; - - int16_t hash_data[MAX_SB_SQUARE]; - int16_t *cur_hash_row = hash_data; - const int16_t *cur_diff_row = diff + row * diff_stride + col; - for (int i = 0; i < cur_tx_bh; i++) { - memcpy(cur_hash_row, cur_diff_row, sizeof(*hash_data) * cur_tx_bw); - cur_hash_row += cur_tx_bw; - cur_diff_row += diff_stride; - } - const int hash = av1_get_crc32c_value(&x->mb_rd_record.crc_calculator, - (uint8_t *)hash_data, - 2 * cur_tx_bw * cur_tx_bh); - // Find corresponding RD info based on the hash value. - const int record_idx = - row_in_sb * (MAX_MIB_SIZE >> (tx_size_idx + 1)) + col_in_sb; - TXB_RD_RECORD *records = &rd_records_table[tx_size_idx][record_idx]; - int idx = find_tx_size_rd_info(records, hash); - dst_rd_info[cur_rd_info_idx].rd_info_array = - &records->tx_rd_info[idx]; - } - ++cur_rd_info_idx; - } - } - cur_tx_size = next_tx_size; - ++cur_tx_depth; - } - return 1; -} - -// Search for best transform size and type for luma inter blocks. -static void pick_tx_size_type_yrd(const AV1_COMP *cpi, MACROBLOCK *x, - RD_STATS *rd_stats, BLOCK_SIZE bsize, - int mi_row, int mi_col, int64_t ref_best_rd) { - const AV1_COMMON *cm = &cpi->common; - MACROBLOCKD *const xd = &x->e_mbd; - assert(is_inter_block(xd->mi[0])); - - av1_invalid_rd_stats(rd_stats); - - if (cpi->sf.model_based_prune_tx_search_level && ref_best_rd != INT64_MAX) { - int model_rate; - int64_t model_dist; - int model_skip; - model_rd_sb_fn[MODELRD_TYPE_TX_SEARCH_PRUNE]( - cpi, bsize, x, xd, 0, 0, mi_row, mi_col, &model_rate, &model_dist, - &model_skip, NULL, NULL, NULL, NULL); - const int64_t model_rd = RDCOST(x->rdmult, model_rate, model_dist); - // If the modeled rd is a lot worse than the best so far, breakout. - // TODO(debargha, urvang): Improve the model and make the check below - // tighter. - assert(cpi->sf.model_based_prune_tx_search_level >= 0 && - cpi->sf.model_based_prune_tx_search_level <= 2); - static const int prune_factor_by8[] = { 3, 5 }; - if (!model_skip && - ((model_rd * - prune_factor_by8[cpi->sf.model_based_prune_tx_search_level - 1]) >> - 3) > ref_best_rd) - return; - } - - uint32_t hash = 0; - int32_t match_index = -1; - MB_RD_RECORD *mb_rd_record = NULL; - const int within_border = - mi_row >= xd->tile.mi_row_start && - (mi_row + mi_size_high[bsize] < xd->tile.mi_row_end) && - mi_col >= xd->tile.mi_col_start && - (mi_col + mi_size_wide[bsize] < xd->tile.mi_col_end); - const int is_mb_rd_hash_enabled = (within_border && cpi->sf.use_mb_rd_hash); - const int n4 = bsize_to_num_blk(bsize); - if (is_mb_rd_hash_enabled) { - hash = get_block_residue_hash(x, bsize); - mb_rd_record = &x->mb_rd_record; - match_index = find_mb_rd_info(mb_rd_record, ref_best_rd, hash); - if (match_index != -1) { - MB_RD_INFO *tx_rd_info = &mb_rd_record->tx_rd_info[match_index]; - fetch_tx_rd_info(n4, tx_rd_info, rd_stats, x); - return; - } - } - - // If we predict that skip is the optimal RD decision - set the respective - // context and terminate early. - int64_t dist; - if (cpi->sf.tx_type_search.use_skip_flag_prediction && - predict_skip_flag(x, bsize, &dist, cm->reduced_tx_set_used)) { - set_skip_flag(x, rd_stats, bsize, dist); - // Save the RD search results into tx_rd_record. - if (is_mb_rd_hash_enabled) - save_tx_rd_info(n4, hash, x, rd_stats, mb_rd_record); - return; - } -#if CONFIG_SPEED_STATS - ++x->tx_search_count; -#endif // CONFIG_SPEED_STATS - - // Precompute residual hashes and find existing or add new RD records to - // store and reuse rate and distortion values to speed up TX size search. - TXB_RD_INFO_NODE matched_rd_info[4 + 16 + 64]; - int found_rd_info = 0; - if (ref_best_rd != INT64_MAX && within_border && cpi->sf.use_inter_txb_hash) { - found_rd_info = - find_tx_size_rd_records(x, bsize, mi_row, mi_col, matched_rd_info); - } - - // Get the tx_size 1 level down - const TX_SIZE min_tx_size = sub_tx_size_map[max_txsize_rect_lookup[bsize]]; - const TxSetType tx_set_type = - av1_get_ext_tx_set_type(min_tx_size, 1, cm->reduced_tx_set_used); - prune_tx(cpi, bsize, x, xd, tx_set_type); - - int found = 0; - RD_STATS this_rd_stats; - av1_init_rd_stats(&this_rd_stats); - const int64_t rd = - select_tx_size_and_type(cpi, x, &this_rd_stats, bsize, ref_best_rd, - found_rd_info ? matched_rd_info : NULL); - - if (rd < INT64_MAX) { - *rd_stats = this_rd_stats; - found = 1; - } - - // Reset the pruning flags. - av1_zero(x->tx_search_prune); - x->tx_split_prune_flag = 0; - - // We should always find at least one candidate unless ref_best_rd is less - // than INT64_MAX (in which case, all the calls to select_tx_size_fix_type - // might have failed to find something better) - assert(IMPLIES(!found, ref_best_rd != INT64_MAX)); - if (!found) return; - - // Save the RD search results into tx_rd_record. - if (is_mb_rd_hash_enabled) { - assert(mb_rd_record != NULL); - save_tx_rd_info(n4, hash, x, rd_stats, mb_rd_record); - } -} - -static void model_rd_for_sb_with_fullrdy( - const AV1_COMP *const cpi, BLOCK_SIZE bsize, MACROBLOCK *x, MACROBLOCKD *xd, - int plane_from, int plane_to, int mi_row, int mi_col, int *out_rate_sum, - int64_t *out_dist_sum, int *skip_txfm_sb, int64_t *skip_sse_sb, - int *plane_rate, int64_t *plane_sse, int64_t *plane_dist) { - const int ref = xd->mi[0]->ref_frame[0]; - - int64_t rate_sum = 0; - int64_t dist_sum = 0; - int64_t total_sse = 0; - - for (int plane = plane_from; plane <= plane_to; ++plane) { - struct macroblock_plane *const p = &x->plane[plane]; - struct macroblockd_plane *const pd = &xd->plane[plane]; - const BLOCK_SIZE plane_bsize = - get_plane_block_size(bsize, pd->subsampling_x, pd->subsampling_y); - const int bw = block_size_wide[plane_bsize]; - const int bh = block_size_high[plane_bsize]; - int64_t sse; - int rate; - int64_t dist; - - if (x->skip_chroma_rd && plane) continue; - - if (is_cur_buf_hbd(xd)) { - sse = aom_highbd_sse(p->src.buf, p->src.stride, pd->dst.buf, - pd->dst.stride, bw, bh); - } else { - sse = aom_sse(p->src.buf, p->src.stride, pd->dst.buf, pd->dst.stride, bw, - bh); - } - sse = ROUND_POWER_OF_TWO(sse, (xd->bd - 8) * 2); - - RD_STATS rd_stats; - if (plane == 0) { - pick_tx_size_type_yrd(cpi, x, &rd_stats, bsize, mi_row, mi_col, - INT64_MAX); - if (rd_stats.invalid_rate) { - rate = 0; - dist = sse << 4; - } else { - rate = rd_stats.rate; - dist = rd_stats.dist; - } - } else { - model_rd_with_curvfit(cpi, x, plane_bsize, plane, sse, bw * bh, &rate, - &dist); - } - - if (plane == 0) x->pred_sse[ref] = (unsigned int)AOMMIN(sse, UINT_MAX); - - total_sse += sse; - rate_sum += rate; - dist_sum += dist; - - if (plane_rate) plane_rate[plane] = rate; - if (plane_sse) plane_sse[plane] = sse; - if (plane_dist) plane_dist[plane] = dist; - } - - if (skip_txfm_sb) *skip_txfm_sb = total_sse == 0; - if (skip_sse_sb) *skip_sse_sb = total_sse << 4; - *out_rate_sum = (int)rate_sum; - *out_dist_sum = dist_sum; -} - -static void rd_pick_palette_intra_sbuv(const AV1_COMP *const cpi, MACROBLOCK *x, - int dc_mode_cost, - uint8_t *best_palette_color_map, - MB_MODE_INFO *const best_mbmi, - int64_t *best_rd, int *rate, - int *rate_tokenonly, int64_t *distortion, - int *skippable) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = xd->mi[0]; - assert(!is_inter_block(mbmi)); - assert( - av1_allow_palette(cpi->common.allow_screen_content_tools, mbmi->sb_type)); - PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info; - const BLOCK_SIZE bsize = mbmi->sb_type; - const SequenceHeader *const seq_params = &cpi->common.seq_params; - int this_rate; - int64_t this_rd; - int colors_u, colors_v, colors; - const int src_stride = x->plane[1].src.stride; - const uint8_t *const src_u = x->plane[1].src.buf; - const uint8_t *const src_v = x->plane[2].src.buf; - uint8_t *const color_map = xd->plane[1].color_index_map; - RD_STATS tokenonly_rd_stats; - int plane_block_width, plane_block_height, rows, cols; - av1_get_block_dimensions(bsize, 1, xd, &plane_block_width, - &plane_block_height, &rows, &cols); - - mbmi->uv_mode = UV_DC_PRED; - - int count_buf[1 << 12]; // Maximum (1 << 12) color levels. - if (seq_params->use_highbitdepth) { - colors_u = av1_count_colors_highbd(src_u, src_stride, rows, cols, - seq_params->bit_depth, count_buf); - colors_v = av1_count_colors_highbd(src_v, src_stride, rows, cols, - seq_params->bit_depth, count_buf); - } else { - colors_u = av1_count_colors(src_u, src_stride, rows, cols, count_buf); - colors_v = av1_count_colors(src_v, src_stride, rows, cols, count_buf); - } - - uint16_t color_cache[2 * PALETTE_MAX_SIZE]; - const int n_cache = av1_get_palette_cache(xd, 1, color_cache); - - colors = colors_u > colors_v ? colors_u : colors_v; - if (colors > 1 && colors <= 64) { - int r, c, n, i, j; - const int max_itr = 50; - int lb_u, ub_u, val_u; - int lb_v, ub_v, val_v; - int *const data = x->palette_buffer->kmeans_data_buf; - int centroids[2 * PALETTE_MAX_SIZE]; - - uint16_t *src_u16 = CONVERT_TO_SHORTPTR(src_u); - uint16_t *src_v16 = CONVERT_TO_SHORTPTR(src_v); - if (seq_params->use_highbitdepth) { - lb_u = src_u16[0]; - ub_u = src_u16[0]; - lb_v = src_v16[0]; - ub_v = src_v16[0]; - } else { - lb_u = src_u[0]; - ub_u = src_u[0]; - lb_v = src_v[0]; - ub_v = src_v[0]; - } - - for (r = 0; r < rows; ++r) { - for (c = 0; c < cols; ++c) { - if (seq_params->use_highbitdepth) { - val_u = src_u16[r * src_stride + c]; - val_v = src_v16[r * src_stride + c]; - data[(r * cols + c) * 2] = val_u; - data[(r * cols + c) * 2 + 1] = val_v; - } else { - val_u = src_u[r * src_stride + c]; - val_v = src_v[r * src_stride + c]; - data[(r * cols + c) * 2] = val_u; - data[(r * cols + c) * 2 + 1] = val_v; - } - if (val_u < lb_u) - lb_u = val_u; - else if (val_u > ub_u) - ub_u = val_u; - if (val_v < lb_v) - lb_v = val_v; - else if (val_v > ub_v) - ub_v = val_v; - } - } - - for (n = colors > PALETTE_MAX_SIZE ? PALETTE_MAX_SIZE : colors; n >= 2; - --n) { - for (i = 0; i < n; ++i) { - centroids[i * 2] = lb_u + (2 * i + 1) * (ub_u - lb_u) / n / 2; - centroids[i * 2 + 1] = lb_v + (2 * i + 1) * (ub_v - lb_v) / n / 2; - } - av1_k_means(data, centroids, color_map, rows * cols, n, 2, max_itr); - optimize_palette_colors(color_cache, n_cache, n, 2, centroids); - // Sort the U channel colors in ascending order. - for (i = 0; i < 2 * (n - 1); i += 2) { - int min_idx = i; - int min_val = centroids[i]; - for (j = i + 2; j < 2 * n; j += 2) - if (centroids[j] < min_val) min_val = centroids[j], min_idx = j; - if (min_idx != i) { - int temp_u = centroids[i], temp_v = centroids[i + 1]; - centroids[i] = centroids[min_idx]; - centroids[i + 1] = centroids[min_idx + 1]; - centroids[min_idx] = temp_u, centroids[min_idx + 1] = temp_v; - } - } - av1_calc_indices(data, centroids, color_map, rows * cols, n, 2); - extend_palette_color_map(color_map, cols, rows, plane_block_width, - plane_block_height); - pmi->palette_size[1] = n; - for (i = 1; i < 3; ++i) { - for (j = 0; j < n; ++j) { - if (seq_params->use_highbitdepth) - pmi->palette_colors[i * PALETTE_MAX_SIZE + j] = clip_pixel_highbd( - (int)centroids[j * 2 + i - 1], seq_params->bit_depth); - else - pmi->palette_colors[i * PALETTE_MAX_SIZE + j] = - clip_pixel((int)centroids[j * 2 + i - 1]); - } - } - - super_block_uvrd(cpi, x, &tokenonly_rd_stats, bsize, *best_rd); - if (tokenonly_rd_stats.rate == INT_MAX) continue; - this_rate = tokenonly_rd_stats.rate + - intra_mode_info_cost_uv(cpi, x, mbmi, bsize, dc_mode_cost); - this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); - if (this_rd < *best_rd) { - *best_rd = this_rd; - *best_mbmi = *mbmi; - memcpy(best_palette_color_map, color_map, - plane_block_width * plane_block_height * - sizeof(best_palette_color_map[0])); - *rate = this_rate; - *distortion = tokenonly_rd_stats.dist; - *rate_tokenonly = tokenonly_rd_stats.rate; - *skippable = tokenonly_rd_stats.skip; - } - } - } - if (best_mbmi->palette_mode_info.palette_size[1] > 0) { - memcpy(color_map, best_palette_color_map, - plane_block_width * plane_block_height * - sizeof(best_palette_color_map[0])); - } -} - -// Run RD calculation with given chroma intra prediction angle., and return -// the RD cost. Update the best mode info. if the RD cost is the best so far. -static int64_t pick_intra_angle_routine_sbuv( - const AV1_COMP *const cpi, MACROBLOCK *x, BLOCK_SIZE bsize, - int rate_overhead, int64_t best_rd_in, int *rate, RD_STATS *rd_stats, - int *best_angle_delta, int64_t *best_rd) { - MB_MODE_INFO *mbmi = x->e_mbd.mi[0]; - assert(!is_inter_block(mbmi)); - int this_rate; - int64_t this_rd; - RD_STATS tokenonly_rd_stats; - - if (!super_block_uvrd(cpi, x, &tokenonly_rd_stats, bsize, best_rd_in)) - return INT64_MAX; - this_rate = tokenonly_rd_stats.rate + - intra_mode_info_cost_uv(cpi, x, mbmi, bsize, rate_overhead); - this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); - if (this_rd < *best_rd) { - *best_rd = this_rd; - *best_angle_delta = mbmi->angle_delta[PLANE_TYPE_UV]; - *rate = this_rate; - rd_stats->rate = tokenonly_rd_stats.rate; - rd_stats->dist = tokenonly_rd_stats.dist; - rd_stats->skip = tokenonly_rd_stats.skip; - } - return this_rd; -} - -// With given chroma directional intra prediction mode, pick the best angle -// delta. Return true if a RD cost that is smaller than the input one is found. -static int rd_pick_intra_angle_sbuv(const AV1_COMP *const cpi, MACROBLOCK *x, - BLOCK_SIZE bsize, int rate_overhead, - int64_t best_rd, int *rate, - RD_STATS *rd_stats) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *mbmi = xd->mi[0]; - assert(!is_inter_block(mbmi)); - int i, angle_delta, best_angle_delta = 0; - int64_t this_rd, best_rd_in, rd_cost[2 * (MAX_ANGLE_DELTA + 2)]; - - rd_stats->rate = INT_MAX; - rd_stats->skip = 0; - rd_stats->dist = INT64_MAX; - for (i = 0; i < 2 * (MAX_ANGLE_DELTA + 2); ++i) rd_cost[i] = INT64_MAX; - - for (angle_delta = 0; angle_delta <= MAX_ANGLE_DELTA; angle_delta += 2) { - for (i = 0; i < 2; ++i) { - best_rd_in = (best_rd == INT64_MAX) - ? INT64_MAX - : (best_rd + (best_rd >> ((angle_delta == 0) ? 3 : 5))); - mbmi->angle_delta[PLANE_TYPE_UV] = (1 - 2 * i) * angle_delta; - this_rd = pick_intra_angle_routine_sbuv(cpi, x, bsize, rate_overhead, - best_rd_in, rate, rd_stats, - &best_angle_delta, &best_rd); - rd_cost[2 * angle_delta + i] = this_rd; - if (angle_delta == 0) { - if (this_rd == INT64_MAX) return 0; - rd_cost[1] = this_rd; - break; - } - } - } - - assert(best_rd != INT64_MAX); - for (angle_delta = 1; angle_delta <= MAX_ANGLE_DELTA; angle_delta += 2) { - int64_t rd_thresh; - for (i = 0; i < 2; ++i) { - int skip_search = 0; - rd_thresh = best_rd + (best_rd >> 5); - if (rd_cost[2 * (angle_delta + 1) + i] > rd_thresh && - rd_cost[2 * (angle_delta - 1) + i] > rd_thresh) - skip_search = 1; - if (!skip_search) { - mbmi->angle_delta[PLANE_TYPE_UV] = (1 - 2 * i) * angle_delta; - pick_intra_angle_routine_sbuv(cpi, x, bsize, rate_overhead, best_rd, - rate, rd_stats, &best_angle_delta, - &best_rd); - } - } - } - - mbmi->angle_delta[PLANE_TYPE_UV] = best_angle_delta; - return rd_stats->rate != INT_MAX; -} - -#define PLANE_SIGN_TO_JOINT_SIGN(plane, a, b) \ - (plane == CFL_PRED_U ? a * CFL_SIGNS + b - 1 : b * CFL_SIGNS + a - 1) -static int cfl_rd_pick_alpha(MACROBLOCK *const x, const AV1_COMP *const cpi, - TX_SIZE tx_size, int64_t best_rd) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = xd->mi[0]; - - const BLOCK_SIZE bsize = mbmi->sb_type; -#if CONFIG_DEBUG - assert(is_cfl_allowed(xd) && cpi->oxcf.enable_cfl_intra); - const int ssx = xd->plane[AOM_PLANE_U].subsampling_x; - const int ssy = xd->plane[AOM_PLANE_U].subsampling_y; - const BLOCK_SIZE plane_bsize = get_plane_block_size(mbmi->sb_type, ssx, ssy); - (void)plane_bsize; - assert(plane_bsize < BLOCK_SIZES_ALL); - if (!xd->lossless[mbmi->segment_id]) { - assert(block_size_wide[plane_bsize] == tx_size_wide[tx_size]); - assert(block_size_high[plane_bsize] == tx_size_high[tx_size]); - } -#endif // CONFIG_DEBUG - - xd->cfl.use_dc_pred_cache = 1; - const int64_t mode_rd = - RDCOST(x->rdmult, - x->intra_uv_mode_cost[CFL_ALLOWED][mbmi->mode][UV_CFL_PRED], 0); - int64_t best_rd_uv[CFL_JOINT_SIGNS][CFL_PRED_PLANES]; - int best_c[CFL_JOINT_SIGNS][CFL_PRED_PLANES]; -#if CONFIG_DEBUG - int best_rate_uv[CFL_JOINT_SIGNS][CFL_PRED_PLANES]; -#endif // CONFIG_DEBUG - - for (int plane = 0; plane < CFL_PRED_PLANES; plane++) { - RD_STATS rd_stats; - av1_init_rd_stats(&rd_stats); - for (int joint_sign = 0; joint_sign < CFL_JOINT_SIGNS; joint_sign++) { - best_rd_uv[joint_sign][plane] = INT64_MAX; - best_c[joint_sign][plane] = 0; - } - // Collect RD stats for an alpha value of zero in this plane. - // Skip i == CFL_SIGN_ZERO as (0, 0) is invalid. - for (int i = CFL_SIGN_NEG; i < CFL_SIGNS; i++) { - const int joint_sign = PLANE_SIGN_TO_JOINT_SIGN(plane, CFL_SIGN_ZERO, i); - if (i == CFL_SIGN_NEG) { - mbmi->cfl_alpha_idx = 0; - mbmi->cfl_alpha_signs = joint_sign; - txfm_rd_in_plane(x, cpi, &rd_stats, best_rd, 0, plane + 1, bsize, - tx_size, cpi->sf.use_fast_coef_costing, FTXS_NONE, 0); - if (rd_stats.rate == INT_MAX) break; - } - const int alpha_rate = x->cfl_cost[joint_sign][plane][0]; - best_rd_uv[joint_sign][plane] = - RDCOST(x->rdmult, rd_stats.rate + alpha_rate, rd_stats.dist); -#if CONFIG_DEBUG - best_rate_uv[joint_sign][plane] = rd_stats.rate; -#endif // CONFIG_DEBUG - } - } - - int best_joint_sign = -1; - - for (int plane = 0; plane < CFL_PRED_PLANES; plane++) { - for (int pn_sign = CFL_SIGN_NEG; pn_sign < CFL_SIGNS; pn_sign++) { - int progress = 0; - for (int c = 0; c < CFL_ALPHABET_SIZE; c++) { - int flag = 0; - RD_STATS rd_stats; - if (c > 2 && progress < c) break; - av1_init_rd_stats(&rd_stats); - for (int i = 0; i < CFL_SIGNS; i++) { - const int joint_sign = PLANE_SIGN_TO_JOINT_SIGN(plane, pn_sign, i); - if (i == 0) { - mbmi->cfl_alpha_idx = (c << CFL_ALPHABET_SIZE_LOG2) + c; - mbmi->cfl_alpha_signs = joint_sign; - txfm_rd_in_plane(x, cpi, &rd_stats, best_rd, 0, plane + 1, bsize, - tx_size, cpi->sf.use_fast_coef_costing, FTXS_NONE, - 0); - if (rd_stats.rate == INT_MAX) break; - } - const int alpha_rate = x->cfl_cost[joint_sign][plane][c]; - int64_t this_rd = - RDCOST(x->rdmult, rd_stats.rate + alpha_rate, rd_stats.dist); - if (this_rd >= best_rd_uv[joint_sign][plane]) continue; - best_rd_uv[joint_sign][plane] = this_rd; - best_c[joint_sign][plane] = c; -#if CONFIG_DEBUG - best_rate_uv[joint_sign][plane] = rd_stats.rate; -#endif // CONFIG_DEBUG - flag = 2; - if (best_rd_uv[joint_sign][!plane] == INT64_MAX) continue; - this_rd += mode_rd + best_rd_uv[joint_sign][!plane]; - if (this_rd >= best_rd) continue; - best_rd = this_rd; - best_joint_sign = joint_sign; - } - progress += flag; - } - } - } - - int best_rate_overhead = INT_MAX; - int ind = 0; - if (best_joint_sign >= 0) { - const int u = best_c[best_joint_sign][CFL_PRED_U]; - const int v = best_c[best_joint_sign][CFL_PRED_V]; - ind = (u << CFL_ALPHABET_SIZE_LOG2) + v; - best_rate_overhead = x->cfl_cost[best_joint_sign][CFL_PRED_U][u] + - x->cfl_cost[best_joint_sign][CFL_PRED_V][v]; -#if CONFIG_DEBUG - xd->cfl.rate = x->intra_uv_mode_cost[CFL_ALLOWED][mbmi->mode][UV_CFL_PRED] + - best_rate_overhead + - best_rate_uv[best_joint_sign][CFL_PRED_U] + - best_rate_uv[best_joint_sign][CFL_PRED_V]; -#endif // CONFIG_DEBUG - } else { - best_joint_sign = 0; - } - - mbmi->cfl_alpha_idx = ind; - mbmi->cfl_alpha_signs = best_joint_sign; - xd->cfl.use_dc_pred_cache = 0; - xd->cfl.dc_pred_is_cached[0] = 0; - xd->cfl.dc_pred_is_cached[1] = 0; - return best_rate_overhead; -} - -static void init_sbuv_mode(MB_MODE_INFO *const mbmi) { - mbmi->uv_mode = UV_DC_PRED; - mbmi->palette_mode_info.palette_size[1] = 0; -} - -static int64_t rd_pick_intra_sbuv_mode(const AV1_COMP *const cpi, MACROBLOCK *x, - int *rate, int *rate_tokenonly, - int64_t *distortion, int *skippable, - BLOCK_SIZE bsize, TX_SIZE max_tx_size) { - MACROBLOCKD *xd = &x->e_mbd; - MB_MODE_INFO *mbmi = xd->mi[0]; - assert(!is_inter_block(mbmi)); - MB_MODE_INFO best_mbmi = *mbmi; - int64_t best_rd = INT64_MAX, this_rd; - - for (int mode_idx = 0; mode_idx < UV_INTRA_MODES; ++mode_idx) { - int this_rate; - RD_STATS tokenonly_rd_stats; - UV_PREDICTION_MODE mode = uv_rd_search_mode_order[mode_idx]; - const int is_directional_mode = av1_is_directional_mode(get_uv_mode(mode)); - if (!(cpi->sf.intra_uv_mode_mask[txsize_sqr_up_map[max_tx_size]] & - (1 << mode))) - continue; - if (!cpi->oxcf.enable_smooth_intra && mode >= UV_SMOOTH_PRED && - mode <= UV_SMOOTH_H_PRED) - continue; - - if (!cpi->oxcf.enable_paeth_intra && mode == UV_PAETH_PRED) continue; - - mbmi->uv_mode = mode; - int cfl_alpha_rate = 0; - if (mode == UV_CFL_PRED) { - if (!is_cfl_allowed(xd) || !cpi->oxcf.enable_cfl_intra) continue; - assert(!is_directional_mode); - const TX_SIZE uv_tx_size = av1_get_tx_size(AOM_PLANE_U, xd); - cfl_alpha_rate = cfl_rd_pick_alpha(x, cpi, uv_tx_size, best_rd); - if (cfl_alpha_rate == INT_MAX) continue; - } - mbmi->angle_delta[PLANE_TYPE_UV] = 0; - if (is_directional_mode && av1_use_angle_delta(mbmi->sb_type) && - cpi->oxcf.enable_angle_delta) { - const int rate_overhead = - x->intra_uv_mode_cost[is_cfl_allowed(xd)][mbmi->mode][mode]; - if (!rd_pick_intra_angle_sbuv(cpi, x, bsize, rate_overhead, best_rd, - &this_rate, &tokenonly_rd_stats)) - continue; - } else { - if (!super_block_uvrd(cpi, x, &tokenonly_rd_stats, bsize, best_rd)) { - continue; - } - } - const int mode_cost = - x->intra_uv_mode_cost[is_cfl_allowed(xd)][mbmi->mode][mode] + - cfl_alpha_rate; - this_rate = tokenonly_rd_stats.rate + - intra_mode_info_cost_uv(cpi, x, mbmi, bsize, mode_cost); - if (mode == UV_CFL_PRED) { - assert(is_cfl_allowed(xd) && cpi->oxcf.enable_cfl_intra); -#if CONFIG_DEBUG - if (!xd->lossless[mbmi->segment_id]) - assert(xd->cfl.rate == tokenonly_rd_stats.rate + mode_cost); -#endif // CONFIG_DEBUG - } - this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); - - if (this_rd < best_rd) { - best_mbmi = *mbmi; - best_rd = this_rd; - *rate = this_rate; - *rate_tokenonly = tokenonly_rd_stats.rate; - *distortion = tokenonly_rd_stats.dist; - *skippable = tokenonly_rd_stats.skip; - } - } - - const int try_palette = - cpi->oxcf.enable_palette && - av1_allow_palette(cpi->common.allow_screen_content_tools, mbmi->sb_type); - if (try_palette) { - uint8_t *best_palette_color_map = x->palette_buffer->best_palette_color_map; - rd_pick_palette_intra_sbuv( - cpi, x, - x->intra_uv_mode_cost[is_cfl_allowed(xd)][mbmi->mode][UV_DC_PRED], - best_palette_color_map, &best_mbmi, &best_rd, rate, rate_tokenonly, - distortion, skippable); - } - - *mbmi = best_mbmi; - // Make sure we actually chose a mode - assert(best_rd < INT64_MAX); - return best_rd; -} - -static void choose_intra_uv_mode(const AV1_COMP *const cpi, MACROBLOCK *const x, - BLOCK_SIZE bsize, TX_SIZE max_tx_size, - int *rate_uv, int *rate_uv_tokenonly, - int64_t *dist_uv, int *skip_uv, - UV_PREDICTION_MODE *mode_uv) { - const AV1_COMMON *const cm = &cpi->common; - MACROBLOCKD *xd = &x->e_mbd; - MB_MODE_INFO *mbmi = xd->mi[0]; - const int mi_row = -xd->mb_to_top_edge >> (3 + MI_SIZE_LOG2); - const int mi_col = -xd->mb_to_left_edge >> (3 + MI_SIZE_LOG2); - // Use an estimated rd for uv_intra based on DC_PRED if the - // appropriate speed flag is set. - init_sbuv_mode(mbmi); - if (x->skip_chroma_rd) { - *rate_uv = 0; - *rate_uv_tokenonly = 0; - *dist_uv = 0; - *skip_uv = 1; - *mode_uv = UV_DC_PRED; - return; - } - xd->cfl.is_chroma_reference = - is_chroma_reference(mi_row, mi_col, bsize, cm->seq_params.subsampling_x, - cm->seq_params.subsampling_y); - bsize = scale_chroma_bsize(bsize, xd->plane[AOM_PLANE_U].subsampling_x, - xd->plane[AOM_PLANE_U].subsampling_y); - // Only store reconstructed luma when there's chroma RDO. When there's no - // chroma RDO, the reconstructed luma will be stored in encode_superblock(). - xd->cfl.store_y = store_cfl_required_rdo(cm, x); - if (xd->cfl.store_y) { - // Restore reconstructed luma values. - av1_encode_intra_block_plane(cpi, x, mbmi->sb_type, AOM_PLANE_Y, - cpi->optimize_seg_arr[mbmi->segment_id], - mi_row, mi_col); - xd->cfl.store_y = 0; - } - rd_pick_intra_sbuv_mode(cpi, x, rate_uv, rate_uv_tokenonly, dist_uv, skip_uv, - bsize, max_tx_size); - *mode_uv = mbmi->uv_mode; -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rdopt.c
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
if (mode == D203_PRED && best_intra_mode != H_PRED && best_intra_mode != D45_PRED) return 1; if (mode == D157_PRED && best_intra_mode != H_PRED && best_intra_mode != D135_PRED) return 1; return 0; } // Model based RD estimation for luma intra blocks.
+ show +
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
static int64_t intra_model_yrd(const AV1_COMP *const cpi, MACROBLOCK *const x, BLOCK_SIZE bsize, int mode_cost, int mi_row, int mi_col) { const AV1_COMMON *cm = &cpi->common; MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; assert(!is_inter_block(mbmi)); RD_STATS this_rd_stats; int row, col; int64_t temp_sse, this_rd; TX_SIZE tx_size = tx_size_from_tx_mode(bsize, cm->tx_mode); const int stepr = tx_size_high_unit[tx_size]; const int stepc = tx_size_wide_unit[tx_size]; const int max_blocks_wide = max_block_wide(xd, bsize, 0); const int max_blocks_high = max_block_high(xd, bsize, 0); mbmi->tx_size = tx_size; // Prediction. for (row = 0; row < max_blocks_high; row += stepr) { for (col = 0; col < max_blocks_wide; col += stepc) { av1_predict_intra_block_facade(cm, xd, 0, col, row, tx_size); } } // RD estimation. model_rd_sb_fn[MODELRD_TYPE_INTRA]( cpi, bsize, x, xd, 0, 0, mi_row, mi_col, &this_rd_stats.rate, &this_rd_stats.dist, &this_rd_stats.skip, &temp_sse, NULL, NULL, NULL); if (av1_is_directional_mode(mbmi->mode) && av1_use_angle_delta(bsize)) { mode_cost += x->angle_delta_cost[mbmi->mode - V_PRED] [MAX_ANGLE_DELTA + mbmi->angle_delta[PLANE_TYPE_Y]]; } if (mbmi->mode == DC_PRED && av1_filter_intra_allowed_bsize(cm, mbmi->sb_type)) { if (mbmi->filter_intra_mode_info.use_filter_intra) { const int mode = mbmi->filter_intra_mode_info.filter_intra_mode; mode_cost += x->filter_intra_cost[mbmi->sb_type][1] + x->filter_intra_mode_cost[mode]; } else { mode_cost += x->filter_intra_cost[mbmi->sb_type][0]; } } this_rd = RDCOST(x->rdmult, this_rd_stats.rate + mode_cost, this_rd_stats.dist); return this_rd; } // Extends 'color_map' array from 'orig_width x orig_height' to 'new_width x // new_height'. Extra rows and columns are filled in by copying last valid // row/column. static void extend_palette_color_map(uint8_t *const color_map, int orig_width, int orig_height, int new_width, int new_height) { int j; assert(new_width >= orig_width); assert(new_height >= orig_height); if (new_width == orig_width && new_height == orig_height) return; for (j = orig_height - 1; j >= 0; --j) { memmove(color_map + j * new_width, color_map + j * orig_width, orig_width); // Copy last column to extra columns. memset(color_map + j * new_width + orig_width, color_map[j * new_width + orig_width - 1], new_width - orig_width); } // Copy last row to extra rows. for (j = orig_height; j < new_height; ++j) { memcpy(color_map + j * new_width, color_map + (orig_height - 1) * new_width, new_width); } } // Bias toward using colors in the cache. // TODO(huisu): Try other schemes to improve compression. static void optimize_palette_colors(uint16_t *color_cache, int n_cache, int n_colors, int stride, int *centroids) { if (n_cache <= 0) return; for (int i = 0; i < n_colors * stride; i += stride) { int min_diff = abs(centroids[i] - (int)color_cache[0]); int idx = 0; for (int j = 1; j < n_cache; ++j) { const int this_diff = abs(centroids[i] - color_cache[j]); if (this_diff < min_diff) { min_diff = this_diff; idx = j; } } if (min_diff <= 1) centroids[i] = color_cache[idx]; } } // Given the base colors as specified in centroids[], calculate the RD cost // of palette mode. static void palette_rd_y(const AV1_COMP *const cpi, MACROBLOCK *x, MB_MODE_INFO *mbmi, BLOCK_SIZE bsize, int mi_row, int mi_col, int dc_mode_cost, const int *data, int *centroids, int n, uint16_t *color_cache, int n_cache, MB_MODE_INFO *best_mbmi, uint8_t *best_palette_color_map, int64_t *best_rd, int64_t *best_model_rd, int *rate, int *rate_tokenonly, int *rate_overhead, int64_t *distortion, int *skippable, PICK_MODE_CONTEXT *ctx, uint8_t *blk_skip) { optimize_palette_colors(color_cache, n_cache, n, 1, centroids); int k = av1_remove_duplicates(centroids, n); if (k < PALETTE_MIN_SIZE) { // Too few unique colors to create a palette. And DC_PRED will work // well for that case anyway. So skip. return; } PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info; if (cpi->common.seq_params.use_highbitdepth) for (int i = 0; i < k; ++i) pmi->palette_colors[i] = clip_pixel_highbd( (int)centroids[i], cpi->common.seq_params.bit_depth); else for (int i = 0; i < k; ++i) pmi->palette_colors[i] = clip_pixel(centroids[i]); pmi->palette_size[0] = k; MACROBLOCKD *const xd = &x->e_mbd; uint8_t *const color_map = xd->plane[0].color_index_map; int block_width, block_height, rows, cols; av1_get_block_dimensions(bsize, 0, xd, &block_width, &block_height, &rows, &cols); av1_calc_indices(data, centroids, color_map, rows * cols, k, 1); extend_palette_color_map(color_map, cols, rows, block_width, block_height); const int palette_mode_cost = intra_mode_info_cost_y(cpi, x, mbmi, bsize, dc_mode_cost); int64_t this_model_rd = intra_model_yrd(cpi, x, bsize, palette_mode_cost, mi_row, mi_col); if (*best_model_rd != INT64_MAX && this_model_rd > *best_model_rd + (*best_model_rd >> 1)) return; if (this_model_rd < *best_model_rd) *best_model_rd = this_model_rd; RD_STATS tokenonly_rd_stats; super_block_yrd(cpi, x, &tokenonly_rd_stats, bsize, *best_rd); if (tokenonly_rd_stats.rate == INT_MAX) return; int this_rate = tokenonly_rd_stats.rate + palette_mode_cost; int64_t this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); if (!xd->lossless[mbmi->segment_id] && block_signals_txsize(mbmi->sb_type)) { tokenonly_rd_stats.rate -= tx_size_cost(&cpi->common, x, bsize, mbmi->tx_size); } if (this_rd < *best_rd) { *best_rd = this_rd; memcpy(best_palette_color_map, color_map, block_width * block_height * sizeof(color_map[0])); *best_mbmi = *mbmi; memcpy(blk_skip, x->blk_skip, sizeof(x->blk_skip[0]) * ctx->num_4x4_blk); *rate_overhead = this_rate - tokenonly_rd_stats.rate; if (rate) *rate = this_rate; if (rate_tokenonly) *rate_tokenonly = tokenonly_rd_stats.rate; if (distortion) *distortion = tokenonly_rd_stats.dist; if (skippable) *skippable = tokenonly_rd_stats.skip; } } static int rd_pick_palette_intra_sby( const AV1_COMP *const cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row, int mi_col, int dc_mode_cost, MB_MODE_INFO *best_mbmi, uint8_t *best_palette_color_map, int64_t *best_rd, int64_t *best_model_rd, int *rate, int *rate_tokenonly, int64_t *distortion, int *skippable, PICK_MODE_CONTEXT *ctx, uint8_t *best_blk_skip) { int rate_overhead = 0; MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; assert(!is_inter_block(mbmi)); assert(av1_allow_palette(cpi->common.allow_screen_content_tools, bsize)); const SequenceHeader *const seq_params = &cpi->common.seq_params; int colors, n; const int src_stride = x->plane[0].src.stride; const uint8_t *const src = x->plane[0].src.buf; uint8_t *const color_map = xd->plane[0].color_index_map; int block_width, block_height, rows, cols; av1_get_block_dimensions(bsize, 0, xd, &block_width, &block_height, &rows, &cols); int count_buf[1 << 12]; // Maximum (1 << 12) color levels. if (seq_params->use_highbitdepth) colors = av1_count_colors_highbd(src, src_stride, rows, cols, seq_params->bit_depth, count_buf); else colors = av1_count_colors(src, src_stride, rows, cols, count_buf); mbmi->filter_intra_mode_info.use_filter_intra = 0; if (colors > 1 && colors <= 64) { int r, c, i; const int max_itr = 50; int *const data = x->palette_buffer->kmeans_data_buf; int centroids[PALETTE_MAX_SIZE]; int lb, ub, val; uint16_t *src16 = CONVERT_TO_SHORTPTR(src); if (seq_params->use_highbitdepth) lb = ub = src16[0]; else lb = ub = src[0]; if (seq_params->use_highbitdepth) { for (r = 0; r < rows; ++r) { for (c = 0; c < cols; ++c) { val = src16[r * src_stride + c]; data[r * cols + c] = val; if (val < lb) lb = val; else if (val > ub) ub = val; } } } else { for (r = 0; r < rows; ++r) { for (c = 0; c < cols; ++c) { val = src[r * src_stride + c]; data[r * cols + c] = val; if (val < lb) lb = val; else if (val > ub) ub = val; } } } mbmi->mode = DC_PRED; mbmi->filter_intra_mode_info.use_filter_intra = 0; uint16_t color_cache[2 * PALETTE_MAX_SIZE]; const int n_cache = av1_get_palette_cache(xd, 0, color_cache); // Find the dominant colors, stored in top_colors[]. int top_colors[PALETTE_MAX_SIZE] = { 0 }; for (i = 0; i < AOMMIN(colors, PALETTE_MAX_SIZE); ++i) { int max_count = 0; for (int j = 0; j < (1 << seq_params->bit_depth); ++j) { if (count_buf[j] > max_count) { max_count = count_buf[j]; top_colors[i] = j; } } assert(max_count > 0); count_buf[top_colors[i]] = 0; } // Try the dominant colors directly. // TODO(huisu@google.com): Try to avoid duplicate computation in cases // where the dominant colors and the k-means results are similar. for (n = AOMMIN(colors, PALETTE_MAX_SIZE); n >= 2; --n) { for (i = 0; i < n; ++i) centroids[i] = top_colors[i]; palette_rd_y(cpi, x, mbmi, bsize, mi_row, mi_col, dc_mode_cost, data, centroids, n, color_cache, n_cache, best_mbmi, best_palette_color_map, best_rd, best_model_rd, rate, rate_tokenonly, &rate_overhead, distortion, skippable, ctx, best_blk_skip); } // K-means clustering. for (n = AOMMIN(colors, PALETTE_MAX_SIZE); n >= 2; --n) { if (colors == PALETTE_MIN_SIZE) { // Special case: These colors automatically become the centroids. assert(colors == n); assert(colors == 2); centroids[0] = lb; centroids[1] = ub; } else { for (i = 0; i < n; ++i) { centroids[i] = lb + (2 * i + 1) * (ub - lb) / n / 2; } av1_k_means(data, centroids, color_map, rows * cols, n, 1, max_itr); } palette_rd_y(cpi, x, mbmi, bsize, mi_row, mi_col, dc_mode_cost, data, centroids, n, color_cache, n_cache, best_mbmi, best_palette_color_map, best_rd, best_model_rd, rate, rate_tokenonly, &rate_overhead, distortion, skippable, ctx, best_blk_skip); } } if (best_mbmi->palette_mode_info.palette_size[0] > 0) { memcpy(color_map, best_palette_color_map, block_width * block_height * sizeof(best_palette_color_map[0])); } *mbmi = *best_mbmi; return rate_overhead; } // Return 1 if an filter intra mode is selected; return 0 otherwise. static int rd_pick_filter_intra_sby(const AV1_COMP *const cpi, MACROBLOCK *x, int mi_row, int mi_col, int *rate, int *rate_tokenonly, int64_t *distortion, int *skippable, BLOCK_SIZE bsize, int mode_cost, int64_t *best_rd, int64_t *best_model_rd, PICK_MODE_CONTEXT *ctx) { MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *mbmi = xd->mi[0]; int filter_intra_selected_flag = 0; FILTER_INTRA_MODE mode; TX_SIZE best_tx_size = TX_8X8; FILTER_INTRA_MODE_INFO filter_intra_mode_info; TX_TYPE best_txk_type[TXK_TYPE_BUF_LEN]; (void)ctx; av1_zero(filter_intra_mode_info); mbmi->filter_intra_mode_info.use_filter_intra = 1; mbmi->mode = DC_PRED; mbmi->palette_mode_info.palette_size[0] = 0; for (mode = 0; mode < FILTER_INTRA_MODES; ++mode) { int64_t this_rd, this_model_rd; RD_STATS tokenonly_rd_stats; mbmi->filter_intra_mode_info.filter_intra_mode = mode; this_model_rd = intra_model_yrd(cpi, x, bsize, mode_cost, mi_row, mi_col); if (*best_model_rd != INT64_MAX && this_model_rd > *best_model_rd + (*best_model_rd >> 1)) continue; if (this_model_rd < *best_model_rd) *best_model_rd = this_model_rd; super_block_yrd(cpi, x, &tokenonly_rd_stats, bsize, *best_rd); if (tokenonly_rd_stats.rate == INT_MAX) continue; const int this_rate = tokenonly_rd_stats.rate + intra_mode_info_cost_y(cpi, x, mbmi, bsize, mode_cost); this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); if (this_rd < *best_rd) { *best_rd = this_rd; best_tx_size = mbmi->tx_size; filter_intra_mode_info = mbmi->filter_intra_mode_info; memcpy(best_txk_type, mbmi->txk_type, sizeof(best_txk_type[0]) * TXK_TYPE_BUF_LEN); memcpy(ctx->blk_skip, x->blk_skip, sizeof(x->blk_skip[0]) * ctx->num_4x4_blk); *rate = this_rate; *rate_tokenonly = tokenonly_rd_stats.rate; *distortion = tokenonly_rd_stats.dist; *skippable = tokenonly_rd_stats.skip; filter_intra_selected_flag = 1; } } if (filter_intra_selected_flag) { mbmi->mode = DC_PRED; mbmi->tx_size = best_tx_size; mbmi->filter_intra_mode_info = filter_intra_mode_info; memcpy(mbmi->txk_type, best_txk_type, sizeof(best_txk_type[0]) * TXK_TYPE_BUF_LEN); return 1; } else { return 0; } } // Run RD calculation with given luma intra prediction angle., and return // the RD cost. Update the best mode info. if the RD cost is the best so far. static int64_t calc_rd_given_intra_angle( const AV1_COMP *const cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row, int mi_col, int mode_cost, int64_t best_rd_in, int8_t angle_delta, int max_angle_delta, int *rate, RD_STATS *rd_stats, int *best_angle_delta, TX_SIZE *best_tx_size, int64_t *best_rd, int64_t *best_model_rd, TX_TYPE *best_txk_type, uint8_t *best_blk_skip) { RD_STATS tokenonly_rd_stats; int64_t this_rd, this_model_rd; MB_MODE_INFO *mbmi = x->e_mbd.mi[0]; const int n4 = bsize_to_num_blk(bsize); assert(!is_inter_block(mbmi)); mbmi->angle_delta[PLANE_TYPE_Y] = angle_delta; this_model_rd = intra_model_yrd(cpi, x, bsize, mode_cost, mi_row, mi_col); if (*best_model_rd != INT64_MAX && this_model_rd > *best_model_rd + (*best_model_rd >> 1)) return INT64_MAX; if (this_model_rd < *best_model_rd) *best_model_rd = this_model_rd; super_block_yrd(cpi, x, &tokenonly_rd_stats, bsize, best_rd_in); if (tokenonly_rd_stats.rate == INT_MAX) return INT64_MAX; int this_rate = mode_cost + tokenonly_rd_stats.rate + x->angle_delta_cost[mbmi->mode - V_PRED][max_angle_delta + angle_delta]; this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); if (this_rd < *best_rd) { memcpy(best_txk_type, mbmi->txk_type, sizeof(*best_txk_type) * TXK_TYPE_BUF_LEN); memcpy(best_blk_skip, x->blk_skip, sizeof(best_blk_skip[0]) * n4); *best_rd = this_rd; *best_angle_delta = mbmi->angle_delta[PLANE_TYPE_Y]; *best_tx_size = mbmi->tx_size; *rate = this_rate; rd_stats->rate = tokenonly_rd_stats.rate; rd_stats->dist = tokenonly_rd_stats.dist; rd_stats->skip = tokenonly_rd_stats.skip; } return this_rd; } // With given luma directional intra prediction mode, pick the best angle delta // Return the RD cost corresponding to the best angle delta. static int64_t rd_pick_intra_angle_sby(const AV1_COMP *const cpi, MACROBLOCK *x, int mi_row, int mi_col, int *rate, RD_STATS *rd_stats, BLOCK_SIZE bsize, int mode_cost, int64_t best_rd, int64_t *best_model_rd) { MB_MODE_INFO *mbmi = x->e_mbd.mi[0]; assert(!is_inter_block(mbmi)); int best_angle_delta = 0; int64_t rd_cost[2 * (MAX_ANGLE_DELTA + 2)]; TX_SIZE best_tx_size = mbmi->tx_size; TX_TYPE best_txk_type[TXK_TYPE_BUF_LEN]; uint8_t best_blk_skip[MAX_MIB_SIZE * MAX_MIB_SIZE]; for (int i = 0; i < 2 * (MAX_ANGLE_DELTA + 2); ++i) rd_cost[i] = INT64_MAX; int first_try = 1; for (int angle_delta = 0; angle_delta <= MAX_ANGLE_DELTA; angle_delta += 2) { for (int i = 0; i < 2; ++i) { const int64_t best_rd_in = (best_rd == INT64_MAX) ? INT64_MAX : (best_rd + (best_rd >> (first_try ? 3 : 5))); const int64_t this_rd = calc_rd_given_intra_angle( cpi, x, bsize, mi_row, mi_col, mode_cost, best_rd_in, (1 - 2 * i) * angle_delta, MAX_ANGLE_DELTA, rate, rd_stats, &best_angle_delta, &best_tx_size, &best_rd, best_model_rd, best_txk_type, best_blk_skip); rd_cost[2 * angle_delta + i] = this_rd; if (first_try && this_rd == INT64_MAX) return best_rd; first_try = 0; if (angle_delta == 0) { rd_cost[1] = this_rd; break; } } } assert(best_rd != INT64_MAX); for (int angle_delta = 1; angle_delta <= MAX_ANGLE_DELTA; angle_delta += 2) { for (int i = 0; i < 2; ++i) { int skip_search = 0; const int64_t rd_thresh = best_rd + (best_rd >> 5); if (rd_cost[2 * (angle_delta + 1) + i] > rd_thresh && rd_cost[2 * (angle_delta - 1) + i] > rd_thresh) skip_search = 1; if (!skip_search) { calc_rd_given_intra_angle(cpi, x, bsize, mi_row, mi_col, mode_cost, best_rd, (1 - 2 * i) * angle_delta, MAX_ANGLE_DELTA, rate, rd_stats, &best_angle_delta, &best_tx_size, &best_rd, best_model_rd, best_txk_type, best_blk_skip); } } } if (rd_stats->rate != INT_MAX) { mbmi->tx_size = best_tx_size; mbmi->angle_delta[PLANE_TYPE_Y] = best_angle_delta; memcpy(mbmi->txk_type, best_txk_type, sizeof(*best_txk_type) * TXK_TYPE_BUF_LEN); memcpy(x->blk_skip, best_blk_skip, sizeof(best_blk_skip[0]) * bsize_to_num_blk(bsize)); } return best_rd; } // Indices are sign, integer, and fractional part of the gradient value static const uint8_t gradient_to_angle_bin[2][7][16] = { { { 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1 }, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, }, { { 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4 }, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3 }, { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, { 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, }, }; /* clang-format off */ static const uint8_t mode_to_angle_bin[INTRA_MODES] = { 0, 2, 6, 0, 4, 3, 5, 7, 1, 0, 0, }; /* clang-format on */ static void get_gradient_hist(const uint8_t *src, int src_stride, int rows, int cols, uint64_t *hist) { src += src_stride; for (int r = 1; r < rows; ++r) { for (int c = 1; c < cols; ++c) { int dx = src[c] - src[c - 1]; int dy = src[c] - src[c - src_stride]; int index; const int temp = dx * dx + dy * dy; if (dy == 0) { index = 2; } else { const int sn = (dx > 0) ^ (dy > 0); dx = abs(dx); dy = abs(dy); const int remd = (dx % dy) * 16 / dy; const int quot = dx / dy; index = gradient_to_angle_bin[sn][AOMMIN(quot, 6)][AOMMIN(remd, 15)]; } hist[index] += temp; } src += src_stride; } } static void get_highbd_gradient_hist(const uint8_t *src8, int src_stride, int rows, int cols, uint64_t *hist) { uint16_t *src = CONVERT_TO_SHORTPTR(src8); src += src_stride; for (int r = 1; r < rows; ++r) { for (int c = 1; c < cols; ++c) { int dx = src[c] - src[c - 1]; int dy = src[c] - src[c - src_stride]; int index; const int temp = dx * dx + dy * dy; if (dy == 0) { index = 2; } else { const int sn = (dx > 0) ^ (dy > 0); dx = abs(dx); dy = abs(dy); const int remd = (dx % dy) * 16 / dy; const int quot = dx / dy; index = gradient_to_angle_bin[sn][AOMMIN(quot, 6)][AOMMIN(remd, 15)]; } hist[index] += temp; } src += src_stride; } } static void angle_estimation(const uint8_t *src, int src_stride, int rows, int cols, BLOCK_SIZE bsize, int is_hbd, uint8_t *directional_mode_skip_mask) { // Check if angle_delta is used if (!av1_use_angle_delta(bsize)) return; uint64_t hist[DIRECTIONAL_MODES] = { 0 }; if (is_hbd) get_highbd_gradient_hist(src, src_stride, rows, cols, hist); else get_gradient_hist(src, src_stride, rows, cols, hist); int i; uint64_t hist_sum = 0; for (i = 0; i < DIRECTIONAL_MODES; ++i) hist_sum += hist[i]; for (i = 0; i < INTRA_MODES; ++i) { if (av1_is_directional_mode(i)) { const uint8_t angle_bin = mode_to_angle_bin[i]; uint64_t score = 2 * hist[angle_bin]; int weight = 2; if (angle_bin > 0) { score += hist[angle_bin - 1]; ++weight; } if (angle_bin < DIRECTIONAL_MODES - 1) { score += hist[angle_bin + 1]; ++weight; } const int thresh = 10; if (score * thresh < hist_sum * weight) directional_mode_skip_mask[i] = 1; } } } // Given selected prediction mode, search for the best tx type and size. static void intra_block_yrd(const AV1_COMP *const cpi, MACROBLOCK *x, BLOCK_SIZE bsize, const int *bmode_costs, int64_t *best_rd, int *rate, int *rate_tokenonly, int64_t *distortion, int *skippable, MB_MODE_INFO *best_mbmi, PICK_MODE_CONTEXT *ctx) { MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; RD_STATS rd_stats; super_block_yrd(cpi, x, &rd_stats, bsize, *best_rd); if (rd_stats.rate == INT_MAX) return; int this_rate_tokenonly = rd_stats.rate; if (!xd->lossless[mbmi->segment_id] && block_signals_txsize(mbmi->sb_type)) { // super_block_yrd above includes the cost of the tx_size in the // tokenonly rate, but for intra blocks, tx_size is always coded // (prediction granularity), so we account for it in the full rate, // not the tokenonly rate. this_rate_tokenonly -= tx_size_cost(&cpi->common, x, bsize, mbmi->tx_size); } const int this_rate = rd_stats.rate + intra_mode_info_cost_y(cpi, x, mbmi, bsize, bmode_costs[mbmi->mode]); const int64_t this_rd = RDCOST(x->rdmult, this_rate, rd_stats.dist); if (this_rd < *best_rd) { *best_mbmi = *mbmi; *best_rd = this_rd; *rate = this_rate; *rate_tokenonly = this_rate_tokenonly; *distortion = rd_stats.dist; *skippable = rd_stats.skip; memcpy(ctx->blk_skip, x->blk_skip, sizeof(x->blk_skip[0]) * ctx->num_4x4_blk); } } // This function is used only for intra_only frames static int64_t rd_pick_intra_sby_mode(const AV1_COMP *const cpi, MACROBLOCK *x, int mi_row, int mi_col, int *rate, int *rate_tokenonly, int64_t *distortion, int *skippable, BLOCK_SIZE bsize, int64_t best_rd, PICK_MODE_CONTEXT *ctx) { MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; assert(!is_inter_block(mbmi)); int64_t best_model_rd = INT64_MAX; const int rows = block_size_high[bsize]; const int cols = block_size_wide[bsize]; int is_directional_mode; uint8_t directional_mode_skip_mask[INTRA_MODES] = { 0 }; int beat_best_rd = 0; const int *bmode_costs; PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info; const int try_palette = cpi->oxcf.enable_palette && av1_allow_palette(cpi->common.allow_screen_content_tools, mbmi->sb_type); uint8_t *best_palette_color_map = try_palette ? x->palette_buffer->best_palette_color_map : NULL; const MB_MODE_INFO *above_mi = xd->above_mbmi; const MB_MODE_INFO *left_mi = xd->left_mbmi; const PREDICTION_MODE A = av1_above_block_mode(above_mi); const PREDICTION_MODE L = av1_left_block_mode(left_mi); const int above_ctx = intra_mode_context[A]; const int left_ctx = intra_mode_context[L]; bmode_costs = x->y_mode_costs[above_ctx][left_ctx]; mbmi->angle_delta[PLANE_TYPE_Y] = 0; if (cpi->sf.intra_angle_estimation) { const int src_stride = x->plane[0].src.stride; const uint8_t *src = x->plane[0].src.buf; angle_estimation(src, src_stride, rows, cols, bsize, is_cur_buf_hbd(xd), directional_mode_skip_mask); } mbmi->filter_intra_mode_info.use_filter_intra = 0; pmi->palette_size[0] = 0; if (cpi->sf.tx_type_search.fast_intra_tx_type_search) x->use_default_intra_tx_type = 1; else x->use_default_intra_tx_type = 0; MB_MODE_INFO best_mbmi = *mbmi; /* Y Search for intra prediction mode */ for (int mode_idx = INTRA_MODE_START; mode_idx < INTRA_MODE_END; ++mode_idx) { RD_STATS this_rd_stats; int this_rate, this_rate_tokenonly, s; int64_t this_distortion, this_rd, this_model_rd; mbmi->mode = intra_rd_search_mode_order[mode_idx]; if ((!cpi->oxcf.enable_smooth_intra || cpi->sf.disable_smooth_intra) && (mbmi->mode == SMOOTH_PRED || mbmi->mode == SMOOTH_H_PRED || mbmi->mode == SMOOTH_V_PRED)) continue; if (!cpi->oxcf.enable_paeth_intra && mbmi->mode == PAETH_PRED) continue; mbmi->angle_delta[PLANE_TYPE_Y] = 0; this_model_rd = intra_model_yrd(cpi, x, bsize, bmode_costs[mbmi->mode], mi_row, mi_col); if (best_model_rd != INT64_MAX && this_model_rd > best_model_rd + (best_model_rd >> 1)) continue; if (this_model_rd < best_model_rd) best_model_rd = this_model_rd; is_directional_mode = av1_is_directional_mode(mbmi->mode); if (is_directional_mode && directional_mode_skip_mask[mbmi->mode]) continue; if (is_directional_mode && av1_use_angle_delta(bsize) && cpi->oxcf.enable_angle_delta) { this_rd_stats.rate = INT_MAX; rd_pick_intra_angle_sby(cpi, x, mi_row, mi_col, &this_rate, &this_rd_stats, bsize, bmode_costs[mbmi->mode], best_rd, &best_model_rd); } else { super_block_yrd(cpi, x, &this_rd_stats, bsize, best_rd); } this_rate_tokenonly = this_rd_stats.rate; this_distortion = this_rd_stats.dist; s = this_rd_stats.skip; if (this_rate_tokenonly == INT_MAX) continue; if (!xd->lossless[mbmi->segment_id] && block_signals_txsize(mbmi->sb_type)) { // super_block_yrd above includes the cost of the tx_size in the // tokenonly rate, but for intra blocks, tx_size is always coded // (prediction granularity), so we account for it in the full rate, // not the tokenonly rate. this_rate_tokenonly -= tx_size_cost(&cpi->common, x, bsize, mbmi->tx_size); } this_rate = this_rd_stats.rate + intra_mode_info_cost_y(cpi, x, mbmi, bsize, bmode_costs[mbmi->mode]); this_rd = RDCOST(x->rdmult, this_rate, this_distortion); if (this_rd < best_rd) { best_mbmi = *mbmi; best_rd = this_rd; beat_best_rd = 1; *rate = this_rate; *rate_tokenonly = this_rate_tokenonly; *distortion = this_distortion; *skippable = s; memcpy(ctx->blk_skip, x->blk_skip, sizeof(x->blk_skip[0]) * ctx->num_4x4_blk); } } if (try_palette) { rd_pick_palette_intra_sby( cpi, x, bsize, mi_row, mi_col, bmode_costs[DC_PRED], &best_mbmi, best_palette_color_map, &best_rd, &best_model_rd, rate, rate_tokenonly, distortion, skippable, ctx, ctx->blk_skip); } if (beat_best_rd && av1_filter_intra_allowed_bsize(&cpi->common, bsize)) { if (rd_pick_filter_intra_sby( cpi, x, mi_row, mi_col, rate, rate_tokenonly, distortion, skippable, bsize, bmode_costs[DC_PRED], &best_rd, &best_model_rd, ctx)) { best_mbmi = *mbmi; } } // If previous searches use only the default tx type, do an extra search for // the best tx type. if (x->use_default_intra_tx_type) { *mbmi = best_mbmi; x->use_default_intra_tx_type = 0; intra_block_yrd(cpi, x, bsize, bmode_costs, &best_rd, rate, rate_tokenonly, distortion, skippable, &best_mbmi, ctx); } *mbmi = best_mbmi; return best_rd; } // Return value 0: early termination triggered, no valid rd cost available; // 1: rd cost values are valid. static int super_block_uvrd(const AV1_COMP *const cpi, MACROBLOCK *x, RD_STATS *rd_stats, BLOCK_SIZE bsize, int64_t ref_best_rd) { MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_U]; const TX_SIZE uv_tx_size = av1_get_tx_size(AOM_PLANE_U, xd); int plane; int is_cost_valid = 1; const int is_inter = is_inter_block(mbmi); int64_t this_rd = 0, skip_rd = 0; av1_init_rd_stats(rd_stats); if (ref_best_rd < 0) is_cost_valid = 0; if (x->skip_chroma_rd) return is_cost_valid; bsize = scale_chroma_bsize(bsize, pd->subsampling_x, pd->subsampling_y); if (is_inter && is_cost_valid) { for (plane = 1; plane < MAX_MB_PLANE; ++plane) av1_subtract_plane(x, bsize, plane); } if (is_cost_valid) { for (plane = 1; plane < MAX_MB_PLANE; ++plane) { RD_STATS pn_rd_stats; int64_t chroma_ref_best_rd = ref_best_rd; // For inter blocks, refined ref_best_rd is used for early exit // For intra blocks, even though current rd crosses ref_best_rd, early // exit is not recommended as current rd is used for gating subsequent // modes as well (say, for angular modes) // TODO(any): Extend the early exit mechanism for intra modes as well if (cpi->sf.perform_best_rd_based_gating_for_chroma && is_inter && chroma_ref_best_rd != INT64_MAX) chroma_ref_best_rd = ref_best_rd - AOMMIN(this_rd, skip_rd); txfm_rd_in_plane(x, cpi, &pn_rd_stats, chroma_ref_best_rd, 0, plane, bsize, uv_tx_size, cpi->sf.use_fast_coef_costing, FTXS_NONE, 0); if (pn_rd_stats.rate == INT_MAX) { is_cost_valid = 0; break; } av1_merge_rd_stats(rd_stats, &pn_rd_stats); this_rd = RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist); skip_rd = RDCOST(x->rdmult, 0, rd_stats->sse); if (AOMMIN(this_rd, skip_rd) > ref_best_rd) { is_cost_valid = 0; break; } } } if (!is_cost_valid) { // reset cost value av1_invalid_rd_stats(rd_stats); } return is_cost_valid; } // Pick transform type for a transform block of tx_size. static void tx_type_rd(const AV1_COMP *cpi, MACROBLOCK *x, TX_SIZE tx_size, int blk_row, int blk_col, int plane, int block, int plane_bsize, TXB_CTX *txb_ctx, RD_STATS *rd_stats, FAST_TX_SEARCH_MODE ftxs_mode, int64_t ref_rdcost, TXB_RD_INFO *rd_info_array) { const struct macroblock_plane *const p = &x->plane[plane]; const uint16_t cur_joint_ctx = (txb_ctx->dc_sign_ctx << 8) + txb_ctx->txb_skip_ctx; const int txk_type_idx = av1_get_txk_type_index(plane_bsize, blk_row, blk_col); // Look up RD and terminate early in case when we've already processed exactly // the same residual with exactly the same entropy context. if (rd_info_array != NULL && rd_info_array->valid && rd_info_array->entropy_context == cur_joint_ctx) { if (plane == 0) x->e_mbd.mi[0]->txk_type[txk_type_idx] = rd_info_array->tx_type; const TX_TYPE ref_tx_type = av1_get_tx_type(get_plane_type(plane), &x->e_mbd, blk_row, blk_col, tx_size, cpi->common.reduced_tx_set_used); if (ref_tx_type == rd_info_array->tx_type) { rd_stats->rate += rd_info_array->rate; rd_stats->dist += rd_info_array->dist; rd_stats->sse += rd_info_array->sse; rd_stats->skip &= rd_info_array->eob == 0; p->eobs[block] = rd_info_array->eob; p->txb_entropy_ctx[block] = rd_info_array->txb_entropy_ctx; return; } } RD_STATS this_rd_stats; search_txk_type(cpi, x, plane, block, blk_row, blk_col, plane_bsize, tx_size, txb_ctx, ftxs_mode, 0, 0, ref_rdcost, &this_rd_stats); av1_merge_rd_stats(rd_stats, &this_rd_stats); // Save RD results for possible reuse in future. if (rd_info_array != NULL) { rd_info_array->valid = 1; rd_info_array->entropy_context = cur_joint_ctx; rd_info_array->rate = this_rd_stats.rate; rd_info_array->dist = this_rd_stats.dist; rd_info_array->sse = this_rd_stats.sse; rd_info_array->eob = p->eobs[block]; rd_info_array->txb_entropy_ctx = p->txb_entropy_ctx[block]; if (plane == 0) { rd_info_array->tx_type = x->e_mbd.mi[0]->txk_type[txk_type_idx]; } } } static void get_mean_and_dev(const int16_t *data, int stride, int bw, int bh, float *mean, float *dev) { int x_sum = 0; uint64_t x2_sum = 0; for (int i = 0; i < bh; ++i) { for (int j = 0; j < bw; ++j) { const int val = data[j]; x_sum += val; x2_sum += val * val; } data += stride; } const int num = bw * bh; const float e_x = (float)x_sum / num; const float e_x2 = (float)((double)x2_sum / num); const float diff = e_x2 - e_x * e_x; *dev = (diff > 0) ? sqrtf(diff) : 0; *mean = e_x; } static void get_mean_and_dev_float(const float *data, int stride, int bw, int bh, float *mean, float *dev) { float x_sum = 0; float x2_sum = 0; for (int i = 0; i < bh; ++i) { for (int j = 0; j < bw; ++j) { const float val = data[j]; x_sum += val; x2_sum += val * val; } data += stride; } const int num = bw * bh; const float e_x = x_sum / num; const float e_x2 = x2_sum / num; const float diff = e_x2 - e_x * e_x; *dev = (diff > 0) ? sqrtf(diff) : 0; *mean = e_x; } // Feature used by the model to predict tx split: the mean and standard // deviation values of the block and sub-blocks. static void get_mean_dev_features(const int16_t *data, int stride, int bw, int bh, int levels, float *feature) { int feature_idx = 0; int width = bw; int height = bh; const int16_t *const data_ptr = &data[0]; for (int lv = 0; lv < levels; ++lv) { if (width < 2 || height < 2) break; float mean_buf[16]; float dev_buf[16]; int blk_idx = 0; for (int row = 0; row < bh; row += height) { for (int col = 0; col < bw; col += width) { float mean, dev; get_mean_and_dev(data_ptr + row * stride + col, stride, width, height, &mean, &dev); feature[feature_idx++] = mean; feature[feature_idx++] = dev; mean_buf[blk_idx] = mean; dev_buf[blk_idx++] = dev; } } if (blk_idx > 1) { float mean, dev; // Deviation of means. get_mean_and_dev_float(mean_buf, 1, 1, blk_idx, &mean, &dev); feature[feature_idx++] = dev; // Mean of deviations. get_mean_and_dev_float(dev_buf, 1, 1, blk_idx, &mean, &dev); feature[feature_idx++] = mean; } // Reduce the block size when proceeding to the next level. if (height == width) { height = height >> 1; width = width >> 1; } else if (height > width) { height = height >> 1; } else { width = width >> 1; } } } static int ml_predict_tx_split(MACROBLOCK *x, BLOCK_SIZE bsize, int blk_row, int blk_col, TX_SIZE tx_size) { const NN_CONFIG *nn_config = av1_tx_split_nnconfig_map[tx_size]; if (!nn_config) return -1; const int diff_stride = block_size_wide[bsize]; const int16_t *diff = x->plane[0].src_diff + 4 * blk_row * diff_stride + 4 * blk_col; const int bw = tx_size_wide[tx_size]; const int bh = tx_size_high[tx_size]; aom_clear_system_state(); float features[64] = { 0.0f }; get_mean_dev_features(diff, diff_stride, bw, bh, 2, features); float score = 0.0f; av1_nn_predict(features, nn_config, &score); aom_clear_system_state(); if (score > 8.0f) return 100; if (score < -8.0f) return 0; score = 1.0f / (1.0f + (float)exp(-score)); return (int)(score * 100); } typedef struct { int64_t rd; int txb_entropy_ctx; TX_TYPE tx_type; } TxCandidateInfo; static void try_tx_block_no_split( const AV1_COMP *cpi, MACROBLOCK *x, int blk_row, int blk_col, int block, TX_SIZE tx_size, int depth, BLOCK_SIZE plane_bsize, const ENTROPY_CONTEXT *ta, const ENTROPY_CONTEXT *tl, int txfm_partition_ctx, RD_STATS *rd_stats, int64_t ref_best_rd, FAST_TX_SEARCH_MODE ftxs_mode, TXB_RD_INFO_NODE *rd_info_node, TxCandidateInfo *no_split) { MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; struct macroblock_plane *const p = &x->plane[0]; const int bw = block_size_wide[plane_bsize] >> tx_size_wide_log2[0]; no_split->rd = INT64_MAX; no_split->txb_entropy_ctx = 0; no_split->tx_type = TX_TYPES; const ENTROPY_CONTEXT *const pta = ta + blk_col; const ENTROPY_CONTEXT *const ptl = tl + blk_row; const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size); TXB_CTX txb_ctx; get_txb_ctx(plane_bsize, tx_size, 0, pta, ptl, &txb_ctx); const int zero_blk_rate = x->coeff_costs[txs_ctx][PLANE_TYPE_Y] .txb_skip_cost[txb_ctx.txb_skip_ctx][1]; rd_stats->ref_rdcost = ref_best_rd; rd_stats->zero_rate = zero_blk_rate; const int index = av1_get_txb_size_index(plane_bsize, blk_row, blk_col); mbmi->inter_tx_size[index] = tx_size; tx_type_rd(cpi, x, tx_size, blk_row, blk_col, 0, block, plane_bsize, &txb_ctx, rd_stats, ftxs_mode, ref_best_rd, rd_info_node != NULL ? rd_info_node->rd_info_array : NULL); assert(rd_stats->rate < INT_MAX); if ((RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist) >= RDCOST(x->rdmult, zero_blk_rate, rd_stats->sse) || rd_stats->skip == 1) && !xd->lossless[mbmi->segment_id]) { #if CONFIG_RD_DEBUG av1_update_txb_coeff_cost(rd_stats, 0, tx_size, blk_row, blk_col, zero_blk_rate - rd_stats->rate); #endif // CONFIG_RD_DEBUG rd_stats->rate = zero_blk_rate; rd_stats->dist = rd_stats->sse; rd_stats->skip = 1; set_blk_skip(x, 0, blk_row * bw + blk_col, 1); p->eobs[block] = 0; update_txk_array(mbmi->txk_type, plane_bsize, blk_row, blk_col, tx_size, DCT_DCT); } else { set_blk_skip(x, 0, blk_row * bw + blk_col, 0); rd_stats->skip = 0; } if (tx_size > TX_4X4 && depth < MAX_VARTX_DEPTH) rd_stats->rate += x->txfm_partition_cost[txfm_partition_ctx][0]; no_split->rd = RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist); no_split->txb_entropy_ctx = p->txb_entropy_ctx[block]; const int txk_type_idx = av1_get_txk_type_index(plane_bsize, blk_row, blk_col); no_split->tx_type = mbmi->txk_type[txk_type_idx]; } static void select_tx_block(const AV1_COMP *cpi, MACROBLOCK *x, int blk_row, int blk_col, int block, TX_SIZE tx_size, int depth, BLOCK_SIZE plane_bsize, ENTROPY_CONTEXT *ta, ENTROPY_CONTEXT *tl, TXFM_CONTEXT *tx_above, TXFM_CONTEXT *tx_left, RD_STATS *rd_stats, int64_t prev_level_rd, int64_t ref_best_rd, int *is_cost_valid, FAST_TX_SEARCH_MODE ftxs_mode, TXB_RD_INFO_NODE *rd_info_node); static void try_tx_block_split( const AV1_COMP *cpi, MACROBLOCK *x, int blk_row, int blk_col, int block, TX_SIZE tx_size, int depth, BLOCK_SIZE plane_bsize, ENTROPY_CONTEXT *ta, ENTROPY_CONTEXT *tl, TXFM_CONTEXT *tx_above, TXFM_CONTEXT *tx_left, int txfm_partition_ctx, int64_t no_split_rd, int64_t ref_best_rd, FAST_TX_SEARCH_MODE ftxs_mode, TXB_RD_INFO_NODE *rd_info_node, RD_STATS *split_rd_stats, int64_t *split_rd) { assert(tx_size < TX_SIZES_ALL); MACROBLOCKD *const xd = &x->e_mbd; const int max_blocks_high = max_block_high(xd, plane_bsize, 0); const int max_blocks_wide = max_block_wide(xd, plane_bsize, 0); const TX_SIZE sub_txs = sub_tx_size_map[tx_size]; const int bsw = tx_size_wide_unit[sub_txs]; const int bsh = tx_size_high_unit[sub_txs]; const int sub_step = bsw * bsh; const int nblks = (tx_size_high_unit[tx_size] / bsh) * (tx_size_wide_unit[tx_size] / bsw); assert(nblks > 0); int blk_idx = 0; int64_t tmp_rd = 0; *split_rd = INT64_MAX; split_rd_stats->rate = x->txfm_partition_cost[txfm_partition_ctx][1]; for (int r = 0; r < tx_size_high_unit[tx_size]; r += bsh) { for (int c = 0; c < tx_size_wide_unit[tx_size]; c += bsw, ++blk_idx) { assert(blk_idx < 4); const int offsetr = blk_row + r; const int offsetc = blk_col + c; if (offsetr >= max_blocks_high || offsetc >= max_blocks_wide) continue; RD_STATS this_rd_stats; int this_cost_valid = 1; select_tx_block( cpi, x, offsetr, offsetc, block, sub_txs, depth + 1, plane_bsize, ta, tl, tx_above, tx_left, &this_rd_stats, no_split_rd / nblks, ref_best_rd - tmp_rd, &this_cost_valid, ftxs_mode, (rd_info_node != NULL) ? rd_info_node->children[blk_idx] : NULL); if (!this_cost_valid) return; av1_merge_rd_stats(split_rd_stats, &this_rd_stats); tmp_rd = RDCOST(x->rdmult, split_rd_stats->rate, split_rd_stats->dist); if (no_split_rd < tmp_rd) return; block += sub_step; } } *split_rd = tmp_rd; } // Search for the best tx partition/type for a given luma block. static void select_tx_block(const AV1_COMP *cpi, MACROBLOCK *x, int blk_row, int blk_col, int block, TX_SIZE tx_size, int depth, BLOCK_SIZE plane_bsize, ENTROPY_CONTEXT *ta, ENTROPY_CONTEXT *tl, TXFM_CONTEXT *tx_above, TXFM_CONTEXT *tx_left, RD_STATS *rd_stats, int64_t prev_level_rd, int64_t ref_best_rd, int *is_cost_valid, FAST_TX_SEARCH_MODE ftxs_mode, TXB_RD_INFO_NODE *rd_info_node) { assert(tx_size < TX_SIZES_ALL); av1_init_rd_stats(rd_stats); if (ref_best_rd < 0) { *is_cost_valid = 0; return; } MACROBLOCKD *const xd = &x->e_mbd; const int max_blocks_high = max_block_high(xd, plane_bsize, 0); const int max_blocks_wide = max_block_wide(xd, plane_bsize, 0); if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return; const int bw = block_size_wide[plane_bsize] >> tx_size_wide_log2[0]; MB_MODE_INFO *const mbmi = xd->mi[0]; const int ctx = txfm_partition_context(tx_above + blk_col, tx_left + blk_row, mbmi->sb_type, tx_size); struct macroblock_plane *const p = &x->plane[0]; const int try_no_split = cpi->oxcf.enable_tx64 || txsize_sqr_up_map[tx_size] != TX_64X64; int try_split = tx_size > TX_4X4 && depth < MAX_VARTX_DEPTH; #if CONFIG_DIST_8X8 if (x->using_dist_8x8) try_split &= tx_size_wide[tx_size] >= 16 && tx_size_high[tx_size] >= 16; #endif TxCandidateInfo no_split = { INT64_MAX, 0, TX_TYPES }; // TX no split if (try_no_split) { try_tx_block_no_split(cpi, x, blk_row, blk_col, block, tx_size, depth, plane_bsize, ta, tl, ctx, rd_stats, ref_best_rd, ftxs_mode, rd_info_node, &no_split); if (cpi->sf.adaptive_txb_search_level && (no_split.rd - (no_split.rd >> (1 + cpi->sf.adaptive_txb_search_level))) > ref_best_rd) { *is_cost_valid = 0; return; } if (cpi->sf.txb_split_cap) { if (p->eobs[block] == 0) try_split = 0; } if (cpi->sf.adaptive_txb_search_level && (no_split.rd - (no_split.rd >> (2 + cpi->sf.adaptive_txb_search_level))) > prev_level_rd) { try_split = 0; } } if (x->e_mbd.bd == 8 && !x->cb_partition_scan && try_split) { const int threshold = cpi->sf.tx_type_search.ml_tx_split_thresh; if (threshold >= 0) { const int split_score = ml_predict_tx_split(x, plane_bsize, blk_row, blk_col, tx_size); if (split_score >= 0 && split_score < threshold) try_split = 0; } } // TX split int64_t split_rd = INT64_MAX; RD_STATS split_rd_stats; av1_init_rd_stats(&split_rd_stats); if (try_split) { try_tx_block_split(cpi, x, blk_row, blk_col, block, tx_size, depth, plane_bsize, ta, tl, tx_above, tx_left, ctx, no_split.rd, AOMMIN(no_split.rd, ref_best_rd), ftxs_mode, rd_info_node, &split_rd_stats, &split_rd); } if (no_split.rd < split_rd) { ENTROPY_CONTEXT *pta = ta + blk_col; ENTROPY_CONTEXT *ptl = tl + blk_row; const TX_SIZE tx_size_selected = tx_size; p->txb_entropy_ctx[block] = no_split.txb_entropy_ctx; av1_set_txb_context(x, 0, block, tx_size_selected, pta, ptl); txfm_partition_update(tx_above + blk_col, tx_left + blk_row, tx_size, tx_size); for (int idy = 0; idy < tx_size_high_unit[tx_size]; ++idy) { for (int idx = 0; idx < tx_size_wide_unit[tx_size]; ++idx) { const int index = av1_get_txb_size_index(plane_bsize, blk_row + idy, blk_col + idx); mbmi->inter_tx_size[index] = tx_size_selected; } } mbmi->tx_size = tx_size_selected; update_txk_array(mbmi->txk_type, plane_bsize, blk_row, blk_col, tx_size, no_split.tx_type); set_blk_skip(x, 0, blk_row * bw + blk_col, rd_stats->skip); } else { *rd_stats = split_rd_stats; if (split_rd == INT64_MAX) *is_cost_valid = 0; } } static int64_t select_tx_size_and_type(const AV1_COMP *cpi, MACROBLOCK *x, RD_STATS *rd_stats, BLOCK_SIZE bsize, int64_t ref_best_rd, TXB_RD_INFO_NODE *rd_info_tree) { MACROBLOCKD *const xd = &x->e_mbd; assert(is_inter_block(xd->mi[0])); // TODO(debargha): enable this as a speed feature where the // select_inter_block_yrd() function above will use a simplified search // such as not using full optimize, but the inter_block_yrd() function // will use more complex search given that the transform partitions have // already been decided. const int fast_tx_search = cpi->sf.tx_size_search_method > USE_FULL_RD; int64_t rd_thresh = ref_best_rd; if (fast_tx_search && rd_thresh < INT64_MAX) { if (INT64_MAX - rd_thresh > (rd_thresh >> 3)) rd_thresh += (rd_thresh >> 3); } assert(rd_thresh > 0); const FAST_TX_SEARCH_MODE ftxs_mode = fast_tx_search ? FTXS_DCT_AND_1D_DCT_ONLY : FTXS_NONE; const struct macroblockd_plane *const pd = &xd->plane[0]; const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd->subsampling_x, pd->subsampling_y); const int mi_width = mi_size_wide[plane_bsize]; const int mi_height = mi_size_high[plane_bsize]; ENTROPY_CONTEXT ctxa[MAX_MIB_SIZE]; ENTROPY_CONTEXT ctxl[MAX_MIB_SIZE]; TXFM_CONTEXT tx_above[MAX_MIB_SIZE]; TXFM_CONTEXT tx_left[MAX_MIB_SIZE]; av1_get_entropy_contexts(bsize, pd, ctxa, ctxl); memcpy(tx_above, xd->above_txfm_context, sizeof(TXFM_CONTEXT) * mi_width); memcpy(tx_left, xd->left_txfm_context, sizeof(TXFM_CONTEXT) * mi_height); const int skip_ctx = av1_get_skip_context(xd); const int s0 = x->skip_cost[skip_ctx][0]; const int s1 = x->skip_cost[skip_ctx][1]; const int init_depth = get_search_init_depth(mi_width, mi_height, 1, &cpi->sf); const TX_SIZE max_tx_size = max_txsize_rect_lookup[plane_bsize]; const int bh = tx_size_high_unit[max_tx_size]; const int bw = tx_size_wide_unit[max_tx_size]; const int step = bw * bh; int64_t skip_rd = RDCOST(x->rdmult, s1, 0); int64_t this_rd = RDCOST(x->rdmult, s0, 0); int block = 0; av1_init_rd_stats(rd_stats); for (int idy = 0; idy < mi_height; idy += bh) { for (int idx = 0; idx < mi_width; idx += bw) { const int64_t best_rd_sofar = (rd_thresh == INT64_MAX) ? INT64_MAX : (rd_thresh - (AOMMIN(skip_rd, this_rd))); int is_cost_valid = 1; RD_STATS pn_rd_stats; select_tx_block(cpi, x, idy, idx, block, max_tx_size, init_depth, plane_bsize, ctxa, ctxl, tx_above, tx_left, &pn_rd_stats, INT64_MAX, best_rd_sofar, &is_cost_valid, ftxs_mode, rd_info_tree); if (!is_cost_valid || pn_rd_stats.rate == INT_MAX) { av1_invalid_rd_stats(rd_stats); return INT64_MAX; } av1_merge_rd_stats(rd_stats, &pn_rd_stats); skip_rd = RDCOST(x->rdmult, s1, rd_stats->sse); this_rd = RDCOST(x->rdmult, rd_stats->rate + s0, rd_stats->dist); block += step; if (rd_info_tree != NULL) rd_info_tree += 1; } } if (skip_rd <= this_rd) { rd_stats->skip = 1; } else { rd_stats->skip = 0; } if (rd_stats->rate == INT_MAX) return INT64_MAX; // If fast_tx_search is true, only DCT and 1D DCT were tested in // select_inter_block_yrd() above. Do a better search for tx type with // tx sizes already decided. if (fast_tx_search) { if (!inter_block_yrd(cpi, x, rd_stats, bsize, ref_best_rd, FTXS_NONE)) return INT64_MAX; } int64_t rd; if (rd_stats->skip) { rd = RDCOST(x->rdmult, s1, rd_stats->sse); } else { rd = RDCOST(x->rdmult, rd_stats->rate + s0, rd_stats->dist); if (!xd->lossless[xd->mi[0]->segment_id]) rd = AOMMIN(rd, RDCOST(x->rdmult, s1, rd_stats->sse)); } return rd; } // Finds rd cost for a y block, given the transform size partitions static void tx_block_yrd(const AV1_COMP *cpi, MACROBLOCK *x, int blk_row, int blk_col, int block, TX_SIZE tx_size, BLOCK_SIZE plane_bsize, int depth, ENTROPY_CONTEXT *above_ctx, ENTROPY_CONTEXT *left_ctx, TXFM_CONTEXT *tx_above, TXFM_CONTEXT *tx_left, int64_t ref_best_rd, RD_STATS *rd_stats, FAST_TX_SEARCH_MODE ftxs_mode) { MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; const int max_blocks_high = max_block_high(xd, plane_bsize, 0); const int max_blocks_wide = max_block_wide(xd, plane_bsize, 0); assert(tx_size < TX_SIZES_ALL); if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return; const TX_SIZE plane_tx_size = mbmi->inter_tx_size[av1_get_txb_size_index( plane_bsize, blk_row, blk_col)]; int ctx = txfm_partition_context(tx_above + blk_col, tx_left + blk_row, mbmi->sb_type, tx_size); av1_init_rd_stats(rd_stats); if (tx_size == plane_tx_size) { ENTROPY_CONTEXT *ta = above_ctx + blk_col; ENTROPY_CONTEXT *tl = left_ctx + blk_row; const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size); TXB_CTX txb_ctx; get_txb_ctx(plane_bsize, tx_size, 0, ta, tl, &txb_ctx); const int zero_blk_rate = x->coeff_costs[txs_ctx][get_plane_type(0)] .txb_skip_cost[txb_ctx.txb_skip_ctx][1]; rd_stats->zero_rate = zero_blk_rate; rd_stats->ref_rdcost = ref_best_rd; tx_type_rd(cpi, x, tx_size, blk_row, blk_col, 0, block, plane_bsize, &txb_ctx, rd_stats, ftxs_mode, ref_best_rd, NULL); const int mi_width = block_size_wide[plane_bsize] >> tx_size_wide_log2[0]; if (RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist) >= RDCOST(x->rdmult, zero_blk_rate, rd_stats->sse) || rd_stats->skip == 1) { rd_stats->rate = zero_blk_rate; rd_stats->dist = rd_stats->sse; rd_stats->skip = 1; set_blk_skip(x, 0, blk_row * mi_width + blk_col, 1); x->plane[0].eobs[block] = 0; x->plane[0].txb_entropy_ctx[block] = 0; update_txk_array(mbmi->txk_type, plane_bsize, blk_row, blk_col, tx_size, DCT_DCT); } else { rd_stats->skip = 0; set_blk_skip(x, 0, blk_row * mi_width + blk_col, 0); } if (tx_size > TX_4X4 && depth < MAX_VARTX_DEPTH) rd_stats->rate += x->txfm_partition_cost[ctx][0]; av1_set_txb_context(x, 0, block, tx_size, ta, tl); txfm_partition_update(tx_above + blk_col, tx_left + blk_row, tx_size, tx_size); } else { const TX_SIZE sub_txs = sub_tx_size_map[tx_size]; const int bsw = tx_size_wide_unit[sub_txs]; const int bsh = tx_size_high_unit[sub_txs]; const int step = bsh * bsw; RD_STATS pn_rd_stats; int64_t this_rd = 0; assert(bsw > 0 && bsh > 0); for (int row = 0; row < tx_size_high_unit[tx_size]; row += bsh) { for (int col = 0; col < tx_size_wide_unit[tx_size]; col += bsw) { const int offsetr = blk_row + row; const int offsetc = blk_col + col; if (offsetr >= max_blocks_high || offsetc >= max_blocks_wide) continue; av1_init_rd_stats(&pn_rd_stats); tx_block_yrd(cpi, x, offsetr, offsetc, block, sub_txs, plane_bsize, depth + 1, above_ctx, left_ctx, tx_above, tx_left, ref_best_rd - this_rd, &pn_rd_stats, ftxs_mode); if (pn_rd_stats.rate == INT_MAX) { av1_invalid_rd_stats(rd_stats); return; } av1_merge_rd_stats(rd_stats, &pn_rd_stats); this_rd += RDCOST(x->rdmult, pn_rd_stats.rate, pn_rd_stats.dist); block += step; } } if (tx_size > TX_4X4 && depth < MAX_VARTX_DEPTH) rd_stats->rate += x->txfm_partition_cost[ctx][1]; } } // Return value 0: early termination triggered, no valid rd cost available; // 1: rd cost values are valid. static int inter_block_yrd(const AV1_COMP *cpi, MACROBLOCK *x, RD_STATS *rd_stats, BLOCK_SIZE bsize, int64_t ref_best_rd, FAST_TX_SEARCH_MODE ftxs_mode) { MACROBLOCKD *const xd = &x->e_mbd; int is_cost_valid = 1; int64_t this_rd = 0; if (ref_best_rd < 0) is_cost_valid = 0; av1_init_rd_stats(rd_stats); if (is_cost_valid) { const struct macroblockd_plane *const pd = &xd->plane[0]; const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd->subsampling_x, pd->subsampling_y); const int mi_width = mi_size_wide[plane_bsize]; const int mi_height = mi_size_high[plane_bsize]; const TX_SIZE max_tx_size = get_vartx_max_txsize(xd, plane_bsize, 0); const int bh = tx_size_high_unit[max_tx_size]; const int bw = tx_size_wide_unit[max_tx_size]; const int init_depth = get_search_init_depth(mi_width, mi_height, 1, &cpi->sf); int idx, idy; int block = 0; int step = tx_size_wide_unit[max_tx_size] * tx_size_high_unit[max_tx_size]; ENTROPY_CONTEXT ctxa[MAX_MIB_SIZE]; ENTROPY_CONTEXT ctxl[MAX_MIB_SIZE]; TXFM_CONTEXT tx_above[MAX_MIB_SIZE]; TXFM_CONTEXT tx_left[MAX_MIB_SIZE]; RD_STATS pn_rd_stats; av1_get_entropy_contexts(bsize, pd, ctxa, ctxl); memcpy(tx_above, xd->above_txfm_context, sizeof(TXFM_CONTEXT) * mi_width); memcpy(tx_left, xd->left_txfm_context, sizeof(TXFM_CONTEXT) * mi_height); for (idy = 0; idy < mi_height; idy += bh) { for (idx = 0; idx < mi_width; idx += bw) { av1_init_rd_stats(&pn_rd_stats); tx_block_yrd(cpi, x, idy, idx, block, max_tx_size, plane_bsize, init_depth, ctxa, ctxl, tx_above, tx_left, ref_best_rd - this_rd, &pn_rd_stats, ftxs_mode); if (pn_rd_stats.rate == INT_MAX) { av1_invalid_rd_stats(rd_stats); return 0; } av1_merge_rd_stats(rd_stats, &pn_rd_stats); this_rd += AOMMIN(RDCOST(x->rdmult, pn_rd_stats.rate, pn_rd_stats.dist), RDCOST(x->rdmult, pn_rd_stats.zero_rate, pn_rd_stats.sse)); block += step; } } } const int skip_ctx = av1_get_skip_context(xd); const int s0 = x->skip_cost[skip_ctx][0]; const int s1 = x->skip_cost[skip_ctx][1]; int64_t skip_rd = RDCOST(x->rdmult, s1, rd_stats->sse); this_rd = RDCOST(x->rdmult, rd_stats->rate + s0, rd_stats->dist); if (skip_rd < this_rd) { this_rd = skip_rd; rd_stats->rate = 0; rd_stats->dist = rd_stats->sse; rd_stats->skip = 1; } if (this_rd > ref_best_rd) is_cost_valid = 0; if (!is_cost_valid) { // reset cost value av1_invalid_rd_stats(rd_stats); } return is_cost_valid; } static int find_tx_size_rd_info(TXB_RD_RECORD *cur_record, const uint32_t hash) { // Linear search through the circular buffer to find matching hash. for (int i = cur_record->index_start - 1; i >= 0; i--) { if (cur_record->hash_vals[i] == hash) return i; } for (int i = cur_record->num - 1; i >= cur_record->index_start; i--) { if (cur_record->hash_vals[i] == hash) return i; } int index; // If not found - add new RD info into the buffer and return its index if (cur_record->num < TX_SIZE_RD_RECORD_BUFFER_LEN) { index = (cur_record->index_start + cur_record->num) % TX_SIZE_RD_RECORD_BUFFER_LEN; cur_record->num++; } else { index = cur_record->index_start; cur_record->index_start = (cur_record->index_start + 1) % TX_SIZE_RD_RECORD_BUFFER_LEN; } cur_record->hash_vals[index] = hash; av1_zero(cur_record->tx_rd_info[index]); return index; } typedef struct { int leaf; int8_t children[4]; } RD_RECORD_IDX_NODE; static const RD_RECORD_IDX_NODE rd_record_tree_8x8[] = { { 1, { 0 } }, }; static const RD_RECORD_IDX_NODE rd_record_tree_8x16[] = { { 0, { 1, 2, -1, -1 } }, { 1, { 0, 0, 0, 0 } }, { 1, { 0, 0, 0, 0 } }, }; static const RD_RECORD_IDX_NODE rd_record_tree_16x8[] = { { 0, { 1, 2, -1, -1 } }, { 1, { 0 } }, { 1, { 0 } }, }; static const RD_RECORD_IDX_NODE rd_record_tree_16x16[] = { { 0, { 1, 2, 3, 4 } }, { 1, { 0 } }, { 1, { 0 } }, { 1, { 0 } }, { 1, { 0 } }, }; static const RD_RECORD_IDX_NODE rd_record_tree_1_2[] = { { 0, { 1, 2, -1, -1 } }, { 0, { 3, 4, 5, 6 } }, { 0, { 7, 8, 9, 10 } }, }; static const RD_RECORD_IDX_NODE rd_record_tree_2_1[] = { { 0, { 1, 2, -1, -1 } }, { 0, { 3, 4, 7, 8 } }, { 0, { 5, 6, 9, 10 } }, }; static const RD_RECORD_IDX_NODE rd_record_tree_sqr[] = { { 0, { 1, 2, 3, 4 } }, { 0, { 5, 6, 9, 10 } }, { 0, { 7, 8, 11, 12 } }, { 0, { 13, 14, 17, 18 } }, { 0, { 15, 16, 19, 20 } }, }; static const RD_RECORD_IDX_NODE rd_record_tree_64x128[] = { { 0, { 2, 3, 4, 5 } }, { 0, { 6, 7, 8, 9 } }, { 0, { 10, 11, 14, 15 } }, { 0, { 12, 13, 16, 17 } }, { 0, { 18, 19, 22, 23 } }, { 0, { 20, 21, 24, 25 } }, { 0, { 26, 27, 30, 31 } }, { 0, { 28, 29, 32, 33 } }, { 0, { 34, 35, 38, 39 } }, { 0, { 36, 37, 40, 41 } }, }; static const RD_RECORD_IDX_NODE rd_record_tree_128x64[] = { { 0, { 2, 3, 6, 7 } }, { 0, { 4, 5, 8, 9 } }, { 0, { 10, 11, 18, 19 } }, { 0, { 12, 13, 20, 21 } }, { 0, { 14, 15, 22, 23 } }, { 0, { 16, 17, 24, 25 } }, { 0, { 26, 27, 34, 35 } }, { 0, { 28, 29, 36, 37 } }, { 0, { 30, 31, 38, 39 } }, { 0, { 32, 33, 40, 41 } }, }; static const RD_RECORD_IDX_NODE rd_record_tree_128x128[] = { { 0, { 4, 5, 8, 9 } }, { 0, { 6, 7, 10, 11 } }, { 0, { 12, 13, 16, 17 } }, { 0, { 14, 15, 18, 19 } }, { 0, { 20, 21, 28, 29 } }, { 0, { 22, 23, 30, 31 } }, { 0, { 24, 25, 32, 33 } }, { 0, { 26, 27, 34, 35 } }, { 0, { 36, 37, 44, 45 } }, { 0, { 38, 39, 46, 47 } }, { 0, { 40, 41, 48, 49 } }, { 0, { 42, 43, 50, 51 } }, { 0, { 52, 53, 60, 61 } }, { 0, { 54, 55, 62, 63 } }, { 0, { 56, 57, 64, 65 } }, { 0, { 58, 59, 66, 67 } }, { 0, { 68, 69, 76, 77 } }, { 0, { 70, 71, 78, 79 } }, { 0, { 72, 73, 80, 81 } }, { 0, { 74, 75, 82, 83 } }, }; static const RD_RECORD_IDX_NODE rd_record_tree_1_4[] = { { 0, { 1, -1, 2, -1 } }, { 0, { 3, 4, -1, -1 } }, { 0, { 5, 6, -1, -1 } }, }; static const RD_RECORD_IDX_NODE rd_record_tree_4_1[] = { { 0, { 1, 2, -1, -1 } }, { 0, { 3, 4, -1, -1 } }, { 0, { 5, 6, -1, -1 } }, }; static const RD_RECORD_IDX_NODE *rd_record_tree[BLOCK_SIZES_ALL] = { NULL, // BLOCK_4X4 NULL, // BLOCK_4X8 NULL, // BLOCK_8X4 rd_record_tree_8x8, // BLOCK_8X8 rd_record_tree_8x16, // BLOCK_8X16 rd_record_tree_16x8, // BLOCK_16X8 rd_record_tree_16x16, // BLOCK_16X16 rd_record_tree_1_2, // BLOCK_16X32 rd_record_tree_2_1, // BLOCK_32X16 rd_record_tree_sqr, // BLOCK_32X32 rd_record_tree_1_2, // BLOCK_32X64 rd_record_tree_2_1, // BLOCK_64X32 rd_record_tree_sqr, // BLOCK_64X64 rd_record_tree_64x128, // BLOCK_64X128 rd_record_tree_128x64, // BLOCK_128X64 rd_record_tree_128x128, // BLOCK_128X128 NULL, // BLOCK_4X16 NULL, // BLOCK_16X4 rd_record_tree_1_4, // BLOCK_8X32 rd_record_tree_4_1, // BLOCK_32X8 rd_record_tree_1_4, // BLOCK_16X64 rd_record_tree_4_1, // BLOCK_64X16 }; static const int rd_record_tree_size[BLOCK_SIZES_ALL] = { 0, // BLOCK_4X4 0, // BLOCK_4X8 0, // BLOCK_8X4 sizeof(rd_record_tree_8x8) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_8X8 sizeof(rd_record_tree_8x16) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_8X16 sizeof(rd_record_tree_16x8) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_16X8 sizeof(rd_record_tree_16x16) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_16X16 sizeof(rd_record_tree_1_2) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_16X32 sizeof(rd_record_tree_2_1) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_32X16 sizeof(rd_record_tree_sqr) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_32X32 sizeof(rd_record_tree_1_2) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_32X64 sizeof(rd_record_tree_2_1) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_64X32 sizeof(rd_record_tree_sqr) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_64X64 sizeof(rd_record_tree_64x128) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_64X128 sizeof(rd_record_tree_128x64) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_128X64 sizeof(rd_record_tree_128x128) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_128X128 0, // BLOCK_4X16 0, // BLOCK_16X4 sizeof(rd_record_tree_1_4) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_8X32 sizeof(rd_record_tree_4_1) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_32X8 sizeof(rd_record_tree_1_4) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_16X64 sizeof(rd_record_tree_4_1) / sizeof(RD_RECORD_IDX_NODE), // BLOCK_64X16 }; static INLINE void init_rd_record_tree(TXB_RD_INFO_NODE *tree, BLOCK_SIZE bsize) { const RD_RECORD_IDX_NODE *rd_record = rd_record_tree[bsize]; const int size = rd_record_tree_size[bsize]; for (int i = 0; i < size; ++i) { if (rd_record[i].leaf) { av1_zero(tree[i].children); } else { for (int j = 0; j < 4; ++j) { const int8_t idx = rd_record[i].children[j]; tree[i].children[j] = idx > 0 ? &tree[idx] : NULL; } } } } // Go through all TX blocks that could be used in TX size search, compute // residual hash values for them and find matching RD info that stores previous // RD search results for these TX blocks. The idea is to prevent repeated // rate/distortion computations that happen because of the combination of // partition and TX size search. The resulting RD info records are returned in // the form of a quadtree for easier access in actual TX size search. static int find_tx_size_rd_records(MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row, int mi_col, TXB_RD_INFO_NODE *dst_rd_info) { TXB_RD_RECORD *rd_records_table[4] = { x->txb_rd_record_8X8, x->txb_rd_record_16X16, x->txb_rd_record_32X32, x->txb_rd_record_64X64 }; const TX_SIZE max_square_tx_size = max_txsize_lookup[bsize]; const int bw = block_size_wide[bsize]; const int bh = block_size_high[bsize]; // Hashing is performed only for square TX sizes larger than TX_4X4 if (max_square_tx_size < TX_8X8) return 0; const int diff_stride = bw; const struct macroblock_plane *const p = &x->plane[0]; const int16_t *diff = &p->src_diff[0]; init_rd_record_tree(dst_rd_info, bsize); // Coordinates of the top-left corner of current block within the superblock // measured in pixels: const int mi_row_in_sb = (mi_row % MAX_MIB_SIZE) << MI_SIZE_LOG2; const int mi_col_in_sb = (mi_col % MAX_MIB_SIZE) << MI_SIZE_LOG2; int cur_rd_info_idx = 0; int cur_tx_depth = 0; TX_SIZE cur_tx_size = max_txsize_rect_lookup[bsize]; while (cur_tx_depth <= MAX_VARTX_DEPTH) { const int cur_tx_bw = tx_size_wide[cur_tx_size]; const int cur_tx_bh = tx_size_high[cur_tx_size]; if (cur_tx_bw < 8 || cur_tx_bh < 8) break; const TX_SIZE next_tx_size = sub_tx_size_map[cur_tx_size]; const int tx_size_idx = cur_tx_size - TX_8X8; for (int row = 0; row < bh; row += cur_tx_bh) { for (int col = 0; col < bw; col += cur_tx_bw) { if (cur_tx_bw != cur_tx_bh) { // Use dummy nodes for all rectangular transforms within the // TX size search tree. dst_rd_info[cur_rd_info_idx].rd_info_array = NULL; } else { // Get spatial location of this TX block within the superblock // (measured in cur_tx_bsize units). const int row_in_sb = (mi_row_in_sb + row) / cur_tx_bh; const int col_in_sb = (mi_col_in_sb + col) / cur_tx_bw; int16_t hash_data[MAX_SB_SQUARE]; int16_t *cur_hash_row = hash_data; const int16_t *cur_diff_row = diff + row * diff_stride + col; for (int i = 0; i < cur_tx_bh; i++) { memcpy(cur_hash_row, cur_diff_row, sizeof(*hash_data) * cur_tx_bw); cur_hash_row += cur_tx_bw; cur_diff_row += diff_stride; } const int hash = av1_get_crc32c_value(&x->mb_rd_record.crc_calculator, (uint8_t *)hash_data, 2 * cur_tx_bw * cur_tx_bh); // Find corresponding RD info based on the hash value. const int record_idx = row_in_sb * (MAX_MIB_SIZE >> (tx_size_idx + 1)) + col_in_sb; TXB_RD_RECORD *records = &rd_records_table[tx_size_idx][record_idx]; int idx = find_tx_size_rd_info(records, hash); dst_rd_info[cur_rd_info_idx].rd_info_array = &records->tx_rd_info[idx]; } ++cur_rd_info_idx; } } cur_tx_size = next_tx_size; ++cur_tx_depth; } return 1; } // Search for best transform size and type for luma inter blocks. static void pick_tx_size_type_yrd(const AV1_COMP *cpi, MACROBLOCK *x, RD_STATS *rd_stats, BLOCK_SIZE bsize, int mi_row, int mi_col, int64_t ref_best_rd) { const AV1_COMMON *cm = &cpi->common; MACROBLOCKD *const xd = &x->e_mbd; assert(is_inter_block(xd->mi[0])); av1_invalid_rd_stats(rd_stats); if (cpi->sf.model_based_prune_tx_search_level && ref_best_rd != INT64_MAX) { int model_rate; int64_t model_dist; int model_skip; model_rd_sb_fn[MODELRD_TYPE_TX_SEARCH_PRUNE]( cpi, bsize, x, xd, 0, 0, mi_row, mi_col, &model_rate, &model_dist, &model_skip, NULL, NULL, NULL, NULL); const int64_t model_rd = RDCOST(x->rdmult, model_rate, model_dist); // If the modeled rd is a lot worse than the best so far, breakout. // TODO(debargha, urvang): Improve the model and make the check below // tighter. assert(cpi->sf.model_based_prune_tx_search_level >= 0 && cpi->sf.model_based_prune_tx_search_level <= 2); static const int prune_factor_by8[] = { 3, 5 }; if (!model_skip && ((model_rd * prune_factor_by8[cpi->sf.model_based_prune_tx_search_level - 1]) >> 3) > ref_best_rd) return; } uint32_t hash = 0; int32_t match_index = -1; MB_RD_RECORD *mb_rd_record = NULL; const int within_border = mi_row >= xd->tile.mi_row_start && (mi_row + mi_size_high[bsize] < xd->tile.mi_row_end) && mi_col >= xd->tile.mi_col_start && (mi_col + mi_size_wide[bsize] < xd->tile.mi_col_end); const int is_mb_rd_hash_enabled = (within_border && cpi->sf.use_mb_rd_hash); const int n4 = bsize_to_num_blk(bsize); if (is_mb_rd_hash_enabled) { hash = get_block_residue_hash(x, bsize); mb_rd_record = &x->mb_rd_record; match_index = find_mb_rd_info(mb_rd_record, ref_best_rd, hash); if (match_index != -1) { MB_RD_INFO *tx_rd_info = &mb_rd_record->tx_rd_info[match_index]; fetch_tx_rd_info(n4, tx_rd_info, rd_stats, x); return; } } // If we predict that skip is the optimal RD decision - set the respective // context and terminate early. int64_t dist; if (cpi->sf.tx_type_search.use_skip_flag_prediction && predict_skip_flag(x, bsize, &dist, cm->reduced_tx_set_used)) { set_skip_flag(x, rd_stats, bsize, dist); // Save the RD search results into tx_rd_record. if (is_mb_rd_hash_enabled) save_tx_rd_info(n4, hash, x, rd_stats, mb_rd_record); return; } #if CONFIG_SPEED_STATS ++x->tx_search_count; #endif // CONFIG_SPEED_STATS // Precompute residual hashes and find existing or add new RD records to // store and reuse rate and distortion values to speed up TX size search. TXB_RD_INFO_NODE matched_rd_info[4 + 16 + 64]; int found_rd_info = 0; if (ref_best_rd != INT64_MAX && within_border && cpi->sf.use_inter_txb_hash) { found_rd_info = find_tx_size_rd_records(x, bsize, mi_row, mi_col, matched_rd_info); } // Get the tx_size 1 level down const TX_SIZE min_tx_size = sub_tx_size_map[max_txsize_rect_lookup[bsize]]; const TxSetType tx_set_type = av1_get_ext_tx_set_type(min_tx_size, 1, cm->reduced_tx_set_used); prune_tx(cpi, bsize, x, xd, tx_set_type); int found = 0; RD_STATS this_rd_stats; av1_init_rd_stats(&this_rd_stats); const int64_t rd = select_tx_size_and_type(cpi, x, &this_rd_stats, bsize, ref_best_rd, found_rd_info ? matched_rd_info : NULL); if (rd < INT64_MAX) { *rd_stats = this_rd_stats; found = 1; } // Reset the pruning flags. av1_zero(x->tx_search_prune); x->tx_split_prune_flag = 0; // We should always find at least one candidate unless ref_best_rd is less // than INT64_MAX (in which case, all the calls to select_tx_size_fix_type // might have failed to find something better) assert(IMPLIES(!found, ref_best_rd != INT64_MAX)); if (!found) return; // Save the RD search results into tx_rd_record. if (is_mb_rd_hash_enabled) { assert(mb_rd_record != NULL); save_tx_rd_info(n4, hash, x, rd_stats, mb_rd_record); } } static void model_rd_for_sb_with_fullrdy( const AV1_COMP *const cpi, BLOCK_SIZE bsize, MACROBLOCK *x, MACROBLOCKD *xd, int plane_from, int plane_to, int mi_row, int mi_col, int *out_rate_sum, int64_t *out_dist_sum, int *skip_txfm_sb, int64_t *skip_sse_sb, int *plane_rate, int64_t *plane_sse, int64_t *plane_dist) { const int ref = xd->mi[0]->ref_frame[0]; int64_t rate_sum = 0; int64_t dist_sum = 0; int64_t total_sse = 0; for (int plane = plane_from; plane <= plane_to; ++plane) { struct macroblock_plane *const p = &x->plane[plane]; struct macroblockd_plane *const pd = &xd->plane[plane]; const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd->subsampling_x, pd->subsampling_y); const int bw = block_size_wide[plane_bsize]; const int bh = block_size_high[plane_bsize]; int64_t sse; int rate; int64_t dist; if (x->skip_chroma_rd && plane) continue; if (is_cur_buf_hbd(xd)) { sse = aom_highbd_sse(p->src.buf, p->src.stride, pd->dst.buf, pd->dst.stride, bw, bh); } else { sse = aom_sse(p->src.buf, p->src.stride, pd->dst.buf, pd->dst.stride, bw, bh); } sse = ROUND_POWER_OF_TWO(sse, (xd->bd - 8) * 2); RD_STATS rd_stats; if (plane == 0) { pick_tx_size_type_yrd(cpi, x, &rd_stats, bsize, mi_row, mi_col, INT64_MAX); if (rd_stats.invalid_rate) { rate = 0; dist = sse << 4; } else { rate = rd_stats.rate; dist = rd_stats.dist; } } else { model_rd_with_curvfit(cpi, x, plane_bsize, plane, sse, bw * bh, &rate, &dist); } if (plane == 0) x->pred_sse[ref] = (unsigned int)AOMMIN(sse, UINT_MAX); total_sse += sse; rate_sum += rate; dist_sum += dist; if (plane_rate) plane_rate[plane] = rate; if (plane_sse) plane_sse[plane] = sse; if (plane_dist) plane_dist[plane] = dist; } if (skip_txfm_sb) *skip_txfm_sb = total_sse == 0; if (skip_sse_sb) *skip_sse_sb = total_sse << 4; *out_rate_sum = (int)rate_sum; *out_dist_sum = dist_sum; } static void rd_pick_palette_intra_sbuv(const AV1_COMP *const cpi, MACROBLOCK *x, int dc_mode_cost, uint8_t *best_palette_color_map, MB_MODE_INFO *const best_mbmi, int64_t *best_rd, int *rate, int *rate_tokenonly, int64_t *distortion, int *skippable) { MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; assert(!is_inter_block(mbmi)); assert( av1_allow_palette(cpi->common.allow_screen_content_tools, mbmi->sb_type)); PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info; const BLOCK_SIZE bsize = mbmi->sb_type; const SequenceHeader *const seq_params = &cpi->common.seq_params; int this_rate; int64_t this_rd; int colors_u, colors_v, colors; const int src_stride = x->plane[1].src.stride; const uint8_t *const src_u = x->plane[1].src.buf; const uint8_t *const src_v = x->plane[2].src.buf; uint8_t *const color_map = xd->plane[1].color_index_map; RD_STATS tokenonly_rd_stats; int plane_block_width, plane_block_height, rows, cols; av1_get_block_dimensions(bsize, 1, xd, &plane_block_width, &plane_block_height, &rows, &cols); mbmi->uv_mode = UV_DC_PRED; int count_buf[1 << 12]; // Maximum (1 << 12) color levels. if (seq_params->use_highbitdepth) { colors_u = av1_count_colors_highbd(src_u, src_stride, rows, cols, seq_params->bit_depth, count_buf); colors_v = av1_count_colors_highbd(src_v, src_stride, rows, cols, seq_params->bit_depth, count_buf); } else { colors_u = av1_count_colors(src_u, src_stride, rows, cols, count_buf); colors_v = av1_count_colors(src_v, src_stride, rows, cols, count_buf); } uint16_t color_cache[2 * PALETTE_MAX_SIZE]; const int n_cache = av1_get_palette_cache(xd, 1, color_cache); colors = colors_u > colors_v ? colors_u : colors_v; if (colors > 1 && colors <= 64) { int r, c, n, i, j; const int max_itr = 50; int lb_u, ub_u, val_u; int lb_v, ub_v, val_v; int *const data = x->palette_buffer->kmeans_data_buf; int centroids[2 * PALETTE_MAX_SIZE]; uint16_t *src_u16 = CONVERT_TO_SHORTPTR(src_u); uint16_t *src_v16 = CONVERT_TO_SHORTPTR(src_v); if (seq_params->use_highbitdepth) { lb_u = src_u16[0]; ub_u = src_u16[0]; lb_v = src_v16[0]; ub_v = src_v16[0]; } else { lb_u = src_u[0]; ub_u = src_u[0]; lb_v = src_v[0]; ub_v = src_v[0]; } for (r = 0; r < rows; ++r) { for (c = 0; c < cols; ++c) { if (seq_params->use_highbitdepth) { val_u = src_u16[r * src_stride + c]; val_v = src_v16[r * src_stride + c]; data[(r * cols + c) * 2] = val_u; data[(r * cols + c) * 2 + 1] = val_v; } else { val_u = src_u[r * src_stride + c]; val_v = src_v[r * src_stride + c]; data[(r * cols + c) * 2] = val_u; data[(r * cols + c) * 2 + 1] = val_v; } if (val_u < lb_u) lb_u = val_u; else if (val_u > ub_u) ub_u = val_u; if (val_v < lb_v) lb_v = val_v; else if (val_v > ub_v) ub_v = val_v; } } for (n = colors > PALETTE_MAX_SIZE ? PALETTE_MAX_SIZE : colors; n >= 2; --n) { for (i = 0; i < n; ++i) { centroids[i * 2] = lb_u + (2 * i + 1) * (ub_u - lb_u) / n / 2; centroids[i * 2 + 1] = lb_v + (2 * i + 1) * (ub_v - lb_v) / n / 2; } av1_k_means(data, centroids, color_map, rows * cols, n, 2, max_itr); optimize_palette_colors(color_cache, n_cache, n, 2, centroids); // Sort the U channel colors in ascending order. for (i = 0; i < 2 * (n - 1); i += 2) { int min_idx = i; int min_val = centroids[i]; for (j = i + 2; j < 2 * n; j += 2) if (centroids[j] < min_val) min_val = centroids[j], min_idx = j; if (min_idx != i) { int temp_u = centroids[i], temp_v = centroids[i + 1]; centroids[i] = centroids[min_idx]; centroids[i + 1] = centroids[min_idx + 1]; centroids[min_idx] = temp_u, centroids[min_idx + 1] = temp_v; } } av1_calc_indices(data, centroids, color_map, rows * cols, n, 2); extend_palette_color_map(color_map, cols, rows, plane_block_width, plane_block_height); pmi->palette_size[1] = n; for (i = 1; i < 3; ++i) { for (j = 0; j < n; ++j) { if (seq_params->use_highbitdepth) pmi->palette_colors[i * PALETTE_MAX_SIZE + j] = clip_pixel_highbd( (int)centroids[j * 2 + i - 1], seq_params->bit_depth); else pmi->palette_colors[i * PALETTE_MAX_SIZE + j] = clip_pixel((int)centroids[j * 2 + i - 1]); } } super_block_uvrd(cpi, x, &tokenonly_rd_stats, bsize, *best_rd); if (tokenonly_rd_stats.rate == INT_MAX) continue; this_rate = tokenonly_rd_stats.rate + intra_mode_info_cost_uv(cpi, x, mbmi, bsize, dc_mode_cost); this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); if (this_rd < *best_rd) { *best_rd = this_rd; *best_mbmi = *mbmi; memcpy(best_palette_color_map, color_map, plane_block_width * plane_block_height * sizeof(best_palette_color_map[0])); *rate = this_rate; *distortion = tokenonly_rd_stats.dist; *rate_tokenonly = tokenonly_rd_stats.rate; *skippable = tokenonly_rd_stats.skip; } } } if (best_mbmi->palette_mode_info.palette_size[1] > 0) { memcpy(color_map, best_palette_color_map, plane_block_width * plane_block_height * sizeof(best_palette_color_map[0])); } } // Run RD calculation with given chroma intra prediction angle., and return // the RD cost. Update the best mode info. if the RD cost is the best so far. static int64_t pick_intra_angle_routine_sbuv( const AV1_COMP *const cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int rate_overhead, int64_t best_rd_in, int *rate, RD_STATS *rd_stats, int *best_angle_delta, int64_t *best_rd) { MB_MODE_INFO *mbmi = x->e_mbd.mi[0]; assert(!is_inter_block(mbmi)); int this_rate; int64_t this_rd; RD_STATS tokenonly_rd_stats; if (!super_block_uvrd(cpi, x, &tokenonly_rd_stats, bsize, best_rd_in)) return INT64_MAX; this_rate = tokenonly_rd_stats.rate + intra_mode_info_cost_uv(cpi, x, mbmi, bsize, rate_overhead); this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); if (this_rd < *best_rd) { *best_rd = this_rd; *best_angle_delta = mbmi->angle_delta[PLANE_TYPE_UV]; *rate = this_rate; rd_stats->rate = tokenonly_rd_stats.rate; rd_stats->dist = tokenonly_rd_stats.dist; rd_stats->skip = tokenonly_rd_stats.skip; } return this_rd; } // With given chroma directional intra prediction mode, pick the best angle // delta. Return true if a RD cost that is smaller than the input one is found. static int rd_pick_intra_angle_sbuv(const AV1_COMP *const cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int rate_overhead, int64_t best_rd, int *rate, RD_STATS *rd_stats) { MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *mbmi = xd->mi[0]; assert(!is_inter_block(mbmi)); int i, angle_delta, best_angle_delta = 0; int64_t this_rd, best_rd_in, rd_cost[2 * (MAX_ANGLE_DELTA + 2)]; rd_stats->rate = INT_MAX; rd_stats->skip = 0; rd_stats->dist = INT64_MAX; for (i = 0; i < 2 * (MAX_ANGLE_DELTA + 2); ++i) rd_cost[i] = INT64_MAX; for (angle_delta = 0; angle_delta <= MAX_ANGLE_DELTA; angle_delta += 2) { for (i = 0; i < 2; ++i) { best_rd_in = (best_rd == INT64_MAX) ? INT64_MAX : (best_rd + (best_rd >> ((angle_delta == 0) ? 3 : 5))); mbmi->angle_delta[PLANE_TYPE_UV] = (1 - 2 * i) * angle_delta; this_rd = pick_intra_angle_routine_sbuv(cpi, x, bsize, rate_overhead, best_rd_in, rate, rd_stats, &best_angle_delta, &best_rd); rd_cost[2 * angle_delta + i] = this_rd; if (angle_delta == 0) { if (this_rd == INT64_MAX) return 0; rd_cost[1] = this_rd; break; } } } assert(best_rd != INT64_MAX); for (angle_delta = 1; angle_delta <= MAX_ANGLE_DELTA; angle_delta += 2) { int64_t rd_thresh; for (i = 0; i < 2; ++i) { int skip_search = 0; rd_thresh = best_rd + (best_rd >> 5); if (rd_cost[2 * (angle_delta + 1) + i] > rd_thresh && rd_cost[2 * (angle_delta - 1) + i] > rd_thresh) skip_search = 1; if (!skip_search) { mbmi->angle_delta[PLANE_TYPE_UV] = (1 - 2 * i) * angle_delta; pick_intra_angle_routine_sbuv(cpi, x, bsize, rate_overhead, best_rd, rate, rd_stats, &best_angle_delta, &best_rd); } } } mbmi->angle_delta[PLANE_TYPE_UV] = best_angle_delta; return rd_stats->rate != INT_MAX; } #define PLANE_SIGN_TO_JOINT_SIGN(plane, a, b) \ (plane == CFL_PRED_U ? a * CFL_SIGNS + b - 1 : b * CFL_SIGNS + a - 1) static int cfl_rd_pick_alpha(MACROBLOCK *const x, const AV1_COMP *const cpi, TX_SIZE tx_size, int64_t best_rd) { MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; const BLOCK_SIZE bsize = mbmi->sb_type; #if CONFIG_DEBUG assert(is_cfl_allowed(xd) && cpi->oxcf.enable_cfl_intra); const int ssx = xd->plane[AOM_PLANE_U].subsampling_x; const int ssy = xd->plane[AOM_PLANE_U].subsampling_y; const BLOCK_SIZE plane_bsize = get_plane_block_size(mbmi->sb_type, ssx, ssy); (void)plane_bsize; assert(plane_bsize < BLOCK_SIZES_ALL); if (!xd->lossless[mbmi->segment_id]) { assert(block_size_wide[plane_bsize] == tx_size_wide[tx_size]); assert(block_size_high[plane_bsize] == tx_size_high[tx_size]); } #endif // CONFIG_DEBUG xd->cfl.use_dc_pred_cache = 1; const int64_t mode_rd = RDCOST(x->rdmult, x->intra_uv_mode_cost[CFL_ALLOWED][mbmi->mode][UV_CFL_PRED], 0); int64_t best_rd_uv[CFL_JOINT_SIGNS][CFL_PRED_PLANES]; int best_c[CFL_JOINT_SIGNS][CFL_PRED_PLANES]; #if CONFIG_DEBUG int best_rate_uv[CFL_JOINT_SIGNS][CFL_PRED_PLANES]; #endif // CONFIG_DEBUG for (int plane = 0; plane < CFL_PRED_PLANES; plane++) { RD_STATS rd_stats; av1_init_rd_stats(&rd_stats); for (int joint_sign = 0; joint_sign < CFL_JOINT_SIGNS; joint_sign++) { best_rd_uv[joint_sign][plane] = INT64_MAX; best_c[joint_sign][plane] = 0; } // Collect RD stats for an alpha value of zero in this plane. // Skip i == CFL_SIGN_ZERO as (0, 0) is invalid. for (int i = CFL_SIGN_NEG; i < CFL_SIGNS; i++) { const int joint_sign = PLANE_SIGN_TO_JOINT_SIGN(plane, CFL_SIGN_ZERO, i); if (i == CFL_SIGN_NEG) { mbmi->cfl_alpha_idx = 0; mbmi->cfl_alpha_signs = joint_sign; txfm_rd_in_plane(x, cpi, &rd_stats, best_rd, 0, plane + 1, bsize, tx_size, cpi->sf.use_fast_coef_costing, FTXS_NONE, 0); if (rd_stats.rate == INT_MAX) break; } const int alpha_rate = x->cfl_cost[joint_sign][plane][0]; best_rd_uv[joint_sign][plane] = RDCOST(x->rdmult, rd_stats.rate + alpha_rate, rd_stats.dist); #if CONFIG_DEBUG best_rate_uv[joint_sign][plane] = rd_stats.rate; #endif // CONFIG_DEBUG } } int best_joint_sign = -1; for (int plane = 0; plane < CFL_PRED_PLANES; plane++) { for (int pn_sign = CFL_SIGN_NEG; pn_sign < CFL_SIGNS; pn_sign++) { int progress = 0; for (int c = 0; c < CFL_ALPHABET_SIZE; c++) { int flag = 0; RD_STATS rd_stats; if (c > 2 && progress < c) break; av1_init_rd_stats(&rd_stats); for (int i = 0; i < CFL_SIGNS; i++) { const int joint_sign = PLANE_SIGN_TO_JOINT_SIGN(plane, pn_sign, i); if (i == 0) { mbmi->cfl_alpha_idx = (c << CFL_ALPHABET_SIZE_LOG2) + c; mbmi->cfl_alpha_signs = joint_sign; txfm_rd_in_plane(x, cpi, &rd_stats, best_rd, 0, plane + 1, bsize, tx_size, cpi->sf.use_fast_coef_costing, FTXS_NONE, 0); if (rd_stats.rate == INT_MAX) break; } const int alpha_rate = x->cfl_cost[joint_sign][plane][c]; int64_t this_rd = RDCOST(x->rdmult, rd_stats.rate + alpha_rate, rd_stats.dist); if (this_rd >= best_rd_uv[joint_sign][plane]) continue; best_rd_uv[joint_sign][plane] = this_rd; best_c[joint_sign][plane] = c; #if CONFIG_DEBUG best_rate_uv[joint_sign][plane] = rd_stats.rate; #endif // CONFIG_DEBUG flag = 2; if (best_rd_uv[joint_sign][!plane] == INT64_MAX) continue; this_rd += mode_rd + best_rd_uv[joint_sign][!plane]; if (this_rd >= best_rd) continue; best_rd = this_rd; best_joint_sign = joint_sign; } progress += flag; } } } int best_rate_overhead = INT_MAX; int ind = 0; if (best_joint_sign >= 0) { const int u = best_c[best_joint_sign][CFL_PRED_U]; const int v = best_c[best_joint_sign][CFL_PRED_V]; ind = (u << CFL_ALPHABET_SIZE_LOG2) + v; best_rate_overhead = x->cfl_cost[best_joint_sign][CFL_PRED_U][u] + x->cfl_cost[best_joint_sign][CFL_PRED_V][v]; #if CONFIG_DEBUG xd->cfl.rate = x->intra_uv_mode_cost[CFL_ALLOWED][mbmi->mode][UV_CFL_PRED] + best_rate_overhead + best_rate_uv[best_joint_sign][CFL_PRED_U] + best_rate_uv[best_joint_sign][CFL_PRED_V]; #endif // CONFIG_DEBUG } else { best_joint_sign = 0; } mbmi->cfl_alpha_idx = ind; mbmi->cfl_alpha_signs = best_joint_sign; xd->cfl.use_dc_pred_cache = 0; xd->cfl.dc_pred_is_cached[0] = 0; xd->cfl.dc_pred_is_cached[1] = 0; return best_rate_overhead; } static void init_sbuv_mode(MB_MODE_INFO *const mbmi) { mbmi->uv_mode = UV_DC_PRED; mbmi->palette_mode_info.palette_size[1] = 0; } static int64_t rd_pick_intra_sbuv_mode(const AV1_COMP *const cpi, MACROBLOCK *x, int *rate, int *rate_tokenonly, int64_t *distortion, int *skippable, BLOCK_SIZE bsize, TX_SIZE max_tx_size) { MACROBLOCKD *xd = &x->e_mbd; MB_MODE_INFO *mbmi = xd->mi[0]; assert(!is_inter_block(mbmi)); MB_MODE_INFO best_mbmi = *mbmi; int64_t best_rd = INT64_MAX, this_rd; for (int mode_idx = 0; mode_idx < UV_INTRA_MODES; ++mode_idx) { int this_rate; RD_STATS tokenonly_rd_stats; UV_PREDICTION_MODE mode = uv_rd_search_mode_order[mode_idx]; const int is_directional_mode = av1_is_directional_mode(get_uv_mode(mode)); if (!(cpi->sf.intra_uv_mode_mask[txsize_sqr_up_map[max_tx_size]] & (1 << mode))) continue; if (!cpi->oxcf.enable_smooth_intra && mode >= UV_SMOOTH_PRED && mode <= UV_SMOOTH_H_PRED) continue; if (!cpi->oxcf.enable_paeth_intra && mode == UV_PAETH_PRED) continue; mbmi->uv_mode = mode; int cfl_alpha_rate = 0; if (mode == UV_CFL_PRED) { if (!is_cfl_allowed(xd) || !cpi->oxcf.enable_cfl_intra) continue; assert(!is_directional_mode); const TX_SIZE uv_tx_size = av1_get_tx_size(AOM_PLANE_U, xd); cfl_alpha_rate = cfl_rd_pick_alpha(x, cpi, uv_tx_size, best_rd); if (cfl_alpha_rate == INT_MAX) continue; } mbmi->angle_delta[PLANE_TYPE_UV] = 0; if (is_directional_mode && av1_use_angle_delta(mbmi->sb_type) && cpi->oxcf.enable_angle_delta) { const int rate_overhead = x->intra_uv_mode_cost[is_cfl_allowed(xd)][mbmi->mode][mode]; if (!rd_pick_intra_angle_sbuv(cpi, x, bsize, rate_overhead, best_rd, &this_rate, &tokenonly_rd_stats)) continue; } else { if (!super_block_uvrd(cpi, x, &tokenonly_rd_stats, bsize, best_rd)) { continue; } } const int mode_cost = x->intra_uv_mode_cost[is_cfl_allowed(xd)][mbmi->mode][mode] + cfl_alpha_rate; this_rate = tokenonly_rd_stats.rate + intra_mode_info_cost_uv(cpi, x, mbmi, bsize, mode_cost); if (mode == UV_CFL_PRED) { assert(is_cfl_allowed(xd) && cpi->oxcf.enable_cfl_intra); #if CONFIG_DEBUG if (!xd->lossless[mbmi->segment_id]) assert(xd->cfl.rate == tokenonly_rd_stats.rate + mode_cost); #endif // CONFIG_DEBUG } this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); if (this_rd < best_rd) { best_mbmi = *mbmi; best_rd = this_rd; *rate = this_rate; *rate_tokenonly = tokenonly_rd_stats.rate; *distortion = tokenonly_rd_stats.dist; *skippable = tokenonly_rd_stats.skip; } } const int try_palette = cpi->oxcf.enable_palette && av1_allow_palette(cpi->common.allow_screen_content_tools, mbmi->sb_type); if (try_palette) { uint8_t *best_palette_color_map = x->palette_buffer->best_palette_color_map; rd_pick_palette_intra_sbuv( cpi, x, x->intra_uv_mode_cost[is_cfl_allowed(xd)][mbmi->mode][UV_DC_PRED], best_palette_color_map, &best_mbmi, &best_rd, rate, rate_tokenonly, distortion, skippable); } *mbmi = best_mbmi; // Make sure we actually chose a mode assert(best_rd < INT64_MAX); return best_rd; } static void choose_intra_uv_mode(const AV1_COMP *const cpi, MACROBLOCK *const x, BLOCK_SIZE bsize, TX_SIZE max_tx_size, int *rate_uv, int *rate_uv_tokenonly, int64_t *dist_uv, int *skip_uv, UV_PREDICTION_MODE *mode_uv) { const AV1_COMMON *const cm = &cpi->common; MACROBLOCKD *xd = &x->e_mbd; MB_MODE_INFO *mbmi = xd->mi[0]; const int mi_row = -xd->mb_to_top_edge >> (3 + MI_SIZE_LOG2); const int mi_col = -xd->mb_to_left_edge >> (3 + MI_SIZE_LOG2); // Use an estimated rd for uv_intra based on DC_PRED if the // appropriate speed flag is set. init_sbuv_mode(mbmi); if (x->skip_chroma_rd) { *rate_uv = 0; *rate_uv_tokenonly = 0; *dist_uv = 0; *skip_uv = 1; *mode_uv = UV_DC_PRED; return; } xd->cfl.is_chroma_reference = is_chroma_reference(mi_row, mi_col, bsize, cm->seq_params.subsampling_x, cm->seq_params.subsampling_y); bsize = scale_chroma_bsize(bsize, xd->plane[AOM_PLANE_U].subsampling_x, xd->plane[AOM_PLANE_U].subsampling_y); // Only store reconstructed luma when there's chroma RDO. When there's no // chroma RDO, the reconstructed luma will be stored in encode_superblock(). xd->cfl.store_y = store_cfl_required_rdo(cm, x); if (xd->cfl.store_y) { // Restore reconstructed luma values. av1_encode_intra_block_plane(cpi, x, mbmi->sb_type, AOM_PLANE_Y, cpi->optimize_seg_arr[mbmi->segment_id], mi_row, mi_col); xd->cfl.store_y = 0; } rd_pick_intra_sbuv_mode(cpi, x, rate_uv, rate_uv_tokenonly, dist_uv, skip_uv, bsize, max_tx_size); *mode_uv = mbmi->uv_mode;
+ show +
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
} static int cost_mv_ref(const MACROBLOCK *const x, PREDICTION_MODE mode, int16_t mode_context) { if (is_inter_compound_mode(mode)) { return x ->inter_compound_mode_cost[mode_context][INTER_COMPOUND_OFFSET(mode)]; } int mode_cost = 0;

[CVE-2020-0470_1.diff] rdopt.c #22
- cur_mv[1].as_int = args->single_newmv[ref_mv_idx][refs[1]].as_int; - if (cpi->sf.comp_inter_joint_search_thresh <= bsize) { - compound_single_motion_search_interinter( - cpi, x, bsize, cur_mv, mi_row, mi_col, NULL, 0, rate_mv, 0, 1); + if (valid_mv1) { + cur_mv[1].as_int = args->single_newmv[ref_mv_idx][refs[1]].as_int; + clamp_mv_in_range(x, &cur_mv[1], 1); + } + + // aomenc2 + if (cpi->sf.inter_sf.comp_inter_joint_search_thresh <= bsize || + !valid_mv1) { + av1_compound_single_motion_search_interinter(cpi, x, bsize, cur_mv, + NULL, 0, rate_mv, 1);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rdopt.c
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
} else { *rate_mv = 0; for (i = 0; i < 2; ++i) { const int_mv ref_mv = av1_get_ref_mv(x, i); *rate_mv += av1_mv_bit_cost(&cur_mv[i].as_mv, &ref_mv.as_mv, x->nmv_vec_cost, x->mv_cost_stack, MV_COST_WEIGHT); } } } else if (this_mode == NEAREST_NEWMV || this_mode == NEAR_NEWMV) {
+ show +
8140
8141
8142
8143
cur_mv[1].as_int = args->single_newmv[ref_mv_idx][refs[1]].as_int; if (cpi->sf.comp_inter_joint_search_thresh <= bsize) { compound_single_motion_search_interinter( cpi, x, bsize, cur_mv, mi_row, mi_col, NULL, 0, rate_mv, 0, 1);
+ show +
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
} else { const int_mv ref_mv = av1_get_ref_mv(x, 1); *rate_mv = av1_mv_bit_cost(&cur_mv[1].as_mv, &ref_mv.as_mv, x->nmv_vec_cost, x->mv_cost_stack, MV_COST_WEIGHT); } } else { assert(this_mode == NEW_NEARESTMV || this_mode == NEW_NEARMV); cur_mv[0].as_int = args->single_newmv[ref_mv_idx][refs[0]].as_int; if (cpi->sf.comp_inter_joint_search_thresh <= bsize) {

[CVE-2020-0470_1.diff] rdopt.c #23
- cur_mv[0].as_int = args->single_newmv[ref_mv_idx][refs[0]].as_int; - if (cpi->sf.comp_inter_joint_search_thresh <= bsize) { - compound_single_motion_search_interinter( - cpi, x, bsize, cur_mv, mi_row, mi_col, NULL, 0, rate_mv, 0, 0); + if (valid_mv0) { + cur_mv[0].as_int = args->single_newmv[ref_mv_idx][refs[0]].as_int; + clamp_mv_in_range(x, &cur_mv[0], 0); + } + + // aomenc3 + if (cpi->sf.inter_sf.comp_inter_joint_search_thresh <= bsize || + !valid_mv0) { + av1_compound_single_motion_search_interinter(cpi, x, bsize, cur_mv, + NULL, 0, rate_mv, 0);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rdopt.c
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
compound_single_motion_search_interinter( cpi, x, bsize, cur_mv, mi_row, mi_col, NULL, 0, rate_mv, 0, 1); } else { const int_mv ref_mv = av1_get_ref_mv(x, 1); *rate_mv = av1_mv_bit_cost(&cur_mv[1].as_mv, &ref_mv.as_mv, x->nmv_vec_cost, x->mv_cost_stack, MV_COST_WEIGHT); } } else { assert(this_mode == NEW_NEARESTMV || this_mode == NEW_NEARMV);
+ show +
8152
8153
8154
8155
cur_mv[0].as_int = args->single_newmv[ref_mv_idx][refs[0]].as_int; if (cpi->sf.comp_inter_joint_search_thresh <= bsize) { compound_single_motion_search_interinter( cpi, x, bsize, cur_mv, mi_row, mi_col, NULL, 0, rate_mv, 0, 0);
+ show +
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
} else { const int_mv ref_mv = av1_get_ref_mv(x, 0); *rate_mv = av1_mv_bit_cost(&cur_mv[0].as_mv, &ref_mv.as_mv, x->nmv_vec_cost, x->mv_cost_stack, MV_COST_WEIGHT); } } } else { single_motion_search(cpi, x, bsize, mi_row, mi_col, 0, rate_mv); if (x->best_mv.as_int == INVALID_MV) return INT64_MAX;

[CVE-2020-0470_1.diff] rdopt.c #26
-struct obmc_check_mv_field_ctxt { - MB_MODE_INFO *current_mi; - int mv_field_check_result; -}; - -static INLINE void obmc_check_identical_mv(MACROBLOCKD *xd, int rel_mi_col, - uint8_t nb_mi_width, - MB_MODE_INFO *nb_mi, void *fun_ctxt, - const int num_planes) { - (void)xd; - (void)rel_mi_col; - (void)nb_mi_width; - (void)num_planes; - struct obmc_check_mv_field_ctxt *ctxt = - (struct obmc_check_mv_field_ctxt *)fun_ctxt; - const MB_MODE_INFO *current_mi = ctxt->current_mi; - - if (ctxt->mv_field_check_result == 0) return; - - if (nb_mi->ref_frame[0] != current_mi->ref_frame[0] || - nb_mi->mv[0].as_int != current_mi->mv[0].as_int || - nb_mi->interp_filters != current_mi->interp_filters) { - ctxt->mv_field_check_result = 0; - } -} - -// Check if the neighbors' motions used by obmc have same parameters as for -// the current block. If all the parameters are identical, obmc will produce -// the same prediction as from regular bmc, therefore we can skip the -// overlapping operations for less complexity. The parameters checked include -// reference frame, motion vector, and interpolation filter. -int check_identical_obmc_mv_field(const AV1_COMMON *cm, MACROBLOCKD *xd, - int mi_row, int mi_col) { - const BLOCK_SIZE bsize = xd->mi[0]->sb_type; - struct obmc_check_mv_field_ctxt mv_field_check_ctxt = { xd->mi[0], 1 }; - - foreach_overlappable_nb_above(cm, xd, mi_col, - max_neighbor_obmc[mi_size_wide_log2[bsize]], - obmc_check_identical_mv, &mv_field_check_ctxt); - foreach_overlappable_nb_left(cm, xd, mi_row, - max_neighbor_obmc[mi_size_high_log2[bsize]], - obmc_check_identical_mv, &mv_field_check_ctxt); - - return mv_field_check_ctxt.mv_field_check_result; -} - -static int skip_interintra_based_on_first_pass_stats(const AV1_COMP *const cpi, - MACROBLOCK *const x, - BLOCK_SIZE bsize, - int mi_row, int mi_col) { - MACROBLOCKD *xd = &x->e_mbd; - MB_MODE_INFO *mbmi = xd->mi[0]; - if (cpi->two_pass_partition_search && - cpi->sf.use_first_partition_pass_interintra_stats && - !x->cb_partition_scan) { - const int mi_width = mi_size_wide[bsize]; - const int mi_height = mi_size_high[bsize]; - // Search in the stats table to see if obmc motion mode was used in the - // first pass of partition search. - for (int row = mi_row; row < mi_row + mi_width; - row += FIRST_PARTITION_PASS_SAMPLE_REGION) { - for (int col = mi_col; col < mi_col + mi_height; - col += FIRST_PARTITION_PASS_SAMPLE_REGION) { - const int index = av1_first_partition_pass_stats_index(row, col); - const FIRST_PARTITION_PASS_STATS *const stats = - &x->first_partition_pass_stats[index]; - if (stats->interintra_motion_mode_count[mbmi->ref_frame[0]]) { - return 0; - } - } +static INLINE void update_mode_start_end_index(const AV1_COMP *const cpi, + int *mode_index_start, + int *mode_index_end, + int last_motion_mode_allowed, + int interintra_allowed, + int eval_motion_mode) { + *mode_index_start = (int)SIMPLE_TRANSLATION; + *mode_index_end = (int)last_motion_mode_allowed + interintra_allowed; + if (cpi->sf.winner_mode_sf.motion_mode_for_winner_cand) { + if (!eval_motion_mode) { + *mode_index_end = (int)SIMPLE_TRANSLATION; + } else { + // Set the start index appropriately to process motion modes other than + // simple translation + *mode_index_start = 1; - return 1; - return 0;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rdopt.c
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
TransformationType wmtype = get_wmtype(wm_params); if (num_proj_ref == 1) { if (wmtype != ROTZOOM) is_valid_warp = 0; } else { if (wmtype < ROTZOOM) is_valid_warp = 0; } } return is_valid_warp; }
+ show +
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
struct obmc_check_mv_field_ctxt { MB_MODE_INFO *current_mi; int mv_field_check_result; }; static INLINE void obmc_check_identical_mv(MACROBLOCKD *xd, int rel_mi_col, uint8_t nb_mi_width, MB_MODE_INFO *nb_mi, void *fun_ctxt, const int num_planes) { (void)xd; (void)rel_mi_col; (void)nb_mi_width; (void)num_planes; struct obmc_check_mv_field_ctxt *ctxt = (struct obmc_check_mv_field_ctxt *)fun_ctxt; const MB_MODE_INFO *current_mi = ctxt->current_mi; if (ctxt->mv_field_check_result == 0) return; if (nb_mi->ref_frame[0] != current_mi->ref_frame[0] || nb_mi->mv[0].as_int != current_mi->mv[0].as_int || nb_mi->interp_filters != current_mi->interp_filters) { ctxt->mv_field_check_result = 0; } } // Check if the neighbors' motions used by obmc have same parameters as for // the current block. If all the parameters are identical, obmc will produce // the same prediction as from regular bmc, therefore we can skip the // overlapping operations for less complexity. The parameters checked include // reference frame, motion vector, and interpolation filter. int check_identical_obmc_mv_field(const AV1_COMMON *cm, MACROBLOCKD *xd, int mi_row, int mi_col) { const BLOCK_SIZE bsize = xd->mi[0]->sb_type; struct obmc_check_mv_field_ctxt mv_field_check_ctxt = { xd->mi[0], 1 }; foreach_overlappable_nb_above(cm, xd, mi_col, max_neighbor_obmc[mi_size_wide_log2[bsize]], obmc_check_identical_mv, &mv_field_check_ctxt); foreach_overlappable_nb_left(cm, xd, mi_row, max_neighbor_obmc[mi_size_high_log2[bsize]], obmc_check_identical_mv, &mv_field_check_ctxt); return mv_field_check_ctxt.mv_field_check_result; } static int skip_interintra_based_on_first_pass_stats(const AV1_COMP *const cpi, MACROBLOCK *const x, BLOCK_SIZE bsize, int mi_row, int mi_col) { MACROBLOCKD *xd = &x->e_mbd; MB_MODE_INFO *mbmi = xd->mi[0]; if (cpi->two_pass_partition_search && cpi->sf.use_first_partition_pass_interintra_stats && !x->cb_partition_scan) { const int mi_width = mi_size_wide[bsize]; const int mi_height = mi_size_high[bsize]; // Search in the stats table to see if obmc motion mode was used in the // first pass of partition search. for (int row = mi_row; row < mi_row + mi_width; row += FIRST_PARTITION_PASS_SAMPLE_REGION) { for (int col = mi_col; col < mi_col + mi_height; col += FIRST_PARTITION_PASS_SAMPLE_REGION) { const int index = av1_first_partition_pass_stats_index(row, col); const FIRST_PARTITION_PASS_STATS *const stats = &x->first_partition_pass_stats[index]; if (stats->interintra_motion_mode_count[mbmi->ref_frame[0]]) { return 0; } } } return 1; } return 0;
+ show +
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
} // TODO(afergs): Refactor the MBMI references in here - there's four // TODO(afergs): Refactor optional args - add them to a struct or remove static int64_t motion_mode_rd( const AV1_COMP *const cpi, TileDataEnc *tile_data, MACROBLOCK *const x, BLOCK_SIZE bsize, RD_STATS *rd_stats, RD_STATS *rd_stats_y, RD_STATS *rd_stats_uv, int *disable_skip, int mi_row, int mi_col, HandleInterModeArgs *const args, int64_t ref_best_rd, const int *refs, int *rate_mv, const BUFFER_SET *orig_dst, int64_t *best_est_rd,

[CVE-2020-0470_1.diff] rdopt.c #27
- RD_STATS *rd_stats_uv, int *disable_skip, int mi_row, int mi_col, - HandleInterModeArgs *const args, int64_t ref_best_rd, const int *refs, - int *rate_mv, const BUFFER_SET *orig_dst, int64_t *best_est_rd, - int do_tx_search, InterModesInfo *inter_modes_info) { + RD_STATS *rd_stats_uv, int *disable_skip, HandleInterModeArgs *const args, + int64_t ref_best_rd, int64_t *ref_skip_rd, int *rate_mv, + const BUFFER_SET *orig_dst, int64_t *best_est_rd, int do_tx_search, + InterModesInfo *inter_modes_info, int eval_motion_mode) { + const FeatureFlags *const features = &cm->features;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rdopt.c
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
return 1; } return 0; } // TODO(afergs): Refactor the MBMI references in here - there's four // TODO(afergs): Refactor optional args - add them to a struct or remove static int64_t motion_mode_rd( const AV1_COMP *const cpi, TileDataEnc *tile_data, MACROBLOCK *const x, BLOCK_SIZE bsize, RD_STATS *rd_stats, RD_STATS *rd_stats_y,
+ show +
9343
9344
9345
9346
RD_STATS *rd_stats_uv, int *disable_skip, int mi_row, int mi_col, HandleInterModeArgs *const args, int64_t ref_best_rd, const int *refs, int *rate_mv, const BUFFER_SET *orig_dst, int64_t *best_est_rd, int do_tx_search, InterModesInfo *inter_modes_info) {
+ show +
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
const AV1_COMMON *const cm = &cpi->common; const int num_planes = av1_num_planes(cm); MACROBLOCKD *xd = &x->e_mbd; MB_MODE_INFO *mbmi = xd->mi[0]; const int is_comp_pred = has_second_ref(mbmi); const PREDICTION_MODE this_mode = mbmi->mode; const int rate2_nocoeff = rd_stats->rate; int best_xskip = 0, best_disable_skip = 0; RD_STATS best_rd_stats, best_rd_stats_y, best_rd_stats_uv; uint8_t best_blk_skip[MAX_MIB_SIZE * MAX_MIB_SIZE];

[CVE-2020-0470_1.diff] rdopt.c #36
- if (mbmi->ref_frame[1] == INTRA_FRAME) { - rd_stats->rate += x->interintra_mode_cost[size_group_lookup[bsize]] - [mbmi->interintra_mode]; - if (is_interintra_wedge_used(bsize)) { - rd_stats->rate += - x->wedge_interintra_cost[bsize][mbmi->use_wedge_interintra]; - if (mbmi->use_wedge_interintra) { - rd_stats->rate += - av1_cost_literal(get_interintra_wedge_bits(bsize)); - } - } - }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rdopt.c
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
x->skip = 0; rd_stats->dist = 0; rd_stats->sse = 0; rd_stats->skip = 1; rd_stats->rate = tmp_rate2; if (mbmi->motion_mode != WARPED_CAUSAL) rd_stats->rate += switchable_rate; if (interintra_allowed) { rd_stats->rate += x->interintra_cost[size_group_lookup[bsize]] [mbmi->ref_frame[1] == INTRA_FRAME];
+ show +
9557
9558
9559
9560
9561
9562
9563
9564
9565
if (mbmi->ref_frame[1] == INTRA_FRAME) { rd_stats->rate += x->interintra_mode_cost[size_group_lookup[bsize]] [mbmi->interintra_mode]; if (is_interintra_wedge_used(bsize)) { rd_stats->rate += x->wedge_interintra_cost[bsize][mbmi->use_wedge_interintra]; if (mbmi->use_wedge_interintra) { rd_stats->rate += av1_cost_literal(get_interintra_wedge_bits(bsize));
+ show +
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
} } } } if ((last_motion_mode_allowed > SIMPLE_TRANSLATION) && (mbmi->ref_frame[1] != INTRA_FRAME)) { if (last_motion_mode_allowed == WARPED_CAUSAL) { rd_stats->rate += x->motion_mode_cost[bsize][mbmi->motion_mode]; } else { rd_stats->rate += x->motion_mode_cost1[bsize][mbmi->motion_mode];

[CVE-2020-0470_1.diff] rdopt.c #62
- ctx->mbmi_ext = *x->mbmi_ext; + av1_copy_mbmi_ext_to_mbmi_ext_frame(&ctx->mbmi_ext_best, x->mbmi_ext, + av1_ref_frame_type(xd->mi[0]->ref_frame)); + av1_copy_array(ctx->tx_type_map, xd->tx_type_map, ctx->num_4x4_blk); -static void restore_uv_color_map(const AV1_COMP *const cpi, MACROBLOCK *x) { - MACROBLOCKD *const xd = &x->e_mbd; - MB_MODE_INFO *const mbmi = xd->mi[0]; - PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info; - const BLOCK_SIZE bsize = mbmi->sb_type; - int src_stride = x->plane[1].src.stride; - const uint8_t *const src_u = x->plane[1].src.buf; - const uint8_t *const src_v = x->plane[2].src.buf; - int *const data = x->palette_buffer->kmeans_data_buf; - int centroids[2 * PALETTE_MAX_SIZE]; - uint8_t *const color_map = xd->plane[1].color_index_map; - int r, c; - const uint16_t *const src_u16 = CONVERT_TO_SHORTPTR(src_u); - const uint16_t *const src_v16 = CONVERT_TO_SHORTPTR(src_v); - int plane_block_width, plane_block_height, rows, cols; - av1_get_block_dimensions(bsize, 1, xd, &plane_block_width, - &plane_block_height, &rows, &cols); +static AOM_INLINE void calc_target_weighted_pred( + const AV1_COMMON *cm, const MACROBLOCK *x, const MACROBLOCKD *xd, + const uint8_t *above, int above_stride, const uint8_t *left, + int left_stride); - for (r = 0; r < rows; ++r) { - for (c = 0; c < cols; ++c) { - if (cpi->common.seq_params.use_highbitdepth) { - data[(r * cols + c) * 2] = src_u16[r * src_stride + c]; - data[(r * cols + c) * 2 + 1] = src_v16[r * src_stride + c]; - } else { - data[(r * cols + c) * 2] = src_u[r * src_stride + c]; - data[(r * cols + c) * 2 + 1] = src_v[r * src_stride + c]; - } - } - } - - for (r = 1; r < 3; ++r) { - for (c = 0; c < pmi->palette_size[1]; ++c) { - centroids[c * 2 + r - 1] = pmi->palette_colors[r * PALETTE_MAX_SIZE + c]; - } - } - - av1_calc_indices(data, centroids, color_map, rows * cols, - pmi->palette_size[1], 2); - extend_palette_color_map(color_map, cols, rows, plane_block_width, - plane_block_height); -} - -static void calc_target_weighted_pred(const AV1_COMMON *cm, const MACROBLOCK *x, - const MACROBLOCKD *xd, int mi_row, - int mi_col, const uint8_t *above, - int above_stride, const uint8_t *left, - int left_stride); - -static void rd_pick_skip_mode(RD_STATS *rd_cost, - InterModeSearchState *search_state, - const AV1_COMP *const cpi, MACROBLOCK *const x, - BLOCK_SIZE bsize, int mi_row, int mi_col, - struct buf_2d yv12_mb[REF_FRAMES][MAX_MB_PLANE]) { +static AOM_INLINE void rd_pick_skip_mode( + RD_STATS *rd_cost, InterModeSearchState *search_state, + const AV1_COMP *const cpi, MACROBLOCK *const x, BLOCK_SIZE bsize, + struct buf_2d yv12_mb[REF_FRAMES][MAX_MB_PLANE]) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rdopt.c
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
best_rd = rd_cost->rdcost; if (rd_pick_intrabc_mode_sb(cpi, x, rd_cost, bsize, best_rd) < best_rd) { ctx->skip = x->skip; memcpy(ctx->blk_skip, x->blk_skip, sizeof(x->blk_skip[0]) * ctx->num_4x4_blk); assert(rd_cost->rate != INT_MAX); } if (rd_cost->rate == INT_MAX) return; ctx->mic = *xd->mi[0];
+ show +
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
ctx->mbmi_ext = *x->mbmi_ext; } static void restore_uv_color_map(const AV1_COMP *const cpi, MACROBLOCK *x) { MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info; const BLOCK_SIZE bsize = mbmi->sb_type; int src_stride = x->plane[1].src.stride; const uint8_t *const src_u = x->plane[1].src.buf; const uint8_t *const src_v = x->plane[2].src.buf; int *const data = x->palette_buffer->kmeans_data_buf; int centroids[2 * PALETTE_MAX_SIZE]; uint8_t *const color_map = xd->plane[1].color_index_map; int r, c; const uint16_t *const src_u16 = CONVERT_TO_SHORTPTR(src_u); const uint16_t *const src_v16 = CONVERT_TO_SHORTPTR(src_v); int plane_block_width, plane_block_height, rows, cols; av1_get_block_dimensions(bsize, 1, xd, &plane_block_width, &plane_block_height, &rows, &cols); for (r = 0; r < rows; ++r) { for (c = 0; c < cols; ++c) { if (cpi->common.seq_params.use_highbitdepth) { data[(r * cols + c) * 2] = src_u16[r * src_stride + c]; data[(r * cols + c) * 2 + 1] = src_v16[r * src_stride + c]; } else { data[(r * cols + c) * 2] = src_u[r * src_stride + c]; data[(r * cols + c) * 2 + 1] = src_v[r * src_stride + c]; } } } for (r = 1; r < 3; ++r) { for (c = 0; c < pmi->palette_size[1]; ++c) { centroids[c * 2 + r - 1] = pmi->palette_colors[r * PALETTE_MAX_SIZE + c]; } } av1_calc_indices(data, centroids, color_map, rows * cols, pmi->palette_size[1], 2); extend_palette_color_map(color_map, cols, rows, plane_block_width, plane_block_height); } static void calc_target_weighted_pred(const AV1_COMMON *cm, const MACROBLOCK *x, const MACROBLOCKD *xd, int mi_row, int mi_col, const uint8_t *above, int above_stride, const uint8_t *left, int left_stride); static void rd_pick_skip_mode(RD_STATS *rd_cost, InterModeSearchState *search_state, const AV1_COMP *const cpi, MACROBLOCK *const x, BLOCK_SIZE bsize, int mi_row, int mi_col, struct buf_2d yv12_mb[REF_FRAMES][MAX_MB_PLANE]) {
+ show +
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
const AV1_COMMON *const cm = &cpi->common; const SkipModeInfo *const skip_mode_info = &cm->current_frame.skip_mode_info; const int num_planes = av1_num_planes(cm); MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; x->compound_idx = 1; // COMPOUND_AVERAGE RD_STATS skip_mode_rd_stats; av1_invalid_rd_stats(&skip_mode_rd_stats);

[CVE-2020-0470_1.diff] rdopt.c #98
- assert((cm->interp_filter == SWITCHABLE) || - (cm->interp_filter == - av1_extract_interp_filter(mbmi->interp_filters, 0))); + assert((interp_filter == SWITCHABLE) || + (interp_filter == mbmi->interp_filters.as_filters.y_filter)); - av1_update_rd_thresh_fact(cm, tile_data->thresh_freq_fact, - cpi->sf.adaptive_rd_thresh, bsize, THR_GLOBALMV); + if (cpi->sf.inter_sf.adaptive_rd_thresh) { + av1_update_rd_thresh_fact(cm, x->thresh_freq_fact, + cpi->sf.inter_sf.adaptive_rd_thresh, bsize, + THR_GLOBALMV); + } +#if CONFIG_INTERNAL_STATS +#else + store_coding_context(x, ctx, best_pred_diff, 0); +#endif // CONFIG_INTERNAL_STATS
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rdopt.c
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
rd_cost->rate = rate2; rd_cost->dist = distortion2; rd_cost->rdcost = this_rd; if (this_rd >= best_rd_so_far) { rd_cost->rate = INT_MAX; rd_cost->rdcost = INT64_MAX; return; }
+ show +
13809
13810
13811
13812
13813
13814
assert((cm->interp_filter == SWITCHABLE) || (cm->interp_filter == av1_extract_interp_filter(mbmi->interp_filters, 0))); av1_update_rd_thresh_fact(cm, tile_data->thresh_freq_fact, cpi->sf.adaptive_rd_thresh, bsize, THR_GLOBALMV);
+ show +
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
av1_zero(best_pred_diff); store_coding_context(x, ctx, THR_GLOBALMV, best_pred_diff, 0); } struct calc_target_weighted_pred_ctxt { const MACROBLOCK *x; const uint8_t *tmp; int tmp_stride;

[CVE-2020-0478_1.diff] pass2_strategy.c #4
-// Calculate the linear size relative to a baseline of 1080P -#define BASE_SIZE 2073600.0 // 1920x1080 -static double get_linear_size_factor(const AV1_COMP *cpi) { - const double this_area = cpi->initial_width * cpi->initial_height; - return pow(this_area / BASE_SIZE, 0.5); -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/pass2_strategy.c
111
112
113
114
115
116
117
118
119
120
section->mvc_abs -= frame->mvc_abs; section->MVrv -= frame->MVrv; section->MVcv -= frame->MVcv; section->mv_in_out_count -= frame->mv_in_out_count; section->new_mv_count -= frame->new_mv_count; section->count -= frame->count; section->duration -= frame->duration; } // Calculate the linear size relative to a baseline of 1080P
+ show +
121
122
123
124
#define BASE_SIZE 2073600.0 // 1920x1080 static double get_linear_size_factor(const AV1_COMP *cpi) { const double this_area = cpi->initial_width * cpi->initial_height; return pow(this_area / BASE_SIZE, 0.5);
+ show +
125
126
127
128
129
130
131
132
133
134
} // This function returns the maximum target rate per frame. static int frame_max_bits(const RATE_CONTROL *rc, const AV1EncoderConfig *oxcf) { int64_t max_bits = ((int64_t)rc->avg_frame_bandwidth * (int64_t)oxcf->two_pass_vbrmax_section) / 100; if (max_bits < 0) max_bits = 0;

[CVE-2020-0478_1.diff] pass2_strategy.c #17
-#define LEAF_REDUCTION_FACTOR 0.75 -static double lvl_budget_factor[MAX_PYRAMID_LVL - 1][MAX_PYRAMID_LVL - 1] = { - { 1.0, 0.0, 0.0 }, { 0.6, 0.4, 0 }, { 0.45, 0.35, 0.20 } -}; -static void allocate_gf_group_bits( - AV1_COMP *cpi, int64_t gf_group_bits, double group_error, int gf_arf_bits, - const EncodeFrameParams *const frame_params) { - RATE_CONTROL *const rc = &cpi->rc; - const AV1EncoderConfig *const oxcf = &cpi->oxcf; - TWO_PASS *const twopass = &cpi->twopass; - GF_GROUP *const gf_group = &twopass->gf_group; - const int key_frame = (frame_params->frame_type == KEY_FRAME); - const int max_bits = frame_max_bits(&cpi->rc, &cpi->oxcf); - int64_t total_group_bits = gf_group_bits; +// Calculate the boost factor based on the number of bits assigned, i.e. the +// inverse of calculate_boost_bits(). +static int calculate_boost_factor(int frame_count, int bits, + int64_t total_group_bits) { + aom_clear_system_state(); + return (int)(100.0 * frame_count * bits / (total_group_bits - bits)); +} - // Check if GF group has any internal arfs. - int has_internal_arfs = 0; - for (int i = 0; i < gf_group->size; ++i) { - if (gf_group->update_type[i] == INTNL_ARF_UPDATE) { - has_internal_arfs = 1; - break; +// Reduce the number of bits assigned to keyframe or arf if necessary, to +// prevent bitrate spikes that may break level constraints. +// frame_type: 0: keyframe; 1: arf. +static int adjust_boost_bits_for_target_level(const AV1_COMP *const cpi, + RATE_CONTROL *const rc, + int bits_assigned, + int64_t group_bits, + int frame_type) { + const AV1_COMMON *const cm = &cpi->common; + const SequenceHeader *const seq_params = &cm->seq_params; + const int temporal_layer_id = cm->temporal_layer_id; + const int spatial_layer_id = cm->spatial_layer_id; + for (int index = 0; index < seq_params->operating_points_cnt_minus_1 + 1; + ++index) { + if (!is_in_operating_point(seq_params->operating_point_idc[index], + temporal_layer_id, spatial_layer_id)) { + continue; + } + + const AV1_LEVEL target_level = + cpi->level_params.target_seq_level_idx[index]; + if (target_level >= SEQ_LEVELS) continue; + + assert(is_valid_seq_level_idx(target_level)); + + const double level_bitrate_limit = av1_get_max_bitrate_for_level( + target_level, seq_params->tier[0], seq_params->profile); + const int target_bits_per_frame = + (int)(level_bitrate_limit / cpi->framerate); + if (frame_type == 0) { + // Maximum bits for keyframe is 8 times the target_bits_per_frame. + const int level_enforced_max_kf_bits = target_bits_per_frame * 8; + if (bits_assigned > level_enforced_max_kf_bits) { + const int frames = rc->frames_to_key - 1; + rc->kf_boost = calculate_boost_factor( + frames, level_enforced_max_kf_bits, group_bits); + bits_assigned = calculate_boost_bits(frames, rc->kf_boost, group_bits); + } + } else if (frame_type == 1) { + // Maximum bits for arf is 4 times the target_bits_per_frame. + const int level_enforced_max_arf_bits = target_bits_per_frame * 4; + if (bits_assigned > level_enforced_max_arf_bits) { + rc->gfu_boost = calculate_boost_factor( + rc->baseline_gf_interval, level_enforced_max_arf_bits, group_bits); + bits_assigned = calculate_boost_bits(rc->baseline_gf_interval, + rc->gfu_boost, group_bits); + } + } else { + assert(0); + return bits_assigned; +} + +// Compile time switch on alternate algorithm to allocate bits in ARF groups +// #define ALT_ARF_ALLOCATION +#ifdef ALT_ARF_ALLOCATION +double layer_fraction[MAX_ARF_LAYERS + 1] = { 1.0, 0.70, 0.55, 0.60, + 0.60, 1.0, 1.0 }; +static void allocate_gf_group_bits(GF_GROUP *gf_group, RATE_CONTROL *const rc, + int64_t gf_group_bits, int gf_arf_bits, + int key_frame, int use_arf) { + int64_t total_group_bits = gf_group_bits; + int base_frame_bits; + const int gf_group_size = gf_group->size; + int layer_frames[MAX_ARF_LAYERS + 1] = { 0 }; + + // Subtract the extra bits set aside for ARF frames from the Group Total + if (use_arf || !key_frame) total_group_bits -= gf_arf_bits; + + if (rc->baseline_gf_interval) + base_frame_bits = (int)(total_group_bits / rc->baseline_gf_interval); + else + base_frame_bits = (int)1; + + // For key frames the frame target rate is already set and it + // is also the golden frame. + // === [frame_index == 0] === + int frame_index = 0; + if (!key_frame) { + if (rc->source_alt_ref_active) + gf_group->bit_allocation[frame_index] = 0; + else + gf_group->bit_allocation[frame_index] = + base_frame_bits + (int)(gf_arf_bits * layer_fraction[1]); + } + frame_index++; + + // Check the number of frames in each layer in case we have a + // non standard group length. + int max_arf_layer = gf_group->max_layer_depth - 1; + for (int idx = frame_index; idx < gf_group_size; ++idx) { + if ((gf_group->update_type[idx] == ARF_UPDATE) || + (gf_group->update_type[idx] == INTNL_ARF_UPDATE)) { + // max_arf_layer = AOMMAX(max_arf_layer, gf_group->layer_depth[idx]); + layer_frames[gf_group->layer_depth[idx]]++; + } + } + + // Allocate extra bits to each ARF layer + int i; + int layer_extra_bits[MAX_ARF_LAYERS + 1] = { 0 }; + for (i = 1; i <= max_arf_layer; ++i) { + double fraction = (i == max_arf_layer) ? 1.0 : layer_fraction[i]; + layer_extra_bits[i] = + (int)((gf_arf_bits * fraction) / AOMMAX(1, layer_frames[i])); + gf_arf_bits -= (int)(gf_arf_bits * fraction); + } + + // Now combine ARF layer and baseline bits to give total bits for each frame. + int arf_extra_bits; + for (int idx = frame_index; idx < gf_group_size; ++idx) { + switch (gf_group->update_type[idx]) { + case ARF_UPDATE: + case INTNL_ARF_UPDATE: + arf_extra_bits = layer_extra_bits[gf_group->layer_depth[idx]]; + gf_group->bit_allocation[idx] = base_frame_bits + arf_extra_bits; + break; + case INTNL_OVERLAY_UPDATE: + case OVERLAY_UPDATE: gf_group->bit_allocation[idx] = 0; break; + default: gf_group->bit_allocation[idx] = base_frame_bits; break; + } + } + + // Set the frame following the current GOP to 0 bit allocation. For ARF + // groups, this next frame will be overlay frame, which is the first frame + // in the next GOP. For GF group, next GOP will overwrite the rate allocation. + // Setting this frame to use 0 bit (of out the current GOP budget) will + // simplify logics in reference frame management. + gf_group->bit_allocation[gf_group_size] = 0; +} +#else +static void allocate_gf_group_bits(GF_GROUP *gf_group, RATE_CONTROL *const rc, + int64_t gf_group_bits, int gf_arf_bits, + int key_frame, int use_arf) { + int64_t total_group_bits = gf_group_bits; +
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/pass2_strategy.c
558
559
560
561
562
563
564
565
566
567
int divisor = boost >> 10; boost /= divisor; allocation_chunks /= divisor; } // Calculate the number of extra bits for use in the boosted frame or frames. return AOMMAX((int)(((int64_t)boost * total_group_bits) / allocation_chunks), 0); }
+ show +
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
#define LEAF_REDUCTION_FACTOR 0.75 static double lvl_budget_factor[MAX_PYRAMID_LVL - 1][MAX_PYRAMID_LVL - 1] = { { 1.0, 0.0, 0.0 }, { 0.6, 0.4, 0 }, { 0.45, 0.35, 0.20 } }; static void allocate_gf_group_bits( AV1_COMP *cpi, int64_t gf_group_bits, double group_error, int gf_arf_bits, const EncodeFrameParams *const frame_params) { RATE_CONTROL *const rc = &cpi->rc; const AV1EncoderConfig *const oxcf = &cpi->oxcf; TWO_PASS *const twopass = &cpi->twopass; GF_GROUP *const gf_group = &twopass->gf_group; const int key_frame = (frame_params->frame_type == KEY_FRAME); const int max_bits = frame_max_bits(&cpi->rc, &cpi->oxcf); int64_t total_group_bits = gf_group_bits; // Check if GF group has any internal arfs. int has_internal_arfs = 0; for (int i = 0; i < gf_group->size; ++i) { if (gf_group->update_type[i] == INTNL_ARF_UPDATE) { has_internal_arfs = 1; break;
+ show +
589
590
591
592
593
594
595
596
597
598
} } // For key frames the frame target rate is already set and it // is also the golden frame. // === [frame_index == 0] === int frame_index = 0; if (!key_frame) { if (rc->source_alt_ref_active) gf_group->bit_allocation[frame_index] = 0;

[CVE-2020-0478_1.diff] pass2_strategy.c #35
+#ifdef STRICT_RC + rc->kf_boost = AOMMIN(rc->kf_boost, MAX_KF_BOOST); +#endif - - // Work out the fraction of the kf group bits reserved for the inter frames - // within the group after discounting the bits for the kf itself. - if (twopass->kf_group_bits) { - twopass->kfgroup_inter_fraction = - (double)(twopass->kf_group_bits - kf_bits) / - (double)twopass->kf_group_bits; - } else { - twopass->kfgroup_inter_fraction = 1.0; - } + kf_bits = adjust_boost_bits_for_target_level(cpi, rc, kf_bits, + twopass->kf_group_bits, 0);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/pass2_strategy.c
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
} // Work out how many bits to allocate for the key frame itself. kf_bits = calculate_boost_bits((rc->frames_to_key - 1), rc->kf_boost, twopass->kf_group_bits); // printf("kf boost = %d kf_bits = %d kf_zeromotion_pct = %d\n", rc->kf_boost, // kf_bits, twopass->kf_zeromotion_pct); // Work out the fraction of the kf group bits reserved for the inter frames // within the group after discounting the bits for the kf itself.
+ show +
1445
1446
1447
1448
1449
1450
if (twopass->kf_group_bits) { twopass->kfgroup_inter_fraction = (double)(twopass->kf_group_bits - kf_bits) / (double)twopass->kf_group_bits; } else { twopass->kfgroup_inter_fraction = 1.0;
+ show +
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
} twopass->kf_group_bits -= kf_bits; // Save the bits to spend on the key frame. gf_group->bit_allocation[0] = kf_bits; gf_group->update_type[0] = KF_UPDATE; // Note the total error score of the kf group minus the key frame itself. twopass->kf_group_error_left = (int)(kf_group_err - kf_mod_err);

[CVE-2020-0470_1.diff] pass2_strategy.c #4
-// Calculate the linear size relative to a baseline of 1080P -#define BASE_SIZE 2073600.0 // 1920x1080 -static double get_linear_size_factor(const AV1_COMP *cpi) { - const double this_area = cpi->initial_width * cpi->initial_height; - return pow(this_area / BASE_SIZE, 0.5); -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/pass2_strategy.c
111
112
113
114
115
116
117
118
119
120
section->mvc_abs -= frame->mvc_abs; section->MVrv -= frame->MVrv; section->MVcv -= frame->MVcv; section->mv_in_out_count -= frame->mv_in_out_count; section->new_mv_count -= frame->new_mv_count; section->count -= frame->count; section->duration -= frame->duration; } // Calculate the linear size relative to a baseline of 1080P
+ show +
121
122
123
124
#define BASE_SIZE 2073600.0 // 1920x1080 static double get_linear_size_factor(const AV1_COMP *cpi) { const double this_area = cpi->initial_width * cpi->initial_height; return pow(this_area / BASE_SIZE, 0.5);
+ show +
125
126
127
128
129
130
131
132
133
134
} // This function returns the maximum target rate per frame. static int frame_max_bits(const RATE_CONTROL *rc, const AV1EncoderConfig *oxcf) { int64_t max_bits = ((int64_t)rc->avg_frame_bandwidth * (int64_t)oxcf->two_pass_vbrmax_section) / 100; if (max_bits < 0) max_bits = 0;

[CVE-2020-0470_1.diff] pass2_strategy.c #17
-#define LEAF_REDUCTION_FACTOR 0.75 -static double lvl_budget_factor[MAX_PYRAMID_LVL - 1][MAX_PYRAMID_LVL - 1] = { - { 1.0, 0.0, 0.0 }, { 0.6, 0.4, 0 }, { 0.45, 0.35, 0.20 } -}; -static void allocate_gf_group_bits( - AV1_COMP *cpi, int64_t gf_group_bits, double group_error, int gf_arf_bits, - const EncodeFrameParams *const frame_params) { - RATE_CONTROL *const rc = &cpi->rc; - const AV1EncoderConfig *const oxcf = &cpi->oxcf; - TWO_PASS *const twopass = &cpi->twopass; - GF_GROUP *const gf_group = &twopass->gf_group; - const int key_frame = (frame_params->frame_type == KEY_FRAME); - const int max_bits = frame_max_bits(&cpi->rc, &cpi->oxcf); - int64_t total_group_bits = gf_group_bits; +// Calculate the boost factor based on the number of bits assigned, i.e. the +// inverse of calculate_boost_bits(). +static int calculate_boost_factor(int frame_count, int bits, + int64_t total_group_bits) { + aom_clear_system_state(); + return (int)(100.0 * frame_count * bits / (total_group_bits - bits)); +} - // Check if GF group has any internal arfs. - int has_internal_arfs = 0; - for (int i = 0; i < gf_group->size; ++i) { - if (gf_group->update_type[i] == INTNL_ARF_UPDATE) { - has_internal_arfs = 1; - break; +// Reduce the number of bits assigned to keyframe or arf if necessary, to +// prevent bitrate spikes that may break level constraints. +// frame_type: 0: keyframe; 1: arf. +static int adjust_boost_bits_for_target_level(const AV1_COMP *const cpi, + RATE_CONTROL *const rc, + int bits_assigned, + int64_t group_bits, + int frame_type) { + const AV1_COMMON *const cm = &cpi->common; + const SequenceHeader *const seq_params = &cm->seq_params; + const int temporal_layer_id = cm->temporal_layer_id; + const int spatial_layer_id = cm->spatial_layer_id; + for (int index = 0; index < seq_params->operating_points_cnt_minus_1 + 1; + ++index) { + if (!is_in_operating_point(seq_params->operating_point_idc[index], + temporal_layer_id, spatial_layer_id)) { + continue; + } + + const AV1_LEVEL target_level = + cpi->level_params.target_seq_level_idx[index]; + if (target_level >= SEQ_LEVELS) continue; + + assert(is_valid_seq_level_idx(target_level)); + + const double level_bitrate_limit = av1_get_max_bitrate_for_level( + target_level, seq_params->tier[0], seq_params->profile); + const int target_bits_per_frame = + (int)(level_bitrate_limit / cpi->framerate); + if (frame_type == 0) { + // Maximum bits for keyframe is 8 times the target_bits_per_frame. + const int level_enforced_max_kf_bits = target_bits_per_frame * 8; + if (bits_assigned > level_enforced_max_kf_bits) { + const int frames = rc->frames_to_key - 1; + rc->kf_boost = calculate_boost_factor( + frames, level_enforced_max_kf_bits, group_bits); + bits_assigned = calculate_boost_bits(frames, rc->kf_boost, group_bits); + } + } else if (frame_type == 1) { + // Maximum bits for arf is 4 times the target_bits_per_frame. + const int level_enforced_max_arf_bits = target_bits_per_frame * 4; + if (bits_assigned > level_enforced_max_arf_bits) { + rc->gfu_boost = calculate_boost_factor( + rc->baseline_gf_interval, level_enforced_max_arf_bits, group_bits); + bits_assigned = calculate_boost_bits(rc->baseline_gf_interval, + rc->gfu_boost, group_bits); + } + } else { + assert(0); + return bits_assigned; +} + +// Compile time switch on alternate algorithm to allocate bits in ARF groups +// #define ALT_ARF_ALLOCATION +#ifdef ALT_ARF_ALLOCATION +double layer_fraction[MAX_ARF_LAYERS + 1] = { 1.0, 0.70, 0.55, 0.60, + 0.60, 1.0, 1.0 }; +static void allocate_gf_group_bits(GF_GROUP *gf_group, RATE_CONTROL *const rc, + int64_t gf_group_bits, int gf_arf_bits, + int key_frame, int use_arf) { + int64_t total_group_bits = gf_group_bits; + int base_frame_bits; + const int gf_group_size = gf_group->size; + int layer_frames[MAX_ARF_LAYERS + 1] = { 0 }; + + // Subtract the extra bits set aside for ARF frames from the Group Total + if (use_arf || !key_frame) total_group_bits -= gf_arf_bits; + + if (rc->baseline_gf_interval) + base_frame_bits = (int)(total_group_bits / rc->baseline_gf_interval); + else + base_frame_bits = (int)1; + + // For key frames the frame target rate is already set and it + // is also the golden frame. + // === [frame_index == 0] === + int frame_index = 0; + if (!key_frame) { + if (rc->source_alt_ref_active) + gf_group->bit_allocation[frame_index] = 0; + else + gf_group->bit_allocation[frame_index] = + base_frame_bits + (int)(gf_arf_bits * layer_fraction[1]); + } + frame_index++; + + // Check the number of frames in each layer in case we have a + // non standard group length. + int max_arf_layer = gf_group->max_layer_depth - 1; + for (int idx = frame_index; idx < gf_group_size; ++idx) { + if ((gf_group->update_type[idx] == ARF_UPDATE) || + (gf_group->update_type[idx] == INTNL_ARF_UPDATE)) { + // max_arf_layer = AOMMAX(max_arf_layer, gf_group->layer_depth[idx]); + layer_frames[gf_group->layer_depth[idx]]++; + } + } + + // Allocate extra bits to each ARF layer + int i; + int layer_extra_bits[MAX_ARF_LAYERS + 1] = { 0 }; + for (i = 1; i <= max_arf_layer; ++i) { + double fraction = (i == max_arf_layer) ? 1.0 : layer_fraction[i]; + layer_extra_bits[i] = + (int)((gf_arf_bits * fraction) / AOMMAX(1, layer_frames[i])); + gf_arf_bits -= (int)(gf_arf_bits * fraction); + } + + // Now combine ARF layer and baseline bits to give total bits for each frame. + int arf_extra_bits; + for (int idx = frame_index; idx < gf_group_size; ++idx) { + switch (gf_group->update_type[idx]) { + case ARF_UPDATE: + case INTNL_ARF_UPDATE: + arf_extra_bits = layer_extra_bits[gf_group->layer_depth[idx]]; + gf_group->bit_allocation[idx] = base_frame_bits + arf_extra_bits; + break; + case INTNL_OVERLAY_UPDATE: + case OVERLAY_UPDATE: gf_group->bit_allocation[idx] = 0; break; + default: gf_group->bit_allocation[idx] = base_frame_bits; break; + } + } + + // Set the frame following the current GOP to 0 bit allocation. For ARF + // groups, this next frame will be overlay frame, which is the first frame + // in the next GOP. For GF group, next GOP will overwrite the rate allocation. + // Setting this frame to use 0 bit (of out the current GOP budget) will + // simplify logics in reference frame management. + gf_group->bit_allocation[gf_group_size] = 0; +} +#else +static void allocate_gf_group_bits(GF_GROUP *gf_group, RATE_CONTROL *const rc, + int64_t gf_group_bits, int gf_arf_bits, + int key_frame, int use_arf) { + int64_t total_group_bits = gf_group_bits; +
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/pass2_strategy.c
558
559
560
561
562
563
564
565
566
567
int divisor = boost >> 10; boost /= divisor; allocation_chunks /= divisor; } // Calculate the number of extra bits for use in the boosted frame or frames. return AOMMAX((int)(((int64_t)boost * total_group_bits) / allocation_chunks), 0); }
+ show +
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
#define LEAF_REDUCTION_FACTOR 0.75 static double lvl_budget_factor[MAX_PYRAMID_LVL - 1][MAX_PYRAMID_LVL - 1] = { { 1.0, 0.0, 0.0 }, { 0.6, 0.4, 0 }, { 0.45, 0.35, 0.20 } }; static void allocate_gf_group_bits( AV1_COMP *cpi, int64_t gf_group_bits, double group_error, int gf_arf_bits, const EncodeFrameParams *const frame_params) { RATE_CONTROL *const rc = &cpi->rc; const AV1EncoderConfig *const oxcf = &cpi->oxcf; TWO_PASS *const twopass = &cpi->twopass; GF_GROUP *const gf_group = &twopass->gf_group; const int key_frame = (frame_params->frame_type == KEY_FRAME); const int max_bits = frame_max_bits(&cpi->rc, &cpi->oxcf); int64_t total_group_bits = gf_group_bits; // Check if GF group has any internal arfs. int has_internal_arfs = 0; for (int i = 0; i < gf_group->size; ++i) { if (gf_group->update_type[i] == INTNL_ARF_UPDATE) { has_internal_arfs = 1; break;
+ show +
589
590
591
592
593
594
595
596
597
598
} } // For key frames the frame target rate is already set and it // is also the golden frame. // === [frame_index == 0] === int frame_index = 0; if (!key_frame) { if (rc->source_alt_ref_active) gf_group->bit_allocation[frame_index] = 0;

[CVE-2020-0470_1.diff] pass2_strategy.c #35
+#ifdef STRICT_RC + rc->kf_boost = AOMMIN(rc->kf_boost, MAX_KF_BOOST); +#endif - - // Work out the fraction of the kf group bits reserved for the inter frames - // within the group after discounting the bits for the kf itself. - if (twopass->kf_group_bits) { - twopass->kfgroup_inter_fraction = - (double)(twopass->kf_group_bits - kf_bits) / - (double)twopass->kf_group_bits; - } else { - twopass->kfgroup_inter_fraction = 1.0; - } + kf_bits = adjust_boost_bits_for_target_level(cpi, rc, kf_bits, + twopass->kf_group_bits, 0);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/pass2_strategy.c
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
} // Work out how many bits to allocate for the key frame itself. kf_bits = calculate_boost_bits((rc->frames_to_key - 1), rc->kf_boost, twopass->kf_group_bits); // printf("kf boost = %d kf_bits = %d kf_zeromotion_pct = %d\n", rc->kf_boost, // kf_bits, twopass->kf_zeromotion_pct); // Work out the fraction of the kf group bits reserved for the inter frames // within the group after discounting the bits for the kf itself.
+ show +
1445
1446
1447
1448
1449
1450
if (twopass->kf_group_bits) { twopass->kfgroup_inter_fraction = (double)(twopass->kf_group_bits - kf_bits) / (double)twopass->kf_group_bits; } else { twopass->kfgroup_inter_fraction = 1.0;
+ show +
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
} twopass->kf_group_bits -= kf_bits; // Save the bits to spend on the key frame. gf_group->bit_allocation[0] = kf_bits; gf_group->update_type[0] = KF_UPDATE; // Note the total error score of the kf group minus the key frame itself. twopass->kf_group_error_left = (int)(kf_group_err - kf_mod_err);

[CVE-2020-0478_1.diff] var_based_part.c #4
-static void set_block_size(AV1_COMP *const cpi, MACROBLOCK *const x, - MACROBLOCKD *const xd, int mi_row, int mi_col, - BLOCK_SIZE bsize) { - if (cpi->common.mi_cols > mi_col && cpi->common.mi_rows > mi_row) { - set_mode_info_offsets(cpi, x, xd, mi_row, mi_col); +static AOM_INLINE void set_block_size(AV1_COMP *const cpi, MACROBLOCK *const x, + MACROBLOCKD *const xd, int mi_row, + int mi_col, BLOCK_SIZE bsize) { + if (cpi->common.mi_params.mi_cols > mi_col && + cpi->common.mi_params.mi_rows > mi_row) { + set_mode_info_offsets(&cpi->common.mi_params, &cpi->mbmi_ext_info, x, xd, + mi_row, mi_col);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/var_based_part.c
162
163
164
165
166
167
168
169
170
171
memset(&node, 0, sizeof(node)); tree_to_node(data, bsize, &node); sum_2_variances(node.split[0], node.split[1], &node.part_variances->horz[0]); sum_2_variances(node.split[2], node.split[3], &node.part_variances->horz[1]); sum_2_variances(node.split[0], node.split[2], &node.part_variances->vert[0]); sum_2_variances(node.split[1], node.split[3], &node.part_variances->vert[1]); sum_2_variances(&node.part_variances->vert[0], &node.part_variances->vert[1], &node.part_variances->none); }
+ show +
172
173
174
175
176
static void set_block_size(AV1_COMP *const cpi, MACROBLOCK *const x, MACROBLOCKD *const xd, int mi_row, int mi_col, BLOCK_SIZE bsize) { if (cpi->common.mi_cols > mi_col && cpi->common.mi_rows > mi_row) { set_mode_info_offsets(cpi, x, xd, mi_row, mi_col);
+ show +
177
178
179
180
181
182
183
184
185
186
xd->mi[0]->sb_type = bsize; } } static int set_vt_partitioning(AV1_COMP *cpi, MACROBLOCK *const x, MACROBLOCKD *const xd, const TileInfo *const tile, void *data, BLOCK_SIZE bsize, int mi_row, int mi_col, int64_t threshold, BLOCK_SIZE bsize_min, int force_split) {

[CVE-2020-0478_1.diff] var_based_part.c #8
- -static void fill_variance_8x8avg(const uint8_t *s, int sp, const uint8_t *d, - int dp, int x16_idx, int y16_idx, v16x16 *vst, - int pixels_wide, int pixels_high, - int is_key_frame) { +static AOM_INLINE void fill_variance_8x8avg(const uint8_t *s, int sp, + const uint8_t *d, int dp, + int x16_idx, int y16_idx, + VP16x16 *vst, +#if CONFIG_AV1_HIGHBITDEPTH + int highbd_flag, +#endif + int pixels_wide, int pixels_high, + int is_key_frame) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/var_based_part.c
255
256
257
258
259
260
261
262
263
264
set_block_size(cpi, x, xd, mi_row + block_height / 2, mi_col, subsize); return 1; } } return 0; } return 0; }
+ show +
265
266
267
268
static void fill_variance_8x8avg(const uint8_t *s, int sp, const uint8_t *d, int dp, int x16_idx, int y16_idx, v16x16 *vst, int pixels_wide, int pixels_high, int is_key_frame) {
+ show +
269
270
271
272
273
274
275
276
277
278
int k; for (k = 0; k < 4; k++) { int x8_idx = x16_idx + ((k & 1) << 3); int y8_idx = y16_idx + ((k >> 1) << 3); unsigned int sse = 0; int sum = 0; if (x8_idx < pixels_wide && y8_idx < pixels_high) { int s_avg; int d_avg = 128; s_avg = aom_avg_8x8(s + y8_idx * sp + x8_idx, sp);

[CVE-2020-0478_1.diff] var_based_part.c #12
+#if CONFIG_AV1_HIGHBITDEPTH + if (highbd_flag & YV12_FLAG_HIGHBITDEPTH) { + aom_highbd_minmax_8x8(s + y8_idx * sp + x8_idx, sp, + d + y8_idx * dp + x8_idx, dp, &min, &max); + } else { + aom_minmax_8x8(s + y8_idx * sp + x8_idx, sp, d + y8_idx * dp + x8_idx, + dp, &min, &max); + } +#else +#endif -static void fill_variance_4x4avg(const uint8_t *s, int sp, const uint8_t *d, - int dp, int x8_idx, int y8_idx, v8x8 *vst, - int pixels_wide, int pixels_high, - int is_key_frame) { +static AOM_INLINE void fill_variance_4x4avg(const uint8_t *s, int sp, + const uint8_t *d, int dp, + int x8_idx, int y8_idx, VP8x8 *vst, +#if CONFIG_AV1_HIGHBITDEPTH + int highbd_flag, +#endif + int pixels_wide, int pixels_high, + int is_key_frame) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/var_based_part.c
300
301
302
303
304
305
306
307
308
309
if (x8_idx < pixels_wide && y8_idx < pixels_high) { aom_minmax_8x8(s + y8_idx * sp + x8_idx, sp, d + y8_idx * dp + x8_idx, dp, &min, &max); if ((max - min) > minmax_max) minmax_max = (max - min); if ((max - min) < minmax_min) minmax_min = (max - min); } } return (minmax_max - minmax_min); }
+ show +
310
311
312
313
static void fill_variance_4x4avg(const uint8_t *s, int sp, const uint8_t *d, int dp, int x8_idx, int y8_idx, v8x8 *vst, int pixels_wide, int pixels_high, int is_key_frame) {
+ show +
314
315
316
317
318
319
320
321
322
323
int k; for (k = 0; k < 4; k++) { int x4_idx = x8_idx + ((k & 1) << 2); int y4_idx = y8_idx + ((k >> 1) << 2); unsigned int sse = 0; int sum = 0; if (x4_idx < pixels_wide && y4_idx < pixels_high) { int s_avg; int d_avg = 128; s_avg = aom_avg_4x4(s + y4_idx * sp + x4_idx, sp);

[CVE-2020-0478_1.diff] var_based_part.c #18
- CHECK_MEM_ERROR(cm, vt, aom_calloc(1, sizeof(*vt))); + unsigned int y_sad = UINT_MAX; + unsigned int y_sad_g = UINT_MAX; + BLOCK_SIZE bsize = is_small_sb ? BLOCK_64X64 : BLOCK_128X128; - int64_t thresholds[5] = { cpi->vbp_thresholds[0], cpi->vbp_thresholds[1], - cpi->vbp_thresholds[2], cpi->vbp_thresholds[3], - cpi->vbp_thresholds[4] }; + // Ref frame used in partitioning. + MV_REFERENCE_FRAME ref_frame_partition = LAST_FRAME; + + CHECK_MEM_ERROR(cm, vt, aom_malloc(sizeof(*vt))); + + vt->split = td->vt64x64; + + int64_t thresholds[5] = { vbp_thresholds[0], vbp_thresholds[1], + vbp_thresholds[2], vbp_thresholds[3], + vbp_thresholds[4] };
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/var_based_part.c
457
458
459
460
461
462
463
464
465
466
int sp; int dp; int compute_minmax_variance = 1; int is_key_frame = frame_is_intra_only(cm); int pixels_wide = 128, pixels_high = 128; assert(cm->seq_params.sb_size == BLOCK_64X64 || cm->seq_params.sb_size == BLOCK_128X128); const int is_small_sb = (cm->seq_params.sb_size == BLOCK_64X64); const int num_64x64_blocks = is_small_sb ? 1 : 4;
+ show +
467
468
469
470
471
CHECK_MEM_ERROR(cm, vt, aom_calloc(1, sizeof(*vt))); int64_t thresholds[5] = { cpi->vbp_thresholds[0], cpi->vbp_thresholds[1], cpi->vbp_thresholds[2], cpi->vbp_thresholds[3], cpi->vbp_thresholds[4] };
+ show +
472
473
474
475
476
477
478
479
480
481
const int low_res = (cm->width <= 352 && cm->height <= 288); int variance4x4downsample[64]; int segment_id; const int num_planes = av1_num_planes(cm); segment_id = xd->mi[0]->segment_id; set_vbp_thresholds(cpi, thresholds, cm->base_qindex, content_state);

[CVE-2020-0478_1.diff] var_based_part.c #21
- mi->interp_filters = av1_make_interp_filters(BILINEAR, BILINEAR); - if (xd->mb_to_right_edge >= 0 && xd->mb_to_bottom_edge >= 0) { - const MV dummy_mv = { 0, 0 }; - av1_int_pro_motion_estimation(cpi, x, cm->seq_params.sb_size, mi_row, - mi_col, &dummy_mv); + mi->interp_filters = av1_broadcast_interp_filter(BILINEAR); + if (cpi->sf.rt_sf.estimate_motion_for_var_based_partition) { + if (xd->mb_to_right_edge >= 0 && xd->mb_to_bottom_edge >= 0) { + const MV dummy_mv = { 0, 0 }; + y_sad = av1_int_pro_motion_estimation(cpi, x, cm->seq_params.sb_size, + mi_row, mi_col, &dummy_mv); + } + } + if (y_sad == UINT_MAX) { + y_sad = cpi->fn_ptr[bsize].sdf( + x->plane[0].src.buf, x->plane[0].src.stride, xd->plane[0].pre[0].buf, + xd->plane[0].pre[0].stride); -// TODO(kyslov): bring the small SAD functionality back -#if 0 - y_sad = cpi->fn_ptr[bsize].sdf(x->plane[0].src.buf, x->plane[0].src.stride, - xd->plane[0].pre[0].buf, - xd->plane[0].pre[0].stride); -#endif - x->pred_mv[LAST_FRAME] = mi->mv[0].as_mv; + // Pick the ref frame for partitioning, use golden frame only if its + // lower sad. + if (y_sad_g < 0.9 * y_sad) { + av1_setup_pre_planes(xd, 0, yv12_g, mi_row, mi_col, + get_ref_scale_factors(cm, GOLDEN_FRAME), num_planes); + mi->ref_frame[0] = GOLDEN_FRAME; + mi->mv[0].as_int = 0; + y_sad = y_sad_g; + ref_frame_partition = GOLDEN_FRAME; + x->nonrd_prune_ref_frame_search = 0; + } else { + x->pred_mv[LAST_FRAME] = mi->mv[0].as_mv; + ref_frame_partition = LAST_FRAME; + x->nonrd_prune_ref_frame_search = + cpi->sf.rt_sf.nonrd_prune_ref_frame_search; + }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/var_based_part.c
504
505
506
507
508
509
510
511
512
513
const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_yv12_buf(cm, LAST_FRAME); assert(yv12 != NULL); av1_setup_pre_planes(xd, 0, yv12, mi_row, mi_col, get_ref_scale_factors(cm, LAST_FRAME), num_planes); mi->ref_frame[0] = LAST_FRAME; mi->ref_frame[1] = NONE_FRAME; mi->sb_type = cm->seq_params.sb_size; mi->mv[0].as_int = 0;
+ show +
514
515
516
517
518
519
520
521
522
523
524
525
526
527
mi->interp_filters = av1_make_interp_filters(BILINEAR, BILINEAR); if (xd->mb_to_right_edge >= 0 && xd->mb_to_bottom_edge >= 0) { const MV dummy_mv = { 0, 0 }; av1_int_pro_motion_estimation(cpi, x, cm->seq_params.sb_size, mi_row, mi_col, &dummy_mv); } // TODO(kyslov): bring the small SAD functionality back #if 0 y_sad = cpi->fn_ptr[bsize].sdf(x->plane[0].src.buf, x->plane[0].src.stride, xd->plane[0].pre[0].buf, xd->plane[0].pre[0].stride); #endif x->pred_mv[LAST_FRAME] = mi->mv[0].as_mv;
+ show +
528
529
530
531
532
533
534
535
536
537
set_ref_ptrs(cm, xd, mi->ref_frame[0], mi->ref_frame[1]); av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, NULL, cm->seq_params.sb_size, AOM_PLANE_Y, AOM_PLANE_Y); d = xd->plane[0].dst.buf; dp = xd->plane[0].dst.stride; // If the y_sad is very small, take 64x64 as partition and exit.

[CVE-2020-0470_1.diff] var_based_part.c #4
-static void set_block_size(AV1_COMP *const cpi, MACROBLOCK *const x, - MACROBLOCKD *const xd, int mi_row, int mi_col, - BLOCK_SIZE bsize) { - if (cpi->common.mi_cols > mi_col && cpi->common.mi_rows > mi_row) { - set_mode_info_offsets(cpi, x, xd, mi_row, mi_col); +static AOM_INLINE void set_block_size(AV1_COMP *const cpi, MACROBLOCK *const x, + MACROBLOCKD *const xd, int mi_row, + int mi_col, BLOCK_SIZE bsize) { + if (cpi->common.mi_params.mi_cols > mi_col && + cpi->common.mi_params.mi_rows > mi_row) { + set_mode_info_offsets(&cpi->common.mi_params, &cpi->mbmi_ext_info, x, xd, + mi_row, mi_col);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/var_based_part.c
162
163
164
165
166
167
168
169
170
171
memset(&node, 0, sizeof(node)); tree_to_node(data, bsize, &node); sum_2_variances(node.split[0], node.split[1], &node.part_variances->horz[0]); sum_2_variances(node.split[2], node.split[3], &node.part_variances->horz[1]); sum_2_variances(node.split[0], node.split[2], &node.part_variances->vert[0]); sum_2_variances(node.split[1], node.split[3], &node.part_variances->vert[1]); sum_2_variances(&node.part_variances->vert[0], &node.part_variances->vert[1], &node.part_variances->none); }
+ show +
172
173
174
175
176
static void set_block_size(AV1_COMP *const cpi, MACROBLOCK *const x, MACROBLOCKD *const xd, int mi_row, int mi_col, BLOCK_SIZE bsize) { if (cpi->common.mi_cols > mi_col && cpi->common.mi_rows > mi_row) { set_mode_info_offsets(cpi, x, xd, mi_row, mi_col);
+ show +
177
178
179
180
181
182
183
184
185
186
xd->mi[0]->sb_type = bsize; } } static int set_vt_partitioning(AV1_COMP *cpi, MACROBLOCK *const x, MACROBLOCKD *const xd, const TileInfo *const tile, void *data, BLOCK_SIZE bsize, int mi_row, int mi_col, int64_t threshold, BLOCK_SIZE bsize_min, int force_split) {

[CVE-2020-0470_1.diff] var_based_part.c #8
- -static void fill_variance_8x8avg(const uint8_t *s, int sp, const uint8_t *d, - int dp, int x16_idx, int y16_idx, v16x16 *vst, - int pixels_wide, int pixels_high, - int is_key_frame) { +static AOM_INLINE void fill_variance_8x8avg(const uint8_t *s, int sp, + const uint8_t *d, int dp, + int x16_idx, int y16_idx, + VP16x16 *vst, +#if CONFIG_AV1_HIGHBITDEPTH + int highbd_flag, +#endif + int pixels_wide, int pixels_high, + int is_key_frame) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/var_based_part.c
255
256
257
258
259
260
261
262
263
264
set_block_size(cpi, x, xd, mi_row + block_height / 2, mi_col, subsize); return 1; } } return 0; } return 0; }
+ show +
265
266
267
268
static void fill_variance_8x8avg(const uint8_t *s, int sp, const uint8_t *d, int dp, int x16_idx, int y16_idx, v16x16 *vst, int pixels_wide, int pixels_high, int is_key_frame) {
+ show +
269
270
271
272
273
274
275
276
277
278
int k; for (k = 0; k < 4; k++) { int x8_idx = x16_idx + ((k & 1) << 3); int y8_idx = y16_idx + ((k >> 1) << 3); unsigned int sse = 0; int sum = 0; if (x8_idx < pixels_wide && y8_idx < pixels_high) { int s_avg; int d_avg = 128; s_avg = aom_avg_8x8(s + y8_idx * sp + x8_idx, sp);

[CVE-2020-0470_1.diff] var_based_part.c #12
+#if CONFIG_AV1_HIGHBITDEPTH + if (highbd_flag & YV12_FLAG_HIGHBITDEPTH) { + aom_highbd_minmax_8x8(s + y8_idx * sp + x8_idx, sp, + d + y8_idx * dp + x8_idx, dp, &min, &max); + } else { + aom_minmax_8x8(s + y8_idx * sp + x8_idx, sp, d + y8_idx * dp + x8_idx, + dp, &min, &max); + } +#else +#endif -static void fill_variance_4x4avg(const uint8_t *s, int sp, const uint8_t *d, - int dp, int x8_idx, int y8_idx, v8x8 *vst, - int pixels_wide, int pixels_high, - int is_key_frame) { +static AOM_INLINE void fill_variance_4x4avg(const uint8_t *s, int sp, + const uint8_t *d, int dp, + int x8_idx, int y8_idx, VP8x8 *vst, +#if CONFIG_AV1_HIGHBITDEPTH + int highbd_flag, +#endif + int pixels_wide, int pixels_high, + int is_key_frame) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/var_based_part.c
300
301
302
303
304
305
306
307
308
309
if (x8_idx < pixels_wide && y8_idx < pixels_high) { aom_minmax_8x8(s + y8_idx * sp + x8_idx, sp, d + y8_idx * dp + x8_idx, dp, &min, &max); if ((max - min) > minmax_max) minmax_max = (max - min); if ((max - min) < minmax_min) minmax_min = (max - min); } } return (minmax_max - minmax_min); }
+ show +
310
311
312
313
static void fill_variance_4x4avg(const uint8_t *s, int sp, const uint8_t *d, int dp, int x8_idx, int y8_idx, v8x8 *vst, int pixels_wide, int pixels_high, int is_key_frame) {
+ show +
314
315
316
317
318
319
320
321
322
323
int k; for (k = 0; k < 4; k++) { int x4_idx = x8_idx + ((k & 1) << 2); int y4_idx = y8_idx + ((k >> 1) << 2); unsigned int sse = 0; int sum = 0; if (x4_idx < pixels_wide && y4_idx < pixels_high) { int s_avg; int d_avg = 128; s_avg = aom_avg_4x4(s + y4_idx * sp + x4_idx, sp);

[CVE-2020-0470_1.diff] var_based_part.c #18
- CHECK_MEM_ERROR(cm, vt, aom_calloc(1, sizeof(*vt))); + unsigned int y_sad = UINT_MAX; + unsigned int y_sad_g = UINT_MAX; + BLOCK_SIZE bsize = is_small_sb ? BLOCK_64X64 : BLOCK_128X128; - int64_t thresholds[5] = { cpi->vbp_thresholds[0], cpi->vbp_thresholds[1], - cpi->vbp_thresholds[2], cpi->vbp_thresholds[3], - cpi->vbp_thresholds[4] }; + // Ref frame used in partitioning. + MV_REFERENCE_FRAME ref_frame_partition = LAST_FRAME; + + CHECK_MEM_ERROR(cm, vt, aom_malloc(sizeof(*vt))); + + vt->split = td->vt64x64; + + int64_t thresholds[5] = { vbp_thresholds[0], vbp_thresholds[1], + vbp_thresholds[2], vbp_thresholds[3], + vbp_thresholds[4] };
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/var_based_part.c
457
458
459
460
461
462
463
464
465
466
int sp; int dp; int compute_minmax_variance = 1; int is_key_frame = frame_is_intra_only(cm); int pixels_wide = 128, pixels_high = 128; assert(cm->seq_params.sb_size == BLOCK_64X64 || cm->seq_params.sb_size == BLOCK_128X128); const int is_small_sb = (cm->seq_params.sb_size == BLOCK_64X64); const int num_64x64_blocks = is_small_sb ? 1 : 4;
+ show +
467
468
469
470
471
CHECK_MEM_ERROR(cm, vt, aom_calloc(1, sizeof(*vt))); int64_t thresholds[5] = { cpi->vbp_thresholds[0], cpi->vbp_thresholds[1], cpi->vbp_thresholds[2], cpi->vbp_thresholds[3], cpi->vbp_thresholds[4] };
+ show +
472
473
474
475
476
477
478
479
480
481
const int low_res = (cm->width <= 352 && cm->height <= 288); int variance4x4downsample[64]; int segment_id; const int num_planes = av1_num_planes(cm); segment_id = xd->mi[0]->segment_id; set_vbp_thresholds(cpi, thresholds, cm->base_qindex, content_state);

[CVE-2020-0470_1.diff] var_based_part.c #21
- mi->interp_filters = av1_make_interp_filters(BILINEAR, BILINEAR); - if (xd->mb_to_right_edge >= 0 && xd->mb_to_bottom_edge >= 0) { - const MV dummy_mv = { 0, 0 }; - av1_int_pro_motion_estimation(cpi, x, cm->seq_params.sb_size, mi_row, - mi_col, &dummy_mv); + mi->interp_filters = av1_broadcast_interp_filter(BILINEAR); + if (cpi->sf.rt_sf.estimate_motion_for_var_based_partition) { + if (xd->mb_to_right_edge >= 0 && xd->mb_to_bottom_edge >= 0) { + const MV dummy_mv = { 0, 0 }; + y_sad = av1_int_pro_motion_estimation(cpi, x, cm->seq_params.sb_size, + mi_row, mi_col, &dummy_mv); + } + } + if (y_sad == UINT_MAX) { + y_sad = cpi->fn_ptr[bsize].sdf( + x->plane[0].src.buf, x->plane[0].src.stride, xd->plane[0].pre[0].buf, + xd->plane[0].pre[0].stride); -// TODO(kyslov): bring the small SAD functionality back -#if 0 - y_sad = cpi->fn_ptr[bsize].sdf(x->plane[0].src.buf, x->plane[0].src.stride, - xd->plane[0].pre[0].buf, - xd->plane[0].pre[0].stride); -#endif - x->pred_mv[LAST_FRAME] = mi->mv[0].as_mv; + // Pick the ref frame for partitioning, use golden frame only if its + // lower sad. + if (y_sad_g < 0.9 * y_sad) { + av1_setup_pre_planes(xd, 0, yv12_g, mi_row, mi_col, + get_ref_scale_factors(cm, GOLDEN_FRAME), num_planes); + mi->ref_frame[0] = GOLDEN_FRAME; + mi->mv[0].as_int = 0; + y_sad = y_sad_g; + ref_frame_partition = GOLDEN_FRAME; + x->nonrd_prune_ref_frame_search = 0; + } else { + x->pred_mv[LAST_FRAME] = mi->mv[0].as_mv; + ref_frame_partition = LAST_FRAME; + x->nonrd_prune_ref_frame_search = + cpi->sf.rt_sf.nonrd_prune_ref_frame_search; + }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/var_based_part.c
504
505
506
507
508
509
510
511
512
513
const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_yv12_buf(cm, LAST_FRAME); assert(yv12 != NULL); av1_setup_pre_planes(xd, 0, yv12, mi_row, mi_col, get_ref_scale_factors(cm, LAST_FRAME), num_planes); mi->ref_frame[0] = LAST_FRAME; mi->ref_frame[1] = NONE_FRAME; mi->sb_type = cm->seq_params.sb_size; mi->mv[0].as_int = 0;
+ show +
514
515
516
517
518
519
520
521
522
523
524
525
526
527
mi->interp_filters = av1_make_interp_filters(BILINEAR, BILINEAR); if (xd->mb_to_right_edge >= 0 && xd->mb_to_bottom_edge >= 0) { const MV dummy_mv = { 0, 0 }; av1_int_pro_motion_estimation(cpi, x, cm->seq_params.sb_size, mi_row, mi_col, &dummy_mv); } // TODO(kyslov): bring the small SAD functionality back #if 0 y_sad = cpi->fn_ptr[bsize].sdf(x->plane[0].src.buf, x->plane[0].src.stride, xd->plane[0].pre[0].buf, xd->plane[0].pre[0].stride); #endif x->pred_mv[LAST_FRAME] = mi->mv[0].as_mv;
+ show +
528
529
530
531
532
533
534
535
536
537
set_ref_ptrs(cm, xd, mi->ref_frame[0], mi->ref_frame[1]); av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, NULL, cm->seq_params.sb_size, AOM_PLANE_Y, AOM_PLANE_Y); d = xd->plane[0].dst.buf; dp = xd->plane[0].dst.stride; // If the y_sad is very small, take 64x64 as partition and exit.

[CVE-2020-0478_1.diff] encodemv.c #1
-static INLINE int mv_class_base(MV_CLASS_TYPE c) { - return c ? CLASS0_SIZE << (c + 2) : 0; +static void update_mv_component_stats(int comp, nmv_component *mvcomp, + MvSubpelPrecision precision) { + assert(comp != 0); + int offset; + const int sign = comp < 0; + const int mag = sign ? -comp : comp; + const int mv_class = av1_get_mv_class(mag - 1, &offset); + const int d = offset >> 3; // int mv data + const int fr = (offset >> 1) & 3; // fractional mv data + const int hp = offset & 1; // high precision mv data + + // Sign + update_cdf(mvcomp->sign_cdf, sign, 2); + + // Class + update_cdf(mvcomp->classes_cdf, mv_class, MV_CLASSES); + + // Integer bits + if (mv_class == MV_CLASS_0) { + update_cdf(mvcomp->class0_cdf, d, CLASS0_SIZE); + } else { + const int n = mv_class + CLASS0_BITS - 1; // number of bits + for (int i = 0; i < n; ++i) + update_cdf(mvcomp->bits_cdf[i], (d >> i) & 1, 2); + } + // Fractional bits + if (precision > MV_SUBPEL_NONE) { + aom_cdf_prob *fp_cdf = + mv_class == MV_CLASS_0 ? mvcomp->class0_fp_cdf[d] : mvcomp->fp_cdf; + update_cdf(fp_cdf, fr, MV_FP_SIZE); + } + + // High precision bit + if (precision > MV_SUBPEL_LOW_PRECISION) { + aom_cdf_prob *hp_cdf = + mv_class == MV_CLASS_0 ? mvcomp->class0_hp_cdf : mvcomp->hp_cdf; + update_cdf(hp_cdf, hp, 2); + } -// If n != 0, returns the floor of log base 2 of n. If n == 0, returns 0. -static INLINE uint8_t log_in_base_2(unsigned int n) { - // get_msb() is only valid when n != 0. - return n == 0 ? 0 : get_msb(n); -} +void av1_update_mv_stats(const MV *mv, const MV *ref, nmv_context *mvctx, + MvSubpelPrecision precision) { + const MV diff = { mv->row - ref->row, mv->col - ref->col }; + const MV_JOINT_TYPE j = av1_get_mv_joint(&diff); -static INLINE MV_CLASS_TYPE get_mv_class(int z, int *offset) { - const MV_CLASS_TYPE c = (z >= CLASS0_SIZE * 4096) - ? MV_CLASS_10 - : (MV_CLASS_TYPE)log_in_base_2(z >> 3); - if (offset) *offset = z - mv_class_base(c); - return c; + update_cdf(mvctx->joints_cdf, j, MV_JOINTS); + + if (mv_joint_vertical(j)) + update_mv_component_stats(diff.row, &mvctx->comps[0], precision); + + if (mv_joint_horizontal(j)) + update_mv_component_stats(diff.col, &mvctx->comps[1], precision);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodemv.c
13
14
15
16
17
18
19
20
21
22
#include "av1/common/common.h" #include "av1/common/entropymode.h" #include "av1/encoder/cost.h" #include "av1/encoder/encodemv.h" #include "aom_dsp/aom_dsp_common.h" #include "aom_ports/bitops.h"
+ show +
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
static INLINE int mv_class_base(MV_CLASS_TYPE c) { return c ? CLASS0_SIZE << (c + 2) : 0; } // If n != 0, returns the floor of log base 2 of n. If n == 0, returns 0. static INLINE uint8_t log_in_base_2(unsigned int n) { // get_msb() is only valid when n != 0. return n == 0 ? 0 : get_msb(n); } static INLINE MV_CLASS_TYPE get_mv_class(int z, int *offset) { const MV_CLASS_TYPE c = (z >= CLASS0_SIZE * 4096) ? MV_CLASS_10 : (MV_CLASS_TYPE)log_in_base_2(z >> 3); if (offset) *offset = z - mv_class_base(c); return c;
+ show +
39
40
41
42
43
44
45
46
47
48
} static void encode_mv_component(aom_writer *w, int comp, nmv_component *mvcomp, MvSubpelPrecision precision) { assert(comp != 0); int offset; const int sign = comp < 0; const int mag = sign ? -comp : comp; const int mv_class = get_mv_class(mag - 1, &offset); const int d = offset >> 3; // int mv data

[CVE-2020-0470_1.diff] encodemv.c #1
-static INLINE int mv_class_base(MV_CLASS_TYPE c) { - return c ? CLASS0_SIZE << (c + 2) : 0; +static void update_mv_component_stats(int comp, nmv_component *mvcomp, + MvSubpelPrecision precision) { + assert(comp != 0); + int offset; + const int sign = comp < 0; + const int mag = sign ? -comp : comp; + const int mv_class = av1_get_mv_class(mag - 1, &offset); + const int d = offset >> 3; // int mv data + const int fr = (offset >> 1) & 3; // fractional mv data + const int hp = offset & 1; // high precision mv data + + // Sign + update_cdf(mvcomp->sign_cdf, sign, 2); + + // Class + update_cdf(mvcomp->classes_cdf, mv_class, MV_CLASSES); + + // Integer bits + if (mv_class == MV_CLASS_0) { + update_cdf(mvcomp->class0_cdf, d, CLASS0_SIZE); + } else { + const int n = mv_class + CLASS0_BITS - 1; // number of bits + for (int i = 0; i < n; ++i) + update_cdf(mvcomp->bits_cdf[i], (d >> i) & 1, 2); + } + // Fractional bits + if (precision > MV_SUBPEL_NONE) { + aom_cdf_prob *fp_cdf = + mv_class == MV_CLASS_0 ? mvcomp->class0_fp_cdf[d] : mvcomp->fp_cdf; + update_cdf(fp_cdf, fr, MV_FP_SIZE); + } + + // High precision bit + if (precision > MV_SUBPEL_LOW_PRECISION) { + aom_cdf_prob *hp_cdf = + mv_class == MV_CLASS_0 ? mvcomp->class0_hp_cdf : mvcomp->hp_cdf; + update_cdf(hp_cdf, hp, 2); + } -// If n != 0, returns the floor of log base 2 of n. If n == 0, returns 0. -static INLINE uint8_t log_in_base_2(unsigned int n) { - // get_msb() is only valid when n != 0. - return n == 0 ? 0 : get_msb(n); -} +void av1_update_mv_stats(const MV *mv, const MV *ref, nmv_context *mvctx, + MvSubpelPrecision precision) { + const MV diff = { mv->row - ref->row, mv->col - ref->col }; + const MV_JOINT_TYPE j = av1_get_mv_joint(&diff); -static INLINE MV_CLASS_TYPE get_mv_class(int z, int *offset) { - const MV_CLASS_TYPE c = (z >= CLASS0_SIZE * 4096) - ? MV_CLASS_10 - : (MV_CLASS_TYPE)log_in_base_2(z >> 3); - if (offset) *offset = z - mv_class_base(c); - return c; + update_cdf(mvctx->joints_cdf, j, MV_JOINTS); + + if (mv_joint_vertical(j)) + update_mv_component_stats(diff.row, &mvctx->comps[0], precision); + + if (mv_joint_horizontal(j)) + update_mv_component_stats(diff.col, &mvctx->comps[1], precision);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodemv.c
13
14
15
16
17
18
19
20
21
22
#include "av1/common/common.h" #include "av1/common/entropymode.h" #include "av1/encoder/cost.h" #include "av1/encoder/encodemv.h" #include "aom_dsp/aom_dsp_common.h" #include "aom_ports/bitops.h"
+ show +
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
static INLINE int mv_class_base(MV_CLASS_TYPE c) { return c ? CLASS0_SIZE << (c + 2) : 0; } // If n != 0, returns the floor of log base 2 of n. If n == 0, returns 0. static INLINE uint8_t log_in_base_2(unsigned int n) { // get_msb() is only valid when n != 0. return n == 0 ? 0 : get_msb(n); } static INLINE MV_CLASS_TYPE get_mv_class(int z, int *offset) { const MV_CLASS_TYPE c = (z >= CLASS0_SIZE * 4096) ? MV_CLASS_10 : (MV_CLASS_TYPE)log_in_base_2(z >> 3); if (offset) *offset = z - mv_class_base(c); return c;
+ show +
39
40
41
42
43
44
45
46
47
48
} static void encode_mv_component(aom_writer *w, int comp, nmv_component *mvcomp, MvSubpelPrecision precision) { assert(comp != 0); int offset; const int sign = comp < 0; const int mag = sign ? -comp : comp; const int mv_class = get_mv_class(mag - 1, &offset); const int d = offset >> 3; // int mv data

[CVE-2020-0478_1.diff] av1_quantize.c #8
+#endif // CONFIG_AV1_HIGHBITDEPTH +void av1_quantize_lp_c(const int16_t *coeff_ptr, intptr_t n_coeffs, + const int16_t *round_ptr, const int16_t *quant_ptr, + int16_t *qcoeff_ptr, int16_t *dqcoeff_ptr, + const int16_t *dequant_ptr, uint16_t *eob_ptr, + const int16_t *scan) { + int eob = -1; + + memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); + memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr)); + + // Quantization pass: All coefficients with index >= zero_flag are + // skippable. Note: zero_flag can be zero. + for (int i = 0; i < n_coeffs; i++) { + const int rc = scan[i]; + const int coeff = coeff_ptr[rc]; + const int coeff_sign = AOMSIGN(coeff); + const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign; + + int tmp = clamp(abs_coeff + round_ptr[rc != 0], INT16_MIN, INT16_MAX); + tmp = (tmp * quant_ptr[rc != 0]) >> 16; + + qcoeff_ptr[rc] = (tmp ^ coeff_sign) - coeff_sign; + dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0]; + + if (tmp) eob = i; + } + *eob_ptr = eob + 1; +} + - if (n_coeffs < 16) { - // TODO(jingning): Need SIMD implementation for smaller block size - // quantization. - quantize_fp_helper_c( - coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX, - p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, - p->dequant_QTX, eob_ptr, sc->scan, sc->iscan, NULL, NULL, 0); - } else { - av1_quantize_fp(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX, - p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr, - dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, - sc->iscan); - } + av1_quantize_fp(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX, + p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr, + dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, + sc->iscan);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/av1_quantize.c
221
222
223
224
225
226
227
228
229
230
const qm_val_t *qm_ptr = qparam->qmatrix; const qm_val_t *iqm_ptr = qparam->iqmatrix; if (qm_ptr != NULL && iqm_ptr != NULL) { quantize_fp_helper_c(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX, p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, sc->iscan, qm_ptr, iqm_ptr, qparam->log_scale); } else { switch (qparam->log_scale) { case 0:
+ show +
231
232
233
234
235
236
237
238
239
240
241
242
if (n_coeffs < 16) { // TODO(jingning): Need SIMD implementation for smaller block size // quantization. quantize_fp_helper_c( coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX, p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, sc->iscan, NULL, NULL, 0); } else { av1_quantize_fp(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX, p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, sc->iscan);
+ show +
243
244
245
246
247
248
249
250
251
252
} break; case 1: av1_quantize_fp_32x32(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX, p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, sc->iscan); break; case 2: av1_quantize_fp_64x64(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX,

[CVE-2020-0478_1.diff] av1_quantize.c #11
- quantize_b_helper_c(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX, - p->quant_QTX, p->quant_shift_QTX, qcoeff_ptr, - dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, - sc->iscan, qm_ptr, iqm_ptr, qparam->log_scale); + aom_quantize_b_helper_c(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX, + p->quant_QTX, p->quant_shift_QTX, qcoeff_ptr, + dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, + sc->iscan, qm_ptr, iqm_ptr, qparam->log_scale);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/av1_quantize.c
291
292
293
294
295
296
297
298
299
300
aom_quantize_b_64x64_adaptive_c( coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX, p->quant_QTX, p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, sc->iscan); break; default: assert(0); } } } else { if (qm_ptr != NULL && iqm_ptr != NULL) {
+ show +
301
302
303
304
quantize_b_helper_c(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX, p->quant_QTX, p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, sc->iscan, qm_ptr, iqm_ptr, qparam->log_scale);
+ show +
305
306
307
308
309
310
311
312
313
314
} else { switch (qparam->log_scale) { case 0: aom_quantize_b(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX, p->quant_QTX, p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, sc->iscan); break; case 1: aom_quantize_b_32x32(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX,

[CVE-2020-0478_1.diff] av1_quantize.c #14
+#if CONFIG_AV1_HIGHBITDEPTH - if (n_coeffs < 16) { - // TODO(jingning): Need SIMD implementation for smaller block size - // quantization. - av1_highbd_quantize_fp_c( - coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX, p->quant_fp_QTX, - p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr, - sc->scan, sc->iscan, qparam->log_scale); - return; - }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/av1_quantize.c
383
384
385
386
387
388
389
390
391
392
const SCAN_ORDER *sc, const QUANT_PARAM *qparam) { const qm_val_t *qm_ptr = qparam->qmatrix; const qm_val_t *iqm_ptr = qparam->iqmatrix; if (qm_ptr != NULL && iqm_ptr != NULL) { highbd_quantize_fp_helper_c( coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX, p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, sc->iscan, qm_ptr, iqm_ptr, qparam->log_scale); } else {
+ show +
393
394
395
396
397
398
399
400
if (n_coeffs < 16) { // TODO(jingning): Need SIMD implementation for smaller block size // quantization. av1_highbd_quantize_fp_c( coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX, p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, sc->iscan, qparam->log_scale); return;
+ show +
401
402
403
404
405
406
407
408
409
410
} av1_highbd_quantize_fp(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX, p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, sc->iscan, qparam->log_scale); } } void av1_highbd_quantize_b_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const MACROBLOCK_PLANE *p,

[CVE-2020-0470_1.diff] av1_quantize.c #8
+#endif // CONFIG_AV1_HIGHBITDEPTH +void av1_quantize_lp_c(const int16_t *coeff_ptr, intptr_t n_coeffs, + const int16_t *round_ptr, const int16_t *quant_ptr, + int16_t *qcoeff_ptr, int16_t *dqcoeff_ptr, + const int16_t *dequant_ptr, uint16_t *eob_ptr, + const int16_t *scan) { + int eob = -1; + + memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); + memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr)); + + // Quantization pass: All coefficients with index >= zero_flag are + // skippable. Note: zero_flag can be zero. + for (int i = 0; i < n_coeffs; i++) { + const int rc = scan[i]; + const int coeff = coeff_ptr[rc]; + const int coeff_sign = AOMSIGN(coeff); + const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign; + + int tmp = clamp(abs_coeff + round_ptr[rc != 0], INT16_MIN, INT16_MAX); + tmp = (tmp * quant_ptr[rc != 0]) >> 16; + + qcoeff_ptr[rc] = (tmp ^ coeff_sign) - coeff_sign; + dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0]; + + if (tmp) eob = i; + } + *eob_ptr = eob + 1; +} + - if (n_coeffs < 16) { - // TODO(jingning): Need SIMD implementation for smaller block size - // quantization. - quantize_fp_helper_c( - coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX, - p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, - p->dequant_QTX, eob_ptr, sc->scan, sc->iscan, NULL, NULL, 0); - } else { - av1_quantize_fp(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX, - p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr, - dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, - sc->iscan); - } + av1_quantize_fp(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX, + p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr, + dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, + sc->iscan);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/av1_quantize.c
221
222
223
224
225
226
227
228
229
230
const qm_val_t *qm_ptr = qparam->qmatrix; const qm_val_t *iqm_ptr = qparam->iqmatrix; if (qm_ptr != NULL && iqm_ptr != NULL) { quantize_fp_helper_c(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX, p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, sc->iscan, qm_ptr, iqm_ptr, qparam->log_scale); } else { switch (qparam->log_scale) { case 0:
+ show +
231
232
233
234
235
236
237
238
239
240
241
242
if (n_coeffs < 16) { // TODO(jingning): Need SIMD implementation for smaller block size // quantization. quantize_fp_helper_c( coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX, p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, sc->iscan, NULL, NULL, 0); } else { av1_quantize_fp(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX, p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, sc->iscan);
+ show +
243
244
245
246
247
248
249
250
251
252
} break; case 1: av1_quantize_fp_32x32(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX, p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, sc->iscan); break; case 2: av1_quantize_fp_64x64(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX,

[CVE-2020-0470_1.diff] av1_quantize.c #11
- quantize_b_helper_c(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX, - p->quant_QTX, p->quant_shift_QTX, qcoeff_ptr, - dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, - sc->iscan, qm_ptr, iqm_ptr, qparam->log_scale); + aom_quantize_b_helper_c(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX, + p->quant_QTX, p->quant_shift_QTX, qcoeff_ptr, + dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, + sc->iscan, qm_ptr, iqm_ptr, qparam->log_scale);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/av1_quantize.c
291
292
293
294
295
296
297
298
299
300
aom_quantize_b_64x64_adaptive_c( coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX, p->quant_QTX, p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, sc->iscan); break; default: assert(0); } } } else { if (qm_ptr != NULL && iqm_ptr != NULL) {
+ show +
301
302
303
304
quantize_b_helper_c(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX, p->quant_QTX, p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, sc->iscan, qm_ptr, iqm_ptr, qparam->log_scale);
+ show +
305
306
307
308
309
310
311
312
313
314
} else { switch (qparam->log_scale) { case 0: aom_quantize_b(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX, p->quant_QTX, p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, sc->iscan); break; case 1: aom_quantize_b_32x32(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX,

[CVE-2020-0470_1.diff] av1_quantize.c #14
+#if CONFIG_AV1_HIGHBITDEPTH - if (n_coeffs < 16) { - // TODO(jingning): Need SIMD implementation for smaller block size - // quantization. - av1_highbd_quantize_fp_c( - coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX, p->quant_fp_QTX, - p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr, - sc->scan, sc->iscan, qparam->log_scale); - return; - }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/av1_quantize.c
383
384
385
386
387
388
389
390
391
392
const SCAN_ORDER *sc, const QUANT_PARAM *qparam) { const qm_val_t *qm_ptr = qparam->qmatrix; const qm_val_t *iqm_ptr = qparam->iqmatrix; if (qm_ptr != NULL && iqm_ptr != NULL) { highbd_quantize_fp_helper_c( coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX, p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, sc->iscan, qm_ptr, iqm_ptr, qparam->log_scale); } else {
+ show +
393
394
395
396
397
398
399
400
if (n_coeffs < 16) { // TODO(jingning): Need SIMD implementation for smaller block size // quantization. av1_highbd_quantize_fp_c( coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX, p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, sc->iscan, qparam->log_scale); return;
+ show +
401
402
403
404
405
406
407
408
409
410
} av1_highbd_quantize_fp(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX, p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan, sc->iscan, qparam->log_scale); } } void av1_highbd_quantize_b_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const MACROBLOCK_PLANE *p,

[CVE-2020-0478_1.diff] encoder.c #13
-static void enc_setup_mi(AV1_COMMON *cm) { - int i; - int mi_rows_sb_aligned = calc_mi_size(cm->mi_rows); - cm->mi = cm->mip; - memset(cm->mip, 0, cm->mi_stride * mi_rows_sb_aligned * sizeof(*cm->mip)); - cm->prev_mi = cm->prev_mip; - // Clear top border row - memset(cm->prev_mip, 0, sizeof(*cm->prev_mip) * cm->mi_stride); - // Clear left border column - for (i = 0; i < mi_rows_sb_aligned; ++i) - memset(&cm->prev_mip[i * cm->mi_stride], 0, sizeof(*cm->prev_mip)); - cm->mi_grid_visible = cm->mi_grid_base; - cm->prev_mi_grid_visible = cm->prev_mi_grid_base; +static void set_mb_mi(CommonModeInfoParams *mi_params, int width, int height) { + // Ensure that the decoded width and height are both multiples of + // 8 luma pixels (note: this may only be a multiple of 4 chroma pixels if + // subsampling is used). + // This simplifies the implementation of various experiments, + // eg. cdef, which operates on units of 8x8 luma pixels. + const int aligned_width = ALIGN_POWER_OF_TWO(width, 3); + const int aligned_height = ALIGN_POWER_OF_TWO(height, 3); - memset(cm->mi_grid_base, 0, - cm->mi_stride * mi_rows_sb_aligned * sizeof(*cm->mi_grid_base)); + mi_params->mi_cols = aligned_width >> MI_SIZE_LOG2; + mi_params->mi_rows = aligned_height >> MI_SIZE_LOG2; + mi_params->mi_stride = calc_mi_size(mi_params->mi_cols); + + mi_params->mb_cols = (mi_params->mi_cols + 2) >> 2; + mi_params->mb_rows = (mi_params->mi_rows + 2) >> 2; + mi_params->MBs = mi_params->mb_rows * mi_params->mb_cols; + + const int mi_alloc_size_1d = mi_size_wide[mi_params->mi_alloc_bsize]; + mi_params->mi_alloc_stride = + (mi_params->mi_stride + mi_alloc_size_1d - 1) / mi_alloc_size_1d; + + assert(mi_size_wide[mi_params->mi_alloc_bsize] == + mi_size_high[mi_params->mi_alloc_bsize]); + +#if CONFIG_LPF_MASK + av1_alloc_loop_filter_mask(mi_params); +#endif -static int enc_alloc_mi(AV1_COMMON *cm, int mi_size) { - cm->mip = aom_calloc(mi_size, sizeof(*cm->mip)); - if (!cm->mip) return 1; - cm->prev_mip = aom_calloc(mi_size, sizeof(*cm->prev_mip)); - if (!cm->prev_mip) return 1; - cm->mi_alloc_size = mi_size; +static void enc_set_mb_mi(CommonModeInfoParams *mi_params, int width, + int height) { + const int is_4k_or_larger = AOMMIN(width, height) >= 2160; + mi_params->mi_alloc_bsize = is_4k_or_larger ? BLOCK_8X8 : BLOCK_4X4; - cm->mi_grid_base = - (MB_MODE_INFO **)aom_calloc(mi_size, sizeof(MB_MODE_INFO *)); - if (!cm->mi_grid_base) return 1; - cm->prev_mi_grid_base = - (MB_MODE_INFO **)aom_calloc(mi_size, sizeof(MB_MODE_INFO *)); - if (!cm->prev_mi_grid_base) return 1; - - return 0; + set_mb_mi(mi_params, width, height); -static void enc_free_mi(AV1_COMMON *cm) { - aom_free(cm->mip); - cm->mip = NULL; - aom_free(cm->prev_mip); - cm->prev_mip = NULL; - aom_free(cm->mi_grid_base); - cm->mi_grid_base = NULL; - aom_free(cm->prev_mi_grid_base); - cm->prev_mi_grid_base = NULL; - cm->mi_alloc_size = 0; +static void stat_stage_set_mb_mi(CommonModeInfoParams *mi_params, int width, + int height) { + mi_params->mi_alloc_bsize = BLOCK_16X16; + + set_mb_mi(mi_params, width, height); -static void swap_mi_and_prev_mi(AV1_COMMON *cm) { - // Current mip will be the prev_mip for the next frame. - MB_MODE_INFO **temp_base = cm->prev_mi_grid_base; - MB_MODE_INFO *temp = cm->prev_mip; - cm->prev_mip = cm->mip; - cm->mip = temp; +static void enc_setup_mi(CommonModeInfoParams *mi_params) { + const int mi_grid_size = + mi_params->mi_stride * calc_mi_size(mi_params->mi_rows); + memset(mi_params->mi_alloc, 0, + mi_params->mi_alloc_size * sizeof(*mi_params->mi_alloc)); + memset(mi_params->mi_grid_base, 0, + mi_grid_size * sizeof(*mi_params->mi_grid_base)); + memset(mi_params->tx_type_map, 0, + mi_grid_size * sizeof(*mi_params->tx_type_map)); +} - // Update the upper left visible macroblock ptrs. - cm->mi = cm->mip; - cm->prev_mi = cm->prev_mip; - - cm->prev_mi_grid_base = cm->mi_grid_base; - cm->mi_grid_base = temp_base; - cm->mi_grid_visible = cm->mi_grid_base; - cm->prev_mi_grid_visible = cm->prev_mi_grid_base; +static void enc_free_mi(CommonModeInfoParams *mi_params) { + aom_free(mi_params->mi_alloc); + mi_params->mi_alloc = NULL; + aom_free(mi_params->mi_grid_base); + mi_params->mi_grid_base = NULL; + mi_params->mi_alloc_size = 0; + aom_free(mi_params->tx_type_map); + mi_params->tx_type_map = NULL;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encoder.c
370
371
372
373
374
375
376
377
378
379
} else { *cm->fc = primary_ref_buf->frame_context; } } av1_zero(cm->cur_frame->interp_filter_selected); cm->prev_frame = get_primary_ref_frame_buf(cm); cpi->vaq_refresh = 0; }
+ show +
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
static void enc_setup_mi(AV1_COMMON *cm) { int i; int mi_rows_sb_aligned = calc_mi_size(cm->mi_rows); cm->mi = cm->mip; memset(cm->mip, 0, cm->mi_stride * mi_rows_sb_aligned * sizeof(*cm->mip)); cm->prev_mi = cm->prev_mip; // Clear top border row memset(cm->prev_mip, 0, sizeof(*cm->prev_mip) * cm->mi_stride); // Clear left border column for (i = 0; i < mi_rows_sb_aligned; ++i) memset(&cm->prev_mip[i * cm->mi_stride], 0, sizeof(*cm->prev_mip)); cm->mi_grid_visible = cm->mi_grid_base; cm->prev_mi_grid_visible = cm->prev_mi_grid_base; memset(cm->mi_grid_base, 0, cm->mi_stride * mi_rows_sb_aligned * sizeof(*cm->mi_grid_base)); } static int enc_alloc_mi(AV1_COMMON *cm, int mi_size) { cm->mip = aom_calloc(mi_size, sizeof(*cm->mip)); if (!cm->mip) return 1; cm->prev_mip = aom_calloc(mi_size, sizeof(*cm->prev_mip)); if (!cm->prev_mip) return 1; cm->mi_alloc_size = mi_size; cm->mi_grid_base = (MB_MODE_INFO **)aom_calloc(mi_size, sizeof(MB_MODE_INFO *)); if (!cm->mi_grid_base) return 1; cm->prev_mi_grid_base = (MB_MODE_INFO **)aom_calloc(mi_size, sizeof(MB_MODE_INFO *)); if (!cm->prev_mi_grid_base) return 1; return 0; } static void enc_free_mi(AV1_COMMON *cm) { aom_free(cm->mip); cm->mip = NULL; aom_free(cm->prev_mip); cm->prev_mip = NULL; aom_free(cm->mi_grid_base); cm->mi_grid_base = NULL; aom_free(cm->prev_mi_grid_base); cm->prev_mi_grid_base = NULL; cm->mi_alloc_size = 0; } static void swap_mi_and_prev_mi(AV1_COMMON *cm) { // Current mip will be the prev_mip for the next frame. MB_MODE_INFO **temp_base = cm->prev_mi_grid_base; MB_MODE_INFO *temp = cm->prev_mip; cm->prev_mip = cm->mip; cm->mip = temp; // Update the upper left visible macroblock ptrs. cm->mi = cm->mip; cm->prev_mi = cm->prev_mip; cm->prev_mi_grid_base = cm->mi_grid_base; cm->mi_grid_base = temp_base; cm->mi_grid_visible = cm->mi_grid_base; cm->prev_mi_grid_visible = cm->prev_mi_grid_base;
+ show +
442
443
444
445
446
447
448
449
450
451
} void av1_initialize_enc(void) { av1_rtcd(); aom_dsp_rtcd(); aom_scale_rtcd(); av1_init_intra_predictors(); av1_init_me_luts(); av1_rc_init_minq_luts(); av1_init_wedge_masks();

[CVE-2020-0478_1.diff] encoder.c #14
-static void dealloc_context_buffers_ext(AV1_COMP *cpi) { - if (cpi->mbmi_ext_base) { - aom_free(cpi->mbmi_ext_base); - cpi->mbmi_ext_base = NULL; +static void dealloc_context_buffers_ext(MBMIExtFrameBufferInfo *mbmi_ext_info) { + if (mbmi_ext_info->frame_base) { + aom_free(mbmi_ext_info->frame_base); + mbmi_ext_info->frame_base = NULL; + mbmi_ext_info->alloc_size = 0; -static void alloc_context_buffers_ext(AV1_COMP *cpi) { - AV1_COMMON *cm = &cpi->common; - int mi_size = cm->mi_cols * cm->mi_rows; +static void alloc_context_buffers_ext(AV1_COMMON *cm, + MBMIExtFrameBufferInfo *mbmi_ext_info) { + const CommonModeInfoParams *const mi_params = &cm->mi_params; - dealloc_context_buffers_ext(cpi); - CHECK_MEM_ERROR(cm, cpi->mbmi_ext_base, - aom_calloc(mi_size, sizeof(*cpi->mbmi_ext_base))); + const int mi_alloc_size_1d = mi_size_wide[mi_params->mi_alloc_bsize]; + const int mi_alloc_rows = + (mi_params->mi_rows + mi_alloc_size_1d - 1) / mi_alloc_size_1d; + const int mi_alloc_cols = + (mi_params->mi_cols + mi_alloc_size_1d - 1) / mi_alloc_size_1d; + const int new_ext_mi_size = mi_alloc_rows * mi_alloc_cols; + + if (new_ext_mi_size > mbmi_ext_info->alloc_size) { + dealloc_context_buffers_ext(mbmi_ext_info); + CHECK_MEM_ERROR( + cm, mbmi_ext_info->frame_base, + aom_calloc(new_ext_mi_size, sizeof(*mbmi_ext_info->frame_base))); + mbmi_ext_info->alloc_size = new_ext_mi_size; + } + // The stride needs to be updated regardless of whether new allocation + // happened or not. + mbmi_ext_info->stride = mi_alloc_cols;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encoder.c
444
445
446
447
448
449
450
451
452
453
void av1_initialize_enc(void) { av1_rtcd(); aom_dsp_rtcd(); aom_scale_rtcd(); av1_init_intra_predictors(); av1_init_me_luts(); av1_rc_init_minq_luts(); av1_init_wedge_masks(); }
+ show +
454
455
456
457
458
459
460
461
462
463
464
465
466
467
static void dealloc_context_buffers_ext(AV1_COMP *cpi) { if (cpi->mbmi_ext_base) { aom_free(cpi->mbmi_ext_base); cpi->mbmi_ext_base = NULL; } } static void alloc_context_buffers_ext(AV1_COMP *cpi) { AV1_COMMON *cm = &cpi->common; int mi_size = cm->mi_cols * cm->mi_rows; dealloc_context_buffers_ext(cpi); CHECK_MEM_ERROR(cm, cpi->mbmi_ext_base, aom_calloc(mi_size, sizeof(*cpi->mbmi_ext_base)));
+ show +
468
469
470
471
472
473
474
475
476
477
} static void reset_film_grain_chroma_params(aom_film_grain_t *pars) { pars->num_cr_points = 0; pars->cr_mult = 0; pars->cr_luma_mult = 0; memset(pars->scaling_points_cr, 0, sizeof(pars->scaling_points_cr)); memset(pars->ar_coeffs_cr, 0, sizeof(pars->ar_coeffs_cr)); pars->num_cb_points = 0; pars->cb_mult = 0;

[CVE-2020-0478_1.diff] encoder.c #20
-} -static void save_coding_context(AV1_COMP *cpi) { - CODING_CONTEXT *const cc = &cpi->coding_context; - AV1_COMMON *cm = &cpi->common; + for (int i = 0; i < MAX_NUM_OPERATING_POINTS; ++i) { + aom_free(cpi->level_params.level_info[i]); + } - // Stores a snapshot of key state variables which can subsequently be - // restored with a call to av1_restore_coding_context. These functions are - // intended for use in a re-code loop in av1_compress_frame where the - // quantizer value is adjusted between loop iterations. - av1_copy(cc->nmv_vec_cost, cpi->td.mb.nmv_vec_cost); - av1_copy(cc->nmv_costs, cpi->nmv_costs); - av1_copy(cc->nmv_costs_hp, cpi->nmv_costs_hp); - - cc->fc = *cm->fc; -} - -static void restore_coding_context(AV1_COMP *cpi) { - CODING_CONTEXT *const cc = &cpi->coding_context; - AV1_COMMON *cm = &cpi->common; - - // Restore key state variables to the snapshot state stored in the - // previous call to av1_save_coding_context. - av1_copy(cpi->td.mb.nmv_vec_cost, cc->nmv_vec_cost); - av1_copy(cpi->nmv_costs, cc->nmv_costs); - av1_copy(cpi->nmv_costs_hp, cc->nmv_costs_hp); - - *cm->fc = cc->fc; + if (cpi->use_svc) av1_free_svc_cyclic_refresh(cpi);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encoder.c
597
598
599
600
601
602
603
604
605
606
aom_denoise_and_model_free(cpi->denoise_and_model); cpi->denoise_and_model = NULL; } #endif if (cpi->film_grain_table) { aom_film_grain_table_free(cpi->film_grain_table); cpi->film_grain_table = NULL; } }
+ show +
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
static void save_coding_context(AV1_COMP *cpi) { CODING_CONTEXT *const cc = &cpi->coding_context; AV1_COMMON *cm = &cpi->common; // Stores a snapshot of key state variables which can subsequently be // restored with a call to av1_restore_coding_context. These functions are // intended for use in a re-code loop in av1_compress_frame where the // quantizer value is adjusted between loop iterations. av1_copy(cc->nmv_vec_cost, cpi->td.mb.nmv_vec_cost); av1_copy(cc->nmv_costs, cpi->nmv_costs); av1_copy(cc->nmv_costs_hp, cpi->nmv_costs_hp); cc->fc = *cm->fc; } static void restore_coding_context(AV1_COMP *cpi) { CODING_CONTEXT *const cc = &cpi->coding_context; AV1_COMMON *cm = &cpi->common; // Restore key state variables to the snapshot state stored in the // previous call to av1_save_coding_context. av1_copy(cpi->td.mb.nmv_vec_cost, cc->nmv_vec_cost); av1_copy(cpi->nmv_costs, cc->nmv_costs); av1_copy(cpi->nmv_costs_hp, cc->nmv_costs_hp); *cm->fc = cc->fc;
+ show +
633
634
635
636
637
638
639
640
641
642
} static void configure_static_seg_features(AV1_COMP *cpi) { AV1_COMMON *const cm = &cpi->common; const RATE_CONTROL *const rc = &cpi->rc; struct segmentation *const seg = &cm->seg; int high_q = (int)(rc->avg_q > 48.0); int qi_delta;

[CVE-2020-0478_1.diff] encoder.c #51
- cpi->first_time_stamp_ever = INT64_MAX; - - cpi->td.mb.nmvcost[0] = &cpi->nmv_costs[0][MV_MAX]; - cpi->td.mb.nmvcost[1] = &cpi->nmv_costs[1][MV_MAX]; - cpi->td.mb.nmvcost_hp[0] = &cpi->nmv_costs_hp[0][MV_MAX]; - cpi->td.mb.nmvcost_hp[1] = &cpi->nmv_costs_hp[1][MV_MAX]; + cpi->time_stamps.first_ever = INT64_MAX;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encoder.c
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
CHECK_MEM_ERROR(cm, cpi->ssim_vars, aom_malloc(sizeof(*cpi->ssim_vars) * 4 * cpi->common.mi_rows * cpi->common.mi_cols)); cpi->worst_consistency = 100.0; } #endif #if CONFIG_ENTROPY_STATS av1_zero(aggregate_fc); #endif // CONFIG_ENTROPY_STATS
+ show +
2670
2671
2672
2673
2674
2675
cpi->first_time_stamp_ever = INT64_MAX; cpi->td.mb.nmvcost[0] = &cpi->nmv_costs[0][MV_MAX]; cpi->td.mb.nmvcost[1] = &cpi->nmv_costs[1][MV_MAX]; cpi->td.mb.nmvcost_hp[0] = &cpi->nmv_costs_hp[0][MV_MAX]; cpi->td.mb.nmvcost_hp[1] = &cpi->nmv_costs_hp[1][MV_MAX];
+ show +
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
#ifdef OUTPUT_YUV_SKINMAP yuv_skinmap_file = fopen("skinmap.yuv", "ab"); #endif #ifdef OUTPUT_YUV_REC yuv_rec_file = fopen("rec.yuv", "wb"); #endif if (oxcf->pass == 1) { av1_init_first_pass(cpi);

[CVE-2020-0478_1.diff] encoder.c #73
- if (cm->seq_params.force_screen_content_tools) { - for (i = 0; i < FRAME_BUFFERS; ++i) { - av1_hash_table_init(&pool->frame_bufs[i].hash_table, &cpi->td.mb); - } - } -static void check_initial_width(AV1_COMP *cpi, int use_highbitdepth, - int subsampling_x, int subsampling_y) { +void av1_check_initial_width(AV1_COMP *cpi, int use_highbitdepth, + int subsampling_x, int subsampling_y) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encoder.c
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
AV1_COMMON *const cm = &cpi->common; int i; BufferPool *const pool = cm->buffer_pool; cm->cur_frame = NULL; for (i = 0; i < REF_FRAMES; ++i) { cm->ref_frame_map[i] = NULL; } for (i = 0; i < FRAME_BUFFERS; ++i) { pool->frame_bufs[i].ref_count = 0; }
+ show +
3620
3621
3622
3623
3624
3625
3626
3627
3628
if (cm->seq_params.force_screen_content_tools) { for (i = 0; i < FRAME_BUFFERS; ++i) { av1_hash_table_init(&pool->frame_bufs[i].hash_table, &cpi->td.mb); } } } static void check_initial_width(AV1_COMP *cpi, int use_highbitdepth, int subsampling_x, int subsampling_y) {
+ show +
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
AV1_COMMON *const cm = &cpi->common; SequenceHeader *const seq_params = &cm->seq_params; if (!cpi->initial_width || seq_params->use_highbitdepth != use_highbitdepth || seq_params->subsampling_x != subsampling_x || seq_params->subsampling_y != subsampling_y) { seq_params->subsampling_x = subsampling_x; seq_params->subsampling_y = subsampling_y; seq_params->use_highbitdepth = use_highbitdepth;

[CVE-2020-0478_1.diff] encoder.c #89
-static void loopfilter_frame(AV1_COMP *cpi, AV1_COMMON *cm) { - const int num_planes = av1_num_planes(cm); - MACROBLOCKD *xd = &cpi->td.mb.e_mbd; - - assert(IMPLIES(is_lossless_requested(&cpi->oxcf), - cm->coded_lossless && cm->all_lossless)); - - const int use_loopfilter = !cm->coded_lossless && !cm->large_scale_tile; - const int use_cdef = cm->seq_params.enable_cdef && !cm->coded_lossless && - !cm->large_scale_tile; - const int use_restoration = cm->seq_params.enable_restoration && - !cm->all_lossless && !cm->large_scale_tile; - - struct loopfilter *lf = &cm->lf; - -#if CONFIG_COLLECT_COMPONENT_TIMING - start_timing(cpi, loop_filter_time); -#endif - if (use_loopfilter) { - aom_clear_system_state(); - av1_pick_filter_level(cpi->source, cpi, cpi->sf.lpf_pick); - } else { - lf->filter_level[0] = 0; - lf->filter_level[1] = 0; - } - - if (lf->filter_level[0] || lf->filter_level[1]) { - if (cpi->num_workers > 1) - av1_loop_filter_frame_mt(&cm->cur_frame->buf, cm, xd, 0, num_planes, 0, -#if LOOP_FILTER_BITMASK - 0, -#endif - cpi->workers, cpi->num_workers, - &cpi->lf_row_sync); - else - av1_loop_filter_frame(&cm->cur_frame->buf, cm, xd, -#if LOOP_FILTER_BITMASK - 0, -#endif - 0, num_planes, 0); - } -#if CONFIG_COLLECT_COMPONENT_TIMING - end_timing(cpi, loop_filter_time); -#endif - +static void cdef_restoration_frame(AV1_COMP *cpi, AV1_COMMON *cm, + MACROBLOCKD *xd, int use_restoration, + int use_cdef) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encoder.c
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
&cm->error, AOM_CODEC_MEM_ERROR, "Failed to reallocate scaled source buffer for superres"); assert(cpi->scaled_source.y_crop_width == cm->superres_upscaled_width); assert(cpi->scaled_source.y_crop_height == cm->superres_upscaled_height); av1_resize_and_extend_frame(cpi->unscaled_source, &cpi->scaled_source, (int)cm->seq_params.bit_depth, num_planes); cpi->source = &cpi->scaled_source; } }
+ show +
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
static void loopfilter_frame(AV1_COMP *cpi, AV1_COMMON *cm) { const int num_planes = av1_num_planes(cm); MACROBLOCKD *xd = &cpi->td.mb.e_mbd; assert(IMPLIES(is_lossless_requested(&cpi->oxcf), cm->coded_lossless && cm->all_lossless)); const int use_loopfilter = !cm->coded_lossless && !cm->large_scale_tile; const int use_cdef = cm->seq_params.enable_cdef && !cm->coded_lossless && !cm->large_scale_tile; const int use_restoration = cm->seq_params.enable_restoration && !cm->all_lossless && !cm->large_scale_tile; struct loopfilter *lf = &cm->lf; #if CONFIG_COLLECT_COMPONENT_TIMING start_timing(cpi, loop_filter_time); #endif if (use_loopfilter) { aom_clear_system_state(); av1_pick_filter_level(cpi->source, cpi, cpi->sf.lpf_pick); } else { lf->filter_level[0] = 0; lf->filter_level[1] = 0; } if (lf->filter_level[0] || lf->filter_level[1]) { if (cpi->num_workers > 1) av1_loop_filter_frame_mt(&cm->cur_frame->buf, cm, xd, 0, num_planes, 0, #if LOOP_FILTER_BITMASK 0, #endif cpi->workers, cpi->num_workers, &cpi->lf_row_sync); else av1_loop_filter_frame(&cm->cur_frame->buf, cm, xd, #if LOOP_FILTER_BITMASK 0, #endif 0, num_planes, 0); } #if CONFIG_COLLECT_COMPONENT_TIMING end_timing(cpi, loop_filter_time); #endif
+ show +
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
if (use_restoration) av1_loop_restoration_save_boundary_lines(&cm->cur_frame->buf, cm, 0); if (use_cdef) { #if CONFIG_COLLECT_COMPONENT_TIMING start_timing(cpi, cdef_time); #endif // Find CDEF parameters av1_cdef_search(&cm->cur_frame->buf, cpi->source, cm, xd,

[CVE-2020-0478_1.diff] encoder.c #103
+ // Update some stats from cyclic refresh. + if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && !frame_is_intra_only(cm)) + av1_cyclic_refresh_postencode(cpi); + +static int encode_with_recode_loop_and_filter(AV1_COMP *cpi, size_t *size, + uint8_t *dest, int64_t *sse, + int64_t *rate, + int *largest_tile_id) { +#if CONFIG_COLLECT_COMPONENT_TIMING + start_timing(cpi, encode_with_recode_loop_time); +#endif + int err = encode_with_recode_loop(cpi, size, dest); +#if CONFIG_COLLECT_COMPONENT_TIMING + end_timing(cpi, encode_with_recode_loop_time); +#endif + if (err != AOM_CODEC_OK) { + if (err == -1) { + // special case as described in encode_with_recode_loop(). + // Encoding was skipped. + err = AOM_CODEC_OK; + if (sse != NULL) *sse = INT64_MAX; + if (rate != NULL) *rate = INT64_MAX; + *largest_tile_id = 0; + } + return err; + } + +#ifdef OUTPUT_YUV_SKINMAP + if (cpi->common.current_frame.frame_number > 1) { + av1_compute_skin_map(cpi, yuv_skinmap_file); + } +#endif // OUTPUT_YUV_SKINMAP + + AV1_COMMON *const cm = &cpi->common; + SequenceHeader *const seq_params = &cm->seq_params; + + // Special case code to reduce pulsing when key frames are forced at a + // fixed interval. Note the reconstruction error if it is the frame before + // the force key frame + if (cpi->rc.next_key_frame_forced && cpi->rc.frames_to_key == 1) { +#if CONFIG_AV1_HIGHBITDEPTH + if (seq_params->use_highbitdepth) { + cpi->ambient_err = aom_highbd_get_y_sse(cpi->source, &cm->cur_frame->buf); + } else { + cpi->ambient_err = aom_get_y_sse(cpi->source, &cm->cur_frame->buf); + } +#else + cpi->ambient_err = aom_get_y_sse(cpi->source, &cm->cur_frame->buf); +#endif + } + + cm->cur_frame->buf.color_primaries = seq_params->color_primaries; + cm->cur_frame->buf.transfer_characteristics = + seq_params->transfer_characteristics; + cm->cur_frame->buf.matrix_coefficients = seq_params->matrix_coefficients; + cm->cur_frame->buf.monochrome = seq_params->monochrome; + cm->cur_frame->buf.chroma_sample_position = + seq_params->chroma_sample_position; + cm->cur_frame->buf.color_range = seq_params->color_range; + cm->cur_frame->buf.render_width = cm->render_width; + cm->cur_frame->buf.render_height = cm->render_height; + + // TODO(zoeliu): For non-ref frames, loop filtering may need to be turned + // off. + + // Pick the loop filter level for the frame. + if (!cm->features.allow_intrabc) { + loopfilter_frame(cpi, cm); + } else { + cm->lf.filter_level[0] = 0; + cm->lf.filter_level[1] = 0; + cm->cdef_info.cdef_bits = 0; + cm->cdef_info.cdef_strengths[0] = 0; + cm->cdef_info.nb_cdef_strengths = 1; + cm->cdef_info.cdef_uv_strengths[0] = 0; + cm->rst_info[0].frame_restoration_type = RESTORE_NONE; + cm->rst_info[1].frame_restoration_type = RESTORE_NONE; + cm->rst_info[2].frame_restoration_type = RESTORE_NONE; + } + + // TODO(debargha): Fix mv search range on encoder side + // aom_extend_frame_inner_borders(&cm->cur_frame->buf, av1_num_planes(cm)); + aom_extend_frame_borders(&cm->cur_frame->buf, av1_num_planes(cm)); + +#ifdef OUTPUT_YUV_REC + aom_write_one_yuv_frame(cm, &cm->cur_frame->buf); +#endif + + finalize_encoded_frame(cpi); + // Build the bitstream +#if CONFIG_COLLECT_COMPONENT_TIMING + start_timing(cpi, av1_pack_bitstream_final_time); +#endif + if (av1_pack_bitstream(cpi, dest, size, largest_tile_id) != AOM_CODEC_OK) + return AOM_CODEC_ERROR; +#if CONFIG_COLLECT_COMPONENT_TIMING + end_timing(cpi, av1_pack_bitstream_final_time); +#endif + + // Compute sse and rate. + if (sse != NULL) { +#if CONFIG_AV1_HIGHBITDEPTH + *sse = (seq_params->use_highbitdepth) + ? aom_highbd_get_y_sse(cpi->source, &cm->cur_frame->buf) + : aom_get_y_sse(cpi->source, &cm->cur_frame->buf); +#else + *sse = aom_get_y_sse(cpi->source, &cm->cur_frame->buf); +#endif + } + if (rate != NULL) { + const int64_t bits = (*size << 3); + *rate = (bits << 5); // To match scale. + } + return AOM_CODEC_OK; +} + +#if CONFIG_SUPERRES_IN_RECODE + +static void save_cur_buf(AV1_COMP *cpi) { + CODING_CONTEXT *const cc = &cpi->coding_context; + AV1_COMMON *cm = &cpi->common; + const YV12_BUFFER_CONFIG *ybf = &cm->cur_frame->buf; + memset(&cc->copy_buffer, 0, sizeof(cc->copy_buffer)); + if (aom_alloc_frame_buffer(&cc->copy_buffer, ybf->y_crop_width, + ybf->y_crop_height, ybf->subsampling_x, + ybf->subsampling_y, + ybf->flags & YV12_FLAG_HIGHBITDEPTH, ybf->border, + cm->features.byte_alignment) != AOM_CODEC_OK) { + aom_internal_error( + &cm->error, AOM_CODEC_MEM_ERROR, + "Failed to allocate copy buffer for saving coding context"); + } + aom_yv12_copy_frame(ybf, &cc->copy_buffer, av1_num_planes(cm)); +} + +// Coding context that only needs to be saved when recode loop includes +// filtering (deblocking, CDEF, superres post-encode upscale and/or loop +// restoraton). +static void save_extra_coding_context(AV1_COMP *cpi) { + CODING_CONTEXT *const cc = &cpi->coding_context; + AV1_COMMON *cm = &cpi->common; + + cc->lf = cm->lf; + cc->cdef_info = cm->cdef_info; + cc->rc = cpi->rc; +} + +static void save_all_coding_context(AV1_COMP *cpi) { + save_cur_buf(cpi); + save_extra_coding_context(cpi); + if (!frame_is_intra_only(&cpi->common)) release_scaled_references(cpi); +} + +static void restore_cur_buf(AV1_COMP *cpi) { + CODING_CONTEXT *const cc = &cpi->coding_context; + AV1_COMMON *cm = &cpi->common; + aom_yv12_copy_frame(&cc->copy_buffer, &cm->cur_frame->buf, + av1_num_planes(cm)); +} + +// Coding context that only needs to be restored when recode loop includes +// filtering (deblocking, CDEF, superres post-encode upscale and/or loop +// restoraton). +static void restore_extra_coding_context(AV1_COMP *cpi) { + CODING_CONTEXT *const cc = &cpi->coding_context; + AV1_COMMON *cm = &cpi->common; + cm->lf = cc->lf; + cm->cdef_info = cc->cdef_info; + cpi->rc = cc->rc; +} + +static void restore_all_coding_context(AV1_COMP *cpi) { + restore_cur_buf(cpi); + restore_extra_coding_context(cpi); + if (!frame_is_intra_only(&cpi->common)) release_scaled_references(cpi); +} + +static void release_copy_buffer(CODING_CONTEXT *cc) { + aom_free_frame_buffer(&cc->copy_buffer); +} + +static int encode_with_and_without_superres(AV1_COMP *cpi, size_t *size, + uint8_t *dest, + int *largest_tile_id) { + const AV1_COMMON *const cm = &cpi->common; + assert(cm->seq_params.enable_superres); + assert(superres_in_recode_allowed(cpi)); + aom_codec_err_t err = AOM_CODEC_OK; + save_all_coding_context(cpi); + + // Encode with superres. +#if SUPERRES_RECODE_ALL_RATIOS + AV1EncoderConfig *const oxcf = &cpi->oxcf; + int64_t superres_sses[SCALE_NUMERATOR]; + int64_t superres_rates[SCALE_NUMERATOR]; + int superres_largest_tile_ids[SCALE_NUMERATOR]; + // Use superres for Key-frames and Alt-ref frames only. + const GF_GROUP *const gf_group = &cpi->gf_group; + if (gf_group->update_type[gf_group->index] != OVERLAY_UPDATE && + gf_group->update_type[gf_group->index] != INTNL_OVERLAY_UPDATE) { + for (int denom = SCALE_NUMERATOR + 1; denom <= 2 * SCALE_NUMERATOR; + ++denom) { + oxcf->superres_scale_denominator = denom; + oxcf->superres_kf_scale_denominator = denom; + const int this_index = denom - (SCALE_NUMERATOR + 1); + err = encode_with_recode_loop_and_filter( + cpi, size, dest, &superres_sses[this_index], + &superres_rates[this_index], &superres_largest_tile_ids[this_index]); + if (err != AOM_CODEC_OK) return err; + restore_all_coding_context(cpi); + } + // Reset. + oxcf->superres_scale_denominator = SCALE_NUMERATOR; + oxcf->superres_kf_scale_denominator = SCALE_NUMERATOR; + } else { + for (int denom = SCALE_NUMERATOR + 1; denom <= 2 * SCALE_NUMERATOR; + ++denom) { + const int this_index = denom - (SCALE_NUMERATOR + 1); + superres_sses[this_index] = INT64_MAX; + superres_rates[this_index] = INT64_MAX; + } + } +#else + int64_t sse1 = INT64_MAX; + int64_t rate1 = INT64_MAX; + int largest_tile_id1; + err = encode_with_recode_loop_and_filter(cpi, size, dest, &sse1, &rate1, + &largest_tile_id1); + if (err != AOM_CODEC_OK) return err; + restore_all_coding_context(cpi); +#endif // SUPERRES_RECODE_ALL_RATIOS + + // Encode without superres. + int64_t sse2 = INT64_MAX; + int64_t rate2 = INT64_MAX; + int largest_tile_id2; + cpi->superres_mode = SUPERRES_NONE; // To force full-res. + err = encode_with_recode_loop_and_filter(cpi, size, dest, &sse2, &rate2, + &largest_tile_id2); + cpi->superres_mode = cpi->oxcf.superres_mode; // Reset. + assert(cpi->oxcf.superres_mode == SUPERRES_AUTO); + if (err != AOM_CODEC_OK) return err; + + // Note: Both use common rdmult based on base qindex of fullres. + const int64_t rdmult = + av1_compute_rd_mult_based_on_qindex(cpi, cm->quant_params.base_qindex); + +#if SUPERRES_RECODE_ALL_RATIOS + // Find the best rdcost among all superres denoms. + double proj_rdcost1 = DBL_MAX; + int64_t sse1 = INT64_MAX; + int64_t rate1 = INT64_MAX; + int largest_tile_id1 = 0; + (void)sse1; + (void)rate1; + (void)largest_tile_id1; + int best_denom = -1; + for (int denom = SCALE_NUMERATOR + 1; denom <= 2 * SCALE_NUMERATOR; ++denom) { + const int this_index = denom - (SCALE_NUMERATOR + 1); + const int64_t this_sse = superres_sses[this_index]; + const int64_t this_rate = superres_rates[this_index]; + const int this_largest_tile_id = superres_largest_tile_ids[this_index]; + const double this_rdcost = RDCOST_DBL(rdmult, this_rate, this_sse); + if (this_rdcost < proj_rdcost1) { + sse1 = this_sse; + rate1 = this_rate; + largest_tile_id1 = this_largest_tile_id; + proj_rdcost1 = this_rdcost; + best_denom = denom; + } + } +#else + const double proj_rdcost1 = RDCOST_DBL(rdmult, rate1, sse1); +#endif // SUPERRES_RECODE_ALL_RATIOS + const double proj_rdcost2 = RDCOST_DBL(rdmult, rate2, sse2); + + // Re-encode with superres if it's better. + if (proj_rdcost1 < proj_rdcost2) { + restore_all_coding_context(cpi); + // TODO(urvang): We should avoid rerunning the recode loop by saving + // previous output+state, or running encode only for the selected 'q' in + // previous step. +#if SUPERRES_RECODE_ALL_RATIOS + // Again, temporarily force the best denom. + oxcf->superres_scale_denominator = best_denom; + oxcf->superres_kf_scale_denominator = best_denom; +#endif // SUPERRES_RECODE_ALL_RATIOS + int64_t sse3 = INT64_MAX; + int64_t rate3 = INT64_MAX; + err = encode_with_recode_loop_and_filter(cpi, size, dest, &sse3, &rate3, + largest_tile_id); + assert(sse1 == sse3); + assert(rate1 == rate3); + assert(largest_tile_id1 == *largest_tile_id); +#if SUPERRES_RECODE_ALL_RATIOS + // Reset. + oxcf->superres_scale_denominator = SCALE_NUMERATOR; + oxcf->superres_kf_scale_denominator = SCALE_NUMERATOR; +#endif // SUPERRES_RECODE_ALL_RATIOS + } else { + *largest_tile_id = largest_tile_id2; + } + + release_copy_buffer(&cpi->coding_context); + + return err; +} +#endif // CONFIG_SUPERRES_IN_RECODE + - current_frame->frame_number, cpi->twopass.gf_group.index, - cpi->twopass.gf_group.update_type[cpi->twopass.gf_group.index], - current_frame->order_hint, cm->show_frame, cm->show_existing_frame, - cpi->rc.source_alt_ref_active, cpi->refresh_alt_ref_frame, - recon_buf->y_stride, recon_buf->uv_stride, cm->width, cm->height); + current_frame->frame_number, cpi->gf_group.index, + cpi->gf_group.update_type[cpi->gf_group.index], current_frame->order_hint, + cm->show_frame, cm->show_existing_frame, cpi->rc.source_alt_ref_active, + cpi->refresh_alt_ref_frame, recon_buf->y_stride, recon_buf->uv_stride, + cm->width, cm->height);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encoder.c
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
if ((f_recon = fopen(file_name, "ab")) == NULL) { printf("Unable to open file %s to append.\n", file_name); return; } } printf( "\nFrame=%5d, encode_update_type[%5d]=%1d, frame_offset=%d, " "show_frame=%d, show_existing_frame=%d, source_alt_ref_active=%d, " "refresh_alt_ref_frame=%d, " "y_stride=%4d, uv_stride=%4d, cm->width=%4d, cm->height=%4d\n\n",
+ show +
4583
4584
4585
4586
4587
current_frame->frame_number, cpi->twopass.gf_group.index, cpi->twopass.gf_group.update_type[cpi->twopass.gf_group.index], current_frame->order_hint, cm->show_frame, cm->show_existing_frame, cpi->rc.source_alt_ref_active, cpi->refresh_alt_ref_frame, recon_buf->y_stride, recon_buf->uv_stride, cm->width, cm->height);
+ show +
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
#if 0 int ref_frame; printf("get_ref_frame_map_idx: ["); for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) printf(" %d", get_ref_frame_map_idx(cm, ref_frame)); printf(" ]\n"); #endif // 0 // --- Y --- for (h = 0; h < cm->height; ++h) {

[CVE-2020-0470_1.diff] encoder.c #13
-static void enc_setup_mi(AV1_COMMON *cm) { - int i; - int mi_rows_sb_aligned = calc_mi_size(cm->mi_rows); - cm->mi = cm->mip; - memset(cm->mip, 0, cm->mi_stride * mi_rows_sb_aligned * sizeof(*cm->mip)); - cm->prev_mi = cm->prev_mip; - // Clear top border row - memset(cm->prev_mip, 0, sizeof(*cm->prev_mip) * cm->mi_stride); - // Clear left border column - for (i = 0; i < mi_rows_sb_aligned; ++i) - memset(&cm->prev_mip[i * cm->mi_stride], 0, sizeof(*cm->prev_mip)); - cm->mi_grid_visible = cm->mi_grid_base; - cm->prev_mi_grid_visible = cm->prev_mi_grid_base; +static void set_mb_mi(CommonModeInfoParams *mi_params, int width, int height) { + // Ensure that the decoded width and height are both multiples of + // 8 luma pixels (note: this may only be a multiple of 4 chroma pixels if + // subsampling is used). + // This simplifies the implementation of various experiments, + // eg. cdef, which operates on units of 8x8 luma pixels. + const int aligned_width = ALIGN_POWER_OF_TWO(width, 3); + const int aligned_height = ALIGN_POWER_OF_TWO(height, 3); - memset(cm->mi_grid_base, 0, - cm->mi_stride * mi_rows_sb_aligned * sizeof(*cm->mi_grid_base)); + mi_params->mi_cols = aligned_width >> MI_SIZE_LOG2; + mi_params->mi_rows = aligned_height >> MI_SIZE_LOG2; + mi_params->mi_stride = calc_mi_size(mi_params->mi_cols); + + mi_params->mb_cols = (mi_params->mi_cols + 2) >> 2; + mi_params->mb_rows = (mi_params->mi_rows + 2) >> 2; + mi_params->MBs = mi_params->mb_rows * mi_params->mb_cols; + + const int mi_alloc_size_1d = mi_size_wide[mi_params->mi_alloc_bsize]; + mi_params->mi_alloc_stride = + (mi_params->mi_stride + mi_alloc_size_1d - 1) / mi_alloc_size_1d; + + assert(mi_size_wide[mi_params->mi_alloc_bsize] == + mi_size_high[mi_params->mi_alloc_bsize]); + +#if CONFIG_LPF_MASK + av1_alloc_loop_filter_mask(mi_params); +#endif -static int enc_alloc_mi(AV1_COMMON *cm, int mi_size) { - cm->mip = aom_calloc(mi_size, sizeof(*cm->mip)); - if (!cm->mip) return 1; - cm->prev_mip = aom_calloc(mi_size, sizeof(*cm->prev_mip)); - if (!cm->prev_mip) return 1; - cm->mi_alloc_size = mi_size; +static void enc_set_mb_mi(CommonModeInfoParams *mi_params, int width, + int height) { + const int is_4k_or_larger = AOMMIN(width, height) >= 2160; + mi_params->mi_alloc_bsize = is_4k_or_larger ? BLOCK_8X8 : BLOCK_4X4; - cm->mi_grid_base = - (MB_MODE_INFO **)aom_calloc(mi_size, sizeof(MB_MODE_INFO *)); - if (!cm->mi_grid_base) return 1; - cm->prev_mi_grid_base = - (MB_MODE_INFO **)aom_calloc(mi_size, sizeof(MB_MODE_INFO *)); - if (!cm->prev_mi_grid_base) return 1; - - return 0; + set_mb_mi(mi_params, width, height); -static void enc_free_mi(AV1_COMMON *cm) { - aom_free(cm->mip); - cm->mip = NULL; - aom_free(cm->prev_mip); - cm->prev_mip = NULL; - aom_free(cm->mi_grid_base); - cm->mi_grid_base = NULL; - aom_free(cm->prev_mi_grid_base); - cm->prev_mi_grid_base = NULL; - cm->mi_alloc_size = 0; +static void stat_stage_set_mb_mi(CommonModeInfoParams *mi_params, int width, + int height) { + mi_params->mi_alloc_bsize = BLOCK_16X16; + + set_mb_mi(mi_params, width, height); -static void swap_mi_and_prev_mi(AV1_COMMON *cm) { - // Current mip will be the prev_mip for the next frame. - MB_MODE_INFO **temp_base = cm->prev_mi_grid_base; - MB_MODE_INFO *temp = cm->prev_mip; - cm->prev_mip = cm->mip; - cm->mip = temp; +static void enc_setup_mi(CommonModeInfoParams *mi_params) { + const int mi_grid_size = + mi_params->mi_stride * calc_mi_size(mi_params->mi_rows); + memset(mi_params->mi_alloc, 0, + mi_params->mi_alloc_size * sizeof(*mi_params->mi_alloc)); + memset(mi_params->mi_grid_base, 0, + mi_grid_size * sizeof(*mi_params->mi_grid_base)); + memset(mi_params->tx_type_map, 0, + mi_grid_size * sizeof(*mi_params->tx_type_map)); +} - // Update the upper left visible macroblock ptrs. - cm->mi = cm->mip; - cm->prev_mi = cm->prev_mip; - - cm->prev_mi_grid_base = cm->mi_grid_base; - cm->mi_grid_base = temp_base; - cm->mi_grid_visible = cm->mi_grid_base; - cm->prev_mi_grid_visible = cm->prev_mi_grid_base; +static void enc_free_mi(CommonModeInfoParams *mi_params) { + aom_free(mi_params->mi_alloc); + mi_params->mi_alloc = NULL; + aom_free(mi_params->mi_grid_base); + mi_params->mi_grid_base = NULL; + mi_params->mi_alloc_size = 0; + aom_free(mi_params->tx_type_map); + mi_params->tx_type_map = NULL;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encoder.c
370
371
372
373
374
375
376
377
378
379
} else { *cm->fc = primary_ref_buf->frame_context; } } av1_zero(cm->cur_frame->interp_filter_selected); cm->prev_frame = get_primary_ref_frame_buf(cm); cpi->vaq_refresh = 0; }
+ show +
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
static void enc_setup_mi(AV1_COMMON *cm) { int i; int mi_rows_sb_aligned = calc_mi_size(cm->mi_rows); cm->mi = cm->mip; memset(cm->mip, 0, cm->mi_stride * mi_rows_sb_aligned * sizeof(*cm->mip)); cm->prev_mi = cm->prev_mip; // Clear top border row memset(cm->prev_mip, 0, sizeof(*cm->prev_mip) * cm->mi_stride); // Clear left border column for (i = 0; i < mi_rows_sb_aligned; ++i) memset(&cm->prev_mip[i * cm->mi_stride], 0, sizeof(*cm->prev_mip)); cm->mi_grid_visible = cm->mi_grid_base; cm->prev_mi_grid_visible = cm->prev_mi_grid_base; memset(cm->mi_grid_base, 0, cm->mi_stride * mi_rows_sb_aligned * sizeof(*cm->mi_grid_base)); } static int enc_alloc_mi(AV1_COMMON *cm, int mi_size) { cm->mip = aom_calloc(mi_size, sizeof(*cm->mip)); if (!cm->mip) return 1; cm->prev_mip = aom_calloc(mi_size, sizeof(*cm->prev_mip)); if (!cm->prev_mip) return 1; cm->mi_alloc_size = mi_size; cm->mi_grid_base = (MB_MODE_INFO **)aom_calloc(mi_size, sizeof(MB_MODE_INFO *)); if (!cm->mi_grid_base) return 1; cm->prev_mi_grid_base = (MB_MODE_INFO **)aom_calloc(mi_size, sizeof(MB_MODE_INFO *)); if (!cm->prev_mi_grid_base) return 1; return 0; } static void enc_free_mi(AV1_COMMON *cm) { aom_free(cm->mip); cm->mip = NULL; aom_free(cm->prev_mip); cm->prev_mip = NULL; aom_free(cm->mi_grid_base); cm->mi_grid_base = NULL; aom_free(cm->prev_mi_grid_base); cm->prev_mi_grid_base = NULL; cm->mi_alloc_size = 0; } static void swap_mi_and_prev_mi(AV1_COMMON *cm) { // Current mip will be the prev_mip for the next frame. MB_MODE_INFO **temp_base = cm->prev_mi_grid_base; MB_MODE_INFO *temp = cm->prev_mip; cm->prev_mip = cm->mip; cm->mip = temp; // Update the upper left visible macroblock ptrs. cm->mi = cm->mip; cm->prev_mi = cm->prev_mip; cm->prev_mi_grid_base = cm->mi_grid_base; cm->mi_grid_base = temp_base; cm->mi_grid_visible = cm->mi_grid_base; cm->prev_mi_grid_visible = cm->prev_mi_grid_base;
+ show +
442
443
444
445
446
447
448
449
450
451
} void av1_initialize_enc(void) { av1_rtcd(); aom_dsp_rtcd(); aom_scale_rtcd(); av1_init_intra_predictors(); av1_init_me_luts(); av1_rc_init_minq_luts(); av1_init_wedge_masks();

[CVE-2020-0470_1.diff] encoder.c #14
-static void dealloc_context_buffers_ext(AV1_COMP *cpi) { - if (cpi->mbmi_ext_base) { - aom_free(cpi->mbmi_ext_base); - cpi->mbmi_ext_base = NULL; +static void dealloc_context_buffers_ext(MBMIExtFrameBufferInfo *mbmi_ext_info) { + if (mbmi_ext_info->frame_base) { + aom_free(mbmi_ext_info->frame_base); + mbmi_ext_info->frame_base = NULL; + mbmi_ext_info->alloc_size = 0; -static void alloc_context_buffers_ext(AV1_COMP *cpi) { - AV1_COMMON *cm = &cpi->common; - int mi_size = cm->mi_cols * cm->mi_rows; +static void alloc_context_buffers_ext(AV1_COMMON *cm, + MBMIExtFrameBufferInfo *mbmi_ext_info) { + const CommonModeInfoParams *const mi_params = &cm->mi_params; - dealloc_context_buffers_ext(cpi); - CHECK_MEM_ERROR(cm, cpi->mbmi_ext_base, - aom_calloc(mi_size, sizeof(*cpi->mbmi_ext_base))); + const int mi_alloc_size_1d = mi_size_wide[mi_params->mi_alloc_bsize]; + const int mi_alloc_rows = + (mi_params->mi_rows + mi_alloc_size_1d - 1) / mi_alloc_size_1d; + const int mi_alloc_cols = + (mi_params->mi_cols + mi_alloc_size_1d - 1) / mi_alloc_size_1d; + const int new_ext_mi_size = mi_alloc_rows * mi_alloc_cols; + + if (new_ext_mi_size > mbmi_ext_info->alloc_size) { + dealloc_context_buffers_ext(mbmi_ext_info); + CHECK_MEM_ERROR( + cm, mbmi_ext_info->frame_base, + aom_calloc(new_ext_mi_size, sizeof(*mbmi_ext_info->frame_base))); + mbmi_ext_info->alloc_size = new_ext_mi_size; + } + // The stride needs to be updated regardless of whether new allocation + // happened or not. + mbmi_ext_info->stride = mi_alloc_cols;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encoder.c
444
445
446
447
448
449
450
451
452
453
void av1_initialize_enc(void) { av1_rtcd(); aom_dsp_rtcd(); aom_scale_rtcd(); av1_init_intra_predictors(); av1_init_me_luts(); av1_rc_init_minq_luts(); av1_init_wedge_masks(); }
+ show +
454
455
456
457
458
459
460
461
462
463
464
465
466
467
static void dealloc_context_buffers_ext(AV1_COMP *cpi) { if (cpi->mbmi_ext_base) { aom_free(cpi->mbmi_ext_base); cpi->mbmi_ext_base = NULL; } } static void alloc_context_buffers_ext(AV1_COMP *cpi) { AV1_COMMON *cm = &cpi->common; int mi_size = cm->mi_cols * cm->mi_rows; dealloc_context_buffers_ext(cpi); CHECK_MEM_ERROR(cm, cpi->mbmi_ext_base, aom_calloc(mi_size, sizeof(*cpi->mbmi_ext_base)));
+ show +
468
469
470
471
472
473
474
475
476
477
} static void reset_film_grain_chroma_params(aom_film_grain_t *pars) { pars->num_cr_points = 0; pars->cr_mult = 0; pars->cr_luma_mult = 0; memset(pars->scaling_points_cr, 0, sizeof(pars->scaling_points_cr)); memset(pars->ar_coeffs_cr, 0, sizeof(pars->ar_coeffs_cr)); pars->num_cb_points = 0; pars->cb_mult = 0;

[CVE-2020-0470_1.diff] encoder.c #20
-} -static void save_coding_context(AV1_COMP *cpi) { - CODING_CONTEXT *const cc = &cpi->coding_context; - AV1_COMMON *cm = &cpi->common; + for (int i = 0; i < MAX_NUM_OPERATING_POINTS; ++i) { + aom_free(cpi->level_params.level_info[i]); + } - // Stores a snapshot of key state variables which can subsequently be - // restored with a call to av1_restore_coding_context. These functions are - // intended for use in a re-code loop in av1_compress_frame where the - // quantizer value is adjusted between loop iterations. - av1_copy(cc->nmv_vec_cost, cpi->td.mb.nmv_vec_cost); - av1_copy(cc->nmv_costs, cpi->nmv_costs); - av1_copy(cc->nmv_costs_hp, cpi->nmv_costs_hp); - - cc->fc = *cm->fc; -} - -static void restore_coding_context(AV1_COMP *cpi) { - CODING_CONTEXT *const cc = &cpi->coding_context; - AV1_COMMON *cm = &cpi->common; - - // Restore key state variables to the snapshot state stored in the - // previous call to av1_save_coding_context. - av1_copy(cpi->td.mb.nmv_vec_cost, cc->nmv_vec_cost); - av1_copy(cpi->nmv_costs, cc->nmv_costs); - av1_copy(cpi->nmv_costs_hp, cc->nmv_costs_hp); - - *cm->fc = cc->fc; + if (cpi->use_svc) av1_free_svc_cyclic_refresh(cpi);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encoder.c
597
598
599
600
601
602
603
604
605
606
aom_denoise_and_model_free(cpi->denoise_and_model); cpi->denoise_and_model = NULL; } #endif if (cpi->film_grain_table) { aom_film_grain_table_free(cpi->film_grain_table); cpi->film_grain_table = NULL; } }
+ show +
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
static void save_coding_context(AV1_COMP *cpi) { CODING_CONTEXT *const cc = &cpi->coding_context; AV1_COMMON *cm = &cpi->common; // Stores a snapshot of key state variables which can subsequently be // restored with a call to av1_restore_coding_context. These functions are // intended for use in a re-code loop in av1_compress_frame where the // quantizer value is adjusted between loop iterations. av1_copy(cc->nmv_vec_cost, cpi->td.mb.nmv_vec_cost); av1_copy(cc->nmv_costs, cpi->nmv_costs); av1_copy(cc->nmv_costs_hp, cpi->nmv_costs_hp); cc->fc = *cm->fc; } static void restore_coding_context(AV1_COMP *cpi) { CODING_CONTEXT *const cc = &cpi->coding_context; AV1_COMMON *cm = &cpi->common; // Restore key state variables to the snapshot state stored in the // previous call to av1_save_coding_context. av1_copy(cpi->td.mb.nmv_vec_cost, cc->nmv_vec_cost); av1_copy(cpi->nmv_costs, cc->nmv_costs); av1_copy(cpi->nmv_costs_hp, cc->nmv_costs_hp); *cm->fc = cc->fc;
+ show +
633
634
635
636
637
638
639
640
641
642
} static void configure_static_seg_features(AV1_COMP *cpi) { AV1_COMMON *const cm = &cpi->common; const RATE_CONTROL *const rc = &cpi->rc; struct segmentation *const seg = &cm->seg; int high_q = (int)(rc->avg_q > 48.0); int qi_delta;

[CVE-2020-0470_1.diff] encoder.c #51
- cpi->first_time_stamp_ever = INT64_MAX; - - cpi->td.mb.nmvcost[0] = &cpi->nmv_costs[0][MV_MAX]; - cpi->td.mb.nmvcost[1] = &cpi->nmv_costs[1][MV_MAX]; - cpi->td.mb.nmvcost_hp[0] = &cpi->nmv_costs_hp[0][MV_MAX]; - cpi->td.mb.nmvcost_hp[1] = &cpi->nmv_costs_hp[1][MV_MAX]; + cpi->time_stamps.first_ever = INT64_MAX;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encoder.c
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
CHECK_MEM_ERROR(cm, cpi->ssim_vars, aom_malloc(sizeof(*cpi->ssim_vars) * 4 * cpi->common.mi_rows * cpi->common.mi_cols)); cpi->worst_consistency = 100.0; } #endif #if CONFIG_ENTROPY_STATS av1_zero(aggregate_fc); #endif // CONFIG_ENTROPY_STATS
+ show +
2670
2671
2672
2673
2674
2675
cpi->first_time_stamp_ever = INT64_MAX; cpi->td.mb.nmvcost[0] = &cpi->nmv_costs[0][MV_MAX]; cpi->td.mb.nmvcost[1] = &cpi->nmv_costs[1][MV_MAX]; cpi->td.mb.nmvcost_hp[0] = &cpi->nmv_costs_hp[0][MV_MAX]; cpi->td.mb.nmvcost_hp[1] = &cpi->nmv_costs_hp[1][MV_MAX];
+ show +
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
#ifdef OUTPUT_YUV_SKINMAP yuv_skinmap_file = fopen("skinmap.yuv", "ab"); #endif #ifdef OUTPUT_YUV_REC yuv_rec_file = fopen("rec.yuv", "wb"); #endif if (oxcf->pass == 1) { av1_init_first_pass(cpi);

[CVE-2020-0470_1.diff] encoder.c #73
- if (cm->seq_params.force_screen_content_tools) { - for (i = 0; i < FRAME_BUFFERS; ++i) { - av1_hash_table_init(&pool->frame_bufs[i].hash_table, &cpi->td.mb); - } - } -static void check_initial_width(AV1_COMP *cpi, int use_highbitdepth, - int subsampling_x, int subsampling_y) { +void av1_check_initial_width(AV1_COMP *cpi, int use_highbitdepth, + int subsampling_x, int subsampling_y) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encoder.c
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
AV1_COMMON *const cm = &cpi->common; int i; BufferPool *const pool = cm->buffer_pool; cm->cur_frame = NULL; for (i = 0; i < REF_FRAMES; ++i) { cm->ref_frame_map[i] = NULL; } for (i = 0; i < FRAME_BUFFERS; ++i) { pool->frame_bufs[i].ref_count = 0; }
+ show +
3620
3621
3622
3623
3624
3625
3626
3627
3628
if (cm->seq_params.force_screen_content_tools) { for (i = 0; i < FRAME_BUFFERS; ++i) { av1_hash_table_init(&pool->frame_bufs[i].hash_table, &cpi->td.mb); } } } static void check_initial_width(AV1_COMP *cpi, int use_highbitdepth, int subsampling_x, int subsampling_y) {
+ show +
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
AV1_COMMON *const cm = &cpi->common; SequenceHeader *const seq_params = &cm->seq_params; if (!cpi->initial_width || seq_params->use_highbitdepth != use_highbitdepth || seq_params->subsampling_x != subsampling_x || seq_params->subsampling_y != subsampling_y) { seq_params->subsampling_x = subsampling_x; seq_params->subsampling_y = subsampling_y; seq_params->use_highbitdepth = use_highbitdepth;

[CVE-2020-0470_1.diff] encoder.c #89
-static void loopfilter_frame(AV1_COMP *cpi, AV1_COMMON *cm) { - const int num_planes = av1_num_planes(cm); - MACROBLOCKD *xd = &cpi->td.mb.e_mbd; - - assert(IMPLIES(is_lossless_requested(&cpi->oxcf), - cm->coded_lossless && cm->all_lossless)); - - const int use_loopfilter = !cm->coded_lossless && !cm->large_scale_tile; - const int use_cdef = cm->seq_params.enable_cdef && !cm->coded_lossless && - !cm->large_scale_tile; - const int use_restoration = cm->seq_params.enable_restoration && - !cm->all_lossless && !cm->large_scale_tile; - - struct loopfilter *lf = &cm->lf; - -#if CONFIG_COLLECT_COMPONENT_TIMING - start_timing(cpi, loop_filter_time); -#endif - if (use_loopfilter) { - aom_clear_system_state(); - av1_pick_filter_level(cpi->source, cpi, cpi->sf.lpf_pick); - } else { - lf->filter_level[0] = 0; - lf->filter_level[1] = 0; - } - - if (lf->filter_level[0] || lf->filter_level[1]) { - if (cpi->num_workers > 1) - av1_loop_filter_frame_mt(&cm->cur_frame->buf, cm, xd, 0, num_planes, 0, -#if LOOP_FILTER_BITMASK - 0, -#endif - cpi->workers, cpi->num_workers, - &cpi->lf_row_sync); - else - av1_loop_filter_frame(&cm->cur_frame->buf, cm, xd, -#if LOOP_FILTER_BITMASK - 0, -#endif - 0, num_planes, 0); - } -#if CONFIG_COLLECT_COMPONENT_TIMING - end_timing(cpi, loop_filter_time); -#endif - +static void cdef_restoration_frame(AV1_COMP *cpi, AV1_COMMON *cm, + MACROBLOCKD *xd, int use_restoration, + int use_cdef) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encoder.c
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
&cm->error, AOM_CODEC_MEM_ERROR, "Failed to reallocate scaled source buffer for superres"); assert(cpi->scaled_source.y_crop_width == cm->superres_upscaled_width); assert(cpi->scaled_source.y_crop_height == cm->superres_upscaled_height); av1_resize_and_extend_frame(cpi->unscaled_source, &cpi->scaled_source, (int)cm->seq_params.bit_depth, num_planes); cpi->source = &cpi->scaled_source; } }
+ show +
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
static void loopfilter_frame(AV1_COMP *cpi, AV1_COMMON *cm) { const int num_planes = av1_num_planes(cm); MACROBLOCKD *xd = &cpi->td.mb.e_mbd; assert(IMPLIES(is_lossless_requested(&cpi->oxcf), cm->coded_lossless && cm->all_lossless)); const int use_loopfilter = !cm->coded_lossless && !cm->large_scale_tile; const int use_cdef = cm->seq_params.enable_cdef && !cm->coded_lossless && !cm->large_scale_tile; const int use_restoration = cm->seq_params.enable_restoration && !cm->all_lossless && !cm->large_scale_tile; struct loopfilter *lf = &cm->lf; #if CONFIG_COLLECT_COMPONENT_TIMING start_timing(cpi, loop_filter_time); #endif if (use_loopfilter) { aom_clear_system_state(); av1_pick_filter_level(cpi->source, cpi, cpi->sf.lpf_pick); } else { lf->filter_level[0] = 0; lf->filter_level[1] = 0; } if (lf->filter_level[0] || lf->filter_level[1]) { if (cpi->num_workers > 1) av1_loop_filter_frame_mt(&cm->cur_frame->buf, cm, xd, 0, num_planes, 0, #if LOOP_FILTER_BITMASK 0, #endif cpi->workers, cpi->num_workers, &cpi->lf_row_sync); else av1_loop_filter_frame(&cm->cur_frame->buf, cm, xd, #if LOOP_FILTER_BITMASK 0, #endif 0, num_planes, 0); } #if CONFIG_COLLECT_COMPONENT_TIMING end_timing(cpi, loop_filter_time); #endif
+ show +
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
if (use_restoration) av1_loop_restoration_save_boundary_lines(&cm->cur_frame->buf, cm, 0); if (use_cdef) { #if CONFIG_COLLECT_COMPONENT_TIMING start_timing(cpi, cdef_time); #endif // Find CDEF parameters av1_cdef_search(&cm->cur_frame->buf, cpi->source, cm, xd,

[CVE-2020-0470_1.diff] encoder.c #103
+ // Update some stats from cyclic refresh. + if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && !frame_is_intra_only(cm)) + av1_cyclic_refresh_postencode(cpi); + +static int encode_with_recode_loop_and_filter(AV1_COMP *cpi, size_t *size, + uint8_t *dest, int64_t *sse, + int64_t *rate, + int *largest_tile_id) { +#if CONFIG_COLLECT_COMPONENT_TIMING + start_timing(cpi, encode_with_recode_loop_time); +#endif + int err = encode_with_recode_loop(cpi, size, dest); +#if CONFIG_COLLECT_COMPONENT_TIMING + end_timing(cpi, encode_with_recode_loop_time); +#endif + if (err != AOM_CODEC_OK) { + if (err == -1) { + // special case as described in encode_with_recode_loop(). + // Encoding was skipped. + err = AOM_CODEC_OK; + if (sse != NULL) *sse = INT64_MAX; + if (rate != NULL) *rate = INT64_MAX; + *largest_tile_id = 0; + } + return err; + } + +#ifdef OUTPUT_YUV_SKINMAP + if (cpi->common.current_frame.frame_number > 1) { + av1_compute_skin_map(cpi, yuv_skinmap_file); + } +#endif // OUTPUT_YUV_SKINMAP + + AV1_COMMON *const cm = &cpi->common; + SequenceHeader *const seq_params = &cm->seq_params; + + // Special case code to reduce pulsing when key frames are forced at a + // fixed interval. Note the reconstruction error if it is the frame before + // the force key frame + if (cpi->rc.next_key_frame_forced && cpi->rc.frames_to_key == 1) { +#if CONFIG_AV1_HIGHBITDEPTH + if (seq_params->use_highbitdepth) { + cpi->ambient_err = aom_highbd_get_y_sse(cpi->source, &cm->cur_frame->buf); + } else { + cpi->ambient_err = aom_get_y_sse(cpi->source, &cm->cur_frame->buf); + } +#else + cpi->ambient_err = aom_get_y_sse(cpi->source, &cm->cur_frame->buf); +#endif + } + + cm->cur_frame->buf.color_primaries = seq_params->color_primaries; + cm->cur_frame->buf.transfer_characteristics = + seq_params->transfer_characteristics; + cm->cur_frame->buf.matrix_coefficients = seq_params->matrix_coefficients; + cm->cur_frame->buf.monochrome = seq_params->monochrome; + cm->cur_frame->buf.chroma_sample_position = + seq_params->chroma_sample_position; + cm->cur_frame->buf.color_range = seq_params->color_range; + cm->cur_frame->buf.render_width = cm->render_width; + cm->cur_frame->buf.render_height = cm->render_height; + + // TODO(zoeliu): For non-ref frames, loop filtering may need to be turned + // off. + + // Pick the loop filter level for the frame. + if (!cm->features.allow_intrabc) { + loopfilter_frame(cpi, cm); + } else { + cm->lf.filter_level[0] = 0; + cm->lf.filter_level[1] = 0; + cm->cdef_info.cdef_bits = 0; + cm->cdef_info.cdef_strengths[0] = 0; + cm->cdef_info.nb_cdef_strengths = 1; + cm->cdef_info.cdef_uv_strengths[0] = 0; + cm->rst_info[0].frame_restoration_type = RESTORE_NONE; + cm->rst_info[1].frame_restoration_type = RESTORE_NONE; + cm->rst_info[2].frame_restoration_type = RESTORE_NONE; + } + + // TODO(debargha): Fix mv search range on encoder side + // aom_extend_frame_inner_borders(&cm->cur_frame->buf, av1_num_planes(cm)); + aom_extend_frame_borders(&cm->cur_frame->buf, av1_num_planes(cm)); + +#ifdef OUTPUT_YUV_REC + aom_write_one_yuv_frame(cm, &cm->cur_frame->buf); +#endif + + finalize_encoded_frame(cpi); + // Build the bitstream +#if CONFIG_COLLECT_COMPONENT_TIMING + start_timing(cpi, av1_pack_bitstream_final_time); +#endif + if (av1_pack_bitstream(cpi, dest, size, largest_tile_id) != AOM_CODEC_OK) + return AOM_CODEC_ERROR; +#if CONFIG_COLLECT_COMPONENT_TIMING + end_timing(cpi, av1_pack_bitstream_final_time); +#endif + + // Compute sse and rate. + if (sse != NULL) { +#if CONFIG_AV1_HIGHBITDEPTH + *sse = (seq_params->use_highbitdepth) + ? aom_highbd_get_y_sse(cpi->source, &cm->cur_frame->buf) + : aom_get_y_sse(cpi->source, &cm->cur_frame->buf); +#else + *sse = aom_get_y_sse(cpi->source, &cm->cur_frame->buf); +#endif + } + if (rate != NULL) { + const int64_t bits = (*size << 3); + *rate = (bits << 5); // To match scale. + } + return AOM_CODEC_OK; +} + +#if CONFIG_SUPERRES_IN_RECODE + +static void save_cur_buf(AV1_COMP *cpi) { + CODING_CONTEXT *const cc = &cpi->coding_context; + AV1_COMMON *cm = &cpi->common; + const YV12_BUFFER_CONFIG *ybf = &cm->cur_frame->buf; + memset(&cc->copy_buffer, 0, sizeof(cc->copy_buffer)); + if (aom_alloc_frame_buffer(&cc->copy_buffer, ybf->y_crop_width, + ybf->y_crop_height, ybf->subsampling_x, + ybf->subsampling_y, + ybf->flags & YV12_FLAG_HIGHBITDEPTH, ybf->border, + cm->features.byte_alignment) != AOM_CODEC_OK) { + aom_internal_error( + &cm->error, AOM_CODEC_MEM_ERROR, + "Failed to allocate copy buffer for saving coding context"); + } + aom_yv12_copy_frame(ybf, &cc->copy_buffer, av1_num_planes(cm)); +} + +// Coding context that only needs to be saved when recode loop includes +// filtering (deblocking, CDEF, superres post-encode upscale and/or loop +// restoraton). +static void save_extra_coding_context(AV1_COMP *cpi) { + CODING_CONTEXT *const cc = &cpi->coding_context; + AV1_COMMON *cm = &cpi->common; + + cc->lf = cm->lf; + cc->cdef_info = cm->cdef_info; + cc->rc = cpi->rc; +} + +static void save_all_coding_context(AV1_COMP *cpi) { + save_cur_buf(cpi); + save_extra_coding_context(cpi); + if (!frame_is_intra_only(&cpi->common)) release_scaled_references(cpi); +} + +static void restore_cur_buf(AV1_COMP *cpi) { + CODING_CONTEXT *const cc = &cpi->coding_context; + AV1_COMMON *cm = &cpi->common; + aom_yv12_copy_frame(&cc->copy_buffer, &cm->cur_frame->buf, + av1_num_planes(cm)); +} + +// Coding context that only needs to be restored when recode loop includes +// filtering (deblocking, CDEF, superres post-encode upscale and/or loop +// restoraton). +static void restore_extra_coding_context(AV1_COMP *cpi) { + CODING_CONTEXT *const cc = &cpi->coding_context; + AV1_COMMON *cm = &cpi->common; + cm->lf = cc->lf; + cm->cdef_info = cc->cdef_info; + cpi->rc = cc->rc; +} + +static void restore_all_coding_context(AV1_COMP *cpi) { + restore_cur_buf(cpi); + restore_extra_coding_context(cpi); + if (!frame_is_intra_only(&cpi->common)) release_scaled_references(cpi); +} + +static void release_copy_buffer(CODING_CONTEXT *cc) { + aom_free_frame_buffer(&cc->copy_buffer); +} + +static int encode_with_and_without_superres(AV1_COMP *cpi, size_t *size, + uint8_t *dest, + int *largest_tile_id) { + const AV1_COMMON *const cm = &cpi->common; + assert(cm->seq_params.enable_superres); + assert(superres_in_recode_allowed(cpi)); + aom_codec_err_t err = AOM_CODEC_OK; + save_all_coding_context(cpi); + + // Encode with superres. +#if SUPERRES_RECODE_ALL_RATIOS + AV1EncoderConfig *const oxcf = &cpi->oxcf; + int64_t superres_sses[SCALE_NUMERATOR]; + int64_t superres_rates[SCALE_NUMERATOR]; + int superres_largest_tile_ids[SCALE_NUMERATOR]; + // Use superres for Key-frames and Alt-ref frames only. + const GF_GROUP *const gf_group = &cpi->gf_group; + if (gf_group->update_type[gf_group->index] != OVERLAY_UPDATE && + gf_group->update_type[gf_group->index] != INTNL_OVERLAY_UPDATE) { + for (int denom = SCALE_NUMERATOR + 1; denom <= 2 * SCALE_NUMERATOR; + ++denom) { + oxcf->superres_scale_denominator = denom; + oxcf->superres_kf_scale_denominator = denom; + const int this_index = denom - (SCALE_NUMERATOR + 1); + err = encode_with_recode_loop_and_filter( + cpi, size, dest, &superres_sses[this_index], + &superres_rates[this_index], &superres_largest_tile_ids[this_index]); + if (err != AOM_CODEC_OK) return err; + restore_all_coding_context(cpi); + } + // Reset. + oxcf->superres_scale_denominator = SCALE_NUMERATOR; + oxcf->superres_kf_scale_denominator = SCALE_NUMERATOR; + } else { + for (int denom = SCALE_NUMERATOR + 1; denom <= 2 * SCALE_NUMERATOR; + ++denom) { + const int this_index = denom - (SCALE_NUMERATOR + 1); + superres_sses[this_index] = INT64_MAX; + superres_rates[this_index] = INT64_MAX; + } + } +#else + int64_t sse1 = INT64_MAX; + int64_t rate1 = INT64_MAX; + int largest_tile_id1; + err = encode_with_recode_loop_and_filter(cpi, size, dest, &sse1, &rate1, + &largest_tile_id1); + if (err != AOM_CODEC_OK) return err; + restore_all_coding_context(cpi); +#endif // SUPERRES_RECODE_ALL_RATIOS + + // Encode without superres. + int64_t sse2 = INT64_MAX; + int64_t rate2 = INT64_MAX; + int largest_tile_id2; + cpi->superres_mode = SUPERRES_NONE; // To force full-res. + err = encode_with_recode_loop_and_filter(cpi, size, dest, &sse2, &rate2, + &largest_tile_id2); + cpi->superres_mode = cpi->oxcf.superres_mode; // Reset. + assert(cpi->oxcf.superres_mode == SUPERRES_AUTO); + if (err != AOM_CODEC_OK) return err; + + // Note: Both use common rdmult based on base qindex of fullres. + const int64_t rdmult = + av1_compute_rd_mult_based_on_qindex(cpi, cm->quant_params.base_qindex); + +#if SUPERRES_RECODE_ALL_RATIOS + // Find the best rdcost among all superres denoms. + double proj_rdcost1 = DBL_MAX; + int64_t sse1 = INT64_MAX; + int64_t rate1 = INT64_MAX; + int largest_tile_id1 = 0; + (void)sse1; + (void)rate1; + (void)largest_tile_id1; + int best_denom = -1; + for (int denom = SCALE_NUMERATOR + 1; denom <= 2 * SCALE_NUMERATOR; ++denom) { + const int this_index = denom - (SCALE_NUMERATOR + 1); + const int64_t this_sse = superres_sses[this_index]; + const int64_t this_rate = superres_rates[this_index]; + const int this_largest_tile_id = superres_largest_tile_ids[this_index]; + const double this_rdcost = RDCOST_DBL(rdmult, this_rate, this_sse); + if (this_rdcost < proj_rdcost1) { + sse1 = this_sse; + rate1 = this_rate; + largest_tile_id1 = this_largest_tile_id; + proj_rdcost1 = this_rdcost; + best_denom = denom; + } + } +#else + const double proj_rdcost1 = RDCOST_DBL(rdmult, rate1, sse1); +#endif // SUPERRES_RECODE_ALL_RATIOS + const double proj_rdcost2 = RDCOST_DBL(rdmult, rate2, sse2); + + // Re-encode with superres if it's better. + if (proj_rdcost1 < proj_rdcost2) { + restore_all_coding_context(cpi); + // TODO(urvang): We should avoid rerunning the recode loop by saving + // previous output+state, or running encode only for the selected 'q' in + // previous step. +#if SUPERRES_RECODE_ALL_RATIOS + // Again, temporarily force the best denom. + oxcf->superres_scale_denominator = best_denom; + oxcf->superres_kf_scale_denominator = best_denom; +#endif // SUPERRES_RECODE_ALL_RATIOS + int64_t sse3 = INT64_MAX; + int64_t rate3 = INT64_MAX; + err = encode_with_recode_loop_and_filter(cpi, size, dest, &sse3, &rate3, + largest_tile_id); + assert(sse1 == sse3); + assert(rate1 == rate3); + assert(largest_tile_id1 == *largest_tile_id); +#if SUPERRES_RECODE_ALL_RATIOS + // Reset. + oxcf->superres_scale_denominator = SCALE_NUMERATOR; + oxcf->superres_kf_scale_denominator = SCALE_NUMERATOR; +#endif // SUPERRES_RECODE_ALL_RATIOS + } else { + *largest_tile_id = largest_tile_id2; + } + + release_copy_buffer(&cpi->coding_context); + + return err; +} +#endif // CONFIG_SUPERRES_IN_RECODE + - current_frame->frame_number, cpi->twopass.gf_group.index, - cpi->twopass.gf_group.update_type[cpi->twopass.gf_group.index], - current_frame->order_hint, cm->show_frame, cm->show_existing_frame, - cpi->rc.source_alt_ref_active, cpi->refresh_alt_ref_frame, - recon_buf->y_stride, recon_buf->uv_stride, cm->width, cm->height); + current_frame->frame_number, cpi->gf_group.index, + cpi->gf_group.update_type[cpi->gf_group.index], current_frame->order_hint, + cm->show_frame, cm->show_existing_frame, cpi->rc.source_alt_ref_active, + cpi->refresh_alt_ref_frame, recon_buf->y_stride, recon_buf->uv_stride, + cm->width, cm->height);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encoder.c
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
if ((f_recon = fopen(file_name, "ab")) == NULL) { printf("Unable to open file %s to append.\n", file_name); return; } } printf( "\nFrame=%5d, encode_update_type[%5d]=%1d, frame_offset=%d, " "show_frame=%d, show_existing_frame=%d, source_alt_ref_active=%d, " "refresh_alt_ref_frame=%d, " "y_stride=%4d, uv_stride=%4d, cm->width=%4d, cm->height=%4d\n\n",
+ show +
4583
4584
4585
4586
4587
current_frame->frame_number, cpi->twopass.gf_group.index, cpi->twopass.gf_group.update_type[cpi->twopass.gf_group.index], current_frame->order_hint, cm->show_frame, cm->show_existing_frame, cpi->rc.source_alt_ref_active, cpi->refresh_alt_ref_frame, recon_buf->y_stride, recon_buf->uv_stride, cm->width, cm->height);
+ show +
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
#if 0 int ref_frame; printf("get_ref_frame_map_idx: ["); for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) printf(" %d", get_ref_frame_map_idx(cm, ref_frame)); printf(" ]\n"); #endif // 0 // --- Y --- for (h = 0; h < cm->height; ++h) {

[CVE-2020-0478_1.diff] level.c #2
+ TILE_SIZE_HEADER_RATE_TOO_HIGH, + BITRATE_TOO_HIGH, + DECODER_MODEL_FAIL, + "The product of max tile size and header rate is too high.", + "The bitrate is too high.", + "The decoder model fails.", +static double get_max_bitrate(const AV1LevelSpec *const level_spec, int tier, + BITSTREAM_PROFILE profile) { + if (level_spec->level < SEQ_LEVEL_4_0) tier = 0; + const double bitrate_basis = + (tier ? level_spec->high_mbps : level_spec->main_mbps) * 1e6; + const double bitrate_profile_factor = + profile == PROFILE_0 ? 1.0 : (profile == PROFILE_1 ? 2.0 : 3.0); + return bitrate_basis * bitrate_profile_factor; +} + +double av1_get_max_bitrate_for_level(AV1_LEVEL level_index, int tier, + BITSTREAM_PROFILE profile) { + assert(is_valid_seq_level_idx(level_index)); + return get_max_bitrate(&av1_level_defs[level_index], tier, profile); +} + +void av1_get_max_tiles_for_level(AV1_LEVEL level_index, int *const max_tiles, + int *const max_tile_cols) { + assert(is_valid_seq_level_idx(level_index)); + const AV1LevelSpec *const level_spec = &av1_level_defs[level_index]; + *max_tiles = level_spec->max_tiles; + *max_tile_cols = level_spec->max_tile_cols; +} + +// We assume time t to be valid if and only if t >= 0.0. +// So INVALID_TIME can be defined as anything less than 0. +#define INVALID_TIME (-1.0) + +// This corresponds to "free_buffer" in the spec. +static void release_buffer(DECODER_MODEL *const decoder_model, int idx) { + assert(idx >= 0 && idx < BUFFER_POOL_MAX_SIZE); + FRAME_BUFFER *const this_buffer = &decoder_model->frame_buffer_pool[idx]; + this_buffer->decoder_ref_count = 0; + this_buffer->player_ref_count = 0; + this_buffer->display_index = -1; + this_buffer->presentation_time = INVALID_TIME; +} + +static void initialize_buffer_pool(DECODER_MODEL *const decoder_model) { + for (int i = 0; i < BUFFER_POOL_MAX_SIZE; ++i) { + release_buffer(decoder_model, i); + } + for (int i = 0; i < REF_FRAMES; ++i) { + decoder_model->vbi[i] = -1; + } +} + +static int get_free_buffer(DECODER_MODEL *const decoder_model) { + for (int i = 0; i < BUFFER_POOL_MAX_SIZE; ++i) { + const FRAME_BUFFER *const this_buffer = + &decoder_model->frame_buffer_pool[i]; + if (this_buffer->decoder_ref_count == 0 && + this_buffer->player_ref_count == 0) + return i; + } + return -1; +} + +static void update_ref_buffers(DECODER_MODEL *const decoder_model, int idx, + int refresh_frame_flags) { + FRAME_BUFFER *const this_buffer = &decoder_model->frame_buffer_pool[idx]; + for (int i = 0; i < REF_FRAMES; ++i) { + if (refresh_frame_flags & (1 << i)) { + const int pre_idx = decoder_model->vbi[i]; + if (pre_idx != -1) { + --decoder_model->frame_buffer_pool[pre_idx].decoder_ref_count; + } + decoder_model->vbi[i] = idx; + ++this_buffer->decoder_ref_count; + } + } +} + +// The time (in seconds) required to decode a frame. +static double time_to_decode_frame(const AV1_COMMON *const cm, + int64_t max_decode_rate) { + if (cm->show_existing_frame) return 0.0; + + const FRAME_TYPE frame_type = cm->current_frame.frame_type; + int luma_samples = 0; + if (frame_type == KEY_FRAME || frame_type == INTRA_ONLY_FRAME) { + luma_samples = cm->superres_upscaled_width * cm->height; + } else { + const int spatial_layer_dimensions_present_flag = 0; + if (spatial_layer_dimensions_present_flag) { + assert(0 && "Spatial layer dimensions not supported yet."); + } else { + const SequenceHeader *const seq_params = &cm->seq_params; + const int max_frame_width = seq_params->max_frame_width; + const int max_frame_height = seq_params->max_frame_height; + luma_samples = max_frame_width * max_frame_height; + } + } + + return luma_samples / (double)max_decode_rate; +} + +// Release frame buffers that are no longer needed for decode or display. +// It corresponds to "start_decode_at_removal_time" in the spec. +static void release_processed_frames(DECODER_MODEL *const decoder_model, + double removal_time) { + for (int i = 0; i < BUFFER_POOL_MAX_SIZE; ++i) { + FRAME_BUFFER *const this_buffer = &decoder_model->frame_buffer_pool[i]; + if (this_buffer->player_ref_count > 0) { + if (this_buffer->presentation_time >= 0.0 && + this_buffer->presentation_time <= removal_time) { + this_buffer->player_ref_count = 0; + if (this_buffer->decoder_ref_count == 0) { + release_buffer(decoder_model, i); + } + } + } + } +} + +static int frames_in_buffer_pool(const DECODER_MODEL *const decoder_model) { + int frames_in_pool = 0; + for (int i = 0; i < BUFFER_POOL_MAX_SIZE; ++i) { + const FRAME_BUFFER *const this_buffer = + &decoder_model->frame_buffer_pool[i]; + if (this_buffer->decoder_ref_count > 0 || + this_buffer->player_ref_count > 0) { + ++frames_in_pool; + } + } + return frames_in_pool; +} + +static double get_presentation_time(const DECODER_MODEL *const decoder_model, + int display_index) { + if (decoder_model->mode == SCHEDULE_MODE) { + assert(0 && "SCHEDULE_MODE NOT SUPPORTED"); + return INVALID_TIME; + } else { + const double initial_presentation_delay = + decoder_model->initial_presentation_delay; + // Can't decide presentation time until the initial presentation delay is + // known. + if (initial_presentation_delay < 0.0) return INVALID_TIME; + + return initial_presentation_delay + + display_index * decoder_model->num_ticks_per_picture * + decoder_model->display_clock_tick; + } +} + +#define MAX_TIME 1e16 +double time_next_buffer_is_free(const DECODER_MODEL *const decoder_model) { + if (decoder_model->num_decoded_frame == 0) { + return (double)decoder_model->decoder_buffer_delay / 90000.0; + } + + double buf_free_time = MAX_TIME; + for (int i = 0; i < BUFFER_POOL_MAX_SIZE; ++i) { + const FRAME_BUFFER *const this_buffer = + &decoder_model->frame_buffer_pool[i]; + if (this_buffer->decoder_ref_count == 0) { + if (this_buffer->player_ref_count == 0) { + return decoder_model->current_time; + } + const double presentation_time = this_buffer->presentation_time; + if (presentation_time >= 0.0 && presentation_time < buf_free_time) { + buf_free_time = presentation_time; + } + } + } + return buf_free_time < MAX_TIME ? buf_free_time : INVALID_TIME; +} +#undef MAX_TIME + +static double get_removal_time(const DECODER_MODEL *const decoder_model) { + if (decoder_model->mode == SCHEDULE_MODE) { + assert(0 && "SCHEDULE_MODE IS NOT SUPPORTED YET"); + return INVALID_TIME; + } else { + return time_next_buffer_is_free(decoder_model); + } +} + +void av1_decoder_model_print_status(const DECODER_MODEL *const decoder_model) { + printf( + "\n status %d, num_frame %3d, num_decoded_frame %3d, " + "num_shown_frame %3d, current time %6.2f, frames in buffer %2d, " + "presentation delay %6.2f, total interval %6.2f\n", + decoder_model->status, decoder_model->num_frame, + decoder_model->num_decoded_frame, decoder_model->num_shown_frame, + decoder_model->current_time, frames_in_buffer_pool(decoder_model), + decoder_model->initial_presentation_delay, + decoder_model->dfg_interval_queue.total_interval); + for (int i = 0; i < 10; ++i) { + const FRAME_BUFFER *const this_buffer = + &decoder_model->frame_buffer_pool[i]; + printf("buffer %d, decode count %d, display count %d, present time %6.4f\n", + i, this_buffer->decoder_ref_count, this_buffer->player_ref_count, + this_buffer->presentation_time); + } +} + +// op_index is the operating point index. +void av1_decoder_model_init(const AV1_COMP *const cpi, AV1_LEVEL level, + int op_index, DECODER_MODEL *const decoder_model) { + aom_clear_system_state(); + + decoder_model->status = DECODER_MODEL_OK; + decoder_model->level = level; + + const AV1_COMMON *const cm = &cpi->common; + const SequenceHeader *const seq_params = &cm->seq_params; + decoder_model->bit_rate = get_max_bitrate( + av1_level_defs + level, seq_params->tier[op_index], seq_params->profile); + + // TODO(huisu or anyone): implement SCHEDULE_MODE. + decoder_model->mode = RESOURCE_MODE; + decoder_model->encoder_buffer_delay = 20000; + decoder_model->decoder_buffer_delay = 70000; + decoder_model->is_low_delay_mode = false; + + decoder_model->first_bit_arrival_time = 0.0; + decoder_model->last_bit_arrival_time = 0.0; + decoder_model->coded_bits = 0; + + decoder_model->removal_time = INVALID_TIME; + decoder_model->presentation_time = INVALID_TIME; + decoder_model->decode_samples = 0; + decoder_model->display_samples = 0; + decoder_model->max_decode_rate = 0.0; + decoder_model->max_display_rate = 0.0; + + decoder_model->num_frame = -1; + decoder_model->num_decoded_frame = -1; + decoder_model->num_shown_frame = -1; + decoder_model->current_time = 0.0; + + initialize_buffer_pool(decoder_model); + + DFG_INTERVAL_QUEUE *const dfg_interval_queue = + &decoder_model->dfg_interval_queue; + dfg_interval_queue->total_interval = 0.0; + dfg_interval_queue->head = 0; + dfg_interval_queue->size = 0; + + if (seq_params->timing_info_present) { + decoder_model->num_ticks_per_picture = + seq_params->timing_info.num_ticks_per_picture; + decoder_model->display_clock_tick = + seq_params->timing_info.num_units_in_display_tick / + seq_params->timing_info.time_scale; + } else { + decoder_model->num_ticks_per_picture = 1; + decoder_model->display_clock_tick = 1.0 / cpi->framerate; + } + + decoder_model->initial_display_delay = + seq_params->op_params[op_index].initial_display_delay; + decoder_model->initial_presentation_delay = INVALID_TIME; + decoder_model->decode_rate = av1_level_defs[level].max_decode_rate; +} + +void av1_decoder_model_process_frame(const AV1_COMP *const cpi, + size_t coded_bits, + DECODER_MODEL *const decoder_model) { + if (!decoder_model || decoder_model->status != DECODER_MODEL_OK) return; + + aom_clear_system_state(); + + const AV1_COMMON *const cm = &cpi->common; + const int luma_pic_size = cm->superres_upscaled_width * cm->height; + const int show_existing_frame = cm->show_existing_frame; + const int show_frame = cm->show_frame || show_existing_frame; + ++decoder_model->num_frame; + if (!show_existing_frame) ++decoder_model->num_decoded_frame; + if (show_frame) ++decoder_model->num_shown_frame; + decoder_model->coded_bits += coded_bits; + + int display_idx = -1; + if (show_existing_frame) { + display_idx = decoder_model->vbi[cpi->existing_fb_idx_to_show]; + if (display_idx < 0) { + decoder_model->status = DECODE_EXISTING_FRAME_BUF_EMPTY; + return; + } + if (decoder_model->frame_buffer_pool[display_idx].frame_type == KEY_FRAME) { + update_ref_buffers(decoder_model, display_idx, 0xFF); + } + } else { + const double removal_time = get_removal_time(decoder_model); + if (removal_time < 0.0) { + decoder_model->status = DECODE_FRAME_BUF_UNAVAILABLE; + return; + } + + const int previous_decode_samples = decoder_model->decode_samples; + const double previous_removal_time = decoder_model->removal_time; + assert(previous_removal_time < removal_time); + decoder_model->removal_time = removal_time; + decoder_model->decode_samples = luma_pic_size; + const double this_decode_rate = + previous_decode_samples / (removal_time - previous_removal_time); + decoder_model->max_decode_rate = + AOMMAX(decoder_model->max_decode_rate, this_decode_rate); + + // A frame with show_existing_frame being false indicates the end of a DFG. + // Update the bits arrival time of this DFG. + const double buffer_delay = (decoder_model->encoder_buffer_delay + + decoder_model->decoder_buffer_delay) / + 90000.0; + const double latest_arrival_time = removal_time - buffer_delay; + decoder_model->first_bit_arrival_time = + AOMMAX(decoder_model->last_bit_arrival_time, latest_arrival_time); + decoder_model->last_bit_arrival_time = + decoder_model->first_bit_arrival_time + + (double)decoder_model->coded_bits / decoder_model->bit_rate; + // Smoothing buffer underflows if the last bit arrives after the removal + // time. + if (decoder_model->last_bit_arrival_time > removal_time && + !decoder_model->is_low_delay_mode) { + decoder_model->status = SMOOTHING_BUFFER_UNDERFLOW; + return; + } + // Reset the coded bits for the next DFG. + decoder_model->coded_bits = 0; + + // Check if the smoothing buffer overflows. + DFG_INTERVAL_QUEUE *const queue = &decoder_model->dfg_interval_queue; + if (queue->size >= DFG_INTERVAL_QUEUE_SIZE) { + assert(0); + } + const double first_bit_arrival_time = decoder_model->first_bit_arrival_time; + const double last_bit_arrival_time = decoder_model->last_bit_arrival_time; + // Remove the DFGs with removal time earlier than last_bit_arrival_time. + while (queue->buf[queue->head].removal_time <= last_bit_arrival_time && + queue->size > 0) { + if (queue->buf[queue->head].removal_time - first_bit_arrival_time + + queue->total_interval > + 1.0) { + decoder_model->status = SMOOTHING_BUFFER_OVERFLOW; + return; + } + queue->total_interval -= queue->buf[queue->head].last_bit_arrival_time - + queue->buf[queue->head].first_bit_arrival_time; + queue->head = (queue->head + 1) % DFG_INTERVAL_QUEUE_SIZE; + --queue->size; + } + // Push current DFG into the queue. + const int queue_index = + (queue->head + queue->size++) % DFG_INTERVAL_QUEUE_SIZE; + queue->buf[queue_index].first_bit_arrival_time = first_bit_arrival_time; + queue->buf[queue_index].last_bit_arrival_time = last_bit_arrival_time; + queue->buf[queue_index].removal_time = removal_time; + queue->total_interval += last_bit_arrival_time - first_bit_arrival_time; + // The smoothing buffer can hold at most "bit_rate" bits, which is + // equivalent to 1 second of total interval. + if (queue->total_interval > 1.0) { + decoder_model->status = SMOOTHING_BUFFER_OVERFLOW; + return; + } + + release_processed_frames(decoder_model, removal_time); + decoder_model->current_time = + removal_time + time_to_decode_frame(cm, decoder_model->decode_rate); + + const int cfbi = get_free_buffer(decoder_model); + if (cfbi < 0) { + decoder_model->status = DECODE_FRAME_BUF_UNAVAILABLE; + return; + } + const CurrentFrame *const current_frame = &cm->current_frame; + decoder_model->frame_buffer_pool[cfbi].frame_type = + cm->current_frame.frame_type; + display_idx = cfbi; + update_ref_buffers(decoder_model, cfbi, current_frame->refresh_frame_flags); + + if (decoder_model->initial_presentation_delay < 0.0) { + // Display can begin after required number of frames have been buffered. + if (frames_in_buffer_pool(decoder_model) >= + decoder_model->initial_display_delay) { + decoder_model->initial_presentation_delay = decoder_model->current_time; + // Update presentation time for each shown frame in the frame buffer. + for (int i = 0; i < BUFFER_POOL_MAX_SIZE; ++i) { + FRAME_BUFFER *const this_buffer = + &decoder_model->frame_buffer_pool[i]; + if (this_buffer->player_ref_count == 0) continue; + assert(this_buffer->display_index >= 0); + this_buffer->presentation_time = + get_presentation_time(decoder_model, this_buffer->display_index); + } + } + } + } + + // Display. + if (show_frame) { + assert(display_idx >= 0 && display_idx < BUFFER_POOL_MAX_SIZE); + FRAME_BUFFER *const this_buffer = + &decoder_model->frame_buffer_pool[display_idx]; + ++this_buffer->player_ref_count; + this_buffer->display_index = decoder_model->num_shown_frame; + const double presentation_time = + get_presentation_time(decoder_model, this_buffer->display_index); + this_buffer->presentation_time = presentation_time; + if (presentation_time >= 0.0 && + decoder_model->current_time > presentation_time) { + decoder_model->status = DISPLAY_FRAME_LATE; + return; + } + + const int previous_display_samples = decoder_model->display_samples; + const double previous_presentation_time = decoder_model->presentation_time; + decoder_model->display_samples = luma_pic_size; + decoder_model->presentation_time = presentation_time; + if (presentation_time >= 0.0 && previous_presentation_time >= 0.0) { + assert(previous_presentation_time < presentation_time); + const double this_display_rate = + previous_display_samples / + (presentation_time - previous_presentation_time); + decoder_model->max_display_rate = + AOMMAX(decoder_model->max_display_rate, this_display_rate); + } + } +} + +void av1_init_level_info(AV1_COMP *cpi) { + for (int op_index = 0; op_index < MAX_NUM_OPERATING_POINTS; ++op_index) { + AV1LevelInfo *const this_level_info = + cpi->level_params.level_info[op_index]; + if (!this_level_info) continue; + memset(this_level_info, 0, sizeof(*this_level_info)); + AV1LevelSpec *const level_spec = &this_level_info->level_spec; + level_spec->level = SEQ_LEVEL_MAX; + AV1LevelStats *const level_stats = &this_level_info->level_stats; + level_stats->min_cropped_tile_width = INT_MAX; + level_stats->min_cropped_tile_height = INT_MAX; + level_stats->min_frame_width = INT_MAX; + level_stats->min_frame_height = INT_MAX; + level_stats->tile_width_is_valid = 1; + level_stats->min_cr = 1e8; + + FrameWindowBuffer *const frame_window_buffer = + &this_level_info->frame_window_buffer; + frame_window_buffer->num = 0; + frame_window_buffer->start = 0; + + const AV1_COMMON *const cm = &cpi->common; + const int upscaled_width = cm->superres_upscaled_width; + const int height = cm->height; + const int pic_size = upscaled_width * height; + for (AV1_LEVEL level = SEQ_LEVEL_2_0; level < SEQ_LEVELS; ++level) { + DECODER_MODEL *const this_model = &this_level_info->decoder_models[level]; + const AV1LevelSpec *const spec = &av1_level_defs[level]; + if (upscaled_width > spec->max_h_size || height > spec->max_v_size || + pic_size > spec->max_picture_size) { + // Turn off decoder model for this level as the frame size already + // exceeds level constraints. + this_model->status = DECODER_MODEL_DISABLED; + } else { + av1_decoder_model_init(cpi, level, op_index, this_model); + } + } + } +} + + if (level_spec->level < SEQ_LEVEL_4_0) tier = 0; -static TARGET_LEVEL_FAIL_ID check_level_constraints( - const AV1LevelSpec *const target_level_spec, - const AV1LevelSpec *const level_spec, - const AV1LevelStats *const level_stats, int tier, int is_still_picture) { - const double min_cr = get_min_cr(target_level_spec, tier, is_still_picture, - level_spec->max_decode_rate); - TARGET_LEVEL_FAIL_ID fail_id = TARGET_LEVEL_OK; +double av1_get_min_cr_for_level(AV1_LEVEL level_index, int tier, + int is_still_picture) { + assert(is_valid_seq_level_idx(level_index)); + const AV1LevelSpec *const level_spec = &av1_level_defs[level_index]; + return get_min_cr(level_spec, tier, is_still_picture, + level_spec->max_decode_rate); +} +static void get_temporal_parallel_params(int scalability_mode_idc, + int *temporal_parallel_num, + int *temporal_parallel_denom) { + if (scalability_mode_idc < 0) { + *temporal_parallel_num = 1; + *temporal_parallel_denom = 1; + return; + } + + // TODO(huisu@): handle scalability cases. + if (scalability_mode_idc == SCALABILITY_SS) { + (void)scalability_mode_idc; + } else { + (void)scalability_mode_idc; + } +} + +#define MAX_TILE_SIZE (4096 * 2304) +#define MIN_CROPPED_TILE_WIDTH 8 +#define MIN_CROPPED_TILE_HEIGHT 8 +#define MIN_FRAME_WIDTH 16 +#define MIN_FRAME_HEIGHT 16 +#define MAX_TILE_SIZE_HEADER_RATE_PRODUCT 588251136 + +static TARGET_LEVEL_FAIL_ID check_level_constraints( + const AV1LevelInfo *const level_info, AV1_LEVEL level, int tier, + int is_still_picture, BITSTREAM_PROFILE profile, int check_bitrate) { + const DECODER_MODEL *const decoder_model = &level_info->decoder_models[level]; + const DECODER_MODEL_STATUS decoder_model_status = decoder_model->status; + if (decoder_model_status != DECODER_MODEL_OK && + decoder_model_status != DECODER_MODEL_DISABLED) { + return DECODER_MODEL_FAIL; + } + + const AV1LevelSpec *const level_spec = &level_info->level_spec; + const AV1LevelSpec *const target_level_spec = &av1_level_defs[level]; + const AV1LevelStats *const level_stats = &level_info->level_stats; + TARGET_LEVEL_FAIL_ID fail_id = TARGET_LEVEL_OK;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/level.c
262
263
264
265
266
267
268
269
270
271
static double get_min_cr(const AV1LevelSpec *const level_spec, int tier, int is_still_picture, int64_t decoded_sample_rate) { if (is_still_picture) return 0.8; const double min_cr_basis = tier ? level_spec->high_cr : level_spec->main_cr; const double speed_adj = (double)decoded_sample_rate / level_spec->max_display_rate; return AOMMAX(min_cr_basis * speed_adj, 0.8); }
+ show +
272
273
274
275
276
277
278
static TARGET_LEVEL_FAIL_ID check_level_constraints( const AV1LevelSpec *const target_level_spec, const AV1LevelSpec *const level_spec, const AV1LevelStats *const level_stats, int tier, int is_still_picture) { const double min_cr = get_min_cr(target_level_spec, tier, is_still_picture, level_spec->max_decode_rate); TARGET_LEVEL_FAIL_ID fail_id = TARGET_LEVEL_OK;
+ show +
279
280
281
282
283
284
285
286
287
288
do { if (level_spec->max_picture_size > target_level_spec->max_picture_size) { fail_id = LUMA_PIC_SIZE_TOO_LARGE; break; } if (level_spec->max_h_size > target_level_spec->max_h_size) { fail_id = LUMA_PIC_H_SIZE_TOO_LARGE; break;

[CVE-2020-0470_1.diff] level.c #2
+ TILE_SIZE_HEADER_RATE_TOO_HIGH, + BITRATE_TOO_HIGH, + DECODER_MODEL_FAIL, + "The product of max tile size and header rate is too high.", + "The bitrate is too high.", + "The decoder model fails.", +static double get_max_bitrate(const AV1LevelSpec *const level_spec, int tier, + BITSTREAM_PROFILE profile) { + if (level_spec->level < SEQ_LEVEL_4_0) tier = 0; + const double bitrate_basis = + (tier ? level_spec->high_mbps : level_spec->main_mbps) * 1e6; + const double bitrate_profile_factor = + profile == PROFILE_0 ? 1.0 : (profile == PROFILE_1 ? 2.0 : 3.0); + return bitrate_basis * bitrate_profile_factor; +} + +double av1_get_max_bitrate_for_level(AV1_LEVEL level_index, int tier, + BITSTREAM_PROFILE profile) { + assert(is_valid_seq_level_idx(level_index)); + return get_max_bitrate(&av1_level_defs[level_index], tier, profile); +} + +void av1_get_max_tiles_for_level(AV1_LEVEL level_index, int *const max_tiles, + int *const max_tile_cols) { + assert(is_valid_seq_level_idx(level_index)); + const AV1LevelSpec *const level_spec = &av1_level_defs[level_index]; + *max_tiles = level_spec->max_tiles; + *max_tile_cols = level_spec->max_tile_cols; +} + +// We assume time t to be valid if and only if t >= 0.0. +// So INVALID_TIME can be defined as anything less than 0. +#define INVALID_TIME (-1.0) + +// This corresponds to "free_buffer" in the spec. +static void release_buffer(DECODER_MODEL *const decoder_model, int idx) { + assert(idx >= 0 && idx < BUFFER_POOL_MAX_SIZE); + FRAME_BUFFER *const this_buffer = &decoder_model->frame_buffer_pool[idx]; + this_buffer->decoder_ref_count = 0; + this_buffer->player_ref_count = 0; + this_buffer->display_index = -1; + this_buffer->presentation_time = INVALID_TIME; +} + +static void initialize_buffer_pool(DECODER_MODEL *const decoder_model) { + for (int i = 0; i < BUFFER_POOL_MAX_SIZE; ++i) { + release_buffer(decoder_model, i); + } + for (int i = 0; i < REF_FRAMES; ++i) { + decoder_model->vbi[i] = -1; + } +} + +static int get_free_buffer(DECODER_MODEL *const decoder_model) { + for (int i = 0; i < BUFFER_POOL_MAX_SIZE; ++i) { + const FRAME_BUFFER *const this_buffer = + &decoder_model->frame_buffer_pool[i]; + if (this_buffer->decoder_ref_count == 0 && + this_buffer->player_ref_count == 0) + return i; + } + return -1; +} + +static void update_ref_buffers(DECODER_MODEL *const decoder_model, int idx, + int refresh_frame_flags) { + FRAME_BUFFER *const this_buffer = &decoder_model->frame_buffer_pool[idx]; + for (int i = 0; i < REF_FRAMES; ++i) { + if (refresh_frame_flags & (1 << i)) { + const int pre_idx = decoder_model->vbi[i]; + if (pre_idx != -1) { + --decoder_model->frame_buffer_pool[pre_idx].decoder_ref_count; + } + decoder_model->vbi[i] = idx; + ++this_buffer->decoder_ref_count; + } + } +} + +// The time (in seconds) required to decode a frame. +static double time_to_decode_frame(const AV1_COMMON *const cm, + int64_t max_decode_rate) { + if (cm->show_existing_frame) return 0.0; + + const FRAME_TYPE frame_type = cm->current_frame.frame_type; + int luma_samples = 0; + if (frame_type == KEY_FRAME || frame_type == INTRA_ONLY_FRAME) { + luma_samples = cm->superres_upscaled_width * cm->height; + } else { + const int spatial_layer_dimensions_present_flag = 0; + if (spatial_layer_dimensions_present_flag) { + assert(0 && "Spatial layer dimensions not supported yet."); + } else { + const SequenceHeader *const seq_params = &cm->seq_params; + const int max_frame_width = seq_params->max_frame_width; + const int max_frame_height = seq_params->max_frame_height; + luma_samples = max_frame_width * max_frame_height; + } + } + + return luma_samples / (double)max_decode_rate; +} + +// Release frame buffers that are no longer needed for decode or display. +// It corresponds to "start_decode_at_removal_time" in the spec. +static void release_processed_frames(DECODER_MODEL *const decoder_model, + double removal_time) { + for (int i = 0; i < BUFFER_POOL_MAX_SIZE; ++i) { + FRAME_BUFFER *const this_buffer = &decoder_model->frame_buffer_pool[i]; + if (this_buffer->player_ref_count > 0) { + if (this_buffer->presentation_time >= 0.0 && + this_buffer->presentation_time <= removal_time) { + this_buffer->player_ref_count = 0; + if (this_buffer->decoder_ref_count == 0) { + release_buffer(decoder_model, i); + } + } + } + } +} + +static int frames_in_buffer_pool(const DECODER_MODEL *const decoder_model) { + int frames_in_pool = 0; + for (int i = 0; i < BUFFER_POOL_MAX_SIZE; ++i) { + const FRAME_BUFFER *const this_buffer = + &decoder_model->frame_buffer_pool[i]; + if (this_buffer->decoder_ref_count > 0 || + this_buffer->player_ref_count > 0) { + ++frames_in_pool; + } + } + return frames_in_pool; +} + +static double get_presentation_time(const DECODER_MODEL *const decoder_model, + int display_index) { + if (decoder_model->mode == SCHEDULE_MODE) { + assert(0 && "SCHEDULE_MODE NOT SUPPORTED"); + return INVALID_TIME; + } else { + const double initial_presentation_delay = + decoder_model->initial_presentation_delay; + // Can't decide presentation time until the initial presentation delay is + // known. + if (initial_presentation_delay < 0.0) return INVALID_TIME; + + return initial_presentation_delay + + display_index * decoder_model->num_ticks_per_picture * + decoder_model->display_clock_tick; + } +} + +#define MAX_TIME 1e16 +double time_next_buffer_is_free(const DECODER_MODEL *const decoder_model) { + if (decoder_model->num_decoded_frame == 0) { + return (double)decoder_model->decoder_buffer_delay / 90000.0; + } + + double buf_free_time = MAX_TIME; + for (int i = 0; i < BUFFER_POOL_MAX_SIZE; ++i) { + const FRAME_BUFFER *const this_buffer = + &decoder_model->frame_buffer_pool[i]; + if (this_buffer->decoder_ref_count == 0) { + if (this_buffer->player_ref_count == 0) { + return decoder_model->current_time; + } + const double presentation_time = this_buffer->presentation_time; + if (presentation_time >= 0.0 && presentation_time < buf_free_time) { + buf_free_time = presentation_time; + } + } + } + return buf_free_time < MAX_TIME ? buf_free_time : INVALID_TIME; +} +#undef MAX_TIME + +static double get_removal_time(const DECODER_MODEL *const decoder_model) { + if (decoder_model->mode == SCHEDULE_MODE) { + assert(0 && "SCHEDULE_MODE IS NOT SUPPORTED YET"); + return INVALID_TIME; + } else { + return time_next_buffer_is_free(decoder_model); + } +} + +void av1_decoder_model_print_status(const DECODER_MODEL *const decoder_model) { + printf( + "\n status %d, num_frame %3d, num_decoded_frame %3d, " + "num_shown_frame %3d, current time %6.2f, frames in buffer %2d, " + "presentation delay %6.2f, total interval %6.2f\n", + decoder_model->status, decoder_model->num_frame, + decoder_model->num_decoded_frame, decoder_model->num_shown_frame, + decoder_model->current_time, frames_in_buffer_pool(decoder_model), + decoder_model->initial_presentation_delay, + decoder_model->dfg_interval_queue.total_interval); + for (int i = 0; i < 10; ++i) { + const FRAME_BUFFER *const this_buffer = + &decoder_model->frame_buffer_pool[i]; + printf("buffer %d, decode count %d, display count %d, present time %6.4f\n", + i, this_buffer->decoder_ref_count, this_buffer->player_ref_count, + this_buffer->presentation_time); + } +} + +// op_index is the operating point index. +void av1_decoder_model_init(const AV1_COMP *const cpi, AV1_LEVEL level, + int op_index, DECODER_MODEL *const decoder_model) { + aom_clear_system_state(); + + decoder_model->status = DECODER_MODEL_OK; + decoder_model->level = level; + + const AV1_COMMON *const cm = &cpi->common; + const SequenceHeader *const seq_params = &cm->seq_params; + decoder_model->bit_rate = get_max_bitrate( + av1_level_defs + level, seq_params->tier[op_index], seq_params->profile); + + // TODO(huisu or anyone): implement SCHEDULE_MODE. + decoder_model->mode = RESOURCE_MODE; + decoder_model->encoder_buffer_delay = 20000; + decoder_model->decoder_buffer_delay = 70000; + decoder_model->is_low_delay_mode = false; + + decoder_model->first_bit_arrival_time = 0.0; + decoder_model->last_bit_arrival_time = 0.0; + decoder_model->coded_bits = 0; + + decoder_model->removal_time = INVALID_TIME; + decoder_model->presentation_time = INVALID_TIME; + decoder_model->decode_samples = 0; + decoder_model->display_samples = 0; + decoder_model->max_decode_rate = 0.0; + decoder_model->max_display_rate = 0.0; + + decoder_model->num_frame = -1; + decoder_model->num_decoded_frame = -1; + decoder_model->num_shown_frame = -1; + decoder_model->current_time = 0.0; + + initialize_buffer_pool(decoder_model); + + DFG_INTERVAL_QUEUE *const dfg_interval_queue = + &decoder_model->dfg_interval_queue; + dfg_interval_queue->total_interval = 0.0; + dfg_interval_queue->head = 0; + dfg_interval_queue->size = 0; + + if (seq_params->timing_info_present) { + decoder_model->num_ticks_per_picture = + seq_params->timing_info.num_ticks_per_picture; + decoder_model->display_clock_tick = + seq_params->timing_info.num_units_in_display_tick / + seq_params->timing_info.time_scale; + } else { + decoder_model->num_ticks_per_picture = 1; + decoder_model->display_clock_tick = 1.0 / cpi->framerate; + } + + decoder_model->initial_display_delay = + seq_params->op_params[op_index].initial_display_delay; + decoder_model->initial_presentation_delay = INVALID_TIME; + decoder_model->decode_rate = av1_level_defs[level].max_decode_rate; +} + +void av1_decoder_model_process_frame(const AV1_COMP *const cpi, + size_t coded_bits, + DECODER_MODEL *const decoder_model) { + if (!decoder_model || decoder_model->status != DECODER_MODEL_OK) return; + + aom_clear_system_state(); + + const AV1_COMMON *const cm = &cpi->common; + const int luma_pic_size = cm->superres_upscaled_width * cm->height; + const int show_existing_frame = cm->show_existing_frame; + const int show_frame = cm->show_frame || show_existing_frame; + ++decoder_model->num_frame; + if (!show_existing_frame) ++decoder_model->num_decoded_frame; + if (show_frame) ++decoder_model->num_shown_frame; + decoder_model->coded_bits += coded_bits; + + int display_idx = -1; + if (show_existing_frame) { + display_idx = decoder_model->vbi[cpi->existing_fb_idx_to_show]; + if (display_idx < 0) { + decoder_model->status = DECODE_EXISTING_FRAME_BUF_EMPTY; + return; + } + if (decoder_model->frame_buffer_pool[display_idx].frame_type == KEY_FRAME) { + update_ref_buffers(decoder_model, display_idx, 0xFF); + } + } else { + const double removal_time = get_removal_time(decoder_model); + if (removal_time < 0.0) { + decoder_model->status = DECODE_FRAME_BUF_UNAVAILABLE; + return; + } + + const int previous_decode_samples = decoder_model->decode_samples; + const double previous_removal_time = decoder_model->removal_time; + assert(previous_removal_time < removal_time); + decoder_model->removal_time = removal_time; + decoder_model->decode_samples = luma_pic_size; + const double this_decode_rate = + previous_decode_samples / (removal_time - previous_removal_time); + decoder_model->max_decode_rate = + AOMMAX(decoder_model->max_decode_rate, this_decode_rate); + + // A frame with show_existing_frame being false indicates the end of a DFG. + // Update the bits arrival time of this DFG. + const double buffer_delay = (decoder_model->encoder_buffer_delay + + decoder_model->decoder_buffer_delay) / + 90000.0; + const double latest_arrival_time = removal_time - buffer_delay; + decoder_model->first_bit_arrival_time = + AOMMAX(decoder_model->last_bit_arrival_time, latest_arrival_time); + decoder_model->last_bit_arrival_time = + decoder_model->first_bit_arrival_time + + (double)decoder_model->coded_bits / decoder_model->bit_rate; + // Smoothing buffer underflows if the last bit arrives after the removal + // time. + if (decoder_model->last_bit_arrival_time > removal_time && + !decoder_model->is_low_delay_mode) { + decoder_model->status = SMOOTHING_BUFFER_UNDERFLOW; + return; + } + // Reset the coded bits for the next DFG. + decoder_model->coded_bits = 0; + + // Check if the smoothing buffer overflows. + DFG_INTERVAL_QUEUE *const queue = &decoder_model->dfg_interval_queue; + if (queue->size >= DFG_INTERVAL_QUEUE_SIZE) { + assert(0); + } + const double first_bit_arrival_time = decoder_model->first_bit_arrival_time; + const double last_bit_arrival_time = decoder_model->last_bit_arrival_time; + // Remove the DFGs with removal time earlier than last_bit_arrival_time. + while (queue->buf[queue->head].removal_time <= last_bit_arrival_time && + queue->size > 0) { + if (queue->buf[queue->head].removal_time - first_bit_arrival_time + + queue->total_interval > + 1.0) { + decoder_model->status = SMOOTHING_BUFFER_OVERFLOW; + return; + } + queue->total_interval -= queue->buf[queue->head].last_bit_arrival_time - + queue->buf[queue->head].first_bit_arrival_time; + queue->head = (queue->head + 1) % DFG_INTERVAL_QUEUE_SIZE; + --queue->size; + } + // Push current DFG into the queue. + const int queue_index = + (queue->head + queue->size++) % DFG_INTERVAL_QUEUE_SIZE; + queue->buf[queue_index].first_bit_arrival_time = first_bit_arrival_time; + queue->buf[queue_index].last_bit_arrival_time = last_bit_arrival_time; + queue->buf[queue_index].removal_time = removal_time; + queue->total_interval += last_bit_arrival_time - first_bit_arrival_time; + // The smoothing buffer can hold at most "bit_rate" bits, which is + // equivalent to 1 second of total interval. + if (queue->total_interval > 1.0) { + decoder_model->status = SMOOTHING_BUFFER_OVERFLOW; + return; + } + + release_processed_frames(decoder_model, removal_time); + decoder_model->current_time = + removal_time + time_to_decode_frame(cm, decoder_model->decode_rate); + + const int cfbi = get_free_buffer(decoder_model); + if (cfbi < 0) { + decoder_model->status = DECODE_FRAME_BUF_UNAVAILABLE; + return; + } + const CurrentFrame *const current_frame = &cm->current_frame; + decoder_model->frame_buffer_pool[cfbi].frame_type = + cm->current_frame.frame_type; + display_idx = cfbi; + update_ref_buffers(decoder_model, cfbi, current_frame->refresh_frame_flags); + + if (decoder_model->initial_presentation_delay < 0.0) { + // Display can begin after required number of frames have been buffered. + if (frames_in_buffer_pool(decoder_model) >= + decoder_model->initial_display_delay) { + decoder_model->initial_presentation_delay = decoder_model->current_time; + // Update presentation time for each shown frame in the frame buffer. + for (int i = 0; i < BUFFER_POOL_MAX_SIZE; ++i) { + FRAME_BUFFER *const this_buffer = + &decoder_model->frame_buffer_pool[i]; + if (this_buffer->player_ref_count == 0) continue; + assert(this_buffer->display_index >= 0); + this_buffer->presentation_time = + get_presentation_time(decoder_model, this_buffer->display_index); + } + } + } + } + + // Display. + if (show_frame) { + assert(display_idx >= 0 && display_idx < BUFFER_POOL_MAX_SIZE); + FRAME_BUFFER *const this_buffer = + &decoder_model->frame_buffer_pool[display_idx]; + ++this_buffer->player_ref_count; + this_buffer->display_index = decoder_model->num_shown_frame; + const double presentation_time = + get_presentation_time(decoder_model, this_buffer->display_index); + this_buffer->presentation_time = presentation_time; + if (presentation_time >= 0.0 && + decoder_model->current_time > presentation_time) { + decoder_model->status = DISPLAY_FRAME_LATE; + return; + } + + const int previous_display_samples = decoder_model->display_samples; + const double previous_presentation_time = decoder_model->presentation_time; + decoder_model->display_samples = luma_pic_size; + decoder_model->presentation_time = presentation_time; + if (presentation_time >= 0.0 && previous_presentation_time >= 0.0) { + assert(previous_presentation_time < presentation_time); + const double this_display_rate = + previous_display_samples / + (presentation_time - previous_presentation_time); + decoder_model->max_display_rate = + AOMMAX(decoder_model->max_display_rate, this_display_rate); + } + } +} + +void av1_init_level_info(AV1_COMP *cpi) { + for (int op_index = 0; op_index < MAX_NUM_OPERATING_POINTS; ++op_index) { + AV1LevelInfo *const this_level_info = + cpi->level_params.level_info[op_index]; + if (!this_level_info) continue; + memset(this_level_info, 0, sizeof(*this_level_info)); + AV1LevelSpec *const level_spec = &this_level_info->level_spec; + level_spec->level = SEQ_LEVEL_MAX; + AV1LevelStats *const level_stats = &this_level_info->level_stats; + level_stats->min_cropped_tile_width = INT_MAX; + level_stats->min_cropped_tile_height = INT_MAX; + level_stats->min_frame_width = INT_MAX; + level_stats->min_frame_height = INT_MAX; + level_stats->tile_width_is_valid = 1; + level_stats->min_cr = 1e8; + + FrameWindowBuffer *const frame_window_buffer = + &this_level_info->frame_window_buffer; + frame_window_buffer->num = 0; + frame_window_buffer->start = 0; + + const AV1_COMMON *const cm = &cpi->common; + const int upscaled_width = cm->superres_upscaled_width; + const int height = cm->height; + const int pic_size = upscaled_width * height; + for (AV1_LEVEL level = SEQ_LEVEL_2_0; level < SEQ_LEVELS; ++level) { + DECODER_MODEL *const this_model = &this_level_info->decoder_models[level]; + const AV1LevelSpec *const spec = &av1_level_defs[level]; + if (upscaled_width > spec->max_h_size || height > spec->max_v_size || + pic_size > spec->max_picture_size) { + // Turn off decoder model for this level as the frame size already + // exceeds level constraints. + this_model->status = DECODER_MODEL_DISABLED; + } else { + av1_decoder_model_init(cpi, level, op_index, this_model); + } + } + } +} + + if (level_spec->level < SEQ_LEVEL_4_0) tier = 0; -static TARGET_LEVEL_FAIL_ID check_level_constraints( - const AV1LevelSpec *const target_level_spec, - const AV1LevelSpec *const level_spec, - const AV1LevelStats *const level_stats, int tier, int is_still_picture) { - const double min_cr = get_min_cr(target_level_spec, tier, is_still_picture, - level_spec->max_decode_rate); - TARGET_LEVEL_FAIL_ID fail_id = TARGET_LEVEL_OK; +double av1_get_min_cr_for_level(AV1_LEVEL level_index, int tier, + int is_still_picture) { + assert(is_valid_seq_level_idx(level_index)); + const AV1LevelSpec *const level_spec = &av1_level_defs[level_index]; + return get_min_cr(level_spec, tier, is_still_picture, + level_spec->max_decode_rate); +} +static void get_temporal_parallel_params(int scalability_mode_idc, + int *temporal_parallel_num, + int *temporal_parallel_denom) { + if (scalability_mode_idc < 0) { + *temporal_parallel_num = 1; + *temporal_parallel_denom = 1; + return; + } + + // TODO(huisu@): handle scalability cases. + if (scalability_mode_idc == SCALABILITY_SS) { + (void)scalability_mode_idc; + } else { + (void)scalability_mode_idc; + } +} + +#define MAX_TILE_SIZE (4096 * 2304) +#define MIN_CROPPED_TILE_WIDTH 8 +#define MIN_CROPPED_TILE_HEIGHT 8 +#define MIN_FRAME_WIDTH 16 +#define MIN_FRAME_HEIGHT 16 +#define MAX_TILE_SIZE_HEADER_RATE_PRODUCT 588251136 + +static TARGET_LEVEL_FAIL_ID check_level_constraints( + const AV1LevelInfo *const level_info, AV1_LEVEL level, int tier, + int is_still_picture, BITSTREAM_PROFILE profile, int check_bitrate) { + const DECODER_MODEL *const decoder_model = &level_info->decoder_models[level]; + const DECODER_MODEL_STATUS decoder_model_status = decoder_model->status; + if (decoder_model_status != DECODER_MODEL_OK && + decoder_model_status != DECODER_MODEL_DISABLED) { + return DECODER_MODEL_FAIL; + } + + const AV1LevelSpec *const level_spec = &level_info->level_spec; + const AV1LevelSpec *const target_level_spec = &av1_level_defs[level]; + const AV1LevelStats *const level_stats = &level_info->level_stats; + TARGET_LEVEL_FAIL_ID fail_id = TARGET_LEVEL_OK;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/level.c
262
263
264
265
266
267
268
269
270
271
static double get_min_cr(const AV1LevelSpec *const level_spec, int tier, int is_still_picture, int64_t decoded_sample_rate) { if (is_still_picture) return 0.8; const double min_cr_basis = tier ? level_spec->high_cr : level_spec->main_cr; const double speed_adj = (double)decoded_sample_rate / level_spec->max_display_rate; return AOMMAX(min_cr_basis * speed_adj, 0.8); }
+ show +
272
273
274
275
276
277
278
static TARGET_LEVEL_FAIL_ID check_level_constraints( const AV1LevelSpec *const target_level_spec, const AV1LevelSpec *const level_spec, const AV1LevelStats *const level_stats, int tier, int is_still_picture) { const double min_cr = get_min_cr(target_level_spec, tier, is_still_picture, level_spec->max_decode_rate); TARGET_LEVEL_FAIL_ID fail_id = TARGET_LEVEL_OK;
+ show +
279
280
281
282
283
284
285
286
287
288
do { if (level_spec->max_picture_size > target_level_spec->max_picture_size) { fail_id = LUMA_PIC_SIZE_TOO_LARGE; break; } if (level_spec->max_h_size > target_level_spec->max_h_size) { fail_id = LUMA_PIC_H_SIZE_TOO_LARGE; break;

[CVE-2020-0478_1.diff] global_motion.h #1
+#include "av1/common/warped_motion.h" +#define MAX_CORNERS 4096 +#define GM_REFINEMENT_COUNT 5 +unsigned char *av1_downconvert_frame(YV12_BUFFER_CONFIG *frm, int bit_depth); + +typedef struct { + double params[MAX_PARAMDIM - 1]; + int *inliers; + int num_inliers; +} MotionModel; + +// TODO(sarahparker) These need to be retuned for speed 0 and 1 to +// maximize gains from segmented error metric +static const double erroradv_tr[] = { 0.65, 0.60, 0.65 }; +static const double erroradv_prod_tr[] = { 20000, 18000, 16000 }; + +void av1_compute_feature_segmentation_map(uint8_t *segment_map, int width, + int height, int *inliers, + int num_inliers); + +// Returns the error between the result of applying motion 'wm' to the frame +// described by 'ref' and the frame described by 'dst'. +int64_t av1_warp_error(WarpedMotionParams *wm, int use_hbd, int bd, + const uint8_t *ref, int width, int height, int stride, + uint8_t *dst, int p_col, int p_row, int p_width, + int p_height, int p_stride, int subsampling_x, + int subsampling_y, int64_t best_error, + uint8_t *segment_map, int segment_map_stride); + -int64_t av1_refine_integerized_param(WarpedMotionParams *wm, - TransformationType wmtype, int use_hbd, - int bd, uint8_t *ref, int r_width, - int r_height, int r_stride, uint8_t *dst, - int d_width, int d_height, int d_stride, - int n_refinements, - int64_t best_frame_error); +int64_t av1_refine_integerized_param( + WarpedMotionParams *wm, TransformationType wmtype, int use_hbd, int bd, + uint8_t *ref, int r_width, int r_height, int r_stride, uint8_t *dst, + int d_width, int d_height, int d_stride, int n_refinements, + int64_t best_frame_error, uint8_t *segment_map, int segment_map_stride, + int64_t erroradv_threshold);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/global_motion.h
29
30
31
32
33
34
35
36
37
38
void av1_convert_model_to_params(const double *params, WarpedMotionParams *model); int av1_is_enough_erroradvantage(double best_erroradvantage, int params_cost, int erroradv_type); // Returns the av1_warp_error between "dst" and the result of applying the // motion params that result from fine-tuning "wm" to "ref". Note that "wm" is // modified in place.
+ show +
39
40
41
42
43
44
45
int64_t av1_refine_integerized_param(WarpedMotionParams *wm, TransformationType wmtype, int use_hbd, int bd, uint8_t *ref, int r_width, int r_height, int r_stride, uint8_t *dst, int d_width, int d_height, int d_stride, int n_refinements, int64_t best_frame_error);
+ show +
46
47
48
49
50
51
52
53
54
55
/* Computes "num_motions" candidate global motion parameters between two frames. The array "params_by_motion" should be length 8 * "num_motions". The ordering of each set of parameters is best described by the homography: [x' (m2 m3 m0 [x z . y' = m4 m5 m1 * y 1] m6 m7 1) 1]

[CVE-2020-0470_1.diff] global_motion.h #1
+#include "av1/common/warped_motion.h" +#define MAX_CORNERS 4096 +#define GM_REFINEMENT_COUNT 5 +unsigned char *av1_downconvert_frame(YV12_BUFFER_CONFIG *frm, int bit_depth); + +typedef struct { + double params[MAX_PARAMDIM - 1]; + int *inliers; + int num_inliers; +} MotionModel; + +// TODO(sarahparker) These need to be retuned for speed 0 and 1 to +// maximize gains from segmented error metric +static const double erroradv_tr[] = { 0.65, 0.60, 0.65 }; +static const double erroradv_prod_tr[] = { 20000, 18000, 16000 }; + +void av1_compute_feature_segmentation_map(uint8_t *segment_map, int width, + int height, int *inliers, + int num_inliers); + +// Returns the error between the result of applying motion 'wm' to the frame +// described by 'ref' and the frame described by 'dst'. +int64_t av1_warp_error(WarpedMotionParams *wm, int use_hbd, int bd, + const uint8_t *ref, int width, int height, int stride, + uint8_t *dst, int p_col, int p_row, int p_width, + int p_height, int p_stride, int subsampling_x, + int subsampling_y, int64_t best_error, + uint8_t *segment_map, int segment_map_stride); + -int64_t av1_refine_integerized_param(WarpedMotionParams *wm, - TransformationType wmtype, int use_hbd, - int bd, uint8_t *ref, int r_width, - int r_height, int r_stride, uint8_t *dst, - int d_width, int d_height, int d_stride, - int n_refinements, - int64_t best_frame_error); +int64_t av1_refine_integerized_param( + WarpedMotionParams *wm, TransformationType wmtype, int use_hbd, int bd, + uint8_t *ref, int r_width, int r_height, int r_stride, uint8_t *dst, + int d_width, int d_height, int d_stride, int n_refinements, + int64_t best_frame_error, uint8_t *segment_map, int segment_map_stride, + int64_t erroradv_threshold);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/global_motion.h
29
30
31
32
33
34
35
36
37
38
void av1_convert_model_to_params(const double *params, WarpedMotionParams *model); int av1_is_enough_erroradvantage(double best_erroradvantage, int params_cost, int erroradv_type); // Returns the av1_warp_error between "dst" and the result of applying the // motion params that result from fine-tuning "wm" to "ref". Note that "wm" is // modified in place.
+ show +
39
40
41
42
43
44
45
int64_t av1_refine_integerized_param(WarpedMotionParams *wm, TransformationType wmtype, int use_hbd, int bd, uint8_t *ref, int r_width, int r_height, int r_stride, uint8_t *dst, int d_width, int d_height, int d_stride, int n_refinements, int64_t best_frame_error);
+ show +
46
47
48
49
50
51
52
53
54
55
/* Computes "num_motions" candidate global motion parameters between two frames. The array "params_by_motion" should be length 8 * "num_motions". The ordering of each set of parameters is best described by the homography: [x' (m2 m3 m0 [x z . y' = m4 m5 m1 * y 1] m6 m7 1) 1]

[CVE-2020-0478_1.diff] segmentation.c #5
- + int scale_up = cm->prev_frame && (cm->width > cm->prev_frame->width || + cm->height > cm->prev_frame->height); - for (tile_row = 0; tile_row < cm->tile_rows; tile_row++) { - TileInfo tile_info; - av1_tile_set_row(&tile_info, cm, tile_row); - for (tile_col = 0; tile_col < cm->tile_cols; tile_col++) { - MB_MODE_INFO **mi_ptr; - av1_tile_set_col(&tile_info, cm, tile_col); - mi_ptr = cm->mi_grid_visible + tile_info.mi_row_start * cm->mi_stride + - tile_info.mi_col_start; - for (mi_row = tile_info.mi_row_start; mi_row < tile_info.mi_row_end; - mi_row += cm->seq_params.mib_size, - mi_ptr += cm->seq_params.mib_size * cm->mi_stride) { - MB_MODE_INFO **mi = mi_ptr; - for (mi_col = tile_info.mi_col_start; mi_col < tile_info.mi_col_end; - mi_col += cm->seq_params.mib_size, mi += cm->seq_params.mib_size) { - count_segs_sb(cm, xd, &tile_info, mi, no_pred_segcounts, - temporal_predictor_count, t_unpred_seg_counts, mi_row, - mi_col, cm->seq_params.sb_size); + if (!scale_up) { + for (tile_row = 0; tile_row < cm->tiles.rows; tile_row++) { + TileInfo tile_info; + av1_tile_set_row(&tile_info, cm, tile_row); + for (tile_col = 0; tile_col < cm->tiles.cols; tile_col++) { + MB_MODE_INFO **mi_ptr; + av1_tile_set_col(&tile_info, cm, tile_col); + mi_ptr = cm->mi_params.mi_grid_base + + tile_info.mi_row_start * cm->mi_params.mi_stride + + tile_info.mi_col_start; + for (mi_row = tile_info.mi_row_start; mi_row < tile_info.mi_row_end; + mi_row += cm->seq_params.mib_size, + mi_ptr += cm->seq_params.mib_size * cm->mi_params.mi_stride) { + MB_MODE_INFO **mi = mi_ptr; + for (mi_col = tile_info.mi_col_start; mi_col < tile_info.mi_col_end; + mi_col += cm->seq_params.mib_size, + mi += cm->seq_params.mib_size) { + count_segs_sb(cm, xd, &tile_info, mi, no_pred_segcounts, + temporal_predictor_count, t_unpred_seg_counts, mi_row, + mi_col, cm->seq_params.sb_size); + }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/segmentation.c
173
174
175
176
177
178
179
180
181
182
int no_pred_cost; int t_pred_cost = INT_MAX; int tile_col, tile_row, mi_row, mi_col; unsigned temporal_predictor_count[SEG_TEMPORAL_PRED_CTXS][2] = { { 0 } }; unsigned no_pred_segcounts[MAX_SEGMENTS] = { 0 }; unsigned t_unpred_seg_counts[MAX_SEGMENTS] = { 0 }; (void)xd; // First of all generate stats regarding how well the last segment map // predicts this one
+ show +
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
for (tile_row = 0; tile_row < cm->tile_rows; tile_row++) { TileInfo tile_info; av1_tile_set_row(&tile_info, cm, tile_row); for (tile_col = 0; tile_col < cm->tile_cols; tile_col++) { MB_MODE_INFO **mi_ptr; av1_tile_set_col(&tile_info, cm, tile_col); mi_ptr = cm->mi_grid_visible + tile_info.mi_row_start * cm->mi_stride + tile_info.mi_col_start; for (mi_row = tile_info.mi_row_start; mi_row < tile_info.mi_row_end; mi_row += cm->seq_params.mib_size, mi_ptr += cm->seq_params.mib_size * cm->mi_stride) { MB_MODE_INFO **mi = mi_ptr; for (mi_col = tile_info.mi_col_start; mi_col < tile_info.mi_col_end; mi_col += cm->seq_params.mib_size, mi += cm->seq_params.mib_size) { count_segs_sb(cm, xd, &tile_info, mi, no_pred_segcounts, temporal_predictor_count, t_unpred_seg_counts, mi_row, mi_col, cm->seq_params.sb_size);
+ show +
200
201
202
203
204
205
206
207
208
209
} } } } int seg_id_cost[MAX_SEGMENTS]; av1_cost_tokens_from_cdf(seg_id_cost, segp->tree_cdf, NULL); no_pred_cost = 0; for (int i = 0; i < MAX_SEGMENTS; ++i) no_pred_cost += no_pred_segcounts[i] * seg_id_cost[i];

[CVE-2020-0470_1.diff] segmentation.c #5
- + int scale_up = cm->prev_frame && (cm->width > cm->prev_frame->width || + cm->height > cm->prev_frame->height); - for (tile_row = 0; tile_row < cm->tile_rows; tile_row++) { - TileInfo tile_info; - av1_tile_set_row(&tile_info, cm, tile_row); - for (tile_col = 0; tile_col < cm->tile_cols; tile_col++) { - MB_MODE_INFO **mi_ptr; - av1_tile_set_col(&tile_info, cm, tile_col); - mi_ptr = cm->mi_grid_visible + tile_info.mi_row_start * cm->mi_stride + - tile_info.mi_col_start; - for (mi_row = tile_info.mi_row_start; mi_row < tile_info.mi_row_end; - mi_row += cm->seq_params.mib_size, - mi_ptr += cm->seq_params.mib_size * cm->mi_stride) { - MB_MODE_INFO **mi = mi_ptr; - for (mi_col = tile_info.mi_col_start; mi_col < tile_info.mi_col_end; - mi_col += cm->seq_params.mib_size, mi += cm->seq_params.mib_size) { - count_segs_sb(cm, xd, &tile_info, mi, no_pred_segcounts, - temporal_predictor_count, t_unpred_seg_counts, mi_row, - mi_col, cm->seq_params.sb_size); + if (!scale_up) { + for (tile_row = 0; tile_row < cm->tiles.rows; tile_row++) { + TileInfo tile_info; + av1_tile_set_row(&tile_info, cm, tile_row); + for (tile_col = 0; tile_col < cm->tiles.cols; tile_col++) { + MB_MODE_INFO **mi_ptr; + av1_tile_set_col(&tile_info, cm, tile_col); + mi_ptr = cm->mi_params.mi_grid_base + + tile_info.mi_row_start * cm->mi_params.mi_stride + + tile_info.mi_col_start; + for (mi_row = tile_info.mi_row_start; mi_row < tile_info.mi_row_end; + mi_row += cm->seq_params.mib_size, + mi_ptr += cm->seq_params.mib_size * cm->mi_params.mi_stride) { + MB_MODE_INFO **mi = mi_ptr; + for (mi_col = tile_info.mi_col_start; mi_col < tile_info.mi_col_end; + mi_col += cm->seq_params.mib_size, + mi += cm->seq_params.mib_size) { + count_segs_sb(cm, xd, &tile_info, mi, no_pred_segcounts, + temporal_predictor_count, t_unpred_seg_counts, mi_row, + mi_col, cm->seq_params.sb_size); + }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/segmentation.c
173
174
175
176
177
178
179
180
181
182
int no_pred_cost; int t_pred_cost = INT_MAX; int tile_col, tile_row, mi_row, mi_col; unsigned temporal_predictor_count[SEG_TEMPORAL_PRED_CTXS][2] = { { 0 } }; unsigned no_pred_segcounts[MAX_SEGMENTS] = { 0 }; unsigned t_unpred_seg_counts[MAX_SEGMENTS] = { 0 }; (void)xd; // First of all generate stats regarding how well the last segment map // predicts this one
+ show +
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
for (tile_row = 0; tile_row < cm->tile_rows; tile_row++) { TileInfo tile_info; av1_tile_set_row(&tile_info, cm, tile_row); for (tile_col = 0; tile_col < cm->tile_cols; tile_col++) { MB_MODE_INFO **mi_ptr; av1_tile_set_col(&tile_info, cm, tile_col); mi_ptr = cm->mi_grid_visible + tile_info.mi_row_start * cm->mi_stride + tile_info.mi_col_start; for (mi_row = tile_info.mi_row_start; mi_row < tile_info.mi_row_end; mi_row += cm->seq_params.mib_size, mi_ptr += cm->seq_params.mib_size * cm->mi_stride) { MB_MODE_INFO **mi = mi_ptr; for (mi_col = tile_info.mi_col_start; mi_col < tile_info.mi_col_end; mi_col += cm->seq_params.mib_size, mi += cm->seq_params.mib_size) { count_segs_sb(cm, xd, &tile_info, mi, no_pred_segcounts, temporal_predictor_count, t_unpred_seg_counts, mi_row, mi_col, cm->seq_params.sb_size);
+ show +
200
201
202
203
204
205
206
207
208
209
} } } } int seg_id_cost[MAX_SEGMENTS]; av1_cost_tokens_from_cdf(seg_id_cost, segp->tree_cdf, NULL); no_pred_cost = 0; for (int i = 0; i < MAX_SEGMENTS; ++i) no_pred_cost += no_pred_segcounts[i] * seg_id_cost[i];

[CVE-2020-0478_1.diff] rd.h #10
-int av1_get_switchable_rate(const AV1_COMMON *const cm, MACROBLOCK *x, - const MACROBLOCKD *xd); - -int av1_raster_block_offset(BLOCK_SIZE plane_bsize, int raster_block, - int stride); - -int16_t *av1_raster_block_offset_int16(BLOCK_SIZE plane_bsize, int raster_block, - int16_t *base); +int av1_get_switchable_rate(const MACROBLOCK *x, const MACROBLOCKD *xd, + InterpFilter interp_filter);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rd.h
397
398
399
400
401
402
403
404
405
406
int qindex); void av1_model_rd_from_var_lapndz(int64_t var, unsigned int n, unsigned int qstep, int *rate, int64_t *dist); void av1_model_rd_curvfit(BLOCK_SIZE bsize, double sse_norm, double xqr, double *rate_f, double *distbysse_f); void av1_model_rd_surffit(BLOCK_SIZE bsize, double sse_norm, double xm, double yl, double *rate_f, double *distbysse_f);
+ show +
407
408
409
410
411
412
413
414
int av1_get_switchable_rate(const AV1_COMMON *const cm, MACROBLOCK *x, const MACROBLOCKD *xd); int av1_raster_block_offset(BLOCK_SIZE plane_bsize, int raster_block, int stride); int16_t *av1_raster_block_offset_int16(BLOCK_SIZE plane_bsize, int raster_block, int16_t *base);
+ show +
415
416
417
418
419
420
421
422
423
424
YV12_BUFFER_CONFIG *av1_get_scaled_ref_frame(const struct AV1_COMP *cpi, int ref_frame); void av1_init_me_luts(void); void av1_set_mvcost(MACROBLOCK *x, int ref, int ref_mv_idx); void av1_get_entropy_contexts(BLOCK_SIZE bsize, const struct macroblockd_plane *pd,

[CVE-2020-0470_1.diff] rd.h #10
-int av1_get_switchable_rate(const AV1_COMMON *const cm, MACROBLOCK *x, - const MACROBLOCKD *xd); - -int av1_raster_block_offset(BLOCK_SIZE plane_bsize, int raster_block, - int stride); - -int16_t *av1_raster_block_offset_int16(BLOCK_SIZE plane_bsize, int raster_block, - int16_t *base); +int av1_get_switchable_rate(const MACROBLOCK *x, const MACROBLOCKD *xd, + InterpFilter interp_filter);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rd.h
397
398
399
400
401
402
403
404
405
406
int qindex); void av1_model_rd_from_var_lapndz(int64_t var, unsigned int n, unsigned int qstep, int *rate, int64_t *dist); void av1_model_rd_curvfit(BLOCK_SIZE bsize, double sse_norm, double xqr, double *rate_f, double *distbysse_f); void av1_model_rd_surffit(BLOCK_SIZE bsize, double sse_norm, double xm, double yl, double *rate_f, double *distbysse_f);
+ show +
407
408
409
410
411
412
413
414
int av1_get_switchable_rate(const AV1_COMMON *const cm, MACROBLOCK *x, const MACROBLOCKD *xd); int av1_raster_block_offset(BLOCK_SIZE plane_bsize, int raster_block, int stride); int16_t *av1_raster_block_offset_int16(BLOCK_SIZE plane_bsize, int raster_block, int16_t *base);
+ show +
415
416
417
418
419
420
421
422
423
424
YV12_BUFFER_CONFIG *av1_get_scaled_ref_frame(const struct AV1_COMP *cpi, int ref_frame); void av1_init_me_luts(void); void av1_set_mvcost(MACROBLOCK *x, int ref, int ref_mv_idx); void av1_get_entropy_contexts(BLOCK_SIZE bsize, const struct macroblockd_plane *pd,

[CVE-2020-0478_1.diff] picklpf.c #7
- lf->filter_level[0] = - search_filter_level(sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, - last_frame_filter_level, NULL, 0, 0); - lf->filter_level[1] = - search_filter_level(sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, - last_frame_filter_level, NULL, 0, 1); + if (method != LPF_PICK_FROM_FULL_IMAGE_NON_DUAL) { + lf->filter_level[0] = + search_filter_level(sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, + last_frame_filter_level, NULL, 0, 0); + lf->filter_level[1] = + search_filter_level(sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, + last_frame_filter_level, NULL, 0, 1); + }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/picklpf.c
255
256
257
258
259
260
261
262
263
264
lf->filter_level_v = clamp(filt_guess, min_filter_level, max_filter_level); } else { const int last_frame_filter_level[4] = { lf->filter_level[0], lf->filter_level[1], lf->filter_level_u, lf->filter_level_v }; lf->filter_level[0] = lf->filter_level[1] = search_filter_level(sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, last_frame_filter_level, NULL, 0, 2);
+ show +
265
266
267
268
269
270
lf->filter_level[0] = search_filter_level(sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, last_frame_filter_level, NULL, 0, 0); lf->filter_level[1] = search_filter_level(sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, last_frame_filter_level, NULL, 0, 1);
+ show +
271
272
273
274
275
276
277
278
279
280
if (num_planes > 1) { lf->filter_level_u = search_filter_level(sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, last_frame_filter_level, NULL, 1, 0); lf->filter_level_v = search_filter_level(sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, last_frame_filter_level, NULL, 2, 0); } }

[CVE-2020-0470_1.diff] picklpf.c #7
- lf->filter_level[0] = - search_filter_level(sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, - last_frame_filter_level, NULL, 0, 0); - lf->filter_level[1] = - search_filter_level(sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, - last_frame_filter_level, NULL, 0, 1); + if (method != LPF_PICK_FROM_FULL_IMAGE_NON_DUAL) { + lf->filter_level[0] = + search_filter_level(sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, + last_frame_filter_level, NULL, 0, 0); + lf->filter_level[1] = + search_filter_level(sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, + last_frame_filter_level, NULL, 0, 1); + }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/picklpf.c
255
256
257
258
259
260
261
262
263
264
lf->filter_level_v = clamp(filt_guess, min_filter_level, max_filter_level); } else { const int last_frame_filter_level[4] = { lf->filter_level[0], lf->filter_level[1], lf->filter_level_u, lf->filter_level_v }; lf->filter_level[0] = lf->filter_level[1] = search_filter_level(sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, last_frame_filter_level, NULL, 0, 2);
+ show +
265
266
267
268
269
270
lf->filter_level[0] = search_filter_level(sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, last_frame_filter_level, NULL, 0, 0); lf->filter_level[1] = search_filter_level(sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, last_frame_filter_level, NULL, 0, 1);
+ show +
271
272
273
274
275
276
277
278
279
280
if (num_planes > 1) { lf->filter_level_u = search_filter_level(sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, last_frame_filter_level, NULL, 1, 0); lf->filter_level_v = search_filter_level(sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, last_frame_filter_level, NULL, 2, 0); } }

[CVE-2020-0478_1.diff] decodeframe.c #27
- int mu_blocks_wide = - block_size_wide[max_unit_bsize] >> tx_size_wide_log2[0]; - int mu_blocks_high = - block_size_high[max_unit_bsize] >> tx_size_high_log2[0]; + int mu_blocks_wide = mi_size_wide[max_unit_bsize]; + int mu_blocks_high = mi_size_high[max_unit_bsize];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/bitstream.c
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
const int num_4x4_h = block_size_high[plane_bsize] >> tx_size_high_log2[0]; int row, col; TOKEN_STATS token_stats; init_token_stats(&token_stats); const BLOCK_SIZE max_unit_bsize = BLOCK_64X64; assert(max_unit_bsize == get_plane_block_size(BLOCK_64X64, xd->plane[0].subsampling_x, xd->plane[0].subsampling_y));
+ show +
1461
1462
1463
1464
int mu_blocks_wide = block_size_wide[max_unit_bsize] >> tx_size_wide_log2[0]; int mu_blocks_high = block_size_high[max_unit_bsize] >> tx_size_high_log2[0];
+ show +
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
mu_blocks_wide = AOMMIN(num_4x4_w, mu_blocks_wide); mu_blocks_high = AOMMIN(num_4x4_h, mu_blocks_high); for (row = 0; row < num_4x4_h; row += mu_blocks_high) { for (col = 0; col < num_4x4_w; col += mu_blocks_wide) { for (plane = 0; plane < num_planes && is_inter_block(mbmi); ++plane) { const struct macroblockd_plane *const pd = &xd->plane[plane]; if (!is_chroma_reference(mi_row, mi_col, mbmi->sb_type, pd->subsampling_x, pd->subsampling_y)) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodemb.c
505
506
507
508
509
510
511
512
513
514
int step = tx_size_wide_unit[max_tx_size] * tx_size_high_unit[max_tx_size]; av1_get_entropy_contexts(bsizec, pd, ctx.ta[plane], ctx.tl[plane]); av1_subtract_plane(x, bsizec, plane); arg.ta = ctx.ta[plane]; arg.tl = ctx.tl[plane]; const BLOCK_SIZE max_unit_bsize = get_plane_block_size(BLOCK_64X64, pd->subsampling_x, pd->subsampling_y);
+ show +
515
516
517
518
int mu_blocks_wide = block_size_wide[max_unit_bsize] >> tx_size_wide_log2[0]; int mu_blocks_high = block_size_high[max_unit_bsize] >> tx_size_high_log2[0];
+ show +
519
520
521
522
523
524
525
526
527
528
mu_blocks_wide = AOMMIN(mi_width, mu_blocks_wide); mu_blocks_high = AOMMIN(mi_height, mu_blocks_high); for (idy = 0; idy < mi_height; idy += mu_blocks_high) { for (idx = 0; idx < mi_width; idx += mu_blocks_wide) { int blk_row, blk_col; const int unit_height = AOMMIN(mu_blocks_high + idy, mi_height); const int unit_width = AOMMIN(mu_blocks_wide + idx, mi_width); for (blk_row = idy; blk_row < unit_height; blk_row += bh) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/tokenize.c
219
220
221
222
223
224
225
226
227
228
const TX_SIZE max_tx_size = get_vartx_max_txsize(xd, plane_bsize, plane); const BLOCK_SIZE txb_size = txsize_to_bsize[max_tx_size]; int bw = block_size_wide[txb_size] >> tx_size_wide_log2[0]; int bh = block_size_high[txb_size] >> tx_size_high_log2[0]; int idx, idy; int block = 0; int step = tx_size_wide_unit[max_tx_size] * tx_size_high_unit[max_tx_size]; const BLOCK_SIZE max_unit_bsize = get_plane_block_size(BLOCK_64X64, pd->subsampling_x, pd->subsampling_y);
+ show +
229
230
231
232
int mu_blocks_wide = block_size_wide[max_unit_bsize] >> tx_size_wide_log2[0]; int mu_blocks_high = block_size_high[max_unit_bsize] >> tx_size_high_log2[0];
+ show +
233
234
235
236
237
238
239
240
241
242
mu_blocks_wide = AOMMIN(mi_width, mu_blocks_wide); mu_blocks_high = AOMMIN(mi_height, mu_blocks_high); for (idy = 0; idy < mi_height; idy += mu_blocks_high) { for (idx = 0; idx < mi_width; idx += mu_blocks_wide) { int blk_row, blk_col; const int unit_height = AOMMIN(mu_blocks_high + idy, mi_height); const int unit_width = AOMMIN(mu_blocks_wide + idx, mi_width); for (blk_row = idy; blk_row < unit_height; blk_row += bh) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
cfl->is_chroma_reference = is_chroma_reference( mi_row, mi_col, bsize, cfl->subsampling_x, cfl->subsampling_y); if (!is_inter_block(mbmi)) { int row, col; assert(bsize == get_plane_block_size(bsize, xd->plane[0].subsampling_x, xd->plane[0].subsampling_y)); const int max_blocks_wide = max_block_wide(xd, bsize, 0); const int max_blocks_high = max_block_high(xd, bsize, 0); const BLOCK_SIZE max_unit_bsize = BLOCK_64X64;
+ show +
1128
1129
1130
1131
int mu_blocks_wide = block_size_wide[max_unit_bsize] >> tx_size_wide_log2[0]; int mu_blocks_high = block_size_high[max_unit_bsize] >> tx_size_high_log2[0];
+ show +
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
mu_blocks_wide = AOMMIN(max_blocks_wide, mu_blocks_wide); mu_blocks_high = AOMMIN(max_blocks_high, mu_blocks_high); for (row = 0; row < max_blocks_high; row += mu_blocks_high) { for (col = 0; col < max_blocks_wide; col += mu_blocks_wide) { for (int plane = 0; plane < num_planes; ++plane) { const struct macroblockd_plane *const pd = &xd->plane[plane]; if (!is_chroma_reference(mi_row, mi_col, bsize, pd->subsampling_x, pd->subsampling_y)) continue;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
int eobtotal = 0; const int max_blocks_wide = max_block_wide(xd, bsize, 0); const int max_blocks_high = max_block_high(xd, bsize, 0); int row, col; const BLOCK_SIZE max_unit_bsize = BLOCK_64X64; assert(max_unit_bsize == get_plane_block_size(BLOCK_64X64, xd->plane[0].subsampling_x, xd->plane[0].subsampling_y));
+ show +
1180
1181
1182
1183
int mu_blocks_wide = block_size_wide[max_unit_bsize] >> tx_size_wide_log2[0]; int mu_blocks_high = block_size_high[max_unit_bsize] >> tx_size_high_log2[0];
+ show +
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
mu_blocks_wide = AOMMIN(max_blocks_wide, mu_blocks_wide); mu_blocks_high = AOMMIN(max_blocks_high, mu_blocks_high); for (row = 0; row < max_blocks_high; row += mu_blocks_high) { for (col = 0; col < max_blocks_wide; col += mu_blocks_wide) { for (int plane = 0; plane < num_planes; ++plane) { const struct macroblockd_plane *const pd = &xd->plane[plane]; if (!is_chroma_reference(mi_row, mi_col, bsize, pd->subsampling_x, pd->subsampling_y))

[CVE-2020-0478_1.diff] bitstream.c #11
-static void pack_txb_tokens(aom_writer *w, AV1_COMMON *cm, MACROBLOCK *const x, - const TOKENEXTRA **tp, - const TOKENEXTRA *const tok_end, MACROBLOCKD *xd, - MB_MODE_INFO *mbmi, int plane, - BLOCK_SIZE plane_bsize, aom_bit_depth_t bit_depth, - int block, int blk_row, int blk_col, - TX_SIZE tx_size, TOKEN_STATS *token_stats) { +static AOM_INLINE void pack_txb_tokens( + aom_writer *w, AV1_COMMON *cm, MACROBLOCK *const x, const TOKENEXTRA **tp, + const TOKENEXTRA *const tok_end, MACROBLOCKD *xd, MB_MODE_INFO *mbmi, + int plane, BLOCK_SIZE plane_bsize, aom_bit_depth_t bit_depth, int block, + int blk_row, int blk_col, TX_SIZE tx_size, TOKEN_STATS *token_stats) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/bitstream.c
342
343
344
345
346
347
348
349
350
351
write_uniform(w, n, p->token); // The first color index. ++p; --num; for (int i = 0; i < num; ++i) { aom_write_symbol(w, p->token, p->color_map_cdf, n); ++p; } *tp = p; }
+ show +
352
353
354
355
356
357
358
static void pack_txb_tokens(aom_writer *w, AV1_COMMON *cm, MACROBLOCK *const x, const TOKENEXTRA **tp, const TOKENEXTRA *const tok_end, MACROBLOCKD *xd, MB_MODE_INFO *mbmi, int plane, BLOCK_SIZE plane_bsize, aom_bit_depth_t bit_depth, int block, int blk_row, int blk_col, TX_SIZE tx_size, TOKEN_STATS *token_stats) {
+ show +
359
360
361
362
363
364
365
366
367
368
const int max_blocks_high = max_block_high(xd, plane_bsize, plane); const int max_blocks_wide = max_block_wide(xd, plane_bsize, plane); if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return; const struct macroblockd_plane *const pd = &xd->plane[plane]; const TX_SIZE plane_tx_size = plane ? av1_get_max_uv_txsize(mbmi->sb_type, pd->subsampling_x, pd->subsampling_y) : mbmi->inter_tx_size[av1_get_txb_size_index(plane_bsize, blk_row,

[CVE-2020-0478_1.diff] bitstream.c #12
- const int txb_offset = - x->mbmi_ext->cb_offset / (TX_SIZE_W_MIN * TX_SIZE_H_MIN); - tran_low_t *tcoeff_txb = - x->mbmi_ext->cb_coef_buff->tcoeff[plane] + x->mbmi_ext->cb_offset; - uint16_t *eob_txb = x->mbmi_ext->cb_coef_buff->eobs[plane] + txb_offset; - uint8_t *txb_skip_ctx_txb = - x->mbmi_ext->cb_coef_buff->txb_skip_ctx[plane] + txb_offset; - int *dc_sign_ctx_txb = - x->mbmi_ext->cb_coef_buff->dc_sign_ctx[plane] + txb_offset; - tran_low_t *tcoeff = BLOCK_OFFSET(tcoeff_txb, block); - const uint16_t eob = eob_txb[block]; - TXB_CTX txb_ctx = { txb_skip_ctx_txb[block], dc_sign_ctx_txb[block] }; - av1_write_coeffs_txb(cm, xd, w, blk_row, blk_col, plane, tx_size, tcoeff, - eob, &txb_ctx); + av1_write_coeffs_txb(cm, x, w, blk_row, blk_col, plane, block, tx_size);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/bitstream.c
362
363
364
365
366
367
368
369
370
371
if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return; const struct macroblockd_plane *const pd = &xd->plane[plane]; const TX_SIZE plane_tx_size = plane ? av1_get_max_uv_txsize(mbmi->sb_type, pd->subsampling_x, pd->subsampling_y) : mbmi->inter_tx_size[av1_get_txb_size_index(plane_bsize, blk_row, blk_col)]; if (tx_size == plane_tx_size || plane) {
+ show +
372
373
374
375
376
377
378
379
380
381
382
383
384
385
const int txb_offset = x->mbmi_ext->cb_offset / (TX_SIZE_W_MIN * TX_SIZE_H_MIN); tran_low_t *tcoeff_txb = x->mbmi_ext->cb_coef_buff->tcoeff[plane] + x->mbmi_ext->cb_offset; uint16_t *eob_txb = x->mbmi_ext->cb_coef_buff->eobs[plane] + txb_offset; uint8_t *txb_skip_ctx_txb = x->mbmi_ext->cb_coef_buff->txb_skip_ctx[plane] + txb_offset; int *dc_sign_ctx_txb = x->mbmi_ext->cb_coef_buff->dc_sign_ctx[plane] + txb_offset; tran_low_t *tcoeff = BLOCK_OFFSET(tcoeff_txb, block); const uint16_t eob = eob_txb[block]; TXB_CTX txb_ctx = { txb_skip_ctx_txb[block], dc_sign_ctx_txb[block] }; av1_write_coeffs_txb(cm, xd, w, blk_row, blk_col, plane, tx_size, tcoeff, eob, &txb_ctx);
+ show +
386
387
388
389
390
391
392
393
394
395
#if CONFIG_RD_DEBUG TOKEN_STATS tmp_token_stats; init_token_stats(&tmp_token_stats); token_stats->txb_coeff_cost_map[blk_row][blk_col] = tmp_token_stats.cost; token_stats->cost += tmp_token_stats.cost; #endif } else { const TX_SIZE sub_txs = sub_tx_size_map[tx_size]; const int bsw = tx_size_wide_unit[sub_txs]; const int bsh = tx_size_high_unit[sub_txs];

[CVE-2020-0478_1.diff] bitstream.c #16
-static void write_filter_intra_mode_info(const AV1_COMMON *cm, - const MACROBLOCKD *xd, - const MB_MODE_INFO *const mbmi, - aom_writer *w) { +static AOM_INLINE void write_filter_intra_mode_info( + const AV1_COMMON *cm, const MACROBLOCKD *xd, const MB_MODE_INFO *const mbmi, + aom_writer *w) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/bitstream.c
586
587
588
589
590
591
592
593
594
595
WRITE_REF_BIT(bit3, single_ref_p4); } else { const int bit4 = mbmi->ref_frame[0] != LAST3_FRAME; WRITE_REF_BIT(bit4, single_ref_p5); } } } } }
+ show +
596
597
598
599
static void write_filter_intra_mode_info(const AV1_COMMON *cm, const MACROBLOCKD *xd, const MB_MODE_INFO *const mbmi, aom_writer *w) {
+ show +
600
601
602
603
604
605
606
607
608
609
if (av1_filter_intra_allowed(cm, mbmi)) { aom_write_symbol(w, mbmi->filter_intra_mode_info.use_filter_intra, xd->tile_ctx->filter_intra_cdfs[mbmi->sb_type], 2); if (mbmi->filter_intra_mode_info.use_filter_intra) { const FILTER_INTRA_MODE mode = mbmi->filter_intra_mode_info.filter_intra_mode; aom_write_symbol(w, mode, xd->tile_ctx->filter_intra_mode_cdf, FILTER_INTRA_MODES); } }

[CVE-2020-0478_1.diff] bitstream.c #39
- write_mb_interp_filter(cpi, xd, w); + write_mb_interp_filter(cm, xd, w); -static void write_intrabc_info(MACROBLOCKD *xd, - const MB_MODE_INFO_EXT *mbmi_ext, - aom_writer *w) { +static AOM_INLINE void write_intrabc_info( + MACROBLOCKD *xd, const MB_MODE_INFO_EXT_FRAME *mbmi_ext_frame, + aom_writer *w) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/bitstream.c
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
aom_write_symbol(w, mbmi->interinter_comp.wedge_index, ec_ctx->wedge_idx_cdf[bsize], 16); aom_write_bit(w, mbmi->interinter_comp.wedge_sign); } else { assert(mbmi->interinter_comp.type == COMPOUND_DIFFWTD); aom_write_literal(w, mbmi->interinter_comp.mask_type, MAX_DIFFWTD_MASK_BITS); } } }
+ show +
1189
1190
1191
1192
1193
1194
1195
write_mb_interp_filter(cpi, xd, w); } } static void write_intrabc_info(MACROBLOCKD *xd, const MB_MODE_INFO_EXT *mbmi_ext, aom_writer *w) {
+ show +
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
const MB_MODE_INFO *const mbmi = xd->mi[0]; int use_intrabc = is_intrabc_block(mbmi); FRAME_CONTEXT *ec_ctx = xd->tile_ctx; aom_write_symbol(w, use_intrabc, ec_ctx->intrabc_cdf, 2); if (use_intrabc) { assert(mbmi->mode == DC_PRED); assert(mbmi->uv_mode == UV_DC_PRED); assert(mbmi->motion_mode == SIMPLE_TRANSLATION); int_mv dv_ref = mbmi_ext->ref_mv_stack[INTRA_FRAME][0].this_mv; av1_encode_dv(w, &mbmi->mv[0].as_mv, &dv_ref.as_mv, &ec_ctx->ndvc);

[CVE-2020-0478_1.diff] bitstream.c #42
-static void enc_dump_logs(AV1_COMP *cpi, int mi_row, int mi_col) { - AV1_COMMON *const cm = &cpi->common; - const MB_MODE_INFO *const *mbmi = - *(cm->mi_grid_visible + (mi_row * cm->mi_stride + mi_col)); - const MB_MODE_INFO_EXT *const *mbmi_ext = - cpi->mbmi_ext_base + (mi_row * cm->mi_cols + mi_col); +static AOM_INLINE void enc_dump_logs( + const AV1_COMMON *const cm, + const MBMIExtFrameBufferInfo *const mbmi_ext_info, int mi_row, int mi_col) { + const MB_MODE_INFO *const mbmi = *( + cm->mi_params.mi_grid_base + (mi_row * cm->mi_params.mi_stride + mi_col)); + const MB_MODE_INFO_EXT_FRAME *const mbmi_ext_frame = + mbmi_ext_info->frame_base + get_mi_ext_idx(mi_row, mi_col, + cm->mi_params.mi_alloc_bsize, + mbmi_ext_info->stride);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/bitstream.c
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
} printf("\n"); } return 1; } return 0; } #endif #if ENC_MISMATCH_DEBUG
+ show +
1276
1277
1278
1279
1280
1281
static void enc_dump_logs(AV1_COMP *cpi, int mi_row, int mi_col) { AV1_COMMON *const cm = &cpi->common; const MB_MODE_INFO *const *mbmi = *(cm->mi_grid_visible + (mi_row * cm->mi_stride + mi_col)); const MB_MODE_INFO_EXT *const *mbmi_ext = cpi->mbmi_ext_base + (mi_row * cm->mi_cols + mi_col);
+ show +
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
if (is_inter_block(mbmi)) { #define FRAME_TO_CHECK 11 if (cm->current_frame.frame_number == FRAME_TO_CHECK && cm->show_frame == 1) { const BLOCK_SIZE bsize = mbmi->sb_type; int_mv mv[2] = { 0 }; const int is_comp_ref = has_second_ref(mbmi); for (int ref = 0; ref < 1 + is_comp_ref; ++ref)

[CVE-2020-0478_1.diff] bitstream.c #75
-static void write_global_motion_params(const WarpedMotionParams *params, - const WarpedMotionParams *ref_params, - struct aom_write_bit_buffer *wb, - int allow_hp) { +static AOM_INLINE void write_global_motion_params( + const WarpedMotionParams *params, const WarpedMotionParams *ref_params, + struct aom_write_bit_buffer *wb, int allow_hp) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/bitstream.c
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
if (seq_params->order_hint_info.enable_order_hint) aom_wb_write_literal( wb, seq_params->order_hint_info.order_hint_bits_minus_1, 3); } aom_wb_write_bit(wb, seq_params->enable_superres); aom_wb_write_bit(wb, seq_params->enable_cdef); aom_wb_write_bit(wb, seq_params->enable_restoration); }
+ show +
2637
2638
2639
2640
static void write_global_motion_params(const WarpedMotionParams *params, const WarpedMotionParams *ref_params, struct aom_write_bit_buffer *wb, int allow_hp) {
+ show +
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
const TransformationType type = params->wmtype; aom_wb_write_bit(wb, type != IDENTITY); if (type != IDENTITY) { aom_wb_write_bit(wb, type == ROTZOOM); if (type != ROTZOOM) aom_wb_write_bit(wb, type == TRANSLATION); } if (type >= ROTZOOM) { aom_wb_write_signed_primitive_refsubexpfin(

[CVE-2020-0478_1.diff] bitstream.c #84
- wb, cm->op_frame_timing[op_num].buffer_removal_time, - cm->buffer_model.buffer_removal_time_length); - cm->op_frame_timing[op_num].buffer_removal_time++; - if (cm->op_frame_timing[op_num].buffer_removal_time == 0) { + wb, cm->buffer_removal_times[op_num], + seq_params->decoder_model_info.buffer_removal_time_length); + cm->buffer_removal_times[op_num]++; + if (cm->buffer_removal_times[op_num] == 0) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/bitstream.c
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
op_num < seq_params->operating_points_cnt_minus_1 + 1; op_num++) { if (cm->op_params[op_num].decoder_model_param_present_flag) { if (((seq_params->operating_point_idc[op_num] >> cm->temporal_layer_id) & 0x1 && (seq_params->operating_point_idc[op_num] >> (cm->spatial_layer_id + 8)) & 0x1) || seq_params->operating_point_idc[op_num] == 0) { aom_wb_write_unsigned_literal(
+ show +
2912
2913
2914
2915
wb, cm->op_frame_timing[op_num].buffer_removal_time, cm->buffer_model.buffer_removal_time_length); cm->op_frame_timing[op_num].buffer_removal_time++; if (cm->op_frame_timing[op_num].buffer_removal_time == 0) {
+ show +
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
aom_internal_error(&cm->error, AOM_CODEC_UNSUP_BITSTREAM, "buffer_removal_time overflowed"); } } } } } } // Shown keyframes and switch-frames automatically refreshes all reference

[CVE-2020-0478_1.diff] bitstream.c #98
-int write_uleb_obu_size(uint32_t obu_header_size, uint32_t obu_payload_size, - uint8_t *dest) { - const uint32_t obu_size = obu_payload_size; - const uint32_t offset = obu_header_size; +int av1_write_uleb_obu_size(size_t obu_header_size, size_t obu_payload_size, + uint8_t *dest) { + const size_t offset = obu_header_size; + const uint32_t obu_size = (uint32_t)obu_payload_size; + assert(obu_size == obu_payload_size);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/bitstream.c
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
aom_wb_write_literal(&wb, 0, 1); // reserved if (obu_extension) { aom_wb_write_literal(&wb, obu_extension & 0xFF, 8); } size = aom_wb_bytes_written(&wb); return size; }
+ show +
3260
3261
3262
3263
int write_uleb_obu_size(uint32_t obu_header_size, uint32_t obu_payload_size, uint8_t *dest) { const uint32_t obu_size = obu_payload_size; const uint32_t offset = obu_header_size;
+ show +
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
size_t coded_obu_size = 0; if (aom_uleb_encode(obu_size, sizeof(obu_size), dest + offset, &coded_obu_size) != 0) { return AOM_CODEC_ERROR; } return AOM_CODEC_OK; }

[CVE-2020-0470_1.diff] decodeframe.c #27
- int mu_blocks_wide = - block_size_wide[max_unit_bsize] >> tx_size_wide_log2[0]; - int mu_blocks_high = - block_size_high[max_unit_bsize] >> tx_size_high_log2[0]; + int mu_blocks_wide = mi_size_wide[max_unit_bsize]; + int mu_blocks_high = mi_size_high[max_unit_bsize];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/bitstream.c
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
const int num_4x4_h = block_size_high[plane_bsize] >> tx_size_high_log2[0]; int row, col; TOKEN_STATS token_stats; init_token_stats(&token_stats); const BLOCK_SIZE max_unit_bsize = BLOCK_64X64; assert(max_unit_bsize == get_plane_block_size(BLOCK_64X64, xd->plane[0].subsampling_x, xd->plane[0].subsampling_y));
+ show +
1461
1462
1463
1464
int mu_blocks_wide = block_size_wide[max_unit_bsize] >> tx_size_wide_log2[0]; int mu_blocks_high = block_size_high[max_unit_bsize] >> tx_size_high_log2[0];
+ show +
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
mu_blocks_wide = AOMMIN(num_4x4_w, mu_blocks_wide); mu_blocks_high = AOMMIN(num_4x4_h, mu_blocks_high); for (row = 0; row < num_4x4_h; row += mu_blocks_high) { for (col = 0; col < num_4x4_w; col += mu_blocks_wide) { for (plane = 0; plane < num_planes && is_inter_block(mbmi); ++plane) { const struct macroblockd_plane *const pd = &xd->plane[plane]; if (!is_chroma_reference(mi_row, mi_col, mbmi->sb_type, pd->subsampling_x, pd->subsampling_y)) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodemb.c
505
506
507
508
509
510
511
512
513
514
int step = tx_size_wide_unit[max_tx_size] * tx_size_high_unit[max_tx_size]; av1_get_entropy_contexts(bsizec, pd, ctx.ta[plane], ctx.tl[plane]); av1_subtract_plane(x, bsizec, plane); arg.ta = ctx.ta[plane]; arg.tl = ctx.tl[plane]; const BLOCK_SIZE max_unit_bsize = get_plane_block_size(BLOCK_64X64, pd->subsampling_x, pd->subsampling_y);
+ show +
515
516
517
518
int mu_blocks_wide = block_size_wide[max_unit_bsize] >> tx_size_wide_log2[0]; int mu_blocks_high = block_size_high[max_unit_bsize] >> tx_size_high_log2[0];
+ show +
519
520
521
522
523
524
525
526
527
528
mu_blocks_wide = AOMMIN(mi_width, mu_blocks_wide); mu_blocks_high = AOMMIN(mi_height, mu_blocks_high); for (idy = 0; idy < mi_height; idy += mu_blocks_high) { for (idx = 0; idx < mi_width; idx += mu_blocks_wide) { int blk_row, blk_col; const int unit_height = AOMMIN(mu_blocks_high + idy, mi_height); const int unit_width = AOMMIN(mu_blocks_wide + idx, mi_width); for (blk_row = idy; blk_row < unit_height; blk_row += bh) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/tokenize.c
219
220
221
222
223
224
225
226
227
228
const TX_SIZE max_tx_size = get_vartx_max_txsize(xd, plane_bsize, plane); const BLOCK_SIZE txb_size = txsize_to_bsize[max_tx_size]; int bw = block_size_wide[txb_size] >> tx_size_wide_log2[0]; int bh = block_size_high[txb_size] >> tx_size_high_log2[0]; int idx, idy; int block = 0; int step = tx_size_wide_unit[max_tx_size] * tx_size_high_unit[max_tx_size]; const BLOCK_SIZE max_unit_bsize = get_plane_block_size(BLOCK_64X64, pd->subsampling_x, pd->subsampling_y);
+ show +
229
230
231
232
int mu_blocks_wide = block_size_wide[max_unit_bsize] >> tx_size_wide_log2[0]; int mu_blocks_high = block_size_high[max_unit_bsize] >> tx_size_high_log2[0];
+ show +
233
234
235
236
237
238
239
240
241
242
mu_blocks_wide = AOMMIN(mi_width, mu_blocks_wide); mu_blocks_high = AOMMIN(mi_height, mu_blocks_high); for (idy = 0; idy < mi_height; idy += mu_blocks_high) { for (idx = 0; idx < mi_width; idx += mu_blocks_wide) { int blk_row, blk_col; const int unit_height = AOMMIN(mu_blocks_high + idy, mi_height); const int unit_width = AOMMIN(mu_blocks_wide + idx, mi_width); for (blk_row = idy; blk_row < unit_height; blk_row += bh) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
cfl->is_chroma_reference = is_chroma_reference( mi_row, mi_col, bsize, cfl->subsampling_x, cfl->subsampling_y); if (!is_inter_block(mbmi)) { int row, col; assert(bsize == get_plane_block_size(bsize, xd->plane[0].subsampling_x, xd->plane[0].subsampling_y)); const int max_blocks_wide = max_block_wide(xd, bsize, 0); const int max_blocks_high = max_block_high(xd, bsize, 0); const BLOCK_SIZE max_unit_bsize = BLOCK_64X64;
+ show +
1128
1129
1130
1131
int mu_blocks_wide = block_size_wide[max_unit_bsize] >> tx_size_wide_log2[0]; int mu_blocks_high = block_size_high[max_unit_bsize] >> tx_size_high_log2[0];
+ show +
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
mu_blocks_wide = AOMMIN(max_blocks_wide, mu_blocks_wide); mu_blocks_high = AOMMIN(max_blocks_high, mu_blocks_high); for (row = 0; row < max_blocks_high; row += mu_blocks_high) { for (col = 0; col < max_blocks_wide; col += mu_blocks_wide) { for (int plane = 0; plane < num_planes; ++plane) { const struct macroblockd_plane *const pd = &xd->plane[plane]; if (!is_chroma_reference(mi_row, mi_col, bsize, pd->subsampling_x, pd->subsampling_y)) continue;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
int eobtotal = 0; const int max_blocks_wide = max_block_wide(xd, bsize, 0); const int max_blocks_high = max_block_high(xd, bsize, 0); int row, col; const BLOCK_SIZE max_unit_bsize = BLOCK_64X64; assert(max_unit_bsize == get_plane_block_size(BLOCK_64X64, xd->plane[0].subsampling_x, xd->plane[0].subsampling_y));
+ show +
1180
1181
1182
1183
int mu_blocks_wide = block_size_wide[max_unit_bsize] >> tx_size_wide_log2[0]; int mu_blocks_high = block_size_high[max_unit_bsize] >> tx_size_high_log2[0];
+ show +
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
mu_blocks_wide = AOMMIN(max_blocks_wide, mu_blocks_wide); mu_blocks_high = AOMMIN(max_blocks_high, mu_blocks_high); for (row = 0; row < max_blocks_high; row += mu_blocks_high) { for (col = 0; col < max_blocks_wide; col += mu_blocks_wide) { for (int plane = 0; plane < num_planes; ++plane) { const struct macroblockd_plane *const pd = &xd->plane[plane]; if (!is_chroma_reference(mi_row, mi_col, bsize, pd->subsampling_x, pd->subsampling_y))

[CVE-2020-0470_1.diff] bitstream.c #11
-static void pack_txb_tokens(aom_writer *w, AV1_COMMON *cm, MACROBLOCK *const x, - const TOKENEXTRA **tp, - const TOKENEXTRA *const tok_end, MACROBLOCKD *xd, - MB_MODE_INFO *mbmi, int plane, - BLOCK_SIZE plane_bsize, aom_bit_depth_t bit_depth, - int block, int blk_row, int blk_col, - TX_SIZE tx_size, TOKEN_STATS *token_stats) { +static AOM_INLINE void pack_txb_tokens( + aom_writer *w, AV1_COMMON *cm, MACROBLOCK *const x, const TOKENEXTRA **tp, + const TOKENEXTRA *const tok_end, MACROBLOCKD *xd, MB_MODE_INFO *mbmi, + int plane, BLOCK_SIZE plane_bsize, aom_bit_depth_t bit_depth, int block, + int blk_row, int blk_col, TX_SIZE tx_size, TOKEN_STATS *token_stats) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/bitstream.c
342
343
344
345
346
347
348
349
350
351
write_uniform(w, n, p->token); // The first color index. ++p; --num; for (int i = 0; i < num; ++i) { aom_write_symbol(w, p->token, p->color_map_cdf, n); ++p; } *tp = p; }
+ show +
352
353
354
355
356
357
358
static void pack_txb_tokens(aom_writer *w, AV1_COMMON *cm, MACROBLOCK *const x, const TOKENEXTRA **tp, const TOKENEXTRA *const tok_end, MACROBLOCKD *xd, MB_MODE_INFO *mbmi, int plane, BLOCK_SIZE plane_bsize, aom_bit_depth_t bit_depth, int block, int blk_row, int blk_col, TX_SIZE tx_size, TOKEN_STATS *token_stats) {
+ show +
359
360
361
362
363
364
365
366
367
368
const int max_blocks_high = max_block_high(xd, plane_bsize, plane); const int max_blocks_wide = max_block_wide(xd, plane_bsize, plane); if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return; const struct macroblockd_plane *const pd = &xd->plane[plane]; const TX_SIZE plane_tx_size = plane ? av1_get_max_uv_txsize(mbmi->sb_type, pd->subsampling_x, pd->subsampling_y) : mbmi->inter_tx_size[av1_get_txb_size_index(plane_bsize, blk_row,

[CVE-2020-0470_1.diff] bitstream.c #12
- const int txb_offset = - x->mbmi_ext->cb_offset / (TX_SIZE_W_MIN * TX_SIZE_H_MIN); - tran_low_t *tcoeff_txb = - x->mbmi_ext->cb_coef_buff->tcoeff[plane] + x->mbmi_ext->cb_offset; - uint16_t *eob_txb = x->mbmi_ext->cb_coef_buff->eobs[plane] + txb_offset; - uint8_t *txb_skip_ctx_txb = - x->mbmi_ext->cb_coef_buff->txb_skip_ctx[plane] + txb_offset; - int *dc_sign_ctx_txb = - x->mbmi_ext->cb_coef_buff->dc_sign_ctx[plane] + txb_offset; - tran_low_t *tcoeff = BLOCK_OFFSET(tcoeff_txb, block); - const uint16_t eob = eob_txb[block]; - TXB_CTX txb_ctx = { txb_skip_ctx_txb[block], dc_sign_ctx_txb[block] }; - av1_write_coeffs_txb(cm, xd, w, blk_row, blk_col, plane, tx_size, tcoeff, - eob, &txb_ctx); + av1_write_coeffs_txb(cm, x, w, blk_row, blk_col, plane, block, tx_size);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/bitstream.c
362
363
364
365
366
367
368
369
370
371
if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return; const struct macroblockd_plane *const pd = &xd->plane[plane]; const TX_SIZE plane_tx_size = plane ? av1_get_max_uv_txsize(mbmi->sb_type, pd->subsampling_x, pd->subsampling_y) : mbmi->inter_tx_size[av1_get_txb_size_index(plane_bsize, blk_row, blk_col)]; if (tx_size == plane_tx_size || plane) {
+ show +
372
373
374
375
376
377
378
379
380
381
382
383
384
385
const int txb_offset = x->mbmi_ext->cb_offset / (TX_SIZE_W_MIN * TX_SIZE_H_MIN); tran_low_t *tcoeff_txb = x->mbmi_ext->cb_coef_buff->tcoeff[plane] + x->mbmi_ext->cb_offset; uint16_t *eob_txb = x->mbmi_ext->cb_coef_buff->eobs[plane] + txb_offset; uint8_t *txb_skip_ctx_txb = x->mbmi_ext->cb_coef_buff->txb_skip_ctx[plane] + txb_offset; int *dc_sign_ctx_txb = x->mbmi_ext->cb_coef_buff->dc_sign_ctx[plane] + txb_offset; tran_low_t *tcoeff = BLOCK_OFFSET(tcoeff_txb, block); const uint16_t eob = eob_txb[block]; TXB_CTX txb_ctx = { txb_skip_ctx_txb[block], dc_sign_ctx_txb[block] }; av1_write_coeffs_txb(cm, xd, w, blk_row, blk_col, plane, tx_size, tcoeff, eob, &txb_ctx);
+ show +
386
387
388
389
390
391
392
393
394
395
#if CONFIG_RD_DEBUG TOKEN_STATS tmp_token_stats; init_token_stats(&tmp_token_stats); token_stats->txb_coeff_cost_map[blk_row][blk_col] = tmp_token_stats.cost; token_stats->cost += tmp_token_stats.cost; #endif } else { const TX_SIZE sub_txs = sub_tx_size_map[tx_size]; const int bsw = tx_size_wide_unit[sub_txs]; const int bsh = tx_size_high_unit[sub_txs];

[CVE-2020-0470_1.diff] bitstream.c #16
-static void write_filter_intra_mode_info(const AV1_COMMON *cm, - const MACROBLOCKD *xd, - const MB_MODE_INFO *const mbmi, - aom_writer *w) { +static AOM_INLINE void write_filter_intra_mode_info( + const AV1_COMMON *cm, const MACROBLOCKD *xd, const MB_MODE_INFO *const mbmi, + aom_writer *w) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/bitstream.c
586
587
588
589
590
591
592
593
594
595
WRITE_REF_BIT(bit3, single_ref_p4); } else { const int bit4 = mbmi->ref_frame[0] != LAST3_FRAME; WRITE_REF_BIT(bit4, single_ref_p5); } } } } }
+ show +
596
597
598
599
static void write_filter_intra_mode_info(const AV1_COMMON *cm, const MACROBLOCKD *xd, const MB_MODE_INFO *const mbmi, aom_writer *w) {
+ show +
600
601
602
603
604
605
606
607
608
609
if (av1_filter_intra_allowed(cm, mbmi)) { aom_write_symbol(w, mbmi->filter_intra_mode_info.use_filter_intra, xd->tile_ctx->filter_intra_cdfs[mbmi->sb_type], 2); if (mbmi->filter_intra_mode_info.use_filter_intra) { const FILTER_INTRA_MODE mode = mbmi->filter_intra_mode_info.filter_intra_mode; aom_write_symbol(w, mode, xd->tile_ctx->filter_intra_mode_cdf, FILTER_INTRA_MODES); } }

[CVE-2020-0470_1.diff] bitstream.c #39
- write_mb_interp_filter(cpi, xd, w); + write_mb_interp_filter(cm, xd, w); -static void write_intrabc_info(MACROBLOCKD *xd, - const MB_MODE_INFO_EXT *mbmi_ext, - aom_writer *w) { +static AOM_INLINE void write_intrabc_info( + MACROBLOCKD *xd, const MB_MODE_INFO_EXT_FRAME *mbmi_ext_frame, + aom_writer *w) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/bitstream.c
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
aom_write_symbol(w, mbmi->interinter_comp.wedge_index, ec_ctx->wedge_idx_cdf[bsize], 16); aom_write_bit(w, mbmi->interinter_comp.wedge_sign); } else { assert(mbmi->interinter_comp.type == COMPOUND_DIFFWTD); aom_write_literal(w, mbmi->interinter_comp.mask_type, MAX_DIFFWTD_MASK_BITS); } } }
+ show +
1189
1190
1191
1192
1193
1194
1195
write_mb_interp_filter(cpi, xd, w); } } static void write_intrabc_info(MACROBLOCKD *xd, const MB_MODE_INFO_EXT *mbmi_ext, aom_writer *w) {
+ show +
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
const MB_MODE_INFO *const mbmi = xd->mi[0]; int use_intrabc = is_intrabc_block(mbmi); FRAME_CONTEXT *ec_ctx = xd->tile_ctx; aom_write_symbol(w, use_intrabc, ec_ctx->intrabc_cdf, 2); if (use_intrabc) { assert(mbmi->mode == DC_PRED); assert(mbmi->uv_mode == UV_DC_PRED); assert(mbmi->motion_mode == SIMPLE_TRANSLATION); int_mv dv_ref = mbmi_ext->ref_mv_stack[INTRA_FRAME][0].this_mv; av1_encode_dv(w, &mbmi->mv[0].as_mv, &dv_ref.as_mv, &ec_ctx->ndvc);

[CVE-2020-0470_1.diff] bitstream.c #42
-static void enc_dump_logs(AV1_COMP *cpi, int mi_row, int mi_col) { - AV1_COMMON *const cm = &cpi->common; - const MB_MODE_INFO *const *mbmi = - *(cm->mi_grid_visible + (mi_row * cm->mi_stride + mi_col)); - const MB_MODE_INFO_EXT *const *mbmi_ext = - cpi->mbmi_ext_base + (mi_row * cm->mi_cols + mi_col); +static AOM_INLINE void enc_dump_logs( + const AV1_COMMON *const cm, + const MBMIExtFrameBufferInfo *const mbmi_ext_info, int mi_row, int mi_col) { + const MB_MODE_INFO *const mbmi = *( + cm->mi_params.mi_grid_base + (mi_row * cm->mi_params.mi_stride + mi_col)); + const MB_MODE_INFO_EXT_FRAME *const mbmi_ext_frame = + mbmi_ext_info->frame_base + get_mi_ext_idx(mi_row, mi_col, + cm->mi_params.mi_alloc_bsize, + mbmi_ext_info->stride);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/bitstream.c
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
} printf("\n"); } return 1; } return 0; } #endif #if ENC_MISMATCH_DEBUG
+ show +
1276
1277
1278
1279
1280
1281
static void enc_dump_logs(AV1_COMP *cpi, int mi_row, int mi_col) { AV1_COMMON *const cm = &cpi->common; const MB_MODE_INFO *const *mbmi = *(cm->mi_grid_visible + (mi_row * cm->mi_stride + mi_col)); const MB_MODE_INFO_EXT *const *mbmi_ext = cpi->mbmi_ext_base + (mi_row * cm->mi_cols + mi_col);
+ show +
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
if (is_inter_block(mbmi)) { #define FRAME_TO_CHECK 11 if (cm->current_frame.frame_number == FRAME_TO_CHECK && cm->show_frame == 1) { const BLOCK_SIZE bsize = mbmi->sb_type; int_mv mv[2] = { 0 }; const int is_comp_ref = has_second_ref(mbmi); for (int ref = 0; ref < 1 + is_comp_ref; ++ref)

[CVE-2020-0470_1.diff] bitstream.c #75
-static void write_global_motion_params(const WarpedMotionParams *params, - const WarpedMotionParams *ref_params, - struct aom_write_bit_buffer *wb, - int allow_hp) { +static AOM_INLINE void write_global_motion_params( + const WarpedMotionParams *params, const WarpedMotionParams *ref_params, + struct aom_write_bit_buffer *wb, int allow_hp) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/bitstream.c
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
if (seq_params->order_hint_info.enable_order_hint) aom_wb_write_literal( wb, seq_params->order_hint_info.order_hint_bits_minus_1, 3); } aom_wb_write_bit(wb, seq_params->enable_superres); aom_wb_write_bit(wb, seq_params->enable_cdef); aom_wb_write_bit(wb, seq_params->enable_restoration); }
+ show +
2637
2638
2639
2640
static void write_global_motion_params(const WarpedMotionParams *params, const WarpedMotionParams *ref_params, struct aom_write_bit_buffer *wb, int allow_hp) {
+ show +
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
const TransformationType type = params->wmtype; aom_wb_write_bit(wb, type != IDENTITY); if (type != IDENTITY) { aom_wb_write_bit(wb, type == ROTZOOM); if (type != ROTZOOM) aom_wb_write_bit(wb, type == TRANSLATION); } if (type >= ROTZOOM) { aom_wb_write_signed_primitive_refsubexpfin(

[CVE-2020-0470_1.diff] bitstream.c #84
- wb, cm->op_frame_timing[op_num].buffer_removal_time, - cm->buffer_model.buffer_removal_time_length); - cm->op_frame_timing[op_num].buffer_removal_time++; - if (cm->op_frame_timing[op_num].buffer_removal_time == 0) { + wb, cm->buffer_removal_times[op_num], + seq_params->decoder_model_info.buffer_removal_time_length); + cm->buffer_removal_times[op_num]++; + if (cm->buffer_removal_times[op_num] == 0) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/bitstream.c
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
op_num < seq_params->operating_points_cnt_minus_1 + 1; op_num++) { if (cm->op_params[op_num].decoder_model_param_present_flag) { if (((seq_params->operating_point_idc[op_num] >> cm->temporal_layer_id) & 0x1 && (seq_params->operating_point_idc[op_num] >> (cm->spatial_layer_id + 8)) & 0x1) || seq_params->operating_point_idc[op_num] == 0) { aom_wb_write_unsigned_literal(
+ show +
2912
2913
2914
2915
wb, cm->op_frame_timing[op_num].buffer_removal_time, cm->buffer_model.buffer_removal_time_length); cm->op_frame_timing[op_num].buffer_removal_time++; if (cm->op_frame_timing[op_num].buffer_removal_time == 0) {
+ show +
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
aom_internal_error(&cm->error, AOM_CODEC_UNSUP_BITSTREAM, "buffer_removal_time overflowed"); } } } } } } // Shown keyframes and switch-frames automatically refreshes all reference

[CVE-2020-0470_1.diff] bitstream.c #98
-int write_uleb_obu_size(uint32_t obu_header_size, uint32_t obu_payload_size, - uint8_t *dest) { - const uint32_t obu_size = obu_payload_size; - const uint32_t offset = obu_header_size; +int av1_write_uleb_obu_size(size_t obu_header_size, size_t obu_payload_size, + uint8_t *dest) { + const size_t offset = obu_header_size; + const uint32_t obu_size = (uint32_t)obu_payload_size; + assert(obu_size == obu_payload_size);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/bitstream.c
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
aom_wb_write_literal(&wb, 0, 1); // reserved if (obu_extension) { aom_wb_write_literal(&wb, obu_extension & 0xFF, 8); } size = aom_wb_bytes_written(&wb); return size; }
+ show +
3260
3261
3262
3263
int write_uleb_obu_size(uint32_t obu_header_size, uint32_t obu_payload_size, uint8_t *dest) { const uint32_t obu_size = obu_payload_size; const uint32_t offset = obu_header_size;
+ show +
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
size_t coded_obu_size = 0; if (aom_uleb_encode(obu_size, sizeof(obu_size), dest + offset, &coded_obu_size) != 0) { return AOM_CODEC_ERROR; } return AOM_CODEC_OK; }

[CVE-2020-0478_1.diff] context_tree.c #5
+// This function will compute the number of pc_tree nodes to be allocated +// or freed as per the super block size of BLOCK_128X128 or BLOCK_64X64 +static AOM_INLINE int get_pc_tree_nodes(const int is_sb_size_128, + int stat_generation_stage) { + const int tree_nodes_inc = is_sb_size_128 ? 1024 : 0; + const int tree_nodes = + stat_generation_stage ? 1 : (tree_nodes_inc + 256 + 64 + 16 + 4 + 1); + return tree_nodes; +} + -void av1_setup_pc_tree(AV1_COMMON *cm, ThreadData *td) { - int i, j; - const int tree_nodes_inc = 1024; - const int leaf_factor = 4; - const int leaf_nodes = 256 * leaf_factor; - const int tree_nodes = tree_nodes_inc + 256 + 64 + 16 + 4 + 1; +void av1_setup_pc_tree(AV1_COMP *const cpi, ThreadData *td) { + AV1_COMMON *const cm = &cpi->common; + int i, j, stat_generation_stage = is_stat_generation_stage(cpi); + const int is_sb_size_128 = cm->seq_params.sb_size == BLOCK_128X128; + const int tree_nodes = + get_pc_tree_nodes(is_sb_size_128, stat_generation_stage);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/context_tree.c
122
123
124
125
126
127
128
129
130
131
free_mode_context(&tree->horizontal[0], num_planes); free_mode_context(&tree->horizontal[1], num_planes); free_mode_context(&tree->vertical[0], num_planes); free_mode_context(&tree->vertical[1], num_planes); } // This function sets up a tree of contexts such that at each square // partition level. There are contexts for none, horizontal, vertical, and // split. Along with a block_size value and a selected block_size which // represents the state of our search.
+ show +
132
133
134
135
136
137
void av1_setup_pc_tree(AV1_COMMON *cm, ThreadData *td) { int i, j; const int tree_nodes_inc = 1024; const int leaf_factor = 4; const int leaf_nodes = 256 * leaf_factor; const int tree_nodes = tree_nodes_inc + 256 + 64 + 16 + 4 + 1;
+ show +
138
139
140
141
142
143
144
145
146
147
int pc_tree_index = 0; PC_TREE *this_pc; PC_TREE_SHARED_BUFFERS shared_bufs; int square_index = 1; int nodes; aom_free(td->pc_tree); CHECK_MEM_ERROR(cm, td->pc_tree, aom_calloc(tree_nodes, sizeof(*td->pc_tree))); this_pc = &td->pc_tree[0];

[CVE-2020-0470_1.diff] context_tree.c #5
+// This function will compute the number of pc_tree nodes to be allocated +// or freed as per the super block size of BLOCK_128X128 or BLOCK_64X64 +static AOM_INLINE int get_pc_tree_nodes(const int is_sb_size_128, + int stat_generation_stage) { + const int tree_nodes_inc = is_sb_size_128 ? 1024 : 0; + const int tree_nodes = + stat_generation_stage ? 1 : (tree_nodes_inc + 256 + 64 + 16 + 4 + 1); + return tree_nodes; +} + -void av1_setup_pc_tree(AV1_COMMON *cm, ThreadData *td) { - int i, j; - const int tree_nodes_inc = 1024; - const int leaf_factor = 4; - const int leaf_nodes = 256 * leaf_factor; - const int tree_nodes = tree_nodes_inc + 256 + 64 + 16 + 4 + 1; +void av1_setup_pc_tree(AV1_COMP *const cpi, ThreadData *td) { + AV1_COMMON *const cm = &cpi->common; + int i, j, stat_generation_stage = is_stat_generation_stage(cpi); + const int is_sb_size_128 = cm->seq_params.sb_size == BLOCK_128X128; + const int tree_nodes = + get_pc_tree_nodes(is_sb_size_128, stat_generation_stage);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/context_tree.c
122
123
124
125
126
127
128
129
130
131
free_mode_context(&tree->horizontal[0], num_planes); free_mode_context(&tree->horizontal[1], num_planes); free_mode_context(&tree->vertical[0], num_planes); free_mode_context(&tree->vertical[1], num_planes); } // This function sets up a tree of contexts such that at each square // partition level. There are contexts for none, horizontal, vertical, and // split. Along with a block_size value and a selected block_size which // represents the state of our search.
+ show +
132
133
134
135
136
137
void av1_setup_pc_tree(AV1_COMMON *cm, ThreadData *td) { int i, j; const int tree_nodes_inc = 1024; const int leaf_factor = 4; const int leaf_nodes = 256 * leaf_factor; const int tree_nodes = tree_nodes_inc + 256 + 64 + 16 + 4 + 1;
+ show +
138
139
140
141
142
143
144
145
146
147
int pc_tree_index = 0; PC_TREE *this_pc; PC_TREE_SHARED_BUFFERS shared_bufs; int square_index = 1; int nodes; aom_free(td->pc_tree); CHECK_MEM_ERROR(cm, td->pc_tree, aom_calloc(tree_nodes, sizeof(*td->pc_tree))); this_pc = &td->pc_tree[0];

[CVE-2020-0478_1.diff] ratectrl.h #9
-void av1_rc_get_one_pass_vbr_params( - struct AV1_COMP *cpi, uint8_t *const frame_update_type, - struct EncodeFrameParams *const frame_params, unsigned int frame_flags); -void av1_rc_get_one_pass_cbr_params( - struct AV1_COMP *cpi, uint8_t *const frame_update_type, - struct EncodeFrameParams *const frame_params, unsigned int frame_flags);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/ratectrl.h
180
181
182
183
184
185
186
187
188
189
// // The majority of rate control parameters are only expected // to be set in the av1_rc_get_..._params() functions and // updated during the av1_rc_postencode_update...() functions. // The only exceptions are av1_rc_drop_frame() and // av1_rc_update_rate_correction_factors() functions. // Functions to set parameters for encoding before the actual // encode_frame_to_data_rate() function. struct EncodeFrameParams;
+ show +
190
191
192
193
194
195
void av1_rc_get_one_pass_vbr_params( struct AV1_COMP *cpi, uint8_t *const frame_update_type, struct EncodeFrameParams *const frame_params, unsigned int frame_flags); void av1_rc_get_one_pass_cbr_params( struct AV1_COMP *cpi, uint8_t *const frame_update_type, struct EncodeFrameParams *const frame_params, unsigned int frame_flags);
+ show +
196
197
198
199
200
201
202
203
204
205
// Post encode update of the rate control parameters based // on bytes used void av1_rc_postencode_update(struct AV1_COMP *cpi, uint64_t bytes_used); // Post encode update of the rate control parameters for dropped frames void av1_rc_postencode_update_drop_frame(struct AV1_COMP *cpi); // Updates rate correction factors // Changes only the rate correction factors in the rate control structure. void av1_rc_update_rate_correction_factors(struct AV1_COMP *cpi, int width,

[CVE-2020-0470_1.diff] ratectrl.h #9
-void av1_rc_get_one_pass_vbr_params( - struct AV1_COMP *cpi, uint8_t *const frame_update_type, - struct EncodeFrameParams *const frame_params, unsigned int frame_flags); -void av1_rc_get_one_pass_cbr_params( - struct AV1_COMP *cpi, uint8_t *const frame_update_type, - struct EncodeFrameParams *const frame_params, unsigned int frame_flags);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/ratectrl.h
180
181
182
183
184
185
186
187
188
189
// // The majority of rate control parameters are only expected // to be set in the av1_rc_get_..._params() functions and // updated during the av1_rc_postencode_update...() functions. // The only exceptions are av1_rc_drop_frame() and // av1_rc_update_rate_correction_factors() functions. // Functions to set parameters for encoding before the actual // encode_frame_to_data_rate() function. struct EncodeFrameParams;
+ show +
190
191
192
193
194
195
void av1_rc_get_one_pass_vbr_params( struct AV1_COMP *cpi, uint8_t *const frame_update_type, struct EncodeFrameParams *const frame_params, unsigned int frame_flags); void av1_rc_get_one_pass_cbr_params( struct AV1_COMP *cpi, uint8_t *const frame_update_type, struct EncodeFrameParams *const frame_params, unsigned int frame_flags);
+ show +
196
197
198
199
200
201
202
203
204
205
// Post encode update of the rate control parameters based // on bytes used void av1_rc_postencode_update(struct AV1_COMP *cpi, uint64_t bytes_used); // Post encode update of the rate control parameters for dropped frames void av1_rc_postencode_update_drop_frame(struct AV1_COMP *cpi); // Updates rate correction factors // Changes only the rate correction factors in the rate control structure. void av1_rc_update_rate_correction_factors(struct AV1_COMP *cpi, int width,

[CVE-2020-0478_1.diff] speed_features.h #2
+#define MAX_MESH_STEP 4 + +typedef struct MESH_PATTERN { + int range; + int interval; +} MESH_PATTERN; + +enum { + GM_FULL_SEARCH, + GM_REDUCED_REF_SEARCH_SKIP_L2_L3, + GM_REDUCED_REF_SEARCH_SKIP_L2_L3_ARF2, + GM_DISABLE_SEARCH +} UENUM1BYTE(GM_SEARCH_TYPE); + +enum { + GM_ERRORADV_TR_0, + GM_ERRORADV_TR_1, + GM_ERRORADV_TR_2, + GM_ERRORADV_TR_TYPES, +} UENUM1BYTE(GM_ERRORADV_TYPE); + +enum { + FULL_TXFM_RD, + LOW_TXFM_RD, +} UENUM1BYTE(TXFM_RD_MODEL); + +enum { + DIST_WTD_COMP_ENABLED, + DIST_WTD_COMP_SKIP_MV_SEARCH, + DIST_WTD_COMP_DISABLED, +} UENUM1BYTE(DIST_WTD_COMP_FLAG); + - DIAMOND = 0, - NSTEP = 1, - HEX = 2, - BIGDIA = 3, - SQUARE = 4, - FAST_HEX = 5, - FAST_DIAMOND = 6 -} UENUM1BYTE(SEARCH_METHODS); - -enum {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/speed_features.h
78
79
80
81
82
83
84
85
86
87
INTER_PRED_SF = 2, INTRA_PRED_SF = 4, PARTITION_SF = 8, LOOP_FILTER_SF = 16, RD_SKIP_SF = 32, RESERVE_2_SF = 64, RESERVE_3_SF = 128, } UENUM1BYTE(DEV_SPEED_FEATURES); enum {
+ show +
88
89
90
91
92
93
94
95
96
97
DIAMOND = 0, NSTEP = 1, HEX = 2, BIGDIA = 3, SQUARE = 4, FAST_HEX = 5, FAST_DIAMOND = 6 } UENUM1BYTE(SEARCH_METHODS); enum {
+ show +
98
99
100
101
102
103
104
105
106
107
// No recode. DISALLOW_RECODE = 0, // Allow recode for KF and exceeding maximum frame bandwidth. ALLOW_RECODE_KFMAXBW = 1, // Allow recode only for KF/ARF/GF frames. ALLOW_RECODE_KFARFGF = 2, // Allow recode for all frames based on bitrate constraints. ALLOW_RECODE = 3, } UENUM1BYTE(RECODE_LOOP_TYPE);

[CVE-2020-0478_1.diff] speed_features.h #5
+ // Try the full image filter search with non-dual filter only. + LPF_PICK_FROM_FULL_IMAGE_NON_DUAL, + CDEF_FULL_SEARCH, + CDEF_FAST_SEARCH_LVL1, // Search among a subset of all possible filters. + CDEF_FAST_SEARCH_LVL2, // Search reduced subset of filters than Level 1. + CDEF_PICK_FROM_Q, // Estimate filter strength based on quantizer. + CDEF_PICK_METHODS +} UENUM1BYTE(CDEF_PICK_METHOD); + +enum { - // eliminates one tx type in vertical and horizontal direction - PRUNE_ONE = 1, - // eliminates two tx types in each direction - PRUNE_TWO = 2, - PRUNE_2D_ACCURATE = 3, + PRUNE_2D_ACCURATE = 1, - PRUNE_2D_FAST = 4, + PRUNE_2D_FAST = 2, + PRUNE_2D_MORE = 3, + // More aggressive pruning based on tx type score and allowed tx count + PRUNE_2D_AGGRESSIVE = 4,
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/speed_features.h
145
146
147
148
149
150
151
152
153
154
// intra so far is not one of the neighboring directions. FLAG_SKIP_INTRA_DIRMISMATCH = 1 << 4, // Skips intra modes other than DC_PRED if the source variance is small FLAG_SKIP_INTRA_LOWVAR = 1 << 5, } UENUM1BYTE(MODE_SEARCH_SKIP_LOGIC); enum { NO_PRUNE = 0, // eliminates one tx type in vertical and horizontal direction
+ show +
155
156
157
158
159
160
161
162
PRUNE_ONE = 1, // eliminates two tx types in each direction PRUNE_TWO = 2, // adaptively prunes the least perspective tx types out of all 16 // (tuned to provide negligible quality loss) PRUNE_2D_ACCURATE = 3, // similar, but applies much more aggressive pruning to get better speed-up PRUNE_2D_FAST = 4,
+ show +
163
164
165
166
167
168
169
170
171
172
} UENUM1BYTE(TX_TYPE_PRUNE_MODE); typedef struct { TX_TYPE_PRUNE_MODE prune_mode; int fast_intra_tx_type_search; int fast_inter_tx_type_search; // Use a skip flag prediction model to detect blocks with skip = 1 early // and avoid doing full TX type search for such blocks. int use_skip_flag_prediction;

[CVE-2020-0478_1.diff] speed_features.h #12
- // Model based breakout after interpolation filter search - // 0: no breakout - // 1: use model based rd breakout - int model_based_post_interp_filter_breakout; - - // Model based breakout in motion_mode_rd - // 0: no breakout - // 1: use model based rd breakout - int model_based_motion_mode_rd_breakout; - - // Used if partition_search_type = FIXED_SIZE_PARTITION - BLOCK_SIZE always_this_block_size; - - // Drop less likely to be picked reference frames in the RD search. - // Has five levels for now: 0, 1, 2, 3 and 4, where higher levels prune more - // aggressively than lower ones. (0 means no pruning). - int selective_ref_frame; - - // Prune extended partition types search - // Can take values 0 - 2, 0 referring to no pruning, and 1 - 2 increasing - // aggressiveness of pruning in order. - int prune_ext_partition_types_search_level; - - // Use a ML model to prune horz and vert partitions - int ml_prune_rect_partition; - - // Disable/Enable interintra motion mode based on stats collected during - // first_partition_search_pass - int use_first_partition_pass_interintra_stats; - - // Use a ML model to prune horz_a, horz_b, vert_a and vert_b partitions. - int ml_prune_ab_partition; - - // Use a ML model to prune horz4 and vert4 partitions. - int ml_prune_4_partition; - - int fast_cdef_search; - - // 2-pass coding block partition search, and also use the mode decisions made - // in the initial partition search to prune mode candidates, e.g. ref frames. - int two_pass_partition_search; - - // Terminate early in firstpass of two_pass partition search for faster - // firstpass. - int firstpass_simple_motion_search_early_term; - - // Skip rectangular partition test when partition type none gives better - // rd than partition type split. Can take values 0 - 2, 0 referring to no - // skipping, and 1 - 2 increasing aggressiveness of skipping in order. - int less_rectangular_check_level; - - // Use square partition only beyond this block size. - BLOCK_SIZE use_square_partition_only_threshold; - - // Prune reference frames for rectangular partitions. - // 0 implies no pruning - // 1 implies prune for extended partition - // 2 implies prune horiz, vert and extended partition - int prune_ref_frame_for_rect_partitions; - - // Sets min and max square partition levels for this superblock based on - // motion vector and prediction error distribution produced from 16x16 - // simple motion search - MAX_PART_PRED_MODE auto_max_partition_based_on_simple_motion; - int auto_min_partition_based_on_simple_motion; - - // Ensures the rd based auto partition search will always - // go down at least to the specified level. - BLOCK_SIZE rd_auto_partition_min_limit; - - // Min and max partition size we enable (block_size) as per auto - // min max, but also used by adjust partitioning, and pick_partitioning. - BLOCK_SIZE default_min_partition_size; - BLOCK_SIZE default_max_partition_size; - - // Whether or not we allow partitions one smaller or one greater than the last - // frame's partitioning. Only used if use_lastframe_partitioning is set. - int adjust_partitioning_from_last_frame; - - // TODO(jingning): combine the related motion search speed features - // This allows us to use motion search at other sizes as a starting - // point for this motion search and limits the search range around it. - int adaptive_motion_search; - - // Flag for allowing some use of exhaustive searches; - int allow_exhaustive_searches; - - // Threshold for allowing exhaistive motion search. - int exhaustive_searches_thresh; - - // Maximum number of exhaustive searches for a frame. - int max_exaustive_pct; - - // Pattern to be used for any exhaustive mesh searches. - MESH_PATTERN mesh_patterns[MAX_MESH_STEP]; - - // Allows sub 8x8 modes to use the prediction filter that was determined - // best for 8x8 mode. If set to 0 we always re check all the filters for - // sizes less than 8x8, 1 means we check all filter modes if no 8x8 filter - // was selected, and 2 means we use 8 tap if no 8x8 filter mode was selected. - int adaptive_pred_interp_filter; - - // Adaptive prediction mode search - int adaptive_mode_search; - - int alt_ref_search_fp; - - // Implements various heuristics to skip searching modes - // The heuristics selected are based on flags - // defined in the MODE_SEARCH_SKIP_HEURISTICS enum - unsigned int mode_search_skip_flags; - - // A source variance threshold below which filter search is disabled - // Choose a very large value (UINT_MAX) to use 8-tap always - unsigned int disable_filter_search_var_thresh; - - // Only enable wedge search if the edge strength is greater than - // this threshold. A value of 0 signals that this check is disabled. - unsigned int disable_wedge_search_edge_thresh; - - // Only enable wedge search if the variance is above this threshold. - unsigned int disable_wedge_search_var_thresh; - - // Whether fast wedge sign estimate is used - int fast_wedge_sign_estimate; - - // Whether to prune wedge search based on predictor difference - int prune_wedge_pred_diff_based; - - // These bit masks allow you to enable or disable intra modes for each - // transform size separately. - int intra_y_mode_mask[TX_SIZES]; - int intra_uv_mode_mask[TX_SIZES]; - - // This feature controls how the loop filter level is determined. - LPF_PICK_METHOD lpf_pick; - - // This feature controls whether we do the expensive context update and - // calculation in the rd coefficient costing loop. - int use_fast_coef_costing; - - // This feature controls the tolerence vs target used in deciding whether to - // recode a frame. It has no meaning if recode is disabled. - int recode_tolerance; - - // This variable controls the maximum block size where intra blocks can be - // used in inter frames. - // TODO(aconverse): Fold this into one of the other many mode skips - BLOCK_SIZE max_intra_bsize; - - // Partition search early breakout thresholds. - int64_t partition_search_breakout_dist_thr; - int partition_search_breakout_rate_thr; - - // Thresholds for ML based partition search breakout. - int ml_partition_search_breakout_thresh[PARTITION_BLOCK_SIZES]; - - // Allow skipping partition search for still image frame - int allow_partition_search_skip; - - // Fast approximation of av1_model_rd_from_var_lapndz - int simple_model_rd_from_var; - - // If true, sub-pixel search uses the exact convolve function used for final - // encoding and decoding; otherwise, it uses bilinear interpolation. - SUBPEL_SEARCH_TYPE use_accurate_subpel_search; - - // Whether to compute distortion in the image domain (slower but - // more accurate), or in the transform domain (faster but less acurate). - // 0: use image domain - // 1: use transform domain in tx_type search, and use image domain for - // RD_STATS - // 2: use transform domain - int use_transform_domain_distortion; - - GM_SEARCH_TYPE gm_search_type; - - // whether to disable the global motion recode loop - int gm_disable_recode; - - // Do limited interpolation filter search for dual filters, since best choice - // usually includes EIGHTTAP_REGULAR. - int use_fast_interpolation_filter_search; - - // Disable dual filter - int disable_dual_filter; - - // Save results of interpolation_filter_search for a block - // Check mv and ref_frames before search, if they are same with previous - // saved results, it can be skipped. - int skip_repeat_interpolation_filter_search; - - // Use a hash table to store previously computed optimized qcoeffs from - // expensive calls to optimize_txb. - int use_hash_based_trellis; - - // flag to drop some ref frames in compound motion search - int drop_ref; - - // flag to allow skipping intra mode for inter frame prediction - int skip_intra_in_interframe; -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/speed_features.h
345
346
347
348
349
350
351
352
353
354
int adaptive_txb_search_level; // Prune level for tx_size_type search for inter based on rd model // 0: no pruning // 1-2: progressively increasing aggressiveness of pruning int model_based_prune_tx_search_level; // Model based breakout after interpolation filter search // 0: no breakout // 1: use model based rd breakout
+ show +
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
int model_based_post_interp_filter_breakout; // Model based breakout in motion_mode_rd // 0: no breakout // 1: use model based rd breakout int model_based_motion_mode_rd_breakout; // Used if partition_search_type = FIXED_SIZE_PARTITION BLOCK_SIZE always_this_block_size; // Drop less likely to be picked reference frames in the RD search. // Has five levels for now: 0, 1, 2, 3 and 4, where higher levels prune more // aggressively than lower ones. (0 means no pruning). int selective_ref_frame; // Prune extended partition types search // Can take values 0 - 2, 0 referring to no pruning, and 1 - 2 increasing // aggressiveness of pruning in order. int prune_ext_partition_types_search_level; // Use a ML model to prune horz and vert partitions int ml_prune_rect_partition; // Disable/Enable interintra motion mode based on stats collected during // first_partition_search_pass int use_first_partition_pass_interintra_stats; // Use a ML model to prune horz_a, horz_b, vert_a and vert_b partitions. int ml_prune_ab_partition; // Use a ML model to prune horz4 and vert4 partitions. int ml_prune_4_partition; int fast_cdef_search; // 2-pass coding block partition search, and also use the mode decisions made // in the initial partition search to prune mode candidates, e.g. ref frames. int two_pass_partition_search; // Terminate early in firstpass of two_pass partition search for faster // firstpass. int firstpass_simple_motion_search_early_term; // Skip rectangular partition test when partition type none gives better // rd than partition type split. Can take values 0 - 2, 0 referring to no // skipping, and 1 - 2 increasing aggressiveness of skipping in order. int less_rectangular_check_level; // Use square partition only beyond this block size. BLOCK_SIZE use_square_partition_only_threshold; // Prune reference frames for rectangular partitions. // 0 implies no pruning // 1 implies prune for extended partition // 2 implies prune horiz, vert and extended partition int prune_ref_frame_for_rect_partitions; // Sets min and max square partition levels for this superblock based on // motion vector and prediction error distribution produced from 16x16 // simple motion search MAX_PART_PRED_MODE auto_max_partition_based_on_simple_motion; int auto_min_partition_based_on_simple_motion; // Ensures the rd based auto partition search will always // go down at least to the specified level. BLOCK_SIZE rd_auto_partition_min_limit; // Min and max partition size we enable (block_size) as per auto // min max, but also used by adjust partitioning, and pick_partitioning. BLOCK_SIZE default_min_partition_size; BLOCK_SIZE default_max_partition_size; // Whether or not we allow partitions one smaller or one greater than the last // frame's partitioning. Only used if use_lastframe_partitioning is set. int adjust_partitioning_from_last_frame; // TODO(jingning): combine the related motion search speed features // This allows us to use motion search at other sizes as a starting // point for this motion search and limits the search range around it. int adaptive_motion_search; // Flag for allowing some use of exhaustive searches; int allow_exhaustive_searches; // Threshold for allowing exhaistive motion search. int exhaustive_searches_thresh; // Maximum number of exhaustive searches for a frame. int max_exaustive_pct; // Pattern to be used for any exhaustive mesh searches. MESH_PATTERN mesh_patterns[MAX_MESH_STEP]; // Allows sub 8x8 modes to use the prediction filter that was determined // best for 8x8 mode. If set to 0 we always re check all the filters for // sizes less than 8x8, 1 means we check all filter modes if no 8x8 filter // was selected, and 2 means we use 8 tap if no 8x8 filter mode was selected. int adaptive_pred_interp_filter; // Adaptive prediction mode search int adaptive_mode_search; int alt_ref_search_fp; // Implements various heuristics to skip searching modes // The heuristics selected are based on flags // defined in the MODE_SEARCH_SKIP_HEURISTICS enum unsigned int mode_search_skip_flags; // A source variance threshold below which filter search is disabled // Choose a very large value (UINT_MAX) to use 8-tap always unsigned int disable_filter_search_var_thresh; // Only enable wedge search if the edge strength is greater than // this threshold. A value of 0 signals that this check is disabled. unsigned int disable_wedge_search_edge_thresh; // Only enable wedge search if the variance is above this threshold. unsigned int disable_wedge_search_var_thresh; // Whether fast wedge sign estimate is used int fast_wedge_sign_estimate; // Whether to prune wedge search based on predictor difference int prune_wedge_pred_diff_based; // These bit masks allow you to enable or disable intra modes for each // transform size separately. int intra_y_mode_mask[TX_SIZES]; int intra_uv_mode_mask[TX_SIZES]; // This feature controls how the loop filter level is determined. LPF_PICK_METHOD lpf_pick; // This feature controls whether we do the expensive context update and // calculation in the rd coefficient costing loop. int use_fast_coef_costing; // This feature controls the tolerence vs target used in deciding whether to // recode a frame. It has no meaning if recode is disabled. int recode_tolerance; // This variable controls the maximum block size where intra blocks can be // used in inter frames. // TODO(aconverse): Fold this into one of the other many mode skips BLOCK_SIZE max_intra_bsize; // Partition search early breakout thresholds. int64_t partition_search_breakout_dist_thr; int partition_search_breakout_rate_thr; // Thresholds for ML based partition search breakout. int ml_partition_search_breakout_thresh[PARTITION_BLOCK_SIZES]; // Allow skipping partition search for still image frame int allow_partition_search_skip; // Fast approximation of av1_model_rd_from_var_lapndz int simple_model_rd_from_var; // If true, sub-pixel search uses the exact convolve function used for final // encoding and decoding; otherwise, it uses bilinear interpolation. SUBPEL_SEARCH_TYPE use_accurate_subpel_search; // Whether to compute distortion in the image domain (slower but // more accurate), or in the transform domain (faster but less acurate). // 0: use image domain // 1: use transform domain in tx_type search, and use image domain for // RD_STATS // 2: use transform domain int use_transform_domain_distortion; GM_SEARCH_TYPE gm_search_type; // whether to disable the global motion recode loop int gm_disable_recode; // Do limited interpolation filter search for dual filters, since best choice // usually includes EIGHTTAP_REGULAR. int use_fast_interpolation_filter_search; // Disable dual filter int disable_dual_filter; // Save results of interpolation_filter_search for a block // Check mv and ref_frames before search, if they are same with previous // saved results, it can be skipped. int skip_repeat_interpolation_filter_search; // Use a hash table to store previously computed optimized qcoeffs from // expensive calls to optimize_txb. int use_hash_based_trellis; // flag to drop some ref frames in compound motion search int drop_ref; // flag to allow skipping intra mode for inter frame prediction int skip_intra_in_interframe;
+ show +
553
554
555
556
557
558
559
560
561
562
// Use hash table to store intra(keyframe only) txb transform search results // to avoid repeated search on the same residue signal. int use_intra_txb_hash; // Use hash table to store inter txb transform search results // to avoid repeated search on the same residue signal. int use_inter_txb_hash; // Use hash table to store macroblock RD search results

[CVE-2020-0470_1.diff] speed_features.h #2
+#define MAX_MESH_STEP 4 + +typedef struct MESH_PATTERN { + int range; + int interval; +} MESH_PATTERN; + +enum { + GM_FULL_SEARCH, + GM_REDUCED_REF_SEARCH_SKIP_L2_L3, + GM_REDUCED_REF_SEARCH_SKIP_L2_L3_ARF2, + GM_DISABLE_SEARCH +} UENUM1BYTE(GM_SEARCH_TYPE); + +enum { + GM_ERRORADV_TR_0, + GM_ERRORADV_TR_1, + GM_ERRORADV_TR_2, + GM_ERRORADV_TR_TYPES, +} UENUM1BYTE(GM_ERRORADV_TYPE); + +enum { + FULL_TXFM_RD, + LOW_TXFM_RD, +} UENUM1BYTE(TXFM_RD_MODEL); + +enum { + DIST_WTD_COMP_ENABLED, + DIST_WTD_COMP_SKIP_MV_SEARCH, + DIST_WTD_COMP_DISABLED, +} UENUM1BYTE(DIST_WTD_COMP_FLAG); + - DIAMOND = 0, - NSTEP = 1, - HEX = 2, - BIGDIA = 3, - SQUARE = 4, - FAST_HEX = 5, - FAST_DIAMOND = 6 -} UENUM1BYTE(SEARCH_METHODS); - -enum {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/speed_features.h
78
79
80
81
82
83
84
85
86
87
INTER_PRED_SF = 2, INTRA_PRED_SF = 4, PARTITION_SF = 8, LOOP_FILTER_SF = 16, RD_SKIP_SF = 32, RESERVE_2_SF = 64, RESERVE_3_SF = 128, } UENUM1BYTE(DEV_SPEED_FEATURES); enum {
+ show +
88
89
90
91
92
93
94
95
96
97
DIAMOND = 0, NSTEP = 1, HEX = 2, BIGDIA = 3, SQUARE = 4, FAST_HEX = 5, FAST_DIAMOND = 6 } UENUM1BYTE(SEARCH_METHODS); enum {
+ show +
98
99
100
101
102
103
104
105
106
107
// No recode. DISALLOW_RECODE = 0, // Allow recode for KF and exceeding maximum frame bandwidth. ALLOW_RECODE_KFMAXBW = 1, // Allow recode only for KF/ARF/GF frames. ALLOW_RECODE_KFARFGF = 2, // Allow recode for all frames based on bitrate constraints. ALLOW_RECODE = 3, } UENUM1BYTE(RECODE_LOOP_TYPE);

[CVE-2020-0470_1.diff] speed_features.h #5
+ // Try the full image filter search with non-dual filter only. + LPF_PICK_FROM_FULL_IMAGE_NON_DUAL, + CDEF_FULL_SEARCH, + CDEF_FAST_SEARCH_LVL1, // Search among a subset of all possible filters. + CDEF_FAST_SEARCH_LVL2, // Search reduced subset of filters than Level 1. + CDEF_PICK_FROM_Q, // Estimate filter strength based on quantizer. + CDEF_PICK_METHODS +} UENUM1BYTE(CDEF_PICK_METHOD); + +enum { - // eliminates one tx type in vertical and horizontal direction - PRUNE_ONE = 1, - // eliminates two tx types in each direction - PRUNE_TWO = 2, - PRUNE_2D_ACCURATE = 3, + PRUNE_2D_ACCURATE = 1, - PRUNE_2D_FAST = 4, + PRUNE_2D_FAST = 2, + PRUNE_2D_MORE = 3, + // More aggressive pruning based on tx type score and allowed tx count + PRUNE_2D_AGGRESSIVE = 4,
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/speed_features.h
145
146
147
148
149
150
151
152
153
154
// intra so far is not one of the neighboring directions. FLAG_SKIP_INTRA_DIRMISMATCH = 1 << 4, // Skips intra modes other than DC_PRED if the source variance is small FLAG_SKIP_INTRA_LOWVAR = 1 << 5, } UENUM1BYTE(MODE_SEARCH_SKIP_LOGIC); enum { NO_PRUNE = 0, // eliminates one tx type in vertical and horizontal direction
+ show +
155
156
157
158
159
160
161
162
PRUNE_ONE = 1, // eliminates two tx types in each direction PRUNE_TWO = 2, // adaptively prunes the least perspective tx types out of all 16 // (tuned to provide negligible quality loss) PRUNE_2D_ACCURATE = 3, // similar, but applies much more aggressive pruning to get better speed-up PRUNE_2D_FAST = 4,
+ show +
163
164
165
166
167
168
169
170
171
172
} UENUM1BYTE(TX_TYPE_PRUNE_MODE); typedef struct { TX_TYPE_PRUNE_MODE prune_mode; int fast_intra_tx_type_search; int fast_inter_tx_type_search; // Use a skip flag prediction model to detect blocks with skip = 1 early // and avoid doing full TX type search for such blocks. int use_skip_flag_prediction;

[CVE-2020-0470_1.diff] speed_features.h #12
- // Model based breakout after interpolation filter search - // 0: no breakout - // 1: use model based rd breakout - int model_based_post_interp_filter_breakout; - - // Model based breakout in motion_mode_rd - // 0: no breakout - // 1: use model based rd breakout - int model_based_motion_mode_rd_breakout; - - // Used if partition_search_type = FIXED_SIZE_PARTITION - BLOCK_SIZE always_this_block_size; - - // Drop less likely to be picked reference frames in the RD search. - // Has five levels for now: 0, 1, 2, 3 and 4, where higher levels prune more - // aggressively than lower ones. (0 means no pruning). - int selective_ref_frame; - - // Prune extended partition types search - // Can take values 0 - 2, 0 referring to no pruning, and 1 - 2 increasing - // aggressiveness of pruning in order. - int prune_ext_partition_types_search_level; - - // Use a ML model to prune horz and vert partitions - int ml_prune_rect_partition; - - // Disable/Enable interintra motion mode based on stats collected during - // first_partition_search_pass - int use_first_partition_pass_interintra_stats; - - // Use a ML model to prune horz_a, horz_b, vert_a and vert_b partitions. - int ml_prune_ab_partition; - - // Use a ML model to prune horz4 and vert4 partitions. - int ml_prune_4_partition; - - int fast_cdef_search; - - // 2-pass coding block partition search, and also use the mode decisions made - // in the initial partition search to prune mode candidates, e.g. ref frames. - int two_pass_partition_search; - - // Terminate early in firstpass of two_pass partition search for faster - // firstpass. - int firstpass_simple_motion_search_early_term; - - // Skip rectangular partition test when partition type none gives better - // rd than partition type split. Can take values 0 - 2, 0 referring to no - // skipping, and 1 - 2 increasing aggressiveness of skipping in order. - int less_rectangular_check_level; - - // Use square partition only beyond this block size. - BLOCK_SIZE use_square_partition_only_threshold; - - // Prune reference frames for rectangular partitions. - // 0 implies no pruning - // 1 implies prune for extended partition - // 2 implies prune horiz, vert and extended partition - int prune_ref_frame_for_rect_partitions; - - // Sets min and max square partition levels for this superblock based on - // motion vector and prediction error distribution produced from 16x16 - // simple motion search - MAX_PART_PRED_MODE auto_max_partition_based_on_simple_motion; - int auto_min_partition_based_on_simple_motion; - - // Ensures the rd based auto partition search will always - // go down at least to the specified level. - BLOCK_SIZE rd_auto_partition_min_limit; - - // Min and max partition size we enable (block_size) as per auto - // min max, but also used by adjust partitioning, and pick_partitioning. - BLOCK_SIZE default_min_partition_size; - BLOCK_SIZE default_max_partition_size; - - // Whether or not we allow partitions one smaller or one greater than the last - // frame's partitioning. Only used if use_lastframe_partitioning is set. - int adjust_partitioning_from_last_frame; - - // TODO(jingning): combine the related motion search speed features - // This allows us to use motion search at other sizes as a starting - // point for this motion search and limits the search range around it. - int adaptive_motion_search; - - // Flag for allowing some use of exhaustive searches; - int allow_exhaustive_searches; - - // Threshold for allowing exhaistive motion search. - int exhaustive_searches_thresh; - - // Maximum number of exhaustive searches for a frame. - int max_exaustive_pct; - - // Pattern to be used for any exhaustive mesh searches. - MESH_PATTERN mesh_patterns[MAX_MESH_STEP]; - - // Allows sub 8x8 modes to use the prediction filter that was determined - // best for 8x8 mode. If set to 0 we always re check all the filters for - // sizes less than 8x8, 1 means we check all filter modes if no 8x8 filter - // was selected, and 2 means we use 8 tap if no 8x8 filter mode was selected. - int adaptive_pred_interp_filter; - - // Adaptive prediction mode search - int adaptive_mode_search; - - int alt_ref_search_fp; - - // Implements various heuristics to skip searching modes - // The heuristics selected are based on flags - // defined in the MODE_SEARCH_SKIP_HEURISTICS enum - unsigned int mode_search_skip_flags; - - // A source variance threshold below which filter search is disabled - // Choose a very large value (UINT_MAX) to use 8-tap always - unsigned int disable_filter_search_var_thresh; - - // Only enable wedge search if the edge strength is greater than - // this threshold. A value of 0 signals that this check is disabled. - unsigned int disable_wedge_search_edge_thresh; - - // Only enable wedge search if the variance is above this threshold. - unsigned int disable_wedge_search_var_thresh; - - // Whether fast wedge sign estimate is used - int fast_wedge_sign_estimate; - - // Whether to prune wedge search based on predictor difference - int prune_wedge_pred_diff_based; - - // These bit masks allow you to enable or disable intra modes for each - // transform size separately. - int intra_y_mode_mask[TX_SIZES]; - int intra_uv_mode_mask[TX_SIZES]; - - // This feature controls how the loop filter level is determined. - LPF_PICK_METHOD lpf_pick; - - // This feature controls whether we do the expensive context update and - // calculation in the rd coefficient costing loop. - int use_fast_coef_costing; - - // This feature controls the tolerence vs target used in deciding whether to - // recode a frame. It has no meaning if recode is disabled. - int recode_tolerance; - - // This variable controls the maximum block size where intra blocks can be - // used in inter frames. - // TODO(aconverse): Fold this into one of the other many mode skips - BLOCK_SIZE max_intra_bsize; - - // Partition search early breakout thresholds. - int64_t partition_search_breakout_dist_thr; - int partition_search_breakout_rate_thr; - - // Thresholds for ML based partition search breakout. - int ml_partition_search_breakout_thresh[PARTITION_BLOCK_SIZES]; - - // Allow skipping partition search for still image frame - int allow_partition_search_skip; - - // Fast approximation of av1_model_rd_from_var_lapndz - int simple_model_rd_from_var; - - // If true, sub-pixel search uses the exact convolve function used for final - // encoding and decoding; otherwise, it uses bilinear interpolation. - SUBPEL_SEARCH_TYPE use_accurate_subpel_search; - - // Whether to compute distortion in the image domain (slower but - // more accurate), or in the transform domain (faster but less acurate). - // 0: use image domain - // 1: use transform domain in tx_type search, and use image domain for - // RD_STATS - // 2: use transform domain - int use_transform_domain_distortion; - - GM_SEARCH_TYPE gm_search_type; - - // whether to disable the global motion recode loop - int gm_disable_recode; - - // Do limited interpolation filter search for dual filters, since best choice - // usually includes EIGHTTAP_REGULAR. - int use_fast_interpolation_filter_search; - - // Disable dual filter - int disable_dual_filter; - - // Save results of interpolation_filter_search for a block - // Check mv and ref_frames before search, if they are same with previous - // saved results, it can be skipped. - int skip_repeat_interpolation_filter_search; - - // Use a hash table to store previously computed optimized qcoeffs from - // expensive calls to optimize_txb. - int use_hash_based_trellis; - - // flag to drop some ref frames in compound motion search - int drop_ref; - - // flag to allow skipping intra mode for inter frame prediction - int skip_intra_in_interframe; -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/speed_features.h
345
346
347
348
349
350
351
352
353
354
int adaptive_txb_search_level; // Prune level for tx_size_type search for inter based on rd model // 0: no pruning // 1-2: progressively increasing aggressiveness of pruning int model_based_prune_tx_search_level; // Model based breakout after interpolation filter search // 0: no breakout // 1: use model based rd breakout
+ show +
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
int model_based_post_interp_filter_breakout; // Model based breakout in motion_mode_rd // 0: no breakout // 1: use model based rd breakout int model_based_motion_mode_rd_breakout; // Used if partition_search_type = FIXED_SIZE_PARTITION BLOCK_SIZE always_this_block_size; // Drop less likely to be picked reference frames in the RD search. // Has five levels for now: 0, 1, 2, 3 and 4, where higher levels prune more // aggressively than lower ones. (0 means no pruning). int selective_ref_frame; // Prune extended partition types search // Can take values 0 - 2, 0 referring to no pruning, and 1 - 2 increasing // aggressiveness of pruning in order. int prune_ext_partition_types_search_level; // Use a ML model to prune horz and vert partitions int ml_prune_rect_partition; // Disable/Enable interintra motion mode based on stats collected during // first_partition_search_pass int use_first_partition_pass_interintra_stats; // Use a ML model to prune horz_a, horz_b, vert_a and vert_b partitions. int ml_prune_ab_partition; // Use a ML model to prune horz4 and vert4 partitions. int ml_prune_4_partition; int fast_cdef_search; // 2-pass coding block partition search, and also use the mode decisions made // in the initial partition search to prune mode candidates, e.g. ref frames. int two_pass_partition_search; // Terminate early in firstpass of two_pass partition search for faster // firstpass. int firstpass_simple_motion_search_early_term; // Skip rectangular partition test when partition type none gives better // rd than partition type split. Can take values 0 - 2, 0 referring to no // skipping, and 1 - 2 increasing aggressiveness of skipping in order. int less_rectangular_check_level; // Use square partition only beyond this block size. BLOCK_SIZE use_square_partition_only_threshold; // Prune reference frames for rectangular partitions. // 0 implies no pruning // 1 implies prune for extended partition // 2 implies prune horiz, vert and extended partition int prune_ref_frame_for_rect_partitions; // Sets min and max square partition levels for this superblock based on // motion vector and prediction error distribution produced from 16x16 // simple motion search MAX_PART_PRED_MODE auto_max_partition_based_on_simple_motion; int auto_min_partition_based_on_simple_motion; // Ensures the rd based auto partition search will always // go down at least to the specified level. BLOCK_SIZE rd_auto_partition_min_limit; // Min and max partition size we enable (block_size) as per auto // min max, but also used by adjust partitioning, and pick_partitioning. BLOCK_SIZE default_min_partition_size; BLOCK_SIZE default_max_partition_size; // Whether or not we allow partitions one smaller or one greater than the last // frame's partitioning. Only used if use_lastframe_partitioning is set. int adjust_partitioning_from_last_frame; // TODO(jingning): combine the related motion search speed features // This allows us to use motion search at other sizes as a starting // point for this motion search and limits the search range around it. int adaptive_motion_search; // Flag for allowing some use of exhaustive searches; int allow_exhaustive_searches; // Threshold for allowing exhaistive motion search. int exhaustive_searches_thresh; // Maximum number of exhaustive searches for a frame. int max_exaustive_pct; // Pattern to be used for any exhaustive mesh searches. MESH_PATTERN mesh_patterns[MAX_MESH_STEP]; // Allows sub 8x8 modes to use the prediction filter that was determined // best for 8x8 mode. If set to 0 we always re check all the filters for // sizes less than 8x8, 1 means we check all filter modes if no 8x8 filter // was selected, and 2 means we use 8 tap if no 8x8 filter mode was selected. int adaptive_pred_interp_filter; // Adaptive prediction mode search int adaptive_mode_search; int alt_ref_search_fp; // Implements various heuristics to skip searching modes // The heuristics selected are based on flags // defined in the MODE_SEARCH_SKIP_HEURISTICS enum unsigned int mode_search_skip_flags; // A source variance threshold below which filter search is disabled // Choose a very large value (UINT_MAX) to use 8-tap always unsigned int disable_filter_search_var_thresh; // Only enable wedge search if the edge strength is greater than // this threshold. A value of 0 signals that this check is disabled. unsigned int disable_wedge_search_edge_thresh; // Only enable wedge search if the variance is above this threshold. unsigned int disable_wedge_search_var_thresh; // Whether fast wedge sign estimate is used int fast_wedge_sign_estimate; // Whether to prune wedge search based on predictor difference int prune_wedge_pred_diff_based; // These bit masks allow you to enable or disable intra modes for each // transform size separately. int intra_y_mode_mask[TX_SIZES]; int intra_uv_mode_mask[TX_SIZES]; // This feature controls how the loop filter level is determined. LPF_PICK_METHOD lpf_pick; // This feature controls whether we do the expensive context update and // calculation in the rd coefficient costing loop. int use_fast_coef_costing; // This feature controls the tolerence vs target used in deciding whether to // recode a frame. It has no meaning if recode is disabled. int recode_tolerance; // This variable controls the maximum block size where intra blocks can be // used in inter frames. // TODO(aconverse): Fold this into one of the other many mode skips BLOCK_SIZE max_intra_bsize; // Partition search early breakout thresholds. int64_t partition_search_breakout_dist_thr; int partition_search_breakout_rate_thr; // Thresholds for ML based partition search breakout. int ml_partition_search_breakout_thresh[PARTITION_BLOCK_SIZES]; // Allow skipping partition search for still image frame int allow_partition_search_skip; // Fast approximation of av1_model_rd_from_var_lapndz int simple_model_rd_from_var; // If true, sub-pixel search uses the exact convolve function used for final // encoding and decoding; otherwise, it uses bilinear interpolation. SUBPEL_SEARCH_TYPE use_accurate_subpel_search; // Whether to compute distortion in the image domain (slower but // more accurate), or in the transform domain (faster but less acurate). // 0: use image domain // 1: use transform domain in tx_type search, and use image domain for // RD_STATS // 2: use transform domain int use_transform_domain_distortion; GM_SEARCH_TYPE gm_search_type; // whether to disable the global motion recode loop int gm_disable_recode; // Do limited interpolation filter search for dual filters, since best choice // usually includes EIGHTTAP_REGULAR. int use_fast_interpolation_filter_search; // Disable dual filter int disable_dual_filter; // Save results of interpolation_filter_search for a block // Check mv and ref_frames before search, if they are same with previous // saved results, it can be skipped. int skip_repeat_interpolation_filter_search; // Use a hash table to store previously computed optimized qcoeffs from // expensive calls to optimize_txb. int use_hash_based_trellis; // flag to drop some ref frames in compound motion search int drop_ref; // flag to allow skipping intra mode for inter frame prediction int skip_intra_in_interframe;
+ show +
553
554
555
556
557
558
559
560
561
562
// Use hash table to store intra(keyframe only) txb transform search results // to avoid repeated search on the same residue signal. int use_intra_txb_hash; // Use hash table to store inter txb transform search results // to avoid repeated search on the same residue signal. int use_inter_txb_hash; // Use hash table to store macroblock RD search results

[CVE-2020-0478_1.diff] partition_model_weights.h #37
-#define FEATURE_SIZE 19 -static const float av1_2pass_split_partition_weights_128[FEATURE_SIZE + 1] = { - 2.683936f, -0.193620f, -4.106470f, -0.141320f, -0.282289f, - 0.125296f, -1.134961f, 0.862757f, -0.418799f, -0.637666f, - 0.016232f, 0.345013f, 0.018823f, -0.393394f, -1.130700f, - 0.695357f, 0.112569f, -0.341975f, -0.513882f, 5.7488966f, -}; - -static const float av1_2pass_split_partition_weights_64[FEATURE_SIZE + 1] = { - 2.990993f, 0.423273f, -0.926544f, 0.454646f, -0.292698f, - -1.311632f, -0.284432f, 0.717141f, -0.419257f, -0.574760f, - -0.674444f, 0.669047f, -0.374255f, 0.380624f, -0.804036f, - 0.264021f, 0.004163f, 1.896802f, 0.924287f, 0.13490619f, -}; - -static const float av1_2pass_split_partition_weights_32[FEATURE_SIZE + 1] = { - 2.795181f, -0.136943f, -0.924842f, 0.405330f, -0.463505f, - -0.584076f, -0.831472f, 0.382985f, -0.597544f, -0.138915f, - -1.354350f, 0.466035f, -0.553961f, 0.213202f, -1.166429f, - 0.010776f, -0.096236f, 2.335084f, 1.699857f, -0.58178353f, -}; - -static const float av1_2pass_split_partition_weights_16[FEATURE_SIZE + 1] = { - 1.987888f, -0.431100f, -1.687703f, 0.262602f, -0.425298f, - -0.463870f, -1.493457f, 0.470917f, -0.528457f, -0.087700f, - -1.815092f, 0.152883f, -0.337908f, 0.093679f, -1.548267f, - -0.042387f, -0.000861f, 2.556746f, 1.619192f, 0.03643292f, -}; - -static const float av1_2pass_split_partition_weights_8[FEATURE_SIZE + 1] = { - 2.188344f, -0.817528f, -2.119219f, 0.000000f, -0.348167f, - -0.658074f, -1.960362f, 0.000000f, -0.403080f, 0.282699f, - -2.061088f, 0.000000f, -0.431919f, -0.127960f, -1.099550f, - 0.000000f, 0.121622f, 2.017455f, 2.058228f, -0.15475988f, -}; - -static const float av1_2pass_none_partition_weights_128[FEATURE_SIZE + 1] = { - -1.006689f, 0.777908f, 4.461072f, -0.395782f, -0.014610f, - -0.853863f, 0.729997f, -0.420477f, 0.282429f, -1.194595f, - 3.181220f, -0.511416f, 0.117084f, -1.149348f, 1.507990f, - -0.477212f, 0.202963f, -1.469581f, 0.624461f, -0.89081228f, -}; - -static const float av1_2pass_none_partition_weights_64[FEATURE_SIZE + 1] = { - -1.241117f, 0.844878f, 5.638803f, -0.489780f, -0.108796f, - -4.576821f, 1.540624f, -0.477519f, 0.227791f, -1.443968f, - 1.586911f, -0.505125f, 0.140764f, -0.464194f, 1.466658f, - -0.641166f, 0.195412f, 1.427905f, 2.080007f, -1.98272777f, -}; - -static const float av1_2pass_none_partition_weights_32[FEATURE_SIZE + 1] = { - -2.130825f, 0.476023f, 5.907343f, -0.516002f, -0.097471f, - -2.662754f, 0.614858f, -0.576728f, 0.085261f, -0.031901f, - 0.727842f, -0.600034f, 0.079326f, 0.324328f, 0.504502f, - -0.547105f, -0.037670f, 0.304995f, 0.369018f, -2.66299987f, -}; - -static const float av1_2pass_none_partition_weights_16[FEATURE_SIZE + 1] = { - -1.626410f, 0.872047f, 5.414965f, -0.554781f, -0.084514f, - -3.020550f, 0.467632f, -0.382280f, 0.199568f, 0.426220f, - 0.829426f, -0.467100f, 0.153098f, 0.662994f, 0.327545f, - -0.560106f, -0.141610f, 0.403372f, 0.523991f, -3.02891231f, -}; - -static const float av1_2pass_none_partition_weights_8[FEATURE_SIZE + 1] = { - -1.463349f, 0.375376f, 4.751430f, 0.000000f, -0.184451f, - -1.655447f, 0.443214f, 0.000000f, 0.127961f, 0.152435f, - 0.083288f, 0.000000f, 0.143105f, 0.438012f, 0.073238f, - 0.000000f, -0.278137f, 0.186134f, 0.073737f, -1.6494962f, -}; -#undef FEATURE_SIZE +static const NN_CONFIG + *const av1_simple_motion_search_prune_rect_nn_config[5] = { + &av1_simple_motion_search_prune_rect_nn_config_128, + &av1_simple_motion_search_prune_rect_nn_config_64, + &av1_simple_motion_search_prune_rect_nn_config_32, + &av1_simple_motion_search_prune_rect_nn_config_16, + &av1_simple_motion_search_prune_rect_nn_config_8, + };
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/partition_model_weights.h
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
av1_simple_motion_search_prune_part_layer_0_bias_8, av1_simple_motion_search_prune_part_logits_bias_8, }, }; #undef NUM_HIDDEN_LAYERS_8 #undef NUM_FEATURES_8 #undef NUM_LAYER_0_UNITS_8 #undef NUM_LOGITS_8
+ show +
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
#define FEATURE_SIZE 19 static const float av1_2pass_split_partition_weights_128[FEATURE_SIZE + 1] = { 2.683936f, -0.193620f, -4.106470f, -0.141320f, -0.282289f, 0.125296f, -1.134961f, 0.862757f, -0.418799f, -0.637666f, 0.016232f, 0.345013f, 0.018823f, -0.393394f, -1.130700f, 0.695357f, 0.112569f, -0.341975f, -0.513882f, 5.7488966f, }; static const float av1_2pass_split_partition_weights_64[FEATURE_SIZE + 1] = { 2.990993f, 0.423273f, -0.926544f, 0.454646f, -0.292698f, -1.311632f, -0.284432f, 0.717141f, -0.419257f, -0.574760f, -0.674444f, 0.669047f, -0.374255f, 0.380624f, -0.804036f, 0.264021f, 0.004163f, 1.896802f, 0.924287f, 0.13490619f, }; static const float av1_2pass_split_partition_weights_32[FEATURE_SIZE + 1] = { 2.795181f, -0.136943f, -0.924842f, 0.405330f, -0.463505f, -0.584076f, -0.831472f, 0.382985f, -0.597544f, -0.138915f, -1.354350f, 0.466035f, -0.553961f, 0.213202f, -1.166429f, 0.010776f, -0.096236f, 2.335084f, 1.699857f, -0.58178353f, }; static const float av1_2pass_split_partition_weights_16[FEATURE_SIZE + 1] = { 1.987888f, -0.431100f, -1.687703f, 0.262602f, -0.425298f, -0.463870f, -1.493457f, 0.470917f, -0.528457f, -0.087700f, -1.815092f, 0.152883f, -0.337908f, 0.093679f, -1.548267f, -0.042387f, -0.000861f, 2.556746f, 1.619192f, 0.03643292f, }; static const float av1_2pass_split_partition_weights_8[FEATURE_SIZE + 1] = { 2.188344f, -0.817528f, -2.119219f, 0.000000f, -0.348167f, -0.658074f, -1.960362f, 0.000000f, -0.403080f, 0.282699f, -2.061088f, 0.000000f, -0.431919f, -0.127960f, -1.099550f, 0.000000f, 0.121622f, 2.017455f, 2.058228f, -0.15475988f, }; static const float av1_2pass_none_partition_weights_128[FEATURE_SIZE + 1] = { -1.006689f, 0.777908f, 4.461072f, -0.395782f, -0.014610f, -0.853863f, 0.729997f, -0.420477f, 0.282429f, -1.194595f, 3.181220f, -0.511416f, 0.117084f, -1.149348f, 1.507990f, -0.477212f, 0.202963f, -1.469581f, 0.624461f, -0.89081228f, }; static const float av1_2pass_none_partition_weights_64[FEATURE_SIZE + 1] = { -1.241117f, 0.844878f, 5.638803f, -0.489780f, -0.108796f, -4.576821f, 1.540624f, -0.477519f, 0.227791f, -1.443968f, 1.586911f, -0.505125f, 0.140764f, -0.464194f, 1.466658f, -0.641166f, 0.195412f, 1.427905f, 2.080007f, -1.98272777f, }; static const float av1_2pass_none_partition_weights_32[FEATURE_SIZE + 1] = { -2.130825f, 0.476023f, 5.907343f, -0.516002f, -0.097471f, -2.662754f, 0.614858f, -0.576728f, 0.085261f, -0.031901f, 0.727842f, -0.600034f, 0.079326f, 0.324328f, 0.504502f, -0.547105f, -0.037670f, 0.304995f, 0.369018f, -2.66299987f, }; static const float av1_2pass_none_partition_weights_16[FEATURE_SIZE + 1] = { -1.626410f, 0.872047f, 5.414965f, -0.554781f, -0.084514f, -3.020550f, 0.467632f, -0.382280f, 0.199568f, 0.426220f, 0.829426f, -0.467100f, 0.153098f, 0.662994f, 0.327545f, -0.560106f, -0.141610f, 0.403372f, 0.523991f, -3.02891231f, }; static const float av1_2pass_none_partition_weights_8[FEATURE_SIZE + 1] = { -1.463349f, 0.375376f, 4.751430f, 0.000000f, -0.184451f, -1.655447f, 0.443214f, 0.000000f, 0.127961f, 0.152435f, 0.083288f, 0.000000f, 0.143105f, 0.438012f, 0.073238f, 0.000000f, -0.278137f, 0.186134f, 0.073737f, -1.6494962f, }; #undef FEATURE_SIZE
+ show +
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
// nn model for predicting max square partition level of a superblock #define NUM_HIDDEN_LAYERS 1 #define NUM_FEATURES 13 #define NUM_LAYER_0_UNITS 48 #define NUM_LOGITS 4 static const float av1_max_part_pred_logits_kernel[] = { -0.304561f, 0.0885596f, -0.988539f, 1.08147f, 0.215213f, 0.202965f, -0.828457f, -0.233945f, -0.0866977f, -0.115521f,

[CVE-2020-0470_1.diff] partition_model_weights.h #37
-#define FEATURE_SIZE 19 -static const float av1_2pass_split_partition_weights_128[FEATURE_SIZE + 1] = { - 2.683936f, -0.193620f, -4.106470f, -0.141320f, -0.282289f, - 0.125296f, -1.134961f, 0.862757f, -0.418799f, -0.637666f, - 0.016232f, 0.345013f, 0.018823f, -0.393394f, -1.130700f, - 0.695357f, 0.112569f, -0.341975f, -0.513882f, 5.7488966f, -}; - -static const float av1_2pass_split_partition_weights_64[FEATURE_SIZE + 1] = { - 2.990993f, 0.423273f, -0.926544f, 0.454646f, -0.292698f, - -1.311632f, -0.284432f, 0.717141f, -0.419257f, -0.574760f, - -0.674444f, 0.669047f, -0.374255f, 0.380624f, -0.804036f, - 0.264021f, 0.004163f, 1.896802f, 0.924287f, 0.13490619f, -}; - -static const float av1_2pass_split_partition_weights_32[FEATURE_SIZE + 1] = { - 2.795181f, -0.136943f, -0.924842f, 0.405330f, -0.463505f, - -0.584076f, -0.831472f, 0.382985f, -0.597544f, -0.138915f, - -1.354350f, 0.466035f, -0.553961f, 0.213202f, -1.166429f, - 0.010776f, -0.096236f, 2.335084f, 1.699857f, -0.58178353f, -}; - -static const float av1_2pass_split_partition_weights_16[FEATURE_SIZE + 1] = { - 1.987888f, -0.431100f, -1.687703f, 0.262602f, -0.425298f, - -0.463870f, -1.493457f, 0.470917f, -0.528457f, -0.087700f, - -1.815092f, 0.152883f, -0.337908f, 0.093679f, -1.548267f, - -0.042387f, -0.000861f, 2.556746f, 1.619192f, 0.03643292f, -}; - -static const float av1_2pass_split_partition_weights_8[FEATURE_SIZE + 1] = { - 2.188344f, -0.817528f, -2.119219f, 0.000000f, -0.348167f, - -0.658074f, -1.960362f, 0.000000f, -0.403080f, 0.282699f, - -2.061088f, 0.000000f, -0.431919f, -0.127960f, -1.099550f, - 0.000000f, 0.121622f, 2.017455f, 2.058228f, -0.15475988f, -}; - -static const float av1_2pass_none_partition_weights_128[FEATURE_SIZE + 1] = { - -1.006689f, 0.777908f, 4.461072f, -0.395782f, -0.014610f, - -0.853863f, 0.729997f, -0.420477f, 0.282429f, -1.194595f, - 3.181220f, -0.511416f, 0.117084f, -1.149348f, 1.507990f, - -0.477212f, 0.202963f, -1.469581f, 0.624461f, -0.89081228f, -}; - -static const float av1_2pass_none_partition_weights_64[FEATURE_SIZE + 1] = { - -1.241117f, 0.844878f, 5.638803f, -0.489780f, -0.108796f, - -4.576821f, 1.540624f, -0.477519f, 0.227791f, -1.443968f, - 1.586911f, -0.505125f, 0.140764f, -0.464194f, 1.466658f, - -0.641166f, 0.195412f, 1.427905f, 2.080007f, -1.98272777f, -}; - -static const float av1_2pass_none_partition_weights_32[FEATURE_SIZE + 1] = { - -2.130825f, 0.476023f, 5.907343f, -0.516002f, -0.097471f, - -2.662754f, 0.614858f, -0.576728f, 0.085261f, -0.031901f, - 0.727842f, -0.600034f, 0.079326f, 0.324328f, 0.504502f, - -0.547105f, -0.037670f, 0.304995f, 0.369018f, -2.66299987f, -}; - -static const float av1_2pass_none_partition_weights_16[FEATURE_SIZE + 1] = { - -1.626410f, 0.872047f, 5.414965f, -0.554781f, -0.084514f, - -3.020550f, 0.467632f, -0.382280f, 0.199568f, 0.426220f, - 0.829426f, -0.467100f, 0.153098f, 0.662994f, 0.327545f, - -0.560106f, -0.141610f, 0.403372f, 0.523991f, -3.02891231f, -}; - -static const float av1_2pass_none_partition_weights_8[FEATURE_SIZE + 1] = { - -1.463349f, 0.375376f, 4.751430f, 0.000000f, -0.184451f, - -1.655447f, 0.443214f, 0.000000f, 0.127961f, 0.152435f, - 0.083288f, 0.000000f, 0.143105f, 0.438012f, 0.073238f, - 0.000000f, -0.278137f, 0.186134f, 0.073737f, -1.6494962f, -}; -#undef FEATURE_SIZE +static const NN_CONFIG + *const av1_simple_motion_search_prune_rect_nn_config[5] = { + &av1_simple_motion_search_prune_rect_nn_config_128, + &av1_simple_motion_search_prune_rect_nn_config_64, + &av1_simple_motion_search_prune_rect_nn_config_32, + &av1_simple_motion_search_prune_rect_nn_config_16, + &av1_simple_motion_search_prune_rect_nn_config_8, + };
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/partition_model_weights.h
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
av1_simple_motion_search_prune_part_layer_0_bias_8, av1_simple_motion_search_prune_part_logits_bias_8, }, }; #undef NUM_HIDDEN_LAYERS_8 #undef NUM_FEATURES_8 #undef NUM_LAYER_0_UNITS_8 #undef NUM_LOGITS_8
+ show +
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
#define FEATURE_SIZE 19 static const float av1_2pass_split_partition_weights_128[FEATURE_SIZE + 1] = { 2.683936f, -0.193620f, -4.106470f, -0.141320f, -0.282289f, 0.125296f, -1.134961f, 0.862757f, -0.418799f, -0.637666f, 0.016232f, 0.345013f, 0.018823f, -0.393394f, -1.130700f, 0.695357f, 0.112569f, -0.341975f, -0.513882f, 5.7488966f, }; static const float av1_2pass_split_partition_weights_64[FEATURE_SIZE + 1] = { 2.990993f, 0.423273f, -0.926544f, 0.454646f, -0.292698f, -1.311632f, -0.284432f, 0.717141f, -0.419257f, -0.574760f, -0.674444f, 0.669047f, -0.374255f, 0.380624f, -0.804036f, 0.264021f, 0.004163f, 1.896802f, 0.924287f, 0.13490619f, }; static const float av1_2pass_split_partition_weights_32[FEATURE_SIZE + 1] = { 2.795181f, -0.136943f, -0.924842f, 0.405330f, -0.463505f, -0.584076f, -0.831472f, 0.382985f, -0.597544f, -0.138915f, -1.354350f, 0.466035f, -0.553961f, 0.213202f, -1.166429f, 0.010776f, -0.096236f, 2.335084f, 1.699857f, -0.58178353f, }; static const float av1_2pass_split_partition_weights_16[FEATURE_SIZE + 1] = { 1.987888f, -0.431100f, -1.687703f, 0.262602f, -0.425298f, -0.463870f, -1.493457f, 0.470917f, -0.528457f, -0.087700f, -1.815092f, 0.152883f, -0.337908f, 0.093679f, -1.548267f, -0.042387f, -0.000861f, 2.556746f, 1.619192f, 0.03643292f, }; static const float av1_2pass_split_partition_weights_8[FEATURE_SIZE + 1] = { 2.188344f, -0.817528f, -2.119219f, 0.000000f, -0.348167f, -0.658074f, -1.960362f, 0.000000f, -0.403080f, 0.282699f, -2.061088f, 0.000000f, -0.431919f, -0.127960f, -1.099550f, 0.000000f, 0.121622f, 2.017455f, 2.058228f, -0.15475988f, }; static const float av1_2pass_none_partition_weights_128[FEATURE_SIZE + 1] = { -1.006689f, 0.777908f, 4.461072f, -0.395782f, -0.014610f, -0.853863f, 0.729997f, -0.420477f, 0.282429f, -1.194595f, 3.181220f, -0.511416f, 0.117084f, -1.149348f, 1.507990f, -0.477212f, 0.202963f, -1.469581f, 0.624461f, -0.89081228f, }; static const float av1_2pass_none_partition_weights_64[FEATURE_SIZE + 1] = { -1.241117f, 0.844878f, 5.638803f, -0.489780f, -0.108796f, -4.576821f, 1.540624f, -0.477519f, 0.227791f, -1.443968f, 1.586911f, -0.505125f, 0.140764f, -0.464194f, 1.466658f, -0.641166f, 0.195412f, 1.427905f, 2.080007f, -1.98272777f, }; static const float av1_2pass_none_partition_weights_32[FEATURE_SIZE + 1] = { -2.130825f, 0.476023f, 5.907343f, -0.516002f, -0.097471f, -2.662754f, 0.614858f, -0.576728f, 0.085261f, -0.031901f, 0.727842f, -0.600034f, 0.079326f, 0.324328f, 0.504502f, -0.547105f, -0.037670f, 0.304995f, 0.369018f, -2.66299987f, }; static const float av1_2pass_none_partition_weights_16[FEATURE_SIZE + 1] = { -1.626410f, 0.872047f, 5.414965f, -0.554781f, -0.084514f, -3.020550f, 0.467632f, -0.382280f, 0.199568f, 0.426220f, 0.829426f, -0.467100f, 0.153098f, 0.662994f, 0.327545f, -0.560106f, -0.141610f, 0.403372f, 0.523991f, -3.02891231f, }; static const float av1_2pass_none_partition_weights_8[FEATURE_SIZE + 1] = { -1.463349f, 0.375376f, 4.751430f, 0.000000f, -0.184451f, -1.655447f, 0.443214f, 0.000000f, 0.127961f, 0.152435f, 0.083288f, 0.000000f, 0.143105f, 0.438012f, 0.073238f, 0.000000f, -0.278137f, 0.186134f, 0.073737f, -1.6494962f, }; #undef FEATURE_SIZE
+ show +
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
// nn model for predicting max square partition level of a superblock #define NUM_HIDDEN_LAYERS 1 #define NUM_FEATURES 13 #define NUM_LAYER_0_UNITS 48 #define NUM_LOGITS 4 static const float av1_max_part_pred_logits_kernel[] = { -0.304561f, 0.0885596f, -0.988539f, 1.08147f, 0.215213f, 0.202965f, -0.828457f, -0.233945f, -0.0866977f, -0.115521f,

[CVE-2020-0478_1.diff] encoder.h #26
- int ext_refresh_frame_flags_pending; - int ext_refresh_last_frame; - int ext_refresh_golden_frame; - int ext_refresh_bwd_ref_frame; - int ext_refresh_alt2_ref_frame; - int ext_refresh_alt_ref_frame; - - int ext_refresh_frame_context_pending; - int ext_refresh_frame_context; - int ext_use_ref_frame_mvs; - int ext_use_error_resilient; - int ext_use_s_frame; - int ext_use_primary_ref_none; + // Flags signalled by the external interface at frame level. + ExternalFlags ext_flags;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encoder.h
769
770
771
772
773
774
775
776
777
778
int refresh_bwd_ref_frame; int refresh_alt2_ref_frame; int refresh_alt_ref_frame; // For each type of reference frame, this contains the index of a reference // frame buffer for a reference frame of the same type. We use this to // choose our primary reference frame (which is the most recent reference // frame of the same type as the current frame). int fb_of_context_type[REF_FRAMES];
+ show +
779
780
781
782
783
784
785
786
787
788
789
790
791
int ext_refresh_frame_flags_pending; int ext_refresh_last_frame; int ext_refresh_golden_frame; int ext_refresh_bwd_ref_frame; int ext_refresh_alt2_ref_frame; int ext_refresh_alt_ref_frame; int ext_refresh_frame_context_pending; int ext_refresh_frame_context; int ext_use_ref_frame_mvs; int ext_use_error_resilient; int ext_use_s_frame; int ext_use_primary_ref_none;
+ show +
792
793
794
795
796
797
798
799
800
801
YV12_BUFFER_CONFIG last_frame_uf; YV12_BUFFER_CONFIG trial_frame_rst; // Ambient reconstruction err target for force key frames int64_t ambient_err; RD_OPT rd; CODING_CONTEXT coding_context;

[CVE-2020-0478_1.diff] encoder.h #33
- // The following data are for AV1 bitstream levels. - AV1_LEVEL target_seq_level_idx[MAX_NUM_OPERATING_POINTS]; - int keep_level_stats; - AV1LevelInfo level_info[MAX_NUM_OPERATING_POINTS]; - // Count the number of OBU_FRAME and OBU_FRAME_HEADER for level calculation. - int frame_header_count; - FrameWindowBuffer frame_window_buffer; + // Parameters for AV1 bitstream levels. + AV1LevelParams level_params; + + // whether any no-zero delta_q was actually used + int deltaq_used; + + // Indicates the true relative distance of ref frame w.r.t. current frame + int ref_relative_dist[INTER_REFS_PER_FRAME]; + + // Indicate nearest references w.r.t. current frame in past and future + int8_t nearest_past_ref; + int8_t nearest_future_ref; + + // TODO(sdeng): consider merge the following arrays. + double *tpl_rdmult_scaling_factors; + double *tpl_sb_rdmult_scaling_factors; + double *ssim_rdmult_scaling_factors; + +#if CONFIG_TUNE_VMAF + double *vmaf_rdmult_scaling_factors; + double last_frame_ysse; + double last_frame_vmaf; + double last_frame_unsharp_amount; +#endif + + int use_svc; + SVC svc; + + int lap_enabled; + COMPRESSOR_STAGE compressor_stage; + + // Some motion vector stats from the last encoded frame to help us decide what + // precision to use to encode the current frame. + MV_STATS mv_stats; + + // Frame type of the last frame. May be used in some heuristics for speeding + // up the encoding. + FRAME_TYPE last_frame_type; + int num_tg; + + // Super-resolution mode currently being used by the encoder. + // This may / may not be same as user-supplied mode in oxcf->superres_mode + // (when we are recoding to try multiple options for example). + SUPERRES_MODE superres_mode;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encoder.h
984
985
986
987
988
989
990
991
992
993
#if CONFIG_COLLECT_COMPONENT_TIMING // component_time[] are initialized to zero while encoder starts. uint64_t component_time[kTimingComponents]; struct aom_usec_timer component_timer[kTimingComponents]; // frame_component_time[] are initialized to zero at beginning of each frame. uint64_t frame_component_time[kTimingComponents]; #endif // The following data are for AV1 bitstream levels.
+ show +
994
995
996
997
998
999
AV1_LEVEL target_seq_level_idx[MAX_NUM_OPERATING_POINTS]; int keep_level_stats; AV1LevelInfo level_info[MAX_NUM_OPERATING_POINTS]; // Count the number of OBU_FRAME and OBU_FRAME_HEADER for level calculation. int frame_header_count; FrameWindowBuffer frame_window_buffer;
+ show +
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
} AV1_COMP; typedef struct { YV12_BUFFER_CONFIG *source; YV12_BUFFER_CONFIG *last_source; int64_t ts_duration; } EncodeFrameInput; // EncodeFrameParams contains per-frame encoding parameters decided upon by // av1_encode_strategy() and passed down to av1_encode()

[CVE-2020-0470_1.diff] encoder.h #26
- int ext_refresh_frame_flags_pending; - int ext_refresh_last_frame; - int ext_refresh_golden_frame; - int ext_refresh_bwd_ref_frame; - int ext_refresh_alt2_ref_frame; - int ext_refresh_alt_ref_frame; - - int ext_refresh_frame_context_pending; - int ext_refresh_frame_context; - int ext_use_ref_frame_mvs; - int ext_use_error_resilient; - int ext_use_s_frame; - int ext_use_primary_ref_none; + // Flags signalled by the external interface at frame level. + ExternalFlags ext_flags;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encoder.h
769
770
771
772
773
774
775
776
777
778
int refresh_bwd_ref_frame; int refresh_alt2_ref_frame; int refresh_alt_ref_frame; // For each type of reference frame, this contains the index of a reference // frame buffer for a reference frame of the same type. We use this to // choose our primary reference frame (which is the most recent reference // frame of the same type as the current frame). int fb_of_context_type[REF_FRAMES];
+ show +
779
780
781
782
783
784
785
786
787
788
789
790
791
int ext_refresh_frame_flags_pending; int ext_refresh_last_frame; int ext_refresh_golden_frame; int ext_refresh_bwd_ref_frame; int ext_refresh_alt2_ref_frame; int ext_refresh_alt_ref_frame; int ext_refresh_frame_context_pending; int ext_refresh_frame_context; int ext_use_ref_frame_mvs; int ext_use_error_resilient; int ext_use_s_frame; int ext_use_primary_ref_none;
+ show +
792
793
794
795
796
797
798
799
800
801
YV12_BUFFER_CONFIG last_frame_uf; YV12_BUFFER_CONFIG trial_frame_rst; // Ambient reconstruction err target for force key frames int64_t ambient_err; RD_OPT rd; CODING_CONTEXT coding_context;

[CVE-2020-0470_1.diff] encoder.h #33
- // The following data are for AV1 bitstream levels. - AV1_LEVEL target_seq_level_idx[MAX_NUM_OPERATING_POINTS]; - int keep_level_stats; - AV1LevelInfo level_info[MAX_NUM_OPERATING_POINTS]; - // Count the number of OBU_FRAME and OBU_FRAME_HEADER for level calculation. - int frame_header_count; - FrameWindowBuffer frame_window_buffer; + // Parameters for AV1 bitstream levels. + AV1LevelParams level_params; + + // whether any no-zero delta_q was actually used + int deltaq_used; + + // Indicates the true relative distance of ref frame w.r.t. current frame + int ref_relative_dist[INTER_REFS_PER_FRAME]; + + // Indicate nearest references w.r.t. current frame in past and future + int8_t nearest_past_ref; + int8_t nearest_future_ref; + + // TODO(sdeng): consider merge the following arrays. + double *tpl_rdmult_scaling_factors; + double *tpl_sb_rdmult_scaling_factors; + double *ssim_rdmult_scaling_factors; + +#if CONFIG_TUNE_VMAF + double *vmaf_rdmult_scaling_factors; + double last_frame_ysse; + double last_frame_vmaf; + double last_frame_unsharp_amount; +#endif + + int use_svc; + SVC svc; + + int lap_enabled; + COMPRESSOR_STAGE compressor_stage; + + // Some motion vector stats from the last encoded frame to help us decide what + // precision to use to encode the current frame. + MV_STATS mv_stats; + + // Frame type of the last frame. May be used in some heuristics for speeding + // up the encoding. + FRAME_TYPE last_frame_type; + int num_tg; + + // Super-resolution mode currently being used by the encoder. + // This may / may not be same as user-supplied mode in oxcf->superres_mode + // (when we are recoding to try multiple options for example). + SUPERRES_MODE superres_mode;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encoder.h
984
985
986
987
988
989
990
991
992
993
#if CONFIG_COLLECT_COMPONENT_TIMING // component_time[] are initialized to zero while encoder starts. uint64_t component_time[kTimingComponents]; struct aom_usec_timer component_timer[kTimingComponents]; // frame_component_time[] are initialized to zero at beginning of each frame. uint64_t frame_component_time[kTimingComponents]; #endif // The following data are for AV1 bitstream levels.
+ show +
994
995
996
997
998
999
AV1_LEVEL target_seq_level_idx[MAX_NUM_OPERATING_POINTS]; int keep_level_stats; AV1LevelInfo level_info[MAX_NUM_OPERATING_POINTS]; // Count the number of OBU_FRAME and OBU_FRAME_HEADER for level calculation. int frame_header_count; FrameWindowBuffer frame_window_buffer;
+ show +
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
} AV1_COMP; typedef struct { YV12_BUFFER_CONFIG *source; YV12_BUFFER_CONFIG *last_source; int64_t ts_duration; } EncodeFrameInput; // EncodeFrameParams contains per-frame encoding parameters decided upon by // av1_encode_strategy() and passed down to av1_encode()

[CVE-2020-0478_1.diff] pickrst.c #9
+#if CONFIG_AV1_HIGHBITDEPTH +#endif // CONFIG_AV1_HIGHBITDEPTH - decode_xq(xqd, xq, params); - if (!use_highbitdepth) { - return av1_lowbd_pixel_proj_error(src8, width, height, src_stride, dat8, - dat_stride, flt0, flt0_stride, flt1, - flt1_stride, xq, params); - } else { + av1_decode_xq(xqd, xq, params); + +#if CONFIG_AV1_HIGHBITDEPTH + if (use_highbitdepth) { + + } else { + return av1_lowbd_pixel_proj_error(src8, width, height, src_stride, dat8, + dat_stride, flt0, flt0_stride, flt1, + flt1_stride, xq, params); +#else + (void)use_highbitdepth; + return av1_lowbd_pixel_proj_error(src8, width, height, src_stride, dat8, + dat_stride, flt0, flt0_stride, flt1, + flt1_stride, xq, params); +#endif
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/pickrst.c
325
326
327
328
329
330
331
332
333
334
return err; } static int64_t get_pixel_proj_error(const uint8_t *src8, int width, int height, int src_stride, const uint8_t *dat8, int dat_stride, int use_highbitdepth, int32_t *flt0, int flt0_stride, int32_t *flt1, int flt1_stride, int *xqd, const sgr_params_type *params) { int xq[2];
+ show +
335
336
337
338
339
340
decode_xq(xqd, xq, params); if (!use_highbitdepth) { return av1_lowbd_pixel_proj_error(src8, width, height, src_stride, dat8, dat_stride, flt0, flt0_stride, flt1, flt1_stride, xq, params); } else {
+ show +
341
342
343
344
345
346
347
348
349
350
return av1_highbd_pixel_proj_error(src8, width, height, src_stride, dat8, dat_stride, flt0, flt0_stride, flt1, flt1_stride, xq, params); } } #define USE_SGRPROJ_REFINEMENT_SEARCH 1 static int64_t finer_search_pixel_proj_error( const uint8_t *src8, int width, int height, int src_stride, const uint8_t *dat8, int dat_stride, int use_highbitdepth, int32_t *flt0,

[CVE-2020-0478_1.diff] pickrst.c #13
-static void apply_sgr(int sgr_params_idx, const uint8_t *dat8, int width, - int height, int dat_stride, int use_highbd, int bit_depth, - int pu_width, int pu_height, int32_t *flt0, int32_t *flt1, - int flt_stride) { +static AOM_INLINE void apply_sgr(int sgr_params_idx, const uint8_t *dat8, + int width, int height, int dat_stride, + int use_highbd, int bit_depth, int pu_width, + int pu_height, int32_t *flt0, int32_t *flt1, + int flt_stride) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/pickrst.c
520
521
522
523
524
525
526
527
528
529
xqd[1] = clamp((1 << SGRPROJ_PRJ_BITS) - xqd[0], SGRPROJ_PRJ_MIN1, SGRPROJ_PRJ_MAX1); } else { xqd[0] = clamp(xq[0], SGRPROJ_PRJ_MIN0, SGRPROJ_PRJ_MAX0); xqd[1] = clamp((1 << SGRPROJ_PRJ_BITS) - xqd[0] - xq[1], SGRPROJ_PRJ_MIN1, SGRPROJ_PRJ_MAX1); } } // Apply the self-guided filter across an entire restoration unit.
+ show +
530
531
532
533
static void apply_sgr(int sgr_params_idx, const uint8_t *dat8, int width, int height, int dat_stride, int use_highbd, int bit_depth, int pu_width, int pu_height, int32_t *flt0, int32_t *flt1, int flt_stride) {
+ show +
534
535
536
537
538
539
540
541
542
543
for (int i = 0; i < height; i += pu_height) { const int h = AOMMIN(pu_height, height - i); int32_t *flt0_row = flt0 + i * flt_stride; int32_t *flt1_row = flt1 + i * flt_stride; const uint8_t *dat8_row = dat8 + i * dat_stride; // Iterate over the stripe in blocks of width pu_width for (int j = 0; j < width; j += pu_width) { const int w = AOMMIN(pu_width, width - j); const int ret = av1_selfguided_restoration(

[CVE-2020-0478_1.diff] pickrst.c #15
- - for (ep = 0; ep < SGRPROJ_PARAMS; ep++) { - int exq[2]; - apply_sgr(ep, dat8, width, height, dat_stride, use_highbitdepth, bit_depth, - pu_width, pu_height, flt0, flt1, flt_stride); - aom_clear_system_state(); - const sgr_params_type *const params = &sgr_params[ep]; - get_proj_subspace(src8, width, height, src_stride, dat8, dat_stride, - use_highbitdepth, flt0, flt_stride, flt1, flt_stride, exq, - params); - aom_clear_system_state(); - encode_xq(exq, exqd, params); - int64_t err = finer_search_pixel_proj_error( - src8, width, height, src_stride, dat8, dat_stride, use_highbitdepth, - flt0, flt_stride, flt1, flt_stride, 2, exqd, params); - if (besterr == -1 || err < besterr) { - bestep = ep; - besterr = err; - bestxqd[0] = exqd[0]; - bestxqd[1] = exqd[1]; + if (!enable_sgr_ep_pruning) { + for (ep = 0; ep < SGRPROJ_PARAMS; ep++) { + int64_t err; + compute_sgrproj_err(dat8, width, height, dat_stride, src8, src_stride, + use_highbitdepth, bit_depth, pu_width, pu_height, ep, + flt0, flt1, flt_stride, exqd, &err); + get_best_error(&besterr, err, exqd, bestxqd, &bestep, ep); + } + } else { + // evaluate first four seed ep in first group + for (idx = 0; idx < SGRPROJ_EP_GRP1_SEARCH_COUNT; idx++) { + ep = sgproj_ep_grp1_seed[idx]; + int64_t err; + compute_sgrproj_err(dat8, width, height, dat_stride, src8, src_stride, + use_highbitdepth, bit_depth, pu_width, pu_height, ep, + flt0, flt1, flt_stride, exqd, &err); + get_best_error(&besterr, err, exqd, bestxqd, &bestep, ep); + } + // evaluate left and right ep of winner in seed ep + int bestep_ref = bestep; + for (ep = bestep_ref - 1; ep < bestep_ref + 2; ep += 2) { + if (ep < SGRPROJ_EP_GRP1_START_IDX || ep > SGRPROJ_EP_GRP1_END_IDX) + continue; + int64_t err; + compute_sgrproj_err(dat8, width, height, dat_stride, src8, src_stride, + use_highbitdepth, bit_depth, pu_width, pu_height, ep, + flt0, flt1, flt_stride, exqd, &err); + get_best_error(&besterr, err, exqd, bestxqd, &bestep, ep); + } + // evaluate last two group + for (idx = 0; idx < SGRPROJ_EP_GRP2_3_SEARCH_COUNT; idx++) { + ep = sgproj_ep_grp2_3[idx][bestep]; + int64_t err; + compute_sgrproj_err(dat8, width, height, dat_stride, src8, src_stride, + use_highbitdepth, bit_depth, pu_width, pu_height, ep, + flt0, flt1, flt_stride, exqd, &err); + get_best_error(&besterr, err, exqd, bestxqd, &bestep, ep);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/pickrst.c
557
558
559
560
561
562
563
564
565
566
int32_t *flt1 = flt0 + RESTORATION_UNITPELS_MAX; int ep, bestep = 0; int64_t besterr = -1; int exqd[2], bestxqd[2] = { 0, 0 }; int flt_stride = ((width + 7) & ~7) + 8; assert(pu_width == (RESTORATION_PROC_UNIT_SIZE >> 1) || pu_width == RESTORATION_PROC_UNIT_SIZE); assert(pu_height == (RESTORATION_PROC_UNIT_SIZE >> 1) || pu_height == RESTORATION_PROC_UNIT_SIZE);
+ show +
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
for (ep = 0; ep < SGRPROJ_PARAMS; ep++) { int exq[2]; apply_sgr(ep, dat8, width, height, dat_stride, use_highbitdepth, bit_depth, pu_width, pu_height, flt0, flt1, flt_stride); aom_clear_system_state(); const sgr_params_type *const params = &sgr_params[ep]; get_proj_subspace(src8, width, height, src_stride, dat8, dat_stride, use_highbitdepth, flt0, flt_stride, flt1, flt_stride, exq, params); aom_clear_system_state(); encode_xq(exq, exqd, params); int64_t err = finer_search_pixel_proj_error( src8, width, height, src_stride, dat8, dat_stride, use_highbitdepth, flt0, flt_stride, flt1, flt_stride, 2, exqd, params); if (besterr == -1 || err < besterr) { bestep = ep; besterr = err; bestxqd[0] = exqd[0]; bestxqd[1] = exqd[1];
+ show +
586
587
588
589
590
591
592
593
594
595
} } SgrprojInfo ret; ret.ep = bestep; ret.xqd[0] = bestxqd[0]; ret.xqd[1] = bestxqd[1]; return ret; }

[CVE-2020-0478_1.diff] pickrst.c #17
-static void search_sgrproj(const RestorationTileLimits *limits, - const AV1PixelRect *tile, int rest_unit_idx, - void *priv, int32_t *tmpbuf, - RestorationLineBuffers *rlbs) { +static AOM_INLINE void search_sgrproj(const RestorationTileLimits *limits, + const AV1PixelRect *tile, + int rest_unit_idx, void *priv, + int32_t *tmpbuf, + RestorationLineBuffers *rlbs) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/pickrst.c
603
604
605
606
607
608
609
610
611
612
ref_sgrproj_info->xqd[0] - SGRPROJ_PRJ_MIN0, sgrproj_info->xqd[0] - SGRPROJ_PRJ_MIN0); if (params->r[1] > 0) bits += aom_count_primitive_refsubexpfin( SGRPROJ_PRJ_MAX1 - SGRPROJ_PRJ_MIN1 + 1, SGRPROJ_PRJ_SUBEXP_K, ref_sgrproj_info->xqd[1] - SGRPROJ_PRJ_MIN1, sgrproj_info->xqd[1] - SGRPROJ_PRJ_MIN1); return bits; }
+ show +
613
614
615
616
static void search_sgrproj(const RestorationTileLimits *limits, const AV1PixelRect *tile, int rest_unit_idx, void *priv, int32_t *tmpbuf, RestorationLineBuffers *rlbs) {
+ show +
617
618
619
620
621
622
623
624
625
626
(void)rlbs; RestSearchCtxt *rsc = (RestSearchCtxt *)priv; RestUnitSearchInfo *rusi = &rsc->rusi[rest_unit_idx]; const MACROBLOCK *const x = rsc->x; const AV1_COMMON *const cm = rsc->cm; const int highbd = cm->seq_params.use_highbitdepth; const int bit_depth = cm->seq_params.bit_depth; uint8_t *dgd_start =

[CVE-2020-0478_1.diff] pickrst.c #28
+ // Set 'skip_sgr_eval' based on rdcost ratio of RESTORE_WIENER and + // RESTORE_NONE or based on best_rtype + if (rsc->sf->lpf_sf.prune_sgr_based_on_wiener == 1) { + rusi->skip_sgr_eval = cost_wiener > (1.01 * cost_none); + } else if (rsc->sf->lpf_sf.prune_sgr_based_on_wiener == 2) { + rusi->skip_sgr_eval = rusi->best_rtype[RESTORE_WIENER - 1] == RESTORE_NONE; + } + -static void search_norestore(const RestorationTileLimits *limits, - const AV1PixelRect *tile_rect, int rest_unit_idx, - void *priv, int32_t *tmpbuf, - RestorationLineBuffers *rlbs) { +static AOM_INLINE void search_norestore(const RestorationTileLimits *limits, + const AV1PixelRect *tile_rect, + int rest_unit_idx, void *priv, + int32_t *tmpbuf, + RestorationLineBuffers *rlbs) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/pickrst.c
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
RestorationType rtype = (cost_wiener < cost_none) ? RESTORE_WIENER : RESTORE_NONE; rusi->best_rtype[RESTORE_WIENER - 1] = rtype; rsc->sse += rusi->sse[rtype]; rsc->bits += (cost_wiener < cost_none) ? bits_wiener : bits_none; if (cost_wiener < cost_none) rsc->wiener = rusi->wiener; }
+ show +
1271
1272
1273
1274
static void search_norestore(const RestorationTileLimits *limits, const AV1PixelRect *tile_rect, int rest_unit_idx, void *priv, int32_t *tmpbuf, RestorationLineBuffers *rlbs) {
+ show +
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
(void)tile_rect; (void)tmpbuf; (void)rlbs; RestSearchCtxt *rsc = (RestSearchCtxt *)priv; RestUnitSearchInfo *rusi = &rsc->rusi[rest_unit_idx]; const int highbd = rsc->cm->seq_params.use_highbitdepth; rusi->sse[RESTORE_NONE] = sse_restoration_unit( limits, rsc->src, &rsc->cm->cur_frame->buf, rsc->plane, highbd);

[CVE-2020-0478_1.diff] pickrst.c #29
-static void search_switchable(const RestorationTileLimits *limits, - const AV1PixelRect *tile_rect, int rest_unit_idx, - void *priv, int32_t *tmpbuf, - RestorationLineBuffers *rlbs) { +static AOM_INLINE void search_switchable(const RestorationTileLimits *limits, + const AV1PixelRect *tile_rect, + int rest_unit_idx, void *priv, + int32_t *tmpbuf, + RestorationLineBuffers *rlbs) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/pickrst.c
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
RestSearchCtxt *rsc = (RestSearchCtxt *)priv; RestUnitSearchInfo *rusi = &rsc->rusi[rest_unit_idx]; const int highbd = rsc->cm->seq_params.use_highbitdepth; rusi->sse[RESTORE_NONE] = sse_restoration_unit( limits, rsc->src, &rsc->cm->cur_frame->buf, rsc->plane, highbd); rsc->sse += rusi->sse[RESTORE_NONE]; }
+ show +
1289
1290
1291
1292
static void search_switchable(const RestorationTileLimits *limits, const AV1PixelRect *tile_rect, int rest_unit_idx, void *priv, int32_t *tmpbuf, RestorationLineBuffers *rlbs) {
+ show +
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
(void)limits; (void)tile_rect; (void)tmpbuf; (void)rlbs; RestSearchCtxt *rsc = (RestSearchCtxt *)priv; RestUnitSearchInfo *rusi = &rsc->rusi[rest_unit_idx]; const MACROBLOCK *const x = rsc->x; const int wiener_win =

[CVE-2020-0478_1.diff] pickrst.c #33
- if (!cpi->sf.disable_loop_restoration_chroma || !plane) { - extend_frame(rsc.dgd_buffer, rsc.plane_width, rsc.plane_height, - rsc.dgd_stride, RESTORATION_BORDER, RESTORATION_BORDER, - highbd); + if (!cpi->sf.lpf_sf.disable_loop_restoration_chroma || !plane) { + av1_extend_frame(rsc.dgd_buffer, rsc.plane_width, rsc.plane_height, + rsc.dgd_stride, RESTORATION_BORDER, RESTORATION_BORDER, + highbd);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/pickrst.c
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
&cpi->trial_frame_rst, &rsc); const int plane_ntiles = ntiles[plane > 0]; const RestorationType num_rtypes = (plane_ntiles > 1) ? RESTORE_TYPES : RESTORE_SWITCHABLE_TYPES; double best_cost = 0; RestorationType best_rtype = RESTORE_NONE; const int highbd = rsc.cm->seq_params.use_highbitdepth;
+ show +
1416
1417
1418
1419
if (!cpi->sf.disable_loop_restoration_chroma || !plane) { extend_frame(rsc.dgd_buffer, rsc.plane_width, rsc.plane_height, rsc.dgd_stride, RESTORATION_BORDER, RESTORATION_BORDER, highbd);
+ show +
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
for (RestorationType r = 0; r < num_rtypes; ++r) { if ((force_restore_type != RESTORE_TYPES) && (r != RESTORE_NONE) && (r != force_restore_type)) continue; double cost = search_rest_type(&rsc, r); if (r == 0 || cost < best_cost) { best_cost = cost;

[CVE-2020-0470_1.diff] pickrst.c #9
+#if CONFIG_AV1_HIGHBITDEPTH +#endif // CONFIG_AV1_HIGHBITDEPTH - decode_xq(xqd, xq, params); - if (!use_highbitdepth) { - return av1_lowbd_pixel_proj_error(src8, width, height, src_stride, dat8, - dat_stride, flt0, flt0_stride, flt1, - flt1_stride, xq, params); - } else { + av1_decode_xq(xqd, xq, params); + +#if CONFIG_AV1_HIGHBITDEPTH + if (use_highbitdepth) { + + } else { + return av1_lowbd_pixel_proj_error(src8, width, height, src_stride, dat8, + dat_stride, flt0, flt0_stride, flt1, + flt1_stride, xq, params); +#else + (void)use_highbitdepth; + return av1_lowbd_pixel_proj_error(src8, width, height, src_stride, dat8, + dat_stride, flt0, flt0_stride, flt1, + flt1_stride, xq, params); +#endif
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/pickrst.c
325
326
327
328
329
330
331
332
333
334
return err; } static int64_t get_pixel_proj_error(const uint8_t *src8, int width, int height, int src_stride, const uint8_t *dat8, int dat_stride, int use_highbitdepth, int32_t *flt0, int flt0_stride, int32_t *flt1, int flt1_stride, int *xqd, const sgr_params_type *params) { int xq[2];
+ show +
335
336
337
338
339
340
decode_xq(xqd, xq, params); if (!use_highbitdepth) { return av1_lowbd_pixel_proj_error(src8, width, height, src_stride, dat8, dat_stride, flt0, flt0_stride, flt1, flt1_stride, xq, params); } else {
+ show +
341
342
343
344
345
346
347
348
349
350
return av1_highbd_pixel_proj_error(src8, width, height, src_stride, dat8, dat_stride, flt0, flt0_stride, flt1, flt1_stride, xq, params); } } #define USE_SGRPROJ_REFINEMENT_SEARCH 1 static int64_t finer_search_pixel_proj_error( const uint8_t *src8, int width, int height, int src_stride, const uint8_t *dat8, int dat_stride, int use_highbitdepth, int32_t *flt0,

[CVE-2020-0470_1.diff] pickrst.c #13
-static void apply_sgr(int sgr_params_idx, const uint8_t *dat8, int width, - int height, int dat_stride, int use_highbd, int bit_depth, - int pu_width, int pu_height, int32_t *flt0, int32_t *flt1, - int flt_stride) { +static AOM_INLINE void apply_sgr(int sgr_params_idx, const uint8_t *dat8, + int width, int height, int dat_stride, + int use_highbd, int bit_depth, int pu_width, + int pu_height, int32_t *flt0, int32_t *flt1, + int flt_stride) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/pickrst.c
520
521
522
523
524
525
526
527
528
529
xqd[1] = clamp((1 << SGRPROJ_PRJ_BITS) - xqd[0], SGRPROJ_PRJ_MIN1, SGRPROJ_PRJ_MAX1); } else { xqd[0] = clamp(xq[0], SGRPROJ_PRJ_MIN0, SGRPROJ_PRJ_MAX0); xqd[1] = clamp((1 << SGRPROJ_PRJ_BITS) - xqd[0] - xq[1], SGRPROJ_PRJ_MIN1, SGRPROJ_PRJ_MAX1); } } // Apply the self-guided filter across an entire restoration unit.
+ show +
530
531
532
533
static void apply_sgr(int sgr_params_idx, const uint8_t *dat8, int width, int height, int dat_stride, int use_highbd, int bit_depth, int pu_width, int pu_height, int32_t *flt0, int32_t *flt1, int flt_stride) {
+ show +
534
535
536
537
538
539
540
541
542
543
for (int i = 0; i < height; i += pu_height) { const int h = AOMMIN(pu_height, height - i); int32_t *flt0_row = flt0 + i * flt_stride; int32_t *flt1_row = flt1 + i * flt_stride; const uint8_t *dat8_row = dat8 + i * dat_stride; // Iterate over the stripe in blocks of width pu_width for (int j = 0; j < width; j += pu_width) { const int w = AOMMIN(pu_width, width - j); const int ret = av1_selfguided_restoration(

[CVE-2020-0470_1.diff] pickrst.c #15
- - for (ep = 0; ep < SGRPROJ_PARAMS; ep++) { - int exq[2]; - apply_sgr(ep, dat8, width, height, dat_stride, use_highbitdepth, bit_depth, - pu_width, pu_height, flt0, flt1, flt_stride); - aom_clear_system_state(); - const sgr_params_type *const params = &sgr_params[ep]; - get_proj_subspace(src8, width, height, src_stride, dat8, dat_stride, - use_highbitdepth, flt0, flt_stride, flt1, flt_stride, exq, - params); - aom_clear_system_state(); - encode_xq(exq, exqd, params); - int64_t err = finer_search_pixel_proj_error( - src8, width, height, src_stride, dat8, dat_stride, use_highbitdepth, - flt0, flt_stride, flt1, flt_stride, 2, exqd, params); - if (besterr == -1 || err < besterr) { - bestep = ep; - besterr = err; - bestxqd[0] = exqd[0]; - bestxqd[1] = exqd[1]; + if (!enable_sgr_ep_pruning) { + for (ep = 0; ep < SGRPROJ_PARAMS; ep++) { + int64_t err; + compute_sgrproj_err(dat8, width, height, dat_stride, src8, src_stride, + use_highbitdepth, bit_depth, pu_width, pu_height, ep, + flt0, flt1, flt_stride, exqd, &err); + get_best_error(&besterr, err, exqd, bestxqd, &bestep, ep); + } + } else { + // evaluate first four seed ep in first group + for (idx = 0; idx < SGRPROJ_EP_GRP1_SEARCH_COUNT; idx++) { + ep = sgproj_ep_grp1_seed[idx]; + int64_t err; + compute_sgrproj_err(dat8, width, height, dat_stride, src8, src_stride, + use_highbitdepth, bit_depth, pu_width, pu_height, ep, + flt0, flt1, flt_stride, exqd, &err); + get_best_error(&besterr, err, exqd, bestxqd, &bestep, ep); + } + // evaluate left and right ep of winner in seed ep + int bestep_ref = bestep; + for (ep = bestep_ref - 1; ep < bestep_ref + 2; ep += 2) { + if (ep < SGRPROJ_EP_GRP1_START_IDX || ep > SGRPROJ_EP_GRP1_END_IDX) + continue; + int64_t err; + compute_sgrproj_err(dat8, width, height, dat_stride, src8, src_stride, + use_highbitdepth, bit_depth, pu_width, pu_height, ep, + flt0, flt1, flt_stride, exqd, &err); + get_best_error(&besterr, err, exqd, bestxqd, &bestep, ep); + } + // evaluate last two group + for (idx = 0; idx < SGRPROJ_EP_GRP2_3_SEARCH_COUNT; idx++) { + ep = sgproj_ep_grp2_3[idx][bestep]; + int64_t err; + compute_sgrproj_err(dat8, width, height, dat_stride, src8, src_stride, + use_highbitdepth, bit_depth, pu_width, pu_height, ep, + flt0, flt1, flt_stride, exqd, &err); + get_best_error(&besterr, err, exqd, bestxqd, &bestep, ep);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/pickrst.c
557
558
559
560
561
562
563
564
565
566
int32_t *flt1 = flt0 + RESTORATION_UNITPELS_MAX; int ep, bestep = 0; int64_t besterr = -1; int exqd[2], bestxqd[2] = { 0, 0 }; int flt_stride = ((width + 7) & ~7) + 8; assert(pu_width == (RESTORATION_PROC_UNIT_SIZE >> 1) || pu_width == RESTORATION_PROC_UNIT_SIZE); assert(pu_height == (RESTORATION_PROC_UNIT_SIZE >> 1) || pu_height == RESTORATION_PROC_UNIT_SIZE);
+ show +
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
for (ep = 0; ep < SGRPROJ_PARAMS; ep++) { int exq[2]; apply_sgr(ep, dat8, width, height, dat_stride, use_highbitdepth, bit_depth, pu_width, pu_height, flt0, flt1, flt_stride); aom_clear_system_state(); const sgr_params_type *const params = &sgr_params[ep]; get_proj_subspace(src8, width, height, src_stride, dat8, dat_stride, use_highbitdepth, flt0, flt_stride, flt1, flt_stride, exq, params); aom_clear_system_state(); encode_xq(exq, exqd, params); int64_t err = finer_search_pixel_proj_error( src8, width, height, src_stride, dat8, dat_stride, use_highbitdepth, flt0, flt_stride, flt1, flt_stride, 2, exqd, params); if (besterr == -1 || err < besterr) { bestep = ep; besterr = err; bestxqd[0] = exqd[0]; bestxqd[1] = exqd[1];
+ show +
586
587
588
589
590
591
592
593
594
595
} } SgrprojInfo ret; ret.ep = bestep; ret.xqd[0] = bestxqd[0]; ret.xqd[1] = bestxqd[1]; return ret; }

[CVE-2020-0470_1.diff] pickrst.c #17
-static void search_sgrproj(const RestorationTileLimits *limits, - const AV1PixelRect *tile, int rest_unit_idx, - void *priv, int32_t *tmpbuf, - RestorationLineBuffers *rlbs) { +static AOM_INLINE void search_sgrproj(const RestorationTileLimits *limits, + const AV1PixelRect *tile, + int rest_unit_idx, void *priv, + int32_t *tmpbuf, + RestorationLineBuffers *rlbs) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/pickrst.c
603
604
605
606
607
608
609
610
611
612
ref_sgrproj_info->xqd[0] - SGRPROJ_PRJ_MIN0, sgrproj_info->xqd[0] - SGRPROJ_PRJ_MIN0); if (params->r[1] > 0) bits += aom_count_primitive_refsubexpfin( SGRPROJ_PRJ_MAX1 - SGRPROJ_PRJ_MIN1 + 1, SGRPROJ_PRJ_SUBEXP_K, ref_sgrproj_info->xqd[1] - SGRPROJ_PRJ_MIN1, sgrproj_info->xqd[1] - SGRPROJ_PRJ_MIN1); return bits; }
+ show +
613
614
615
616
static void search_sgrproj(const RestorationTileLimits *limits, const AV1PixelRect *tile, int rest_unit_idx, void *priv, int32_t *tmpbuf, RestorationLineBuffers *rlbs) {
+ show +
617
618
619
620
621
622
623
624
625
626
(void)rlbs; RestSearchCtxt *rsc = (RestSearchCtxt *)priv; RestUnitSearchInfo *rusi = &rsc->rusi[rest_unit_idx]; const MACROBLOCK *const x = rsc->x; const AV1_COMMON *const cm = rsc->cm; const int highbd = cm->seq_params.use_highbitdepth; const int bit_depth = cm->seq_params.bit_depth; uint8_t *dgd_start =

[CVE-2020-0470_1.diff] pickrst.c #28
+ // Set 'skip_sgr_eval' based on rdcost ratio of RESTORE_WIENER and + // RESTORE_NONE or based on best_rtype + if (rsc->sf->lpf_sf.prune_sgr_based_on_wiener == 1) { + rusi->skip_sgr_eval = cost_wiener > (1.01 * cost_none); + } else if (rsc->sf->lpf_sf.prune_sgr_based_on_wiener == 2) { + rusi->skip_sgr_eval = rusi->best_rtype[RESTORE_WIENER - 1] == RESTORE_NONE; + } + -static void search_norestore(const RestorationTileLimits *limits, - const AV1PixelRect *tile_rect, int rest_unit_idx, - void *priv, int32_t *tmpbuf, - RestorationLineBuffers *rlbs) { +static AOM_INLINE void search_norestore(const RestorationTileLimits *limits, + const AV1PixelRect *tile_rect, + int rest_unit_idx, void *priv, + int32_t *tmpbuf, + RestorationLineBuffers *rlbs) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/pickrst.c
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
RestorationType rtype = (cost_wiener < cost_none) ? RESTORE_WIENER : RESTORE_NONE; rusi->best_rtype[RESTORE_WIENER - 1] = rtype; rsc->sse += rusi->sse[rtype]; rsc->bits += (cost_wiener < cost_none) ? bits_wiener : bits_none; if (cost_wiener < cost_none) rsc->wiener = rusi->wiener; }
+ show +
1271
1272
1273
1274
static void search_norestore(const RestorationTileLimits *limits, const AV1PixelRect *tile_rect, int rest_unit_idx, void *priv, int32_t *tmpbuf, RestorationLineBuffers *rlbs) {
+ show +
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
(void)tile_rect; (void)tmpbuf; (void)rlbs; RestSearchCtxt *rsc = (RestSearchCtxt *)priv; RestUnitSearchInfo *rusi = &rsc->rusi[rest_unit_idx]; const int highbd = rsc->cm->seq_params.use_highbitdepth; rusi->sse[RESTORE_NONE] = sse_restoration_unit( limits, rsc->src, &rsc->cm->cur_frame->buf, rsc->plane, highbd);

[CVE-2020-0470_1.diff] pickrst.c #29
-static void search_switchable(const RestorationTileLimits *limits, - const AV1PixelRect *tile_rect, int rest_unit_idx, - void *priv, int32_t *tmpbuf, - RestorationLineBuffers *rlbs) { +static AOM_INLINE void search_switchable(const RestorationTileLimits *limits, + const AV1PixelRect *tile_rect, + int rest_unit_idx, void *priv, + int32_t *tmpbuf, + RestorationLineBuffers *rlbs) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/pickrst.c
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
RestSearchCtxt *rsc = (RestSearchCtxt *)priv; RestUnitSearchInfo *rusi = &rsc->rusi[rest_unit_idx]; const int highbd = rsc->cm->seq_params.use_highbitdepth; rusi->sse[RESTORE_NONE] = sse_restoration_unit( limits, rsc->src, &rsc->cm->cur_frame->buf, rsc->plane, highbd); rsc->sse += rusi->sse[RESTORE_NONE]; }
+ show +
1289
1290
1291
1292
static void search_switchable(const RestorationTileLimits *limits, const AV1PixelRect *tile_rect, int rest_unit_idx, void *priv, int32_t *tmpbuf, RestorationLineBuffers *rlbs) {
+ show +
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
(void)limits; (void)tile_rect; (void)tmpbuf; (void)rlbs; RestSearchCtxt *rsc = (RestSearchCtxt *)priv; RestUnitSearchInfo *rusi = &rsc->rusi[rest_unit_idx]; const MACROBLOCK *const x = rsc->x; const int wiener_win =

[CVE-2020-0470_1.diff] pickrst.c #33
- if (!cpi->sf.disable_loop_restoration_chroma || !plane) { - extend_frame(rsc.dgd_buffer, rsc.plane_width, rsc.plane_height, - rsc.dgd_stride, RESTORATION_BORDER, RESTORATION_BORDER, - highbd); + if (!cpi->sf.lpf_sf.disable_loop_restoration_chroma || !plane) { + av1_extend_frame(rsc.dgd_buffer, rsc.plane_width, rsc.plane_height, + rsc.dgd_stride, RESTORATION_BORDER, RESTORATION_BORDER, + highbd);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/pickrst.c
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
&cpi->trial_frame_rst, &rsc); const int plane_ntiles = ntiles[plane > 0]; const RestorationType num_rtypes = (plane_ntiles > 1) ? RESTORE_TYPES : RESTORE_SWITCHABLE_TYPES; double best_cost = 0; RestorationType best_rtype = RESTORE_NONE; const int highbd = rsc.cm->seq_params.use_highbitdepth;
+ show +
1416
1417
1418
1419
if (!cpi->sf.disable_loop_restoration_chroma || !plane) { extend_frame(rsc.dgd_buffer, rsc.plane_width, rsc.plane_height, rsc.dgd_stride, RESTORATION_BORDER, RESTORATION_BORDER, highbd);
+ show +
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
for (RestorationType r = 0; r < num_rtypes; ++r) { if ((force_restore_type != RESTORE_TYPES) && (r != RESTORE_NONE) && (r != force_restore_type)) continue; double cost = search_rest_type(&rsc, r); if (r == 0 || cost < best_cost) { best_cost = cost;

[CVE-2020-0478_1.diff] hash_motion.c #6
- pic_block_hash[0][pos] = av1_get_crc_value( - &x->crc_calculator1, (uint8_t *)p, length * sizeof(p[0])); - pic_block_hash[1][pos] = av1_get_crc_value( - &x->crc_calculator2, (uint8_t *)p, length * sizeof(p[0])); + pic_block_hash[0][pos] = + av1_get_crc_value(calc_1, (uint8_t *)p, length * sizeof(p[0])); + pic_block_hash[1][pos] = + av1_get_crc_value(calc_2, (uint8_t *)p, length * sizeof(p[0]));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/hash_motion.c
193
194
195
196
197
198
199
200
201
202
int pos = 0; for (int y_pos = 0; y_pos < y_end; y_pos++) { for (int x_pos = 0; x_pos < x_end; x_pos++) { get_pixels_in_1D_short_array_by_block_2x2( CONVERT_TO_SHORTPTR(picture->y_buffer) + y_pos * picture->y_stride + x_pos, picture->y_stride, p); pic_block_same_info[0][pos] = is_block16_2x2_row_same_value(p); pic_block_same_info[1][pos] = is_block16_2x2_col_same_value(p);
+ show +
203
204
205
206
pic_block_hash[0][pos] = av1_get_crc_value( &x->crc_calculator1, (uint8_t *)p, length * sizeof(p[0])); pic_block_hash[1][pos] = av1_get_crc_value( &x->crc_calculator2, (uint8_t *)p, length * sizeof(p[0]));
+ show +
207
208
209
210
211
212
213
214
215
216
pos++; } pos += width - 1; } } else { uint8_t p[4]; int pos = 0; for (int y_pos = 0; y_pos < y_end; y_pos++) { for (int x_pos = 0; x_pos < x_end; x_pos++) { get_pixels_in_1D_char_array_by_block_2x2(

[CVE-2020-0478_1.diff] hash_motion.c #12
- x->hash_value_buffer[0][0][pos] = - av1_get_crc_value(&x->crc_calculator1, (uint8_t *)pixel_to_hash, - sizeof(pixel_to_hash)); - x->hash_value_buffer[1][0][pos] = - av1_get_crc_value(&x->crc_calculator2, (uint8_t *)pixel_to_hash, - sizeof(pixel_to_hash)); + buf_1[0][pos] = av1_get_crc_value(calc_1, (uint8_t *)pixel_to_hash, + sizeof(pixel_to_hash)); + buf_2[0][pos] = av1_get_crc_value(calc_2, (uint8_t *)pixel_to_hash, + sizeof(pixel_to_hash));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/hash_motion.c
402
403
404
405
406
407
408
409
410
411
int sub_block_in_width = (block_size >> 1); if (use_highbitdepth) { uint16_t pixel_to_hash[4]; uint16_t *y16_src = CONVERT_TO_SHORTPTR(y_src); for (int y_pos = 0; y_pos < block_size; y_pos += 2) { for (int x_pos = 0; x_pos < block_size; x_pos += 2) { int pos = (y_pos >> 1) * sub_block_in_width + (x_pos >> 1); get_pixels_in_1D_short_array_by_block_2x2( y16_src + y_pos * stride + x_pos, stride, pixel_to_hash); assert(pos < AOM_BUFFER_SIZE_FOR_BLOCK_HASH);
+ show +
412
413
414
415
416
417
x->hash_value_buffer[0][0][pos] = av1_get_crc_value(&x->crc_calculator1, (uint8_t *)pixel_to_hash, sizeof(pixel_to_hash)); x->hash_value_buffer[1][0][pos] = av1_get_crc_value(&x->crc_calculator2, (uint8_t *)pixel_to_hash, sizeof(pixel_to_hash));
+ show +
418
419
420
421
422
423
424
425
426
427
} } } else { uint8_t pixel_to_hash[4]; for (int y_pos = 0; y_pos < block_size; y_pos += 2) { for (int x_pos = 0; x_pos < block_size; x_pos += 2) { int pos = (y_pos >> 1) * sub_block_in_width + (x_pos >> 1); get_pixels_in_1D_char_array_by_block_2x2(y_src + y_pos * stride + x_pos, stride, pixel_to_hash); assert(pos < AOM_BUFFER_SIZE_FOR_BLOCK_HASH);

[CVE-2020-0478_1.diff] hash_motion.c #13
- x->hash_value_buffer[0][0][pos] = av1_get_crc_value( - &x->crc_calculator1, pixel_to_hash, sizeof(pixel_to_hash)); - x->hash_value_buffer[1][0][pos] = av1_get_crc_value( - &x->crc_calculator2, pixel_to_hash, sizeof(pixel_to_hash)); + buf_1[0][pos] = + av1_get_crc_value(calc_1, pixel_to_hash, sizeof(pixel_to_hash)); + buf_2[0][pos] = + av1_get_crc_value(calc_2, pixel_to_hash, sizeof(pixel_to_hash));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/hash_motion.c
418
419
420
421
422
423
424
425
426
427
} } } else { uint8_t pixel_to_hash[4]; for (int y_pos = 0; y_pos < block_size; y_pos += 2) { for (int x_pos = 0; x_pos < block_size; x_pos += 2) { int pos = (y_pos >> 1) * sub_block_in_width + (x_pos >> 1); get_pixels_in_1D_char_array_by_block_2x2(y_src + y_pos * stride + x_pos, stride, pixel_to_hash); assert(pos < AOM_BUFFER_SIZE_FOR_BLOCK_HASH);
+ show +
428
429
430
431
x->hash_value_buffer[0][0][pos] = av1_get_crc_value( &x->crc_calculator1, pixel_to_hash, sizeof(pixel_to_hash)); x->hash_value_buffer[1][0][pos] = av1_get_crc_value( &x->crc_calculator2, pixel_to_hash, sizeof(pixel_to_hash));
+ show +
432
433
434
435
436
437
438
439
440
441
} } } int src_sub_block_in_width = sub_block_in_width; sub_block_in_width >>= 1; int src_idx = 1; int dst_idx = 0;

[CVE-2020-0470_1.diff] hash_motion.c #6
- pic_block_hash[0][pos] = av1_get_crc_value( - &x->crc_calculator1, (uint8_t *)p, length * sizeof(p[0])); - pic_block_hash[1][pos] = av1_get_crc_value( - &x->crc_calculator2, (uint8_t *)p, length * sizeof(p[0])); + pic_block_hash[0][pos] = + av1_get_crc_value(calc_1, (uint8_t *)p, length * sizeof(p[0])); + pic_block_hash[1][pos] = + av1_get_crc_value(calc_2, (uint8_t *)p, length * sizeof(p[0]));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/hash_motion.c
193
194
195
196
197
198
199
200
201
202
int pos = 0; for (int y_pos = 0; y_pos < y_end; y_pos++) { for (int x_pos = 0; x_pos < x_end; x_pos++) { get_pixels_in_1D_short_array_by_block_2x2( CONVERT_TO_SHORTPTR(picture->y_buffer) + y_pos * picture->y_stride + x_pos, picture->y_stride, p); pic_block_same_info[0][pos] = is_block16_2x2_row_same_value(p); pic_block_same_info[1][pos] = is_block16_2x2_col_same_value(p);
+ show +
203
204
205
206
pic_block_hash[0][pos] = av1_get_crc_value( &x->crc_calculator1, (uint8_t *)p, length * sizeof(p[0])); pic_block_hash[1][pos] = av1_get_crc_value( &x->crc_calculator2, (uint8_t *)p, length * sizeof(p[0]));
+ show +
207
208
209
210
211
212
213
214
215
216
pos++; } pos += width - 1; } } else { uint8_t p[4]; int pos = 0; for (int y_pos = 0; y_pos < y_end; y_pos++) { for (int x_pos = 0; x_pos < x_end; x_pos++) { get_pixels_in_1D_char_array_by_block_2x2(

[CVE-2020-0470_1.diff] hash_motion.c #12
- x->hash_value_buffer[0][0][pos] = - av1_get_crc_value(&x->crc_calculator1, (uint8_t *)pixel_to_hash, - sizeof(pixel_to_hash)); - x->hash_value_buffer[1][0][pos] = - av1_get_crc_value(&x->crc_calculator2, (uint8_t *)pixel_to_hash, - sizeof(pixel_to_hash)); + buf_1[0][pos] = av1_get_crc_value(calc_1, (uint8_t *)pixel_to_hash, + sizeof(pixel_to_hash)); + buf_2[0][pos] = av1_get_crc_value(calc_2, (uint8_t *)pixel_to_hash, + sizeof(pixel_to_hash));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/hash_motion.c
402
403
404
405
406
407
408
409
410
411
int sub_block_in_width = (block_size >> 1); if (use_highbitdepth) { uint16_t pixel_to_hash[4]; uint16_t *y16_src = CONVERT_TO_SHORTPTR(y_src); for (int y_pos = 0; y_pos < block_size; y_pos += 2) { for (int x_pos = 0; x_pos < block_size; x_pos += 2) { int pos = (y_pos >> 1) * sub_block_in_width + (x_pos >> 1); get_pixels_in_1D_short_array_by_block_2x2( y16_src + y_pos * stride + x_pos, stride, pixel_to_hash); assert(pos < AOM_BUFFER_SIZE_FOR_BLOCK_HASH);
+ show +
412
413
414
415
416
417
x->hash_value_buffer[0][0][pos] = av1_get_crc_value(&x->crc_calculator1, (uint8_t *)pixel_to_hash, sizeof(pixel_to_hash)); x->hash_value_buffer[1][0][pos] = av1_get_crc_value(&x->crc_calculator2, (uint8_t *)pixel_to_hash, sizeof(pixel_to_hash));
+ show +
418
419
420
421
422
423
424
425
426
427
} } } else { uint8_t pixel_to_hash[4]; for (int y_pos = 0; y_pos < block_size; y_pos += 2) { for (int x_pos = 0; x_pos < block_size; x_pos += 2) { int pos = (y_pos >> 1) * sub_block_in_width + (x_pos >> 1); get_pixels_in_1D_char_array_by_block_2x2(y_src + y_pos * stride + x_pos, stride, pixel_to_hash); assert(pos < AOM_BUFFER_SIZE_FOR_BLOCK_HASH);

[CVE-2020-0470_1.diff] hash_motion.c #13
- x->hash_value_buffer[0][0][pos] = av1_get_crc_value( - &x->crc_calculator1, pixel_to_hash, sizeof(pixel_to_hash)); - x->hash_value_buffer[1][0][pos] = av1_get_crc_value( - &x->crc_calculator2, pixel_to_hash, sizeof(pixel_to_hash)); + buf_1[0][pos] = + av1_get_crc_value(calc_1, pixel_to_hash, sizeof(pixel_to_hash)); + buf_2[0][pos] = + av1_get_crc_value(calc_2, pixel_to_hash, sizeof(pixel_to_hash));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/hash_motion.c
418
419
420
421
422
423
424
425
426
427
} } } else { uint8_t pixel_to_hash[4]; for (int y_pos = 0; y_pos < block_size; y_pos += 2) { for (int x_pos = 0; x_pos < block_size; x_pos += 2) { int pos = (y_pos >> 1) * sub_block_in_width + (x_pos >> 1); get_pixels_in_1D_char_array_by_block_2x2(y_src + y_pos * stride + x_pos, stride, pixel_to_hash); assert(pos < AOM_BUFFER_SIZE_FOR_BLOCK_HASH);
+ show +
428
429
430
431
x->hash_value_buffer[0][0][pos] = av1_get_crc_value( &x->crc_calculator1, pixel_to_hash, sizeof(pixel_to_hash)); x->hash_value_buffer[1][0][pos] = av1_get_crc_value( &x->crc_calculator2, pixel_to_hash, sizeof(pixel_to_hash));
+ show +
432
433
434
435
436
437
438
439
440
441
} } } int src_sub_block_in_width = sub_block_in_width; sub_block_in_width >>= 1; int src_idx = 1; int dst_idx = 0;

[CVE-2020-0478_1.diff] encodemb.c #1
-// Check if one needs to use c version subtraction. -static int check_subtract_block_size(int w, int h) { return w < 4 || h < 4; } - -static void subtract_block(const MACROBLOCKD *xd, int rows, int cols, - int16_t *diff, ptrdiff_t diff_stride, - const uint8_t *src8, ptrdiff_t src_stride, - const uint8_t *pred8, ptrdiff_t pred_stride) { - if (check_subtract_block_size(rows, cols)) { - if (is_cur_buf_hbd(xd)) { - aom_highbd_subtract_block_c(rows, cols, diff, diff_stride, src8, - src_stride, pred8, pred_stride, xd->bd); - return; - } - aom_subtract_block_c(rows, cols, diff, diff_stride, src8, src_stride, pred8, - pred_stride); - - return; - } - +void av1_subtract_block(const MACROBLOCKD *xd, int rows, int cols, + int16_t *diff, ptrdiff_t diff_stride, + const uint8_t *src8, ptrdiff_t src_stride, + const uint8_t *pred8, ptrdiff_t pred_stride) { + assert(rows >= 4 && cols >= 4); +#if CONFIG_AV1_HIGHBITDEPTH +#endif + (void)xd;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodemb.c
29
30
31
32
33
34
35
36
37
38
#include "av1/common/scan.h" #include "av1/encoder/av1_quantize.h" #include "av1/encoder/encodemb.h" #include "av1/encoder/encodetxb.h" #include "av1/encoder/hybrid_fwd_txfm.h" #include "av1/encoder/rd.h" #include "av1/encoder/rdopt.h" // Check if one needs to use c version subtraction.
+ show +
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
static int check_subtract_block_size(int w, int h) { return w < 4 || h < 4; } static void subtract_block(const MACROBLOCKD *xd, int rows, int cols, int16_t *diff, ptrdiff_t diff_stride, const uint8_t *src8, ptrdiff_t src_stride, const uint8_t *pred8, ptrdiff_t pred_stride) { if (check_subtract_block_size(rows, cols)) { if (is_cur_buf_hbd(xd)) { aom_highbd_subtract_block_c(rows, cols, diff, diff_stride, src8, src_stride, pred8, pred_stride, xd->bd); return; } aom_subtract_block_c(rows, cols, diff, diff_stride, src8, src_stride, pred8, pred_stride); return;
+ show +
55
56
57
58
59
60
61
62
63
64
} if (is_cur_buf_hbd(xd)) { aom_highbd_subtract_block(rows, cols, diff, diff_stride, src8, src_stride, pred8, pred_stride, xd->bd); return; } aom_subtract_block(rows, cols, diff, diff_stride, src8, src_stride, pred8, pred_stride); }

[CVE-2020-0478_1.diff] encodemb.c #7
- void *arg, int mi_row, int mi_col, - RUN_TYPE dry_run) { - (void)mi_row; - (void)mi_col; + void *arg, RUN_TYPE dry_run) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodemb.c
291
292
293
294
295
296
297
298
299
300
pd->subsampling_x, pd->subsampling_y); mismatch_record_block_tx(dst, pd->dst.stride, cm->current_frame.order_hint, plane, pixel_c, pixel_r, blk_w, blk_h, xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH); } #endif } static void encode_block_inter(int plane, int block, int blk_row, int blk_col, BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
+ show +
301
302
303
304
void *arg, int mi_row, int mi_col, RUN_TYPE dry_run) { (void)mi_row; (void)mi_col;
+ show +
305
306
307
308
309
310
311
312
313
314
struct encode_b_args *const args = arg; MACROBLOCK *const x = args->x; MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; const struct macroblockd_plane *const pd = &xd->plane[plane]; const int max_blocks_high = max_block_high(xd, plane_bsize, plane); const int max_blocks_wide = max_block_wide(xd, plane_bsize, plane); if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return;

[CVE-2020-0470_1.diff] encodemb.c #1
-// Check if one needs to use c version subtraction. -static int check_subtract_block_size(int w, int h) { return w < 4 || h < 4; } - -static void subtract_block(const MACROBLOCKD *xd, int rows, int cols, - int16_t *diff, ptrdiff_t diff_stride, - const uint8_t *src8, ptrdiff_t src_stride, - const uint8_t *pred8, ptrdiff_t pred_stride) { - if (check_subtract_block_size(rows, cols)) { - if (is_cur_buf_hbd(xd)) { - aom_highbd_subtract_block_c(rows, cols, diff, diff_stride, src8, - src_stride, pred8, pred_stride, xd->bd); - return; - } - aom_subtract_block_c(rows, cols, diff, diff_stride, src8, src_stride, pred8, - pred_stride); - - return; - } - +void av1_subtract_block(const MACROBLOCKD *xd, int rows, int cols, + int16_t *diff, ptrdiff_t diff_stride, + const uint8_t *src8, ptrdiff_t src_stride, + const uint8_t *pred8, ptrdiff_t pred_stride) { + assert(rows >= 4 && cols >= 4); +#if CONFIG_AV1_HIGHBITDEPTH +#endif + (void)xd;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodemb.c
29
30
31
32
33
34
35
36
37
38
#include "av1/common/scan.h" #include "av1/encoder/av1_quantize.h" #include "av1/encoder/encodemb.h" #include "av1/encoder/encodetxb.h" #include "av1/encoder/hybrid_fwd_txfm.h" #include "av1/encoder/rd.h" #include "av1/encoder/rdopt.h" // Check if one needs to use c version subtraction.
+ show +
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
static int check_subtract_block_size(int w, int h) { return w < 4 || h < 4; } static void subtract_block(const MACROBLOCKD *xd, int rows, int cols, int16_t *diff, ptrdiff_t diff_stride, const uint8_t *src8, ptrdiff_t src_stride, const uint8_t *pred8, ptrdiff_t pred_stride) { if (check_subtract_block_size(rows, cols)) { if (is_cur_buf_hbd(xd)) { aom_highbd_subtract_block_c(rows, cols, diff, diff_stride, src8, src_stride, pred8, pred_stride, xd->bd); return; } aom_subtract_block_c(rows, cols, diff, diff_stride, src8, src_stride, pred8, pred_stride); return;
+ show +
55
56
57
58
59
60
61
62
63
64
} if (is_cur_buf_hbd(xd)) { aom_highbd_subtract_block(rows, cols, diff, diff_stride, src8, src_stride, pred8, pred_stride, xd->bd); return; } aom_subtract_block(rows, cols, diff, diff_stride, src8, src_stride, pred8, pred_stride); }

[CVE-2020-0470_1.diff] encodemb.c #7
- void *arg, int mi_row, int mi_col, - RUN_TYPE dry_run) { - (void)mi_row; - (void)mi_col; + void *arg, RUN_TYPE dry_run) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodemb.c
291
292
293
294
295
296
297
298
299
300
pd->subsampling_x, pd->subsampling_y); mismatch_record_block_tx(dst, pd->dst.stride, cm->current_frame.order_hint, plane, pixel_c, pixel_r, blk_w, blk_h, xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH); } #endif } static void encode_block_inter(int plane, int block, int blk_row, int blk_col, BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
+ show +
301
302
303
304
void *arg, int mi_row, int mi_col, RUN_TYPE dry_run) { (void)mi_row; (void)mi_col;
+ show +
305
306
307
308
309
310
311
312
313
314
struct encode_b_args *const args = arg; MACROBLOCK *const x = args->x; MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = xd->mi[0]; const struct macroblockd_plane *const pd = &xd->plane[plane]; const int max_blocks_high = max_block_high(xd, plane_bsize, plane); const int max_blocks_wide = max_block_wide(xd, plane_bsize, plane); if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return;

[CVE-2020-0478_1.diff] encode_strategy.c #3
-static INLINE int is_frame_droppable(const AV1_COMP *const cpi) { - return !(cpi->refresh_alt_ref_frame || cpi->refresh_alt2_ref_frame || - cpi->refresh_bwd_ref_frame || cpi->refresh_golden_frame || - cpi->refresh_last_frame); +static INLINE int is_frame_droppable(const SVC *const svc, + const ExternalFlags *const ext_flags) { + // Droppable frame is only used by external refresh flags. VoD setting won't + // trigger its use case. + if (svc->external_ref_frame_config) + return svc->non_reference_frame; + else if (ext_flags->refresh_frame_flags_pending) + return !(ext_flags->refresh_alt_ref_frame || + ext_flags->refresh_alt2_ref_frame || + ext_flags->refresh_bwd_ref_frame || + ext_flags->refresh_golden_frame || ext_flags->refresh_last_frame); + else + return 0;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encode_strategy.c
146
147
148
149
150
151
152
153
154
155
cpi->common.current_frame.frame_type == KEY_FRAME) { // If this is a show_existing_frame with a source other than altref, // or if it is not a displayed forward keyframe, the keyframe update // counters were incremented when it was originally encoded. cpi->rc.frames_since_key++; cpi->rc.frames_to_key--; } } }
+ show +
156
157
158
159
static INLINE int is_frame_droppable(const AV1_COMP *const cpi) { return !(cpi->refresh_alt_ref_frame || cpi->refresh_alt2_ref_frame || cpi->refresh_bwd_ref_frame || cpi->refresh_golden_frame || cpi->refresh_last_frame);
+ show +
160
161
162
163
164
165
166
167
168
169
} static INLINE void update_frames_till_gf_update(AV1_COMP *cpi) { // TODO(weitinglin): Updating this counter for is_frame_droppable // is a work-around to handle the condition when a frame is drop. // We should fix the cpi->common.show_frame flag // instead of checking the other condition to update the counter properly. if (cpi->common.show_frame || is_frame_droppable(cpi)) { // Decrement count down till next gf if (cpi->rc.frames_till_gf_update_due > 0)

[CVE-2020-0478_1.diff] encode_strategy.c #19
- if (!frame_params.show_existing_frame) { - cm->using_qmatrix = cpi->oxcf.using_qm; - cm->min_qmlevel = cpi->oxcf.qm_minlevel; - cm->max_qmlevel = cpi->oxcf.qm_maxlevel; - if (cpi->twopass.gf_group.index == 1 && cpi->oxcf.enable_tpl_model) { - av1_configure_buffer_updates(cpi, &frame_params, frame_update_type, 0); - av1_set_frame_size(cpi, cm->width, cm->height); - av1_tpl_setup_stats(cpi, &frame_input); - } - } - - if (oxcf->pass == 0) { - if (cpi->oxcf.rc_mode == AOM_CBR) { - av1_rc_get_one_pass_cbr_params(cpi, &frame_update_type, &frame_params, - *frame_flags); - } else { - av1_rc_get_one_pass_vbr_params(cpi, &frame_update_type, &frame_params, - *frame_flags); - } - } else if (oxcf->pass == 1) { + if (has_no_stats_stage(cpi) && cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) { + av1_cyclic_refresh_update_parameters(cpi); + } else if (is_stat_generation_stage(cpi)) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encode_strategy.c
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
// (largely near av1_get_compressed_data) in here // TODO(david.turner@argondesign.com): Change all the encode strategy to // modify frame_params instead of cm or cpi. // Per-frame encode speed. In theory this can vary, but things may have been // written assuming speed-level will not change within a sequence, so this // parameter should be used with caution. frame_params.speed = oxcf->speed;
+ show +
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
if (!frame_params.show_existing_frame) { cm->using_qmatrix = cpi->oxcf.using_qm; cm->min_qmlevel = cpi->oxcf.qm_minlevel; cm->max_qmlevel = cpi->oxcf.qm_maxlevel; if (cpi->twopass.gf_group.index == 1 && cpi->oxcf.enable_tpl_model) { av1_configure_buffer_updates(cpi, &frame_params, frame_update_type, 0); av1_set_frame_size(cpi, cm->width, cm->height); av1_tpl_setup_stats(cpi, &frame_input); } } // Work out some encoding parameters specific to the pass: if (oxcf->pass == 0) { if (cpi->oxcf.rc_mode == AOM_CBR) { av1_rc_get_one_pass_cbr_params(cpi, &frame_update_type, &frame_params, *frame_flags); } else { av1_rc_get_one_pass_vbr_params(cpi, &frame_update_type, &frame_params, *frame_flags); } } else if (oxcf->pass == 1) {
+ show +
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
cpi->td.mb.e_mbd.lossless[0] = is_lossless_requested(&cpi->oxcf); const int kf_requested = (cm->current_frame.frame_number == 0 || (*frame_flags & FRAMEFLAGS_KEY)); if (kf_requested && frame_update_type != OVERLAY_UPDATE && frame_update_type != INTNL_OVERLAY_UPDATE) { frame_params.frame_type = KEY_FRAME; } else { frame_params.frame_type = INTER_FRAME; } } else if (oxcf->pass == 2) {

[CVE-2020-0470_1.diff] encode_strategy.c #3
-static INLINE int is_frame_droppable(const AV1_COMP *const cpi) { - return !(cpi->refresh_alt_ref_frame || cpi->refresh_alt2_ref_frame || - cpi->refresh_bwd_ref_frame || cpi->refresh_golden_frame || - cpi->refresh_last_frame); +static INLINE int is_frame_droppable(const SVC *const svc, + const ExternalFlags *const ext_flags) { + // Droppable frame is only used by external refresh flags. VoD setting won't + // trigger its use case. + if (svc->external_ref_frame_config) + return svc->non_reference_frame; + else if (ext_flags->refresh_frame_flags_pending) + return !(ext_flags->refresh_alt_ref_frame || + ext_flags->refresh_alt2_ref_frame || + ext_flags->refresh_bwd_ref_frame || + ext_flags->refresh_golden_frame || ext_flags->refresh_last_frame); + else + return 0;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encode_strategy.c
146
147
148
149
150
151
152
153
154
155
cpi->common.current_frame.frame_type == KEY_FRAME) { // If this is a show_existing_frame with a source other than altref, // or if it is not a displayed forward keyframe, the keyframe update // counters were incremented when it was originally encoded. cpi->rc.frames_since_key++; cpi->rc.frames_to_key--; } } }
+ show +
156
157
158
159
static INLINE int is_frame_droppable(const AV1_COMP *const cpi) { return !(cpi->refresh_alt_ref_frame || cpi->refresh_alt2_ref_frame || cpi->refresh_bwd_ref_frame || cpi->refresh_golden_frame || cpi->refresh_last_frame);
+ show +
160
161
162
163
164
165
166
167
168
169
} static INLINE void update_frames_till_gf_update(AV1_COMP *cpi) { // TODO(weitinglin): Updating this counter for is_frame_droppable // is a work-around to handle the condition when a frame is drop. // We should fix the cpi->common.show_frame flag // instead of checking the other condition to update the counter properly. if (cpi->common.show_frame || is_frame_droppable(cpi)) { // Decrement count down till next gf if (cpi->rc.frames_till_gf_update_due > 0)

[CVE-2020-0470_1.diff] encode_strategy.c #19
- if (!frame_params.show_existing_frame) { - cm->using_qmatrix = cpi->oxcf.using_qm; - cm->min_qmlevel = cpi->oxcf.qm_minlevel; - cm->max_qmlevel = cpi->oxcf.qm_maxlevel; - if (cpi->twopass.gf_group.index == 1 && cpi->oxcf.enable_tpl_model) { - av1_configure_buffer_updates(cpi, &frame_params, frame_update_type, 0); - av1_set_frame_size(cpi, cm->width, cm->height); - av1_tpl_setup_stats(cpi, &frame_input); - } - } - - if (oxcf->pass == 0) { - if (cpi->oxcf.rc_mode == AOM_CBR) { - av1_rc_get_one_pass_cbr_params(cpi, &frame_update_type, &frame_params, - *frame_flags); - } else { - av1_rc_get_one_pass_vbr_params(cpi, &frame_update_type, &frame_params, - *frame_flags); - } - } else if (oxcf->pass == 1) { + if (has_no_stats_stage(cpi) && cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) { + av1_cyclic_refresh_update_parameters(cpi); + } else if (is_stat_generation_stage(cpi)) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encode_strategy.c
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
// (largely near av1_get_compressed_data) in here // TODO(david.turner@argondesign.com): Change all the encode strategy to // modify frame_params instead of cm or cpi. // Per-frame encode speed. In theory this can vary, but things may have been // written assuming speed-level will not change within a sequence, so this // parameter should be used with caution. frame_params.speed = oxcf->speed;
+ show +
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
if (!frame_params.show_existing_frame) { cm->using_qmatrix = cpi->oxcf.using_qm; cm->min_qmlevel = cpi->oxcf.qm_minlevel; cm->max_qmlevel = cpi->oxcf.qm_maxlevel; if (cpi->twopass.gf_group.index == 1 && cpi->oxcf.enable_tpl_model) { av1_configure_buffer_updates(cpi, &frame_params, frame_update_type, 0); av1_set_frame_size(cpi, cm->width, cm->height); av1_tpl_setup_stats(cpi, &frame_input); } } // Work out some encoding parameters specific to the pass: if (oxcf->pass == 0) { if (cpi->oxcf.rc_mode == AOM_CBR) { av1_rc_get_one_pass_cbr_params(cpi, &frame_update_type, &frame_params, *frame_flags); } else { av1_rc_get_one_pass_vbr_params(cpi, &frame_update_type, &frame_params, *frame_flags); } } else if (oxcf->pass == 1) {
+ show +
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
cpi->td.mb.e_mbd.lossless[0] = is_lossless_requested(&cpi->oxcf); const int kf_requested = (cm->current_frame.frame_number == 0 || (*frame_flags & FRAMEFLAGS_KEY)); if (kf_requested && frame_update_type != OVERLAY_UPDATE && frame_update_type != INTNL_OVERLAY_UPDATE) { frame_params.frame_type = KEY_FRAME; } else { frame_params.frame_type = INTER_FRAME; } } else if (oxcf->pass == 2) {

[CVE-2020-0478_1.diff] corner_match.c #6
-int determine_correspondence(unsigned char *frm, int *frm_corners, - int num_frm_corners, unsigned char *ref, - int *ref_corners, int num_ref_corners, int width, - int height, int frm_stride, int ref_stride, - int *correspondence_pts) { +int av1_determine_correspondence(unsigned char *frm, int *frm_corners, + int num_frm_corners, unsigned char *ref, + int *ref_corners, int num_ref_corners, + int width, int height, int frm_stride, + int ref_stride, int *correspondence_pts) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/corner_match.c
132
133
134
135
136
137
138
139
140
141
best_match_ncc = match_ncc; best_y = y; best_x = x; } } correspondences[i].x += best_x; correspondences[i].y += best_y; } }
+ show +
142
143
144
145
146
int determine_correspondence(unsigned char *frm, int *frm_corners, int num_frm_corners, unsigned char *ref, int *ref_corners, int num_ref_corners, int width, int height, int frm_stride, int ref_stride, int *correspondence_pts) {
+ show +
147
148
149
150
151
152
153
154
155
156
// TODO(sarahparker) Improve this to include 2-way match int i, j; Correspondence *correspondences = (Correspondence *)correspondence_pts; int num_correspondences = 0; for (i = 0; i < num_frm_corners; ++i) { double best_match_ncc = 0.0; double template_norm; int best_match_j = -1; if (!is_eligible_point(frm_corners[2 * i], frm_corners[2 * i + 1], width, height))

[CVE-2020-0470_1.diff] corner_match.c #6
-int determine_correspondence(unsigned char *frm, int *frm_corners, - int num_frm_corners, unsigned char *ref, - int *ref_corners, int num_ref_corners, int width, - int height, int frm_stride, int ref_stride, - int *correspondence_pts) { +int av1_determine_correspondence(unsigned char *frm, int *frm_corners, + int num_frm_corners, unsigned char *ref, + int *ref_corners, int num_ref_corners, + int width, int height, int frm_stride, + int ref_stride, int *correspondence_pts) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/corner_match.c
132
133
134
135
136
137
138
139
140
141
best_match_ncc = match_ncc; best_y = y; best_x = x; } } correspondences[i].x += best_x; correspondences[i].y += best_y; } }
+ show +
142
143
144
145
146
int determine_correspondence(unsigned char *frm, int *frm_corners, int num_frm_corners, unsigned char *ref, int *ref_corners, int num_ref_corners, int width, int height, int frm_stride, int ref_stride, int *correspondence_pts) {
+ show +
147
148
149
150
151
152
153
154
155
156
// TODO(sarahparker) Improve this to include 2-way match int i, j; Correspondence *correspondences = (Correspondence *)correspondence_pts; int num_correspondences = 0; for (i = 0; i < num_frm_corners; ++i) { double best_match_ncc = 0.0; double template_norm; int best_match_j = -1; if (!is_eligible_point(frm_corners[2 * i], frm_corners[2 * i + 1], width, height))

[CVE-2020-0478_1.diff] global_motion.c #3
-int64_t av1_refine_integerized_param(WarpedMotionParams *wm, - TransformationType wmtype, int use_hbd, - int bd, uint8_t *ref, int r_width, - int r_height, int r_stride, uint8_t *dst, - int d_width, int d_height, int d_stride, - int n_refinements, - int64_t best_frame_error) { +#if CONFIG_AV1_HIGHBITDEPTH +static int64_t highbd_warp_error( + WarpedMotionParams *wm, const uint16_t *const ref, int width, int height, + int stride, const uint16_t *const dst, int p_col, int p_row, int p_width, + int p_height, int p_stride, int subsampling_x, int subsampling_y, int bd, + int64_t best_error, uint8_t *segment_map, int segment_map_stride) { + int64_t gm_sumerr = 0; + const int error_bsize_w = AOMMIN(p_width, WARP_ERROR_BLOCK); + const int error_bsize_h = AOMMIN(p_height, WARP_ERROR_BLOCK); + uint16_t tmp[WARP_ERROR_BLOCK * WARP_ERROR_BLOCK]; + + ConvolveParams conv_params = get_conv_params(0, 0, bd); + conv_params.use_dist_wtd_comp_avg = 0; + for (int i = p_row; i < p_row + p_height; i += WARP_ERROR_BLOCK) { + for (int j = p_col; j < p_col + p_width; j += WARP_ERROR_BLOCK) { + int seg_x = j >> WARP_ERROR_BLOCK_LOG; + int seg_y = i >> WARP_ERROR_BLOCK_LOG; + // Only compute the error if this block contains inliers from the motion + // model + if (!segment_map[seg_y * segment_map_stride + seg_x]) continue; + // avoid warping extra 8x8 blocks in the padded region of the frame + // when p_width and p_height are not multiples of WARP_ERROR_BLOCK + const int warp_w = AOMMIN(error_bsize_w, p_col + p_width - j); + const int warp_h = AOMMIN(error_bsize_h, p_row + p_height - i); + highbd_warp_plane(wm, ref, width, height, stride, tmp, j, i, warp_w, + warp_h, WARP_ERROR_BLOCK, subsampling_x, subsampling_y, + bd, &conv_params); + gm_sumerr += av1_calc_highbd_frame_error(tmp, WARP_ERROR_BLOCK, + dst + j + i * p_stride, warp_w, + warp_h, p_stride, bd); + if (gm_sumerr > best_error) return INT64_MAX; + } + } + return gm_sumerr; +} +#endif + +static int64_t warp_error(WarpedMotionParams *wm, const uint8_t *const ref, + int width, int height, int stride, + const uint8_t *const dst, int p_col, int p_row, + int p_width, int p_height, int p_stride, + int subsampling_x, int subsampling_y, + int64_t best_error, uint8_t *segment_map, + int segment_map_stride) { + int64_t gm_sumerr = 0; + int warp_w, warp_h; + const int error_bsize_w = AOMMIN(p_width, WARP_ERROR_BLOCK); + const int error_bsize_h = AOMMIN(p_height, WARP_ERROR_BLOCK); + DECLARE_ALIGNED(16, uint8_t, tmp[WARP_ERROR_BLOCK * WARP_ERROR_BLOCK]); + ConvolveParams conv_params = get_conv_params(0, 0, 8); + conv_params.use_dist_wtd_comp_avg = 0; + + for (int i = p_row; i < p_row + p_height; i += WARP_ERROR_BLOCK) { + for (int j = p_col; j < p_col + p_width; j += WARP_ERROR_BLOCK) { + int seg_x = j >> WARP_ERROR_BLOCK_LOG; + int seg_y = i >> WARP_ERROR_BLOCK_LOG; + // Only compute the error if this block contains inliers from the motion + // model + if (!segment_map[seg_y * segment_map_stride + seg_x]) continue; + // avoid warping extra 8x8 blocks in the padded region of the frame + // when p_width and p_height are not multiples of WARP_ERROR_BLOCK + warp_w = AOMMIN(error_bsize_w, p_col + p_width - j); + warp_h = AOMMIN(error_bsize_h, p_row + p_height - i); + warp_plane(wm, ref, width, height, stride, tmp, j, i, warp_w, warp_h, + WARP_ERROR_BLOCK, subsampling_x, subsampling_y, &conv_params); + + gm_sumerr += + av1_calc_frame_error(tmp, WARP_ERROR_BLOCK, dst + j + i * p_stride, + warp_w, warp_h, p_stride); + if (gm_sumerr > best_error) return INT64_MAX; + } + } + return gm_sumerr; +} + +int64_t av1_warp_error(WarpedMotionParams *wm, int use_hbd, int bd, + const uint8_t *ref, int width, int height, int stride, + uint8_t *dst, int p_col, int p_row, int p_width, + int p_height, int p_stride, int subsampling_x, + int subsampling_y, int64_t best_error, + uint8_t *segment_map, int segment_map_stride) { + if (wm->wmtype <= AFFINE) + if (!av1_get_shear_params(wm)) return INT64_MAX; +#if CONFIG_AV1_HIGHBITDEPTH + if (use_hbd) + return highbd_warp_error(wm, CONVERT_TO_SHORTPTR(ref), width, height, + stride, CONVERT_TO_SHORTPTR(dst), p_col, p_row, + p_width, p_height, p_stride, subsampling_x, + subsampling_y, bd, best_error, segment_map, + segment_map_stride); +#endif + (void)use_hbd; + (void)bd; + return warp_error(wm, ref, width, height, stride, dst, p_col, p_row, p_width, + p_height, p_stride, subsampling_x, subsampling_y, + best_error, segment_map, segment_map_stride); +} + +// Factors used to calculate the thresholds for av1_warp_error +static double thresh_factors[GM_REFINEMENT_COUNT] = { 1.25, 1.20, 1.15, 1.10, + 1.05 }; + +static INLINE int64_t calc_approx_erroradv_threshold( + double scaling_factor, int64_t erroradv_threshold) { + return erroradv_threshold < + (int64_t)(((double)INT64_MAX / scaling_factor) + 0.5) + ? (int64_t)(scaling_factor * erroradv_threshold + 0.5) + : INT64_MAX; +} + +int64_t av1_refine_integerized_param( + WarpedMotionParams *wm, TransformationType wmtype, int use_hbd, int bd, + uint8_t *ref, int r_width, int r_height, int r_stride, uint8_t *dst, + int d_width, int d_height, int d_stride, int n_refinements, + int64_t best_frame_error, uint8_t *segment_map, int segment_map_stride, + int64_t erroradv_threshold) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/global_motion.c
158
159
160
161
162
163
164
165
166
167
case ROTZOOM: wm->wmmat[4] = -wm->wmmat[3]; wm->wmmat[5] = wm->wmmat[2]; AOM_FALLTHROUGH_INTENDED; case AFFINE: wm->wmmat[6] = wm->wmmat[7] = 0; break; default: assert(0); } wm->wmtype = wmtype; }
+ show +
168
169
170
171
172
173
174
int64_t av1_refine_integerized_param(WarpedMotionParams *wm, TransformationType wmtype, int use_hbd, int bd, uint8_t *ref, int r_width, int r_height, int r_stride, uint8_t *dst, int d_width, int d_height, int d_stride, int n_refinements, int64_t best_frame_error) {
+ show +
175
176
177
178
179
180
181
182
183
184
static const int max_trans_model_params[TRANS_TYPES] = { 0, 2, 4, 6 }; const int border = ERRORADV_BORDER; int i = 0, p; int n_params = max_trans_model_params[wmtype]; int32_t *param_mat = wm->wmmat; int64_t step_error, best_error; int32_t step; int32_t *param; int32_t curr_param; int32_t best_param;

[CVE-2020-0478_1.diff] global_motion.c #4
- best_error = av1_warp_error(wm, use_hbd, bd, ref, r_width, r_height, r_stride, - dst + border * d_stride + border, border, border, - d_width - 2 * border, d_height - 2 * border, - d_stride, 0, 0, best_frame_error); + best_error = + av1_warp_error(wm, use_hbd, bd, ref, r_width, r_height, r_stride, + dst + border * d_stride + border, border, border, + d_width - 2 * border, d_height - 2 * border, d_stride, 0, + 0, best_frame_error, segment_map, segment_map_stride); + int64_t error_adv_thresh = + calc_approx_erroradv_threshold(thresh_factors[i], erroradv_threshold);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/global_motion.c
177
178
179
180
181
182
183
184
185
186
int i = 0, p; int n_params = max_trans_model_params[wmtype]; int32_t *param_mat = wm->wmmat; int64_t step_error, best_error; int32_t step; int32_t *param; int32_t curr_param; int32_t best_param; force_wmtype(wm, wmtype);
+ show +
187
188
189
190
best_error = av1_warp_error(wm, use_hbd, bd, ref, r_width, r_height, r_stride, dst + border * d_stride + border, border, border, d_width - 2 * border, d_height - 2 * border, d_stride, 0, 0, best_frame_error);
+ show +
191
192
193
194
195
196
197
198
199
200
best_error = AOMMIN(best_error, best_frame_error); step = 1 << (n_refinements - 1); for (i = 0; i < n_refinements; i++, step >>= 1) { for (p = 0; p < n_params; ++p) { int step_dir = 0; // Skip searches for parameters that are forced to be 0 param = param_mat + p; curr_param = *param; best_param = curr_param; // look to the left

[CVE-2020-0478_1.diff] global_motion.c #8
-static INLINE RansacFunc get_ransac_type(TransformationType type) { - switch (type) { - case AFFINE: return ransac_affine; - case ROTZOOM: return ransac_rotzoom; - case TRANSLATION: return ransac_translation; - default: assert(0); return NULL; - } -} - -static unsigned char *downconvert_frame(YV12_BUFFER_CONFIG *frm, - int bit_depth) { +unsigned char *av1_downconvert_frame(YV12_BUFFER_CONFIG *frm, int bit_depth) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/global_motion.c
241
242
243
244
245
246
247
248
249
250
step_dir = 0; } } } } force_wmtype(wm, wmtype); wm->wmtype = get_wmtype(wm); return best_error; }
+ show +
251
252
253
254
255
256
257
258
259
260
261
static INLINE RansacFunc get_ransac_type(TransformationType type) { switch (type) { case AFFINE: return ransac_affine; case ROTZOOM: return ransac_rotzoom; case TRANSLATION: return ransac_translation; default: assert(0); return NULL; } } static unsigned char *downconvert_frame(YV12_BUFFER_CONFIG *frm, int bit_depth) {
+ show +
262
263
264
265
266
267
268
269
270
271
int i, j; uint16_t *orig_buf = CONVERT_TO_SHORTPTR(frm->y_buffer); uint8_t *buf_8bit = frm->y_buffer_8bit; assert(buf_8bit); if (!frm->buf_8bit_valid) { for (i = 0; i < frm->y_height; ++i) { for (j = 0; j < frm->y_width; ++j) { buf_8bit[i * frm->y_stride + j] = orig_buf[i * frm->y_stride + j] >> (bit_depth - 8); }

[CVE-2020-0478_1.diff] global_motion.c #10
-static INLINE RansacFuncDouble -get_ransac_double_prec_type(TransformationType type) { - switch (type) { - case AFFINE: return ransac_affine_double_prec; - case ROTZOOM: return ransac_rotzoom_double_prec; - case TRANSLATION: return ransac_translation_double_prec; - default: assert(0); return NULL; - } -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/global_motion.c
323
324
325
326
327
328
329
330
331
332
} } // Return true if any one of the motions has inliers. for (i = 0; i < num_motions; ++i) { if (num_inliers_by_motion[i] > 0) return 1; } return 0; }
+ show +
333
334
335
336
337
338
339
static INLINE RansacFuncDouble get_ransac_double_prec_type(TransformationType type) { switch (type) { case AFFINE: return ransac_affine_double_prec; case ROTZOOM: return ransac_rotzoom_double_prec; case TRANSLATION: return ransac_translation_double_prec; default: assert(0); return NULL;
+ show +
340
341
342
343
344
345
346
347
348
349
} } // Don't use points around the frame border since they are less reliable static INLINE int valid_point(int x, int y, int width, int height) { return (x > (PATCH_SIZE + PATCH_CENTER)) && (x < (width - PATCH_SIZE - PATCH_CENTER)) && (y > (PATCH_SIZE + PATCH_CENTER)) && (y < (height - PATCH_SIZE - PATCH_CENTER)); }

[CVE-2020-0470_1.diff] global_motion.c #3
-int64_t av1_refine_integerized_param(WarpedMotionParams *wm, - TransformationType wmtype, int use_hbd, - int bd, uint8_t *ref, int r_width, - int r_height, int r_stride, uint8_t *dst, - int d_width, int d_height, int d_stride, - int n_refinements, - int64_t best_frame_error) { +#if CONFIG_AV1_HIGHBITDEPTH +static int64_t highbd_warp_error( + WarpedMotionParams *wm, const uint16_t *const ref, int width, int height, + int stride, const uint16_t *const dst, int p_col, int p_row, int p_width, + int p_height, int p_stride, int subsampling_x, int subsampling_y, int bd, + int64_t best_error, uint8_t *segment_map, int segment_map_stride) { + int64_t gm_sumerr = 0; + const int error_bsize_w = AOMMIN(p_width, WARP_ERROR_BLOCK); + const int error_bsize_h = AOMMIN(p_height, WARP_ERROR_BLOCK); + uint16_t tmp[WARP_ERROR_BLOCK * WARP_ERROR_BLOCK]; + + ConvolveParams conv_params = get_conv_params(0, 0, bd); + conv_params.use_dist_wtd_comp_avg = 0; + for (int i = p_row; i < p_row + p_height; i += WARP_ERROR_BLOCK) { + for (int j = p_col; j < p_col + p_width; j += WARP_ERROR_BLOCK) { + int seg_x = j >> WARP_ERROR_BLOCK_LOG; + int seg_y = i >> WARP_ERROR_BLOCK_LOG; + // Only compute the error if this block contains inliers from the motion + // model + if (!segment_map[seg_y * segment_map_stride + seg_x]) continue; + // avoid warping extra 8x8 blocks in the padded region of the frame + // when p_width and p_height are not multiples of WARP_ERROR_BLOCK + const int warp_w = AOMMIN(error_bsize_w, p_col + p_width - j); + const int warp_h = AOMMIN(error_bsize_h, p_row + p_height - i); + highbd_warp_plane(wm, ref, width, height, stride, tmp, j, i, warp_w, + warp_h, WARP_ERROR_BLOCK, subsampling_x, subsampling_y, + bd, &conv_params); + gm_sumerr += av1_calc_highbd_frame_error(tmp, WARP_ERROR_BLOCK, + dst + j + i * p_stride, warp_w, + warp_h, p_stride, bd); + if (gm_sumerr > best_error) return INT64_MAX; + } + } + return gm_sumerr; +} +#endif + +static int64_t warp_error(WarpedMotionParams *wm, const uint8_t *const ref, + int width, int height, int stride, + const uint8_t *const dst, int p_col, int p_row, + int p_width, int p_height, int p_stride, + int subsampling_x, int subsampling_y, + int64_t best_error, uint8_t *segment_map, + int segment_map_stride) { + int64_t gm_sumerr = 0; + int warp_w, warp_h; + const int error_bsize_w = AOMMIN(p_width, WARP_ERROR_BLOCK); + const int error_bsize_h = AOMMIN(p_height, WARP_ERROR_BLOCK); + DECLARE_ALIGNED(16, uint8_t, tmp[WARP_ERROR_BLOCK * WARP_ERROR_BLOCK]); + ConvolveParams conv_params = get_conv_params(0, 0, 8); + conv_params.use_dist_wtd_comp_avg = 0; + + for (int i = p_row; i < p_row + p_height; i += WARP_ERROR_BLOCK) { + for (int j = p_col; j < p_col + p_width; j += WARP_ERROR_BLOCK) { + int seg_x = j >> WARP_ERROR_BLOCK_LOG; + int seg_y = i >> WARP_ERROR_BLOCK_LOG; + // Only compute the error if this block contains inliers from the motion + // model + if (!segment_map[seg_y * segment_map_stride + seg_x]) continue; + // avoid warping extra 8x8 blocks in the padded region of the frame + // when p_width and p_height are not multiples of WARP_ERROR_BLOCK + warp_w = AOMMIN(error_bsize_w, p_col + p_width - j); + warp_h = AOMMIN(error_bsize_h, p_row + p_height - i); + warp_plane(wm, ref, width, height, stride, tmp, j, i, warp_w, warp_h, + WARP_ERROR_BLOCK, subsampling_x, subsampling_y, &conv_params); + + gm_sumerr += + av1_calc_frame_error(tmp, WARP_ERROR_BLOCK, dst + j + i * p_stride, + warp_w, warp_h, p_stride); + if (gm_sumerr > best_error) return INT64_MAX; + } + } + return gm_sumerr; +} + +int64_t av1_warp_error(WarpedMotionParams *wm, int use_hbd, int bd, + const uint8_t *ref, int width, int height, int stride, + uint8_t *dst, int p_col, int p_row, int p_width, + int p_height, int p_stride, int subsampling_x, + int subsampling_y, int64_t best_error, + uint8_t *segment_map, int segment_map_stride) { + if (wm->wmtype <= AFFINE) + if (!av1_get_shear_params(wm)) return INT64_MAX; +#if CONFIG_AV1_HIGHBITDEPTH + if (use_hbd) + return highbd_warp_error(wm, CONVERT_TO_SHORTPTR(ref), width, height, + stride, CONVERT_TO_SHORTPTR(dst), p_col, p_row, + p_width, p_height, p_stride, subsampling_x, + subsampling_y, bd, best_error, segment_map, + segment_map_stride); +#endif + (void)use_hbd; + (void)bd; + return warp_error(wm, ref, width, height, stride, dst, p_col, p_row, p_width, + p_height, p_stride, subsampling_x, subsampling_y, + best_error, segment_map, segment_map_stride); +} + +// Factors used to calculate the thresholds for av1_warp_error +static double thresh_factors[GM_REFINEMENT_COUNT] = { 1.25, 1.20, 1.15, 1.10, + 1.05 }; + +static INLINE int64_t calc_approx_erroradv_threshold( + double scaling_factor, int64_t erroradv_threshold) { + return erroradv_threshold < + (int64_t)(((double)INT64_MAX / scaling_factor) + 0.5) + ? (int64_t)(scaling_factor * erroradv_threshold + 0.5) + : INT64_MAX; +} + +int64_t av1_refine_integerized_param( + WarpedMotionParams *wm, TransformationType wmtype, int use_hbd, int bd, + uint8_t *ref, int r_width, int r_height, int r_stride, uint8_t *dst, + int d_width, int d_height, int d_stride, int n_refinements, + int64_t best_frame_error, uint8_t *segment_map, int segment_map_stride, + int64_t erroradv_threshold) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/global_motion.c
158
159
160
161
162
163
164
165
166
167
case ROTZOOM: wm->wmmat[4] = -wm->wmmat[3]; wm->wmmat[5] = wm->wmmat[2]; AOM_FALLTHROUGH_INTENDED; case AFFINE: wm->wmmat[6] = wm->wmmat[7] = 0; break; default: assert(0); } wm->wmtype = wmtype; }
+ show +
168
169
170
171
172
173
174
int64_t av1_refine_integerized_param(WarpedMotionParams *wm, TransformationType wmtype, int use_hbd, int bd, uint8_t *ref, int r_width, int r_height, int r_stride, uint8_t *dst, int d_width, int d_height, int d_stride, int n_refinements, int64_t best_frame_error) {
+ show +
175
176
177
178
179
180
181
182
183
184
static const int max_trans_model_params[TRANS_TYPES] = { 0, 2, 4, 6 }; const int border = ERRORADV_BORDER; int i = 0, p; int n_params = max_trans_model_params[wmtype]; int32_t *param_mat = wm->wmmat; int64_t step_error, best_error; int32_t step; int32_t *param; int32_t curr_param; int32_t best_param;

[CVE-2020-0470_1.diff] global_motion.c #4
- best_error = av1_warp_error(wm, use_hbd, bd, ref, r_width, r_height, r_stride, - dst + border * d_stride + border, border, border, - d_width - 2 * border, d_height - 2 * border, - d_stride, 0, 0, best_frame_error); + best_error = + av1_warp_error(wm, use_hbd, bd, ref, r_width, r_height, r_stride, + dst + border * d_stride + border, border, border, + d_width - 2 * border, d_height - 2 * border, d_stride, 0, + 0, best_frame_error, segment_map, segment_map_stride); + int64_t error_adv_thresh = + calc_approx_erroradv_threshold(thresh_factors[i], erroradv_threshold);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/global_motion.c
177
178
179
180
181
182
183
184
185
186
int i = 0, p; int n_params = max_trans_model_params[wmtype]; int32_t *param_mat = wm->wmmat; int64_t step_error, best_error; int32_t step; int32_t *param; int32_t curr_param; int32_t best_param; force_wmtype(wm, wmtype);
+ show +
187
188
189
190
best_error = av1_warp_error(wm, use_hbd, bd, ref, r_width, r_height, r_stride, dst + border * d_stride + border, border, border, d_width - 2 * border, d_height - 2 * border, d_stride, 0, 0, best_frame_error);
+ show +
191
192
193
194
195
196
197
198
199
200
best_error = AOMMIN(best_error, best_frame_error); step = 1 << (n_refinements - 1); for (i = 0; i < n_refinements; i++, step >>= 1) { for (p = 0; p < n_params; ++p) { int step_dir = 0; // Skip searches for parameters that are forced to be 0 param = param_mat + p; curr_param = *param; best_param = curr_param; // look to the left

[CVE-2020-0470_1.diff] global_motion.c #8
-static INLINE RansacFunc get_ransac_type(TransformationType type) { - switch (type) { - case AFFINE: return ransac_affine; - case ROTZOOM: return ransac_rotzoom; - case TRANSLATION: return ransac_translation; - default: assert(0); return NULL; - } -} - -static unsigned char *downconvert_frame(YV12_BUFFER_CONFIG *frm, - int bit_depth) { +unsigned char *av1_downconvert_frame(YV12_BUFFER_CONFIG *frm, int bit_depth) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/global_motion.c
241
242
243
244
245
246
247
248
249
250
step_dir = 0; } } } } force_wmtype(wm, wmtype); wm->wmtype = get_wmtype(wm); return best_error; }
+ show +
251
252
253
254
255
256
257
258
259
260
261
static INLINE RansacFunc get_ransac_type(TransformationType type) { switch (type) { case AFFINE: return ransac_affine; case ROTZOOM: return ransac_rotzoom; case TRANSLATION: return ransac_translation; default: assert(0); return NULL; } } static unsigned char *downconvert_frame(YV12_BUFFER_CONFIG *frm, int bit_depth) {
+ show +
262
263
264
265
266
267
268
269
270
271
int i, j; uint16_t *orig_buf = CONVERT_TO_SHORTPTR(frm->y_buffer); uint8_t *buf_8bit = frm->y_buffer_8bit; assert(buf_8bit); if (!frm->buf_8bit_valid) { for (i = 0; i < frm->y_height; ++i) { for (j = 0; j < frm->y_width; ++j) { buf_8bit[i * frm->y_stride + j] = orig_buf[i * frm->y_stride + j] >> (bit_depth - 8); }

[CVE-2020-0470_1.diff] global_motion.c #10
-static INLINE RansacFuncDouble -get_ransac_double_prec_type(TransformationType type) { - switch (type) { - case AFFINE: return ransac_affine_double_prec; - case ROTZOOM: return ransac_rotzoom_double_prec; - case TRANSLATION: return ransac_translation_double_prec; - default: assert(0); return NULL; - } -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/global_motion.c
323
324
325
326
327
328
329
330
331
332
} } // Return true if any one of the motions has inliers. for (i = 0; i < num_motions; ++i) { if (num_inliers_by_motion[i] > 0) return 1; } return 0; }
+ show +
333
334
335
336
337
338
339
static INLINE RansacFuncDouble get_ransac_double_prec_type(TransformationType type) { switch (type) { case AFFINE: return ransac_affine_double_prec; case ROTZOOM: return ransac_rotzoom_double_prec; case TRANSLATION: return ransac_translation_double_prec; default: assert(0); return NULL;
+ show +
340
341
342
343
344
345
346
347
348
349
} } // Don't use points around the frame border since they are less reliable static INLINE int valid_point(int x, int y, int width, int height) { return (x > (PATCH_SIZE + PATCH_CENTER)) && (x < (width - PATCH_SIZE - PATCH_CENTER)) && (y > (PATCH_SIZE + PATCH_CENTER)) && (y < (height - PATCH_SIZE - PATCH_CENTER)); }

[CVE-2020-0478_1.diff] encodeframe.c #2
+int av1_get_refresh_frame_flags(const AV1_COMP *const cpi, + const EncodeFrameParams *const frame_params, + FRAME_UPDATE_TYPE frame_update_type, + const RefBufferStack *const ref_buffer_stack); + +int av1_get_refresh_ref_frame_map(int refresh_frame_flags); + +void av1_update_ref_frame_map(AV1_COMP *cpi, + FRAME_UPDATE_TYPE frame_update_type, + int show_existing_frame, int ref_map_index, + RefBufferStack *ref_buffer_stack); + +void av1_get_ref_frames(AV1_COMP *const cpi, RefBufferStack *ref_buffer_stack); + +int is_forced_keyframe_pending(struct lookahead_ctx *lookahead, + const int up_to_index, + const COMPRESSOR_STAGE compressor_stage); +#include "av1/encoder/corner_detect.h" +#include "av1/encoder/motion_search_facade.h" +#if !CONFIG_REALTIME_ONLY +#endif +#include "av1/encoder/tpl_model.h" -static void encode_superblock(const AV1_COMP *const cpi, TileDataEnc *tile_data, - ThreadData *td, TOKENEXTRA **t, RUN_TYPE dry_run, - int mi_row, int mi_col, BLOCK_SIZE bsize, - int *rate); -static int ml_predict_breakout(const AV1_COMP *const cpi, BLOCK_SIZE bsize, - const MACROBLOCK *const x, - const RD_STATS *const rd_stats, - unsigned int pb_source_variance); +#if CONFIG_TUNE_VMAF +#include "av1/encoder/tune_vmaf.h" +#endif + +static AOM_INLINE void encode_superblock(const AV1_COMP *const cpi, + TileDataEnc *tile_data, ThreadData *td, + TOKENEXTRA **t, RUN_TYPE dry_run, + BLOCK_SIZE bsize, int *rate);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
57
58
59
60
61
62
63
64
65
66
#include "av1/encoder/ml.h" #include "av1/encoder/partition_strategy.h" #include "av1/encoder/partition_model_weights.h" #include "av1/encoder/rd.h" #include "av1/encoder/rdopt.h" #include "av1/encoder/reconinter_enc.h" #include "av1/encoder/segmentation.h" #include "av1/encoder/tokenize.h" #include "av1/encoder/var_based_part.h"
+ show +
67
68
69
70
71
72
73
74
static void encode_superblock(const AV1_COMP *const cpi, TileDataEnc *tile_data, ThreadData *td, TOKENEXTRA **t, RUN_TYPE dry_run, int mi_row, int mi_col, BLOCK_SIZE bsize, int *rate); static int ml_predict_breakout(const AV1_COMP *const cpi, BLOCK_SIZE bsize, const MACROBLOCK *const x, const RD_STATS *const rd_stats, unsigned int pb_source_variance);
+ show +
75
76
77
78
79
80
81
82
83
84
// This is used as a reference when computing the source variance for the // purposes of activity masking. // Eventually this should be replaced by custom no-reference routines, // which will be faster. const uint8_t AV1_VAR_OFFS[MAX_SB_SIZE] = { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,

[CVE-2020-0478_1.diff] encodeframe.c #4
+typedef struct { + ENTROPY_CONTEXT a[MAX_MIB_SIZE * MAX_MB_PLANE]; + ENTROPY_CONTEXT l[MAX_MIB_SIZE * MAX_MB_PLANE]; + PARTITION_CONTEXT sa[MAX_MIB_SIZE]; + PARTITION_CONTEXT sl[MAX_MIB_SIZE]; + TXFM_CONTEXT *p_ta; + TXFM_CONTEXT *p_tl; + TXFM_CONTEXT ta[MAX_MIB_SIZE]; + TXFM_CONTEXT tl[MAX_MIB_SIZE]; +} RD_SEARCH_MACROBLOCK_CONTEXT; + +enum { PICK_MODE_RD = 0, PICK_MODE_NONRD }; + +enum { + SB_SINGLE_PASS, // Single pass encoding: all ctxs get updated normally + SB_DRY_PASS, // First pass of multi-pass: does not update the ctxs + SB_WET_PASS // Second pass of multi-pass: finalize and update the ctx +} UENUM1BYTE(SB_MULTI_PASS_MODE); + +// This struct is used to store the statistics used by sb-level multi-pass +// encoding. Currently, this is only used to make a copy of the state before we +// perform the first pass +typedef struct SB_FIRST_PASS_STATS { + RD_SEARCH_MACROBLOCK_CONTEXT x_ctx; + RD_COUNTS rd_count; + + int split_count; + FRAME_COUNTS fc; + InterModeRdModel inter_mode_rd_models[BLOCK_SIZES_ALL]; + int thresh_freq_fact[BLOCK_SIZES_ALL][MAX_MODES]; + int current_qindex; + +#if CONFIG_INTERNAL_STATS + unsigned int mode_chosen_counts[MAX_MODES]; +#endif // CONFIG_INTERNAL_STATS +} SB_FIRST_PASS_STATS; + - switch (bd) { - case 10: - var = - cpi->fn_ptr[bs].vf(ref->buf, ref->stride, - CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_10), 0, &sse); - break; - case 12: - var = - cpi->fn_ptr[bs].vf(ref->buf, ref->stride, - CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_12), 0, &sse); - break; - case 8: - default: - var = - cpi->fn_ptr[bs].vf(ref->buf, ref->stride, - CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_8), 0, &sse); - break; - } + assert(bd == 8 || bd == 10 || bd == 12); + const int off_index = (bd - 8) >> 1; + const uint16_t *high_var_offs[3] = { AV1_HIGH_VAR_OFFS_8, + AV1_HIGH_VAR_OFFS_10, + AV1_HIGH_VAR_OFFS_12 }; + var = + cpi->fn_ptr[bs].vf(ref->buf, ref->stride, + CONVERT_TO_BYTEPTR(high_var_offs[off_index]), 0, &sse);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
148
149
150
151
152
153
154
155
156
157
unsigned int sse; const unsigned int var = cpi->fn_ptr[bs].vf(ref->buf, ref->stride, AV1_VAR_OFFS, 0, &sse); return ROUND_POWER_OF_TWO(var, num_pels_log2_lookup[bs]); } unsigned int av1_high_get_sby_perpixel_variance(const AV1_COMP *cpi, const struct buf_2d *ref, BLOCK_SIZE bs, int bd) { unsigned int var, sse;
+ show +
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
switch (bd) { case 10: var = cpi->fn_ptr[bs].vf(ref->buf, ref->stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_10), 0, &sse); break; case 12: var = cpi->fn_ptr[bs].vf(ref->buf, ref->stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_12), 0, &sse); break; case 8: default: var = cpi->fn_ptr[bs].vf(ref->buf, ref->stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_8), 0, &sse); break;
+ show +
175
176
177
178
179
180
181
182
183
184
} return ROUND_POWER_OF_TWO(var, num_pels_log2_lookup[bs]); } static unsigned int get_sby_perpixel_diff_variance(const AV1_COMP *const cpi, const struct buf_2d *ref, int mi_row, int mi_col, BLOCK_SIZE bs) { unsigned int sse, var; uint8_t *last_y;

[CVE-2020-0478_1.diff] encodeframe.c #14
-static int set_segment_rdmult(const AV1_COMP *const cpi, MACROBLOCK *const x, - int8_t segment_id) { - const AV1_COMMON *const cm = &cpi->common; - av1_init_plane_quantizers(cpi, x, segment_id); - aom_clear_system_state(); - int segment_qindex = av1_get_qindex(&cm->seg, segment_id, cm->base_qindex); - return av1_compute_rd_mult(cpi, segment_qindex + cm->y_dc_delta_q); -} - -static int set_deltaq_rdmult(const AV1_COMP *const cpi, MACROBLOCKD *const xd) { - const AV1_COMMON *const cm = &cpi->common; - - return av1_compute_rd_mult( - cpi, cm->base_qindex + xd->delta_qindex + cm->y_dc_delta_q); -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
459
460
461
462
463
464
465
466
467
468
// the static analysis warnings. for (int i = 0; i < AOMMIN(num_planes, MAX_MB_PLANE); i++) { const int is_uv = i > 0; setup_pred_plane( &x->plane[i].src, bsize, src->buffers[i], src->crop_widths[is_uv], src->crop_heights[is_uv], src->strides[is_uv], mi_row, mi_col, NULL, x->e_mbd.plane[i].subsampling_x, x->e_mbd.plane[i].subsampling_y); } }
+ show +
469
470
471
472
473
474
475
476
477
478
479
480
481
482
static int set_segment_rdmult(const AV1_COMP *const cpi, MACROBLOCK *const x, int8_t segment_id) { const AV1_COMMON *const cm = &cpi->common; av1_init_plane_quantizers(cpi, x, segment_id); aom_clear_system_state(); int segment_qindex = av1_get_qindex(&cm->seg, segment_id, cm->base_qindex); return av1_compute_rd_mult(cpi, segment_qindex + cm->y_dc_delta_q); } static int set_deltaq_rdmult(const AV1_COMP *const cpi, MACROBLOCKD *const xd) { const AV1_COMMON *const cm = &cpi->common; return av1_compute_rd_mult( cpi, cm->base_qindex + xd->delta_qindex + cm->y_dc_delta_q);
+ show +
483
484
485
486
487
488
489
490
491
492
} static EdgeInfo edge_info(const struct buf_2d *ref, const BLOCK_SIZE bsize, const bool high_bd, const int bd) { const int width = block_size_wide[bsize]; const int height = block_size_high[bsize]; // Implementation requires width to be a multiple of 8. It also requires // height to be a multiple of 4, but this is always the case. assert(height % 4 == 0); if (width % 8 != 0) {

[CVE-2020-0478_1.diff] encodeframe.c #16
- if (!ctx->rd_mode_is_ready) { - ctx->skippable = 0; - - // Set to zero to make sure we do not use the previous encoded frame stats - mbmi->skip = 0; - - // Reset skip mode flag. - mbmi->skip_mode = 0; - } - - x->skip_chroma_rd = - !is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x, - xd->plane[1].subsampling_y); - - if (ctx->rd_mode_is_ready) { - x->skip = ctx->skip; - *x->mbmi_ext = ctx->mbmi_ext; - return; - } + ctx->skippable = 0; + // Set to zero to make sure we do not use the previous encoded frame stats + mbmi->skip = 0; + // Reset skip mode flag. + mbmi->skip_mode = 0;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
557
558
559
560
561
562
563
564
565
566
for (i = 0; i < num_planes; ++i) { p[i].coeff = ctx->coeff[i]; p[i].qcoeff = ctx->qcoeff[i]; pd[i].dqcoeff = ctx->dqcoeff[i]; p[i].eobs = ctx->eobs[i]; p[i].txb_entropy_ctx = ctx->txb_entropy_ctx[i]; } for (i = 0; i < 2; ++i) pd[i].color_index_map = ctx->color_index_map[i];
+ show +
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
if (!ctx->rd_mode_is_ready) { ctx->skippable = 0; // Set to zero to make sure we do not use the previous encoded frame stats mbmi->skip = 0; // Reset skip mode flag. mbmi->skip_mode = 0; } x->skip_chroma_rd = !is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x, xd->plane[1].subsampling_y); if (ctx->rd_mode_is_ready) { x->skip = ctx->skip; *x->mbmi_ext = ctx->mbmi_ext; return;
+ show +
585
586
587
588
589
590
591
592
593
594
} if (is_cur_buf_hbd(xd)) { x->source_variance = av1_high_get_sby_perpixel_variance( cpi, &x->plane[0].src, bsize, xd->bd); } else { x->source_variance = av1_get_sby_perpixel_variance(cpi, &x->plane[0].src, bsize); } if (use_pb_simple_motion_pred_sse(cpi)) {

[CVE-2020-0478_1.diff] encodeframe.c #18
+ + // Initialize default mode evaluation params + set_mode_eval_params(cpi, x, DEFAULT_EVAL); + - orig_rdmult = x->rdmult; - - if (aq_mode == VARIANCE_AQ) { - if (cpi->vaq_refresh) { - const int energy = bsize <= BLOCK_16X16 - ? x->mb_energy - : av1_log_block_var(cpi, x, bsize); - mbmi->segment_id = energy; - } - x->rdmult = set_segment_rdmult(cpi, x, mbmi->segment_id); - } else if (aq_mode == COMPLEXITY_AQ) { - x->rdmult = set_segment_rdmult(cpi, x, mbmi->segment_id); - } else if (aq_mode == CYCLIC_REFRESH_AQ) { - // If segment is boosted, use rdmult for that segment. - if (cyclic_refresh_segment_id_boosted(mbmi->segment_id)) - x->rdmult = av1_cyclic_refresh_get_rdmult(cpi->cyclic_refresh); - } else if (cpi->oxcf.enable_tpl_model) { - x->rdmult = x->cb_rdmult; - } - - if (deltaq_mode > 0) x->rdmult = set_deltaq_rdmult(cpi, xd); + const int orig_rdmult = x->rdmult; + setup_block_rdmult(cpi, x, mi_row, mi_col, bsize, aq_mode, mbmi); + // Set error per bit for current rdmult + set_error_per_bit(x, x->rdmult); + av1_rd_cost_update(x->rdmult, &best_rd);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
605
606
607
608
609
610
611
612
613
614
x->edge_strength_x = UINT16_MAX; x->edge_strength_y = UINT16_MAX; } else { EdgeInfo ei = edge_info(&x->plane[0].src, bsize, is_cur_buf_hbd(xd), xd->bd); x->edge_strength = ei.magnitude; x->edge_strength_x = ei.x; x->edge_strength_y = ei.y; } // Save rdmult before it might be changed, so it can be restored later.
+ show +
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
orig_rdmult = x->rdmult; if (aq_mode == VARIANCE_AQ) { if (cpi->vaq_refresh) { const int energy = bsize <= BLOCK_16X16 ? x->mb_energy : av1_log_block_var(cpi, x, bsize); mbmi->segment_id = energy; } x->rdmult = set_segment_rdmult(cpi, x, mbmi->segment_id); } else if (aq_mode == COMPLEXITY_AQ) { x->rdmult = set_segment_rdmult(cpi, x, mbmi->segment_id); } else if (aq_mode == CYCLIC_REFRESH_AQ) { // If segment is boosted, use rdmult for that segment. if (cyclic_refresh_segment_id_boosted(mbmi->segment_id)) x->rdmult = av1_cyclic_refresh_get_rdmult(cpi->cyclic_refresh); } else if (cpi->oxcf.enable_tpl_model) { x->rdmult = x->cb_rdmult; } if (deltaq_mode > 0) x->rdmult = set_deltaq_rdmult(cpi, xd);
+ show +
636
637
638
639
640
641
642
643
644
645
// Find best coding mode & reconstruct the MB so it is available // as a predictor for MBs that follow in the SB if (frame_is_intra_only(cm)) { #if CONFIG_COLLECT_COMPONENT_TIMING start_timing(cpi, av1_rd_pick_intra_mode_sb_time); #endif av1_rd_pick_intra_mode_sb(cpi, x, mi_row, mi_col, rd_cost, bsize, ctx, best_rd); #if CONFIG_COLLECT_COMPONENT_TIMING

[CVE-2020-0478_1.diff] encodeframe.c #21
- if ((rd_cost->rate != INT_MAX) && (aq_mode == COMPLEXITY_AQ) && - (bsize >= BLOCK_16X16) && - (cm->current_frame.frame_type == KEY_FRAME || - cpi->refresh_alt_ref_frame || cpi->refresh_alt2_ref_frame || - (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref))) { + if (rd_cost->rate != INT_MAX && aq_mode == COMPLEXITY_AQ && + bsize >= BLOCK_16X16) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
662
663
664
665
666
667
668
669
670
671
av1_rd_pick_inter_mode_sb(cpi, tile_data, x, mi_row, mi_col, rd_cost, bsize, ctx, best_rd); } } #if CONFIG_COLLECT_COMPONENT_TIMING end_timing(cpi, av1_rd_pick_inter_mode_sb_time); #endif } // Examine the resulting rate and for AQ mode 2 make a segment choice.
+ show +
672
673
674
675
676
if ((rd_cost->rate != INT_MAX) && (aq_mode == COMPLEXITY_AQ) && (bsize >= BLOCK_16X16) && (cm->current_frame.frame_type == KEY_FRAME || cpi->refresh_alt_ref_frame || cpi->refresh_alt2_ref_frame || (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref))) {
+ show +
677
678
679
680
681
682
683
684
685
686
av1_caq_select_segment(cpi, x, bsize, mi_row, mi_col, rd_cost->rate); } x->rdmult = orig_rdmult; // TODO(jingning) The rate-distortion optimization flow needs to be // refactored to provide proper exit/return handle. if (rd_cost->rate == INT_MAX) rd_cost->rdcost = INT64_MAX; ctx->rate = rd_cost->rate;

[CVE-2020-0478_1.diff] encodeframe.c #30
++counts->angle_delta[uv_mode - UV_V_PRED] - if (allow_update_cdf) { - update_cdf(fc->angle_delta_cdf[uv_mode - UV_V_PRED], - mbmi->angle_delta[PLANE_TYPE_UV] + MAX_ANGLE_DELTA, - 2 * MAX_ANGLE_DELTA + 1); - } + update_cdf(fc->angle_delta_cdf[uv_mode - UV_V_PRED], + mbmi->angle_delta[PLANE_TYPE_UV] + MAX_ANGLE_DELTA, + 2 * MAX_ANGLE_DELTA + 1); - if (av1_allow_palette(cm->allow_screen_content_tools, bsize)) - update_palette_cdf(xd, mbmi, counts, allow_update_cdf); + if (av1_allow_palette(cm->features.allow_screen_content_tools, bsize)) { + update_palette_cdf(xd, mbmi, counts); + } -static void update_stats(const AV1_COMMON *const cm, TileDataEnc *tile_data, - ThreadData *td, int mi_row, int mi_col) { +static AOM_INLINE void update_stats(const AV1_COMMON *const cm, + ThreadData *td) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
886
887
888
889
890
891
892
893
894
895
if (allow_update_cdf) update_cdf(cdf_v, CFL_IDX_V(idx), CFL_ALPHABET_SIZE); } } if (av1_is_directional_mode(get_uv_mode(uv_mode)) && av1_use_angle_delta(bsize)) { #if CONFIG_ENTROPY_STATS ++counts->angle_delta[uv_mode - UV_V_PRED] [mbmi->angle_delta[PLANE_TYPE_UV] + MAX_ANGLE_DELTA]; #endif
+ show +
896
897
898
899
900
901
902
903
904
905
906
907
if (allow_update_cdf) { update_cdf(fc->angle_delta_cdf[uv_mode - UV_V_PRED], mbmi->angle_delta[PLANE_TYPE_UV] + MAX_ANGLE_DELTA, 2 * MAX_ANGLE_DELTA + 1); } } if (av1_allow_palette(cm->allow_screen_content_tools, bsize)) update_palette_cdf(xd, mbmi, counts, allow_update_cdf); } static void update_stats(const AV1_COMMON *const cm, TileDataEnc *tile_data, ThreadData *td, int mi_row, int mi_col) {
+ show +
908
909
910
911
912
913
914
915
916
917
MACROBLOCK *x = &td->mb; MACROBLOCKD *const xd = &x->e_mbd; const MB_MODE_INFO *const mbmi = xd->mi[0]; const MB_MODE_INFO_EXT *const mbmi_ext = x->mbmi_ext; const CurrentFrame *const current_frame = &cm->current_frame; const BLOCK_SIZE bsize = mbmi->sb_type; FRAME_CONTEXT *fc = xd->tile_ctx; const uint8_t allow_update_cdf = tile_data->allow_update_cdf; // delta quant applies to both intra and inter

[CVE-2020-0478_1.diff] encodeframe.c #31
- const uint8_t allow_update_cdf = tile_data->allow_update_cdf; - - // delta quant applies to both intra and inter - const int super_block_upper_left = - ((mi_row & (cm->seq_params.mib_size - 1)) == 0) && - ((mi_col & (cm->seq_params.mib_size - 1)) == 0); -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
905
906
907
908
909
910
911
912
913
914
static void update_stats(const AV1_COMMON *const cm, TileDataEnc *tile_data, ThreadData *td, int mi_row, int mi_col) { MACROBLOCK *x = &td->mb; MACROBLOCKD *const xd = &x->e_mbd; const MB_MODE_INFO *const mbmi = xd->mi[0]; const MB_MODE_INFO_EXT *const mbmi_ext = x->mbmi_ext; const CurrentFrame *const current_frame = &cm->current_frame; const BLOCK_SIZE bsize = mbmi->sb_type; FRAME_CONTEXT *fc = xd->tile_ctx;
+ show +
915
916
917
918
919
920
const uint8_t allow_update_cdf = tile_data->allow_update_cdf; // delta quant applies to both intra and inter const int super_block_upper_left = ((mi_row & (cm->seq_params.mib_size - 1)) == 0) && ((mi_col & (cm->seq_params.mib_size - 1)) == 0);
+ show +
921
922
923
924
925
926
927
928
929
930
const int seg_ref_active = segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_REF_FRAME); if (current_frame->skip_mode_info.skip_mode_flag && !seg_ref_active && is_comp_ref_allowed(bsize)) { const int skip_mode_ctx = av1_get_skip_mode_context(xd); #if CONFIG_ENTROPY_STATS td->counts->skip_mode[skip_mode_ctx][mbmi->skip_mode]++; #endif

[CVE-2020-0478_1.diff] encodeframe.c #37
- memcpy(ctx->a + num_4x4_blocks_wide * p, - xd->above_context[p] + (tx_col >> xd->plane[p].subsampling_x), - (sizeof(ENTROPY_CONTEXT) * num_4x4_blocks_wide) >> - xd->plane[p].subsampling_x); - memcpy(ctx->l + num_4x4_blocks_high * p, - xd->left_context[p] + (tx_row >> xd->plane[p].subsampling_y), - (sizeof(ENTROPY_CONTEXT) * num_4x4_blocks_high) >> - xd->plane[p].subsampling_y); + memcpy( + ctx->a + mi_width * p, + xd->above_entropy_context[p] + (tx_col >> xd->plane[p].subsampling_x), + (sizeof(ENTROPY_CONTEXT) * mi_width) >> xd->plane[p].subsampling_x); + memcpy(ctx->l + mi_height * p, + xd->left_entropy_context[p] + (tx_row >> xd->plane[p].subsampling_y), + (sizeof(ENTROPY_CONTEXT) * mi_height) >> xd->plane[p].subsampling_y); - memcpy(ctx->sa, xd->above_seg_context + mi_col, - sizeof(*xd->above_seg_context) * mi_width); - memcpy(ctx->sl, xd->left_seg_context + (mi_row & MAX_MIB_MASK), - sizeof(xd->left_seg_context[0]) * mi_height); + memcpy(ctx->sa, xd->above_partition_context + mi_col, + sizeof(*xd->above_partition_context) * mi_width); + memcpy(ctx->sl, xd->left_partition_context + (mi_row & MAX_MIB_MASK), + sizeof(xd->left_partition_context[0]) * mi_height);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
block_size_wide[bsize] >> tx_size_wide_log2[0]; const int num_4x4_blocks_high = block_size_high[bsize] >> tx_size_high_log2[0]; int mi_width = mi_size_wide[bsize]; int mi_height = mi_size_high[bsize]; // buffer the above/left context information of the block in search. for (p = 0; p < num_planes; ++p) { int tx_col = mi_col; int tx_row = mi_row & MAX_MIB_MASK;
+ show +
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
memcpy(ctx->a + num_4x4_blocks_wide * p, xd->above_context[p] + (tx_col >> xd->plane[p].subsampling_x), (sizeof(ENTROPY_CONTEXT) * num_4x4_blocks_wide) >> xd->plane[p].subsampling_x); memcpy(ctx->l + num_4x4_blocks_high * p, xd->left_context[p] + (tx_row >> xd->plane[p].subsampling_y), (sizeof(ENTROPY_CONTEXT) * num_4x4_blocks_high) >> xd->plane[p].subsampling_y); } memcpy(ctx->sa, xd->above_seg_context + mi_col, sizeof(*xd->above_seg_context) * mi_width); memcpy(ctx->sl, xd->left_seg_context + (mi_row & MAX_MIB_MASK), sizeof(xd->left_seg_context[0]) * mi_height);
+ show +
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
memcpy(ctx->ta, xd->above_txfm_context, sizeof(*xd->above_txfm_context) * mi_width); memcpy(ctx->tl, xd->left_txfm_context, sizeof(*xd->left_txfm_context) * mi_height); ctx->p_ta = xd->above_txfm_context; ctx->p_tl = xd->left_txfm_context; } static void encode_b(const AV1_COMP *const cpi, TileDataEnc *tile_data, ThreadData *td, TOKENEXTRA **tp, int mi_row, int mi_col,

[CVE-2020-0478_1.diff] encodeframe.c #39
- update_stats(&cpi->common, tile_data, td, mi_row, mi_col); + + // delta quant applies to both intra and inter + const int super_block_upper_left = + ((mi_row & (cm->seq_params.mib_size - 1)) == 0) && + ((mi_col & (cm->seq_params.mib_size - 1)) == 0); + const DeltaQInfo *const delta_q_info = &cm->delta_q_info; + if (delta_q_info->delta_q_present_flag && + (bsize != cm->seq_params.sb_size || !mbmi->skip) && + super_block_upper_left) { + xd->current_qindex = mbmi->current_qindex; + if (delta_q_info->delta_lf_present_flag) { + if (delta_q_info->delta_lf_multi) { + const int frame_lf_count = + av1_num_planes(cm) > 1 ? FRAME_LF_COUNT : FRAME_LF_COUNT - 2; + for (int lf_id = 0; lf_id < frame_lf_count; ++lf_id) { + xd->delta_lf[lf_id] = mbmi->delta_lf[lf_id]; + } + } else { + xd->delta_lf_from_base = mbmi->delta_lf_from_base; + } + } + } + + RD_COUNTS *rdc = &td->rd_counts; + if (mbmi->skip_mode) { + assert(!frame_is_intra_only(cm)); + rdc->skip_mode_used_flag = 1; + if (cm->current_frame.reference_mode == REFERENCE_MODE_SELECT) { + assert(has_second_ref(mbmi)); + rdc->compound_ref_used_flag = 1; + } + set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]); + } else { + const int seg_ref_active = + segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_REF_FRAME); + if (!seg_ref_active) { + // If the segment reference feature is enabled we have only a single + // reference frame allowed for the segment so exclude it from + // the reference frame counts used to work out probabilities. + if (is_inter_block(mbmi)) { + av1_collect_neighbors_ref_counts(xd); + if (cm->current_frame.reference_mode == REFERENCE_MODE_SELECT) { + if (has_second_ref(mbmi)) { + // This flag is also updated for 4x4 blocks + rdc->compound_ref_used_flag = 1; + } + } + set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]); + } + } + } + + if (tile_data->allow_update_cdf) update_stats(&cpi->common, td); + + // Gather obmc and warped motion count to update the probability. + if ((!cpi->sf.inter_sf.disable_obmc && + cpi->sf.inter_sf.prune_obmc_prob_thresh > 0) || + (cm->features.allow_warped_motion && + cpi->sf.inter_sf.prune_warped_prob_thresh > 0)) { + const int inter_block = is_inter_block(mbmi); + const int seg_ref_active = + segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_REF_FRAME); + if (!seg_ref_active && inter_block) { + const MOTION_MODE motion_allowed = + cm->features.switchable_motion_mode + ? motion_mode_allowed(xd->global_motion, xd, mbmi, + cm->features.allow_warped_motion) + : SIMPLE_TRANSLATION; + + if (mbmi->ref_frame[1] != INTRA_FRAME) { + if (motion_allowed >= OBMC_CAUSAL) { + td->rd_counts.obmc_used[bsize][mbmi->motion_mode == OBMC_CAUSAL]++; + } + if (motion_allowed == WARPED_CAUSAL) { + td->rd_counts.warped_used[mbmi->motion_mode == WARPED_CAUSAL]++; + } + } + } + } + // TODO(Ravi/Remya): Move this copy function to a better logical place + // This function will copy the best mode information from block + // level (x->mbmi_ext) to frame level (cpi->mbmi_ext_info.frame_base). This + // frame level buffer (cpi->mbmi_ext_info.frame_base) will be used during + // bitstream preparation. + av1_copy_mbmi_ext_to_mbmi_ext_frame(x->mbmi_ext_frame, x->mbmi_ext, + av1_ref_frame_type(xd->mi[0]->ref_frame)); + x->rdmult = origin_mult; -static void encode_sb(const AV1_COMP *const cpi, ThreadData *td, - TileDataEnc *tile_data, TOKENEXTRA **tp, int mi_row, - int mi_col, RUN_TYPE dry_run, BLOCK_SIZE bsize, - PC_TREE *pc_tree, int *rate) { +static AOM_INLINE void encode_sb(const AV1_COMP *const cpi, ThreadData *td, + TileDataEnc *tile_data, TOKENEXTRA **tp, + int mi_row, int mi_col, RUN_TYPE dry_run, + BLOCK_SIZE bsize, PC_TREE *pc_tree, + int *rate) { + assert(bsize < BLOCK_SIZES_ALL); + const CommonModeInfoParams *const mi_params = &cm->mi_params; + assert(bsize < BLOCK_SIZES_ALL);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
mbmi->delta_lf[lf_id] = xd->delta_lf[lf_id]; mbmi->delta_lf_from_base = xd->delta_lf_from_base; } if (has_second_ref(mbmi)) { if (mbmi->compound_idx == 0 || mbmi->interinter_comp.type == COMPOUND_AVERAGE) mbmi->comp_group_idx = 0; else mbmi->comp_group_idx = 1; }
+ show +
1507
1508
1509
1510
1511
1512
1513
1514
update_stats(&cpi->common, tile_data, td, mi_row, mi_col); } } static void encode_sb(const AV1_COMP *const cpi, ThreadData *td, TileDataEnc *tile_data, TOKENEXTRA **tp, int mi_row, int mi_col, RUN_TYPE dry_run, BLOCK_SIZE bsize, PC_TREE *pc_tree, int *rate) {
+ show +
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
const AV1_COMMON *const cm = &cpi->common; MACROBLOCK *const x = &td->mb; MACROBLOCKD *const xd = &x->e_mbd; const int hbs = mi_size_wide[bsize] / 2; const int is_partition_root = bsize >= BLOCK_8X8; const int ctx = is_partition_root ? partition_plane_context(xd, mi_row, mi_col, bsize) : -1; const PARTITION_TYPE partition = pc_tree->partitioning; const BLOCK_SIZE subsize = get_partition_subsize(bsize, partition);

[CVE-2020-0478_1.diff] encodeframe.c #47
-static void rd_use_partition(AV1_COMP *cpi, ThreadData *td, - TileDataEnc *tile_data, MB_MODE_INFO **mib, - TOKENEXTRA **tp, int mi_row, int mi_col, - BLOCK_SIZE bsize, int *rate, int64_t *dist, - int do_recon, PC_TREE *pc_tree) { +static AOM_INLINE void rd_use_partition( + AV1_COMP *cpi, ThreadData *td, TileDataEnc *tile_data, MB_MODE_INFO **mib, + TOKENEXTRA **tp, int mi_row, int mi_col, BLOCK_SIZE bsize, int *rate, + int64_t *dist, int do_recon, PC_TREE *pc_tree) { + const CommonModeInfoParams *const mi_params = &cm->mi_params;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
mib[index]->sb_type = bsize; } } } else { // Else this is a partial SB. set_partial_sb_partition(cm, mi_upper_left, bh, bw, mi_rows_remaining, mi_cols_remaining, bsize, mib); } }
+ show +
1691
1692
1693
1694
1695
static void rd_use_partition(AV1_COMP *cpi, ThreadData *td, TileDataEnc *tile_data, MB_MODE_INFO **mib, TOKENEXTRA **tp, int mi_row, int mi_col, BLOCK_SIZE bsize, int *rate, int64_t *dist, int do_recon, PC_TREE *pc_tree) {
+ show +
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
AV1_COMMON *const cm = &cpi->common; const int num_planes = av1_num_planes(cm); TileInfo *const tile_info = &tile_data->tile_info; MACROBLOCK *const x = &td->mb; MACROBLOCKD *const xd = &x->e_mbd; const int bs = mi_size_wide[bsize]; const int hbs = bs / 2; int i; const int pl = (bsize >= BLOCK_8X8) ? partition_plane_context(xd, mi_row, mi_col, bsize)

[CVE-2020-0478_1.diff] encodeframe.c #63
-static void rd_pick_sqr_partition(AV1_COMP *const cpi, ThreadData *td, - TileDataEnc *tile_data, TOKENEXTRA **tp, - int mi_row, int mi_col, BLOCK_SIZE bsize, - RD_STATS *rd_cost, int64_t best_rd, - PC_TREE *pc_tree, int64_t *none_rd) { - const AV1_COMMON *const cm = &cpi->common; - TileInfo *const tile_info = &tile_data->tile_info; - MACROBLOCK *const x = &td->mb; - MACROBLOCKD *const xd = &x->e_mbd; - const int mi_step = mi_size_wide[bsize] / 2; - RD_SEARCH_MACROBLOCK_CONTEXT x_ctx; - const TOKENEXTRA *const tp_orig = *tp; - PICK_MODE_CONTEXT *ctx_none = &pc_tree->none; - int tmp_partition_cost[PARTITION_TYPES]; - BLOCK_SIZE subsize; - RD_STATS this_rdc, sum_rdc, best_rdc, pn_rdc; - const int bsize_at_least_8x8 = (bsize >= BLOCK_8X8); - int do_square_split = bsize_at_least_8x8; - const int pl = bsize_at_least_8x8 - ? partition_plane_context(xd, mi_row, mi_col, bsize) - : 0; - const int *partition_cost = - pl >= 0 ? x->partition_cost[pl] : x->partition_cost[0]; - const int num_planes = av1_num_planes(cm); - - int64_t split_rd[4] = { 0, 0, 0, 0 }; - - // Override skipping rectangular partition operations for edge blocks - const int has_rows = (mi_row + mi_step < cm->mi_rows); - const int has_cols = (mi_col + mi_step < cm->mi_cols); - - if (none_rd) *none_rd = 0; - - int partition_none_allowed = has_rows && has_cols; - - (void)*tp_orig; - (void)split_rd; - - if (best_rd < 0) { - pc_tree->none.rdcost = INT64_MAX; - pc_tree->none.skip = 0; - av1_invalid_rd_stats(rd_cost); - return; - } - pc_tree->pc_tree_stats.valid = 1; - - // Override partition costs at the edges of the frame in the same - // way as in read_partition (see decodeframe.c) - if (!(has_rows && has_cols)) { - assert(bsize_at_least_8x8 && pl >= 0); - const aom_cdf_prob *partition_cdf = cm->fc->partition_cdf[pl]; - for (int i = 0; i < PARTITION_TYPES; ++i) tmp_partition_cost[i] = INT_MAX; - if (has_cols) { - // At the bottom, the two possibilities are HORZ and SPLIT - aom_cdf_prob bot_cdf[2]; - partition_gather_vert_alike(bot_cdf, partition_cdf, bsize); - static const int bot_inv_map[2] = { PARTITION_HORZ, PARTITION_SPLIT }; - av1_cost_tokens_from_cdf(tmp_partition_cost, bot_cdf, bot_inv_map); - } else if (has_rows) { - // At the right, the two possibilities are VERT and SPLIT - aom_cdf_prob rhs_cdf[2]; - partition_gather_horz_alike(rhs_cdf, partition_cdf, bsize); - static const int rhs_inv_map[2] = { PARTITION_VERT, PARTITION_SPLIT }; - av1_cost_tokens_from_cdf(tmp_partition_cost, rhs_cdf, rhs_inv_map); - } else { - // At the bottom right, we always split - tmp_partition_cost[PARTITION_SPLIT] = 0; - } - - partition_cost = tmp_partition_cost; - } - -#ifndef NDEBUG - // Nothing should rely on the default value of this array (which is just - // leftover from encoding the previous block. Setting it to fixed pattern - // when debugging. - // bit 0, 1, 2 are blk_skip of each plane - // bit 4, 5, 6 are initialization checking of each plane - memset(x->blk_skip, 0x77, sizeof(x->blk_skip)); -#endif // NDEBUG - - assert(mi_size_wide[bsize] == mi_size_high[bsize]); - - av1_init_rd_stats(&this_rdc); - av1_init_rd_stats(&sum_rdc); - av1_invalid_rd_stats(&best_rdc); - best_rdc.rdcost = best_rd; - - set_offsets(cpi, tile_info, x, mi_row, mi_col, bsize); - - if (bsize == BLOCK_16X16 && cpi->vaq_refresh) - x->mb_energy = av1_log_block_var(cpi, x, bsize); - - xd->above_txfm_context = cm->above_txfm_context[tile_info->tile_row] + mi_col; - xd->left_txfm_context = - xd->left_txfm_context_buffer + (mi_row & MAX_MIB_MASK); - save_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); - -#if CONFIG_DIST_8X8 - if (x->using_dist_8x8) { - if (block_size_high[bsize] <= 8 || block_size_wide[bsize] <= 8) - do_square_split = 0; - } -#endif - - // PARTITION_NONE - if (partition_none_allowed) { - int pt_cost = 0; - if (bsize_at_least_8x8) { - pc_tree->partitioning = PARTITION_NONE; - pt_cost = partition_cost[PARTITION_NONE] < INT_MAX - ? partition_cost[PARTITION_NONE] - : 0; - } - const int64_t partition_rd_cost = RDCOST(x->rdmult, pt_cost, 0); - const int64_t best_remain_rdcost = - best_rdc.rdcost == INT64_MAX ? INT64_MAX - : (best_rdc.rdcost - partition_rd_cost); - pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, &this_rdc, PARTITION_NONE, - bsize, ctx_none, best_remain_rdcost, 0); - - pc_tree->pc_tree_stats.rdcost = ctx_none->rdcost; - pc_tree->pc_tree_stats.skip = ctx_none->skip; - - if (none_rd) *none_rd = this_rdc.rdcost; - if (this_rdc.rate != INT_MAX) { - if (bsize_at_least_8x8) { - this_rdc.rate += pt_cost; - this_rdc.rdcost = RDCOST(x->rdmult, this_rdc.rate, this_rdc.dist); - } - - if (this_rdc.rdcost < best_rdc.rdcost) { - // Adjust dist breakout threshold according to the partition size. - const int64_t dist_breakout_thr = - cpi->sf.partition_search_breakout_dist_thr >> - ((2 * (MAX_SB_SIZE_LOG2 - 2)) - - (mi_size_wide_log2[bsize] + mi_size_high_log2[bsize])); - const int rate_breakout_thr = - cpi->sf.partition_search_breakout_rate_thr * - num_pels_log2_lookup[bsize]; - - best_rdc = this_rdc; - if (bsize_at_least_8x8) pc_tree->partitioning = PARTITION_NONE; - - pc_tree->cb_search_range = SEARCH_FULL_PLANE; - - if (!x->e_mbd.lossless[xd->mi[0]->segment_id] && ctx_none->skippable) { - const int use_ml_based_breakout = - bsize <= cpi->sf.use_square_partition_only_threshold && - bsize > BLOCK_4X4 && xd->bd == 8; - - // TODO(anyone): Currently this is using the same model and threshold - // values as in rd_pick_partition. Retraining the model and tuning the - // threshold values might be helpful to improve the speed. - if (use_ml_based_breakout) { - if (ml_predict_breakout(cpi, bsize, x, &this_rdc, - x->source_variance)) { - do_square_split = 0; - } - } - - // If all y, u, v transform blocks in this partition are skippable, - // and the dist & rate are within the thresholds, the partition search - // is terminated for current branch of the partition search tree. The - // dist & rate thresholds are set to 0 at speed 0 to disable the early - // termination at that speed. - if (best_rdc.dist < dist_breakout_thr && - best_rdc.rate < rate_breakout_thr) { - do_square_split = 0; - } - } - - if (cpi->sf.firstpass_simple_motion_search_early_term && - cm->show_frame && bsize <= BLOCK_32X32 && bsize >= BLOCK_8X8 && - !frame_is_intra_only(cm) && mi_row + mi_step < cm->mi_rows && - mi_col + mi_step < cm->mi_cols && this_rdc.rdcost < INT64_MAX && - this_rdc.rdcost >= 0 && this_rdc.rate < INT_MAX && - this_rdc.rate >= 0 && do_square_split) { - av1_firstpass_simple_motion_search_early_term( - cpi, x, pc_tree, mi_row, mi_col, bsize, &this_rdc, - &do_square_split); - } - } - } - - restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); - } - - // store estimated motion vector - if (cpi->sf.adaptive_motion_search) store_pred_mv(x, ctx_none); - - int64_t temp_best_rdcost = best_rdc.rdcost; - pn_rdc = best_rdc; - - // PARTITION_SPLIT - if (do_square_split) { - int reached_last_index = 0; - subsize = get_partition_subsize(bsize, PARTITION_SPLIT); - int idx; - - sum_rdc.rate = partition_cost[PARTITION_SPLIT]; - sum_rdc.rdcost = RDCOST(x->rdmult, sum_rdc.rate, 0); - - for (idx = 0; idx < 4 && sum_rdc.rdcost < temp_best_rdcost; ++idx) { - const int x_idx = (idx & 1) * mi_step; - const int y_idx = (idx >> 1) * mi_step; - - if (mi_row + y_idx >= cm->mi_rows || mi_col + x_idx >= cm->mi_cols) - continue; - - if (cpi->sf.adaptive_motion_search) load_pred_mv(x, ctx_none); - - pc_tree->split[idx]->index = idx; - int64_t *p_split_rd = &split_rd[idx]; - const int64_t best_remain_rdcost = - (temp_best_rdcost == INT64_MAX) ? INT64_MAX - : (temp_best_rdcost - sum_rdc.rdcost); - rd_pick_sqr_partition( - cpi, td, tile_data, tp, mi_row + y_idx, mi_col + x_idx, subsize, - &this_rdc, best_remain_rdcost, pc_tree->split[idx], p_split_rd); - - pc_tree->pc_tree_stats.sub_block_rdcost[idx] = this_rdc.rdcost; - pc_tree->pc_tree_stats.sub_block_skip[idx] = - pc_tree->split[idx]->none.skip; - - if (this_rdc.rate == INT_MAX) { - sum_rdc.rdcost = INT64_MAX; - break; - } else { - sum_rdc.rate += this_rdc.rate; - sum_rdc.dist += this_rdc.dist; - sum_rdc.rdcost += this_rdc.rdcost; - } - } - reached_last_index = (idx == 4); - - if (reached_last_index && sum_rdc.rdcost < best_rdc.rdcost) { - sum_rdc.rdcost = RDCOST(x->rdmult, sum_rdc.rate, sum_rdc.dist); - - if (sum_rdc.rdcost < best_rdc.rdcost) { - best_rdc = sum_rdc; - pc_tree->partitioning = PARTITION_SPLIT; - } - } - - int has_split = 0; - if (pc_tree->partitioning == PARTITION_SPLIT) { - for (int cb_idx = 0; cb_idx <= AOMMIN(idx, 3); ++cb_idx) { - if (pc_tree->split[cb_idx]->partitioning == PARTITION_SPLIT) - ++has_split; - } - - if (has_split >= 3 || sum_rdc.rdcost < (pn_rdc.rdcost >> 1)) { - pc_tree->cb_search_range = SPLIT_PLANE; - } - } - - if (pc_tree->partitioning == PARTITION_NONE) { - pc_tree->cb_search_range = SEARCH_SAME_PLANE; - if (pn_rdc.dist <= sum_rdc.dist) - pc_tree->cb_search_range = NONE_PARTITION_PLANE; - } - - if (pn_rdc.rate == INT_MAX) pc_tree->cb_search_range = NONE_PARTITION_PLANE; - - restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); - } // if (do_split) - - pc_tree->pc_tree_stats.split = pc_tree->partitioning == PARTITION_SPLIT; - if (do_square_split) { - for (int i = 0; i < 4; ++i) { - pc_tree->pc_tree_stats.sub_block_split[i] = - pc_tree->split[i]->partitioning == PARTITION_SPLIT; - } - } - - // TODO(jbb): This code added so that we avoid static analysis - // warning related to the fact that best_rd isn't used after this - // point. This code should be refactored so that the duplicate - // checks occur in some sub function and thus are used... - (void)best_rd; - *rd_cost = best_rdc; - - if (best_rdc.rate < INT_MAX && best_rdc.dist < INT64_MAX && - pc_tree->index != 3) { - if (bsize == cm->seq_params.sb_size) { - restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); - } else { - encode_sb(cpi, td, tile_data, tp, mi_row, mi_col, DRY_RUN_NORMAL, bsize, - pc_tree, NULL); - } - } - - if (bsize == cm->seq_params.sb_size) { - assert(best_rdc.rate < INT_MAX); - assert(best_rdc.dist < INT64_MAX); - } else { - assert(tp_orig == *tp); - } -} - -// split_score indicates confidence of picking split partition; -// none_score indicates confidence of picking none partition; -#define FEATURE_SIZE 19 -static int ml_prune_2pass_split_partition(const PC_TREE_STATS *pc_tree_stats, - BLOCK_SIZE bsize, int *split_score, - int *none_score) { - if (!pc_tree_stats->valid) return 0; - const float *split_weights = NULL; - const float *none_weights = NULL; - switch (bsize) { - case BLOCK_4X4: break; - case BLOCK_8X8: - split_weights = av1_2pass_split_partition_weights_8; - none_weights = av1_2pass_none_partition_weights_8; - break; - case BLOCK_16X16: - split_weights = av1_2pass_split_partition_weights_16; - none_weights = av1_2pass_none_partition_weights_16; - break; - case BLOCK_32X32: - split_weights = av1_2pass_split_partition_weights_32; - none_weights = av1_2pass_none_partition_weights_32; - break; - case BLOCK_64X64: - split_weights = av1_2pass_split_partition_weights_64; - none_weights = av1_2pass_none_partition_weights_64; - break; - case BLOCK_128X128: - split_weights = av1_2pass_split_partition_weights_128; - none_weights = av1_2pass_none_partition_weights_128; - break; - default: assert(0 && "Unexpected bsize."); - } - if (!split_weights || !none_weights) return 0; - - aom_clear_system_state(); - - float features[FEATURE_SIZE]; - int feature_index = 0; - features[feature_index++] = (float)pc_tree_stats->split; - features[feature_index++] = (float)pc_tree_stats->skip; - const int rdcost = (int)AOMMIN(INT_MAX, pc_tree_stats->rdcost); - const int rd_valid = rdcost > 0 && rdcost < 1000000000; - features[feature_index++] = (float)rd_valid; - for (int i = 0; i < 4; ++i) { - features[feature_index++] = (float)pc_tree_stats->sub_block_split[i]; - features[feature_index++] = (float)pc_tree_stats->sub_block_skip[i]; - const int sub_rdcost = - (int)AOMMIN(INT_MAX, pc_tree_stats->sub_block_rdcost[i]); - const int sub_rd_valid = sub_rdcost > 0 && sub_rdcost < 1000000000; - features[feature_index++] = (float)sub_rd_valid; - // Ratio between the sub-block RD and the whole-block RD. - float rd_ratio = 1.0f; - if (rd_valid && sub_rd_valid && sub_rdcost < rdcost) - rd_ratio = (float)sub_rdcost / (float)rdcost; - features[feature_index++] = rd_ratio; - } - assert(feature_index == FEATURE_SIZE); - - float score_1 = split_weights[FEATURE_SIZE]; - float score_2 = none_weights[FEATURE_SIZE]; - for (int i = 0; i < FEATURE_SIZE; ++i) { - score_1 += features[i] * split_weights[i]; - score_2 += features[i] * none_weights[i]; - } - *split_score = (int)(score_1 * 100); - *none_score = (int)(score_2 * 100); - return 1; -} -#undef FEATURE_SIZE - -static void ml_prune_rect_partition(const AV1_COMP *const cpi, - const MACROBLOCK *const x, BLOCK_SIZE bsize, - int64_t best_rd, int64_t none_rd, - int64_t *split_rd, - int *const dst_prune_horz, - int *const dst_prune_vert) { - if (bsize < BLOCK_8X8 || best_rd >= 1000000000) return; - best_rd = AOMMAX(best_rd, 1); - const NN_CONFIG *nn_config = NULL; - const float prob_thresholds[5] = { 0.01f, 0.01f, 0.004f, 0.002f, 0.002f }; - float cur_thresh = 0.0f; - switch (bsize) { - case BLOCK_8X8: - nn_config = &av1_rect_partition_nnconfig_8; - cur_thresh = prob_thresholds[0]; - break; - case BLOCK_16X16: - nn_config = &av1_rect_partition_nnconfig_16; - cur_thresh = prob_thresholds[1]; - break; - case BLOCK_32X32: - nn_config = &av1_rect_partition_nnconfig_32; - cur_thresh = prob_thresholds[2]; - break; - case BLOCK_64X64: - nn_config = &av1_rect_partition_nnconfig_64; - cur_thresh = prob_thresholds[3]; - break; - case BLOCK_128X128: - nn_config = &av1_rect_partition_nnconfig_128; - cur_thresh = prob_thresholds[4]; - break; - default: assert(0 && "Unexpected bsize."); - } - if (!nn_config) return; - aom_clear_system_state(); - - // 1. Compute input features - float features[9]; - - // RD cost ratios - for (int i = 0; i < 5; i++) features[i] = 1.0f; - if (none_rd > 0 && none_rd < 1000000000) - features[0] = (float)none_rd / (float)best_rd; - for (int i = 0; i < 4; i++) { - if (split_rd[i] > 0 && split_rd[i] < 1000000000) - features[1 + i] = (float)split_rd[i] / (float)best_rd; - } - - // Variance ratios - const MACROBLOCKD *const xd = &x->e_mbd; - int whole_block_variance; - if (is_cur_buf_hbd(xd)) { - whole_block_variance = av1_high_get_sby_perpixel_variance( - cpi, &x->plane[0].src, bsize, xd->bd); - } else { - whole_block_variance = - av1_get_sby_perpixel_variance(cpi, &x->plane[0].src, bsize); - } - whole_block_variance = AOMMAX(whole_block_variance, 1); - - int split_variance[4]; - const BLOCK_SIZE subsize = get_partition_subsize(bsize, PARTITION_SPLIT); - struct buf_2d buf; - buf.stride = x->plane[0].src.stride; - const int bw = block_size_wide[bsize]; - for (int i = 0; i < 4; ++i) { - const int x_idx = (i & 1) * bw / 2; - const int y_idx = (i >> 1) * bw / 2; - buf.buf = x->plane[0].src.buf + x_idx + y_idx * buf.stride; - if (is_cur_buf_hbd(xd)) { - split_variance[i] = - av1_high_get_sby_perpixel_variance(cpi, &buf, subsize, xd->bd); - } else { - split_variance[i] = av1_get_sby_perpixel_variance(cpi, &buf, subsize); - } - } - - for (int i = 0; i < 4; i++) - features[5 + i] = (float)split_variance[i] / (float)whole_block_variance; - - // 2. Do the prediction and prune 0-2 partitions based on their probabilities - float raw_scores[3] = { 0.0f }; - av1_nn_predict(features, nn_config, raw_scores); - aom_clear_system_state(); - float probs[3] = { 0.0f }; - av1_nn_softmax(raw_scores, probs, 3); - - // probs[0] is the probability of the fact that both rectangular partitions - // are worse than current best_rd - if (probs[1] <= cur_thresh) (*dst_prune_horz) = 1; - if (probs[2] <= cur_thresh) (*dst_prune_vert) = 1; -} - -// Use a ML model to predict if horz_a, horz_b, vert_a, and vert_b should be -// considered. -static void ml_prune_ab_partition(BLOCK_SIZE bsize, int part_ctx, int var_ctx, - int64_t best_rd, int64_t horz_rd[2], - int64_t vert_rd[2], int64_t split_rd[4], - int *const horza_partition_allowed, - int *const horzb_partition_allowed, - int *const verta_partition_allowed, - int *const vertb_partition_allowed) { - if (bsize < BLOCK_8X8 || best_rd >= 1000000000) return; - const NN_CONFIG *nn_config = NULL; - switch (bsize) { - case BLOCK_8X8: nn_config = NULL; break; - case BLOCK_16X16: nn_config = &av1_ab_partition_nnconfig_16; break; - case BLOCK_32X32: nn_config = &av1_ab_partition_nnconfig_32; break; - case BLOCK_64X64: nn_config = &av1_ab_partition_nnconfig_64; break; - case BLOCK_128X128: nn_config = &av1_ab_partition_nnconfig_128; break; - default: assert(0 && "Unexpected bsize."); - } - if (!nn_config) return; - - aom_clear_system_state(); - - // Generate features. - float features[10]; - int feature_index = 0; - features[feature_index++] = (float)part_ctx; - features[feature_index++] = (float)var_ctx; - const int rdcost = (int)AOMMIN(INT_MAX, best_rd); - int sub_block_rdcost[8] = { 0 }; - int rd_index = 0; - for (int i = 0; i < 2; ++i) { - if (horz_rd[i] > 0 && horz_rd[i] < 1000000000) - sub_block_rdcost[rd_index] = (int)horz_rd[i]; - ++rd_index; - } - for (int i = 0; i < 2; ++i) { - if (vert_rd[i] > 0 && vert_rd[i] < 1000000000) - sub_block_rdcost[rd_index] = (int)vert_rd[i]; - ++rd_index; - } - for (int i = 0; i < 4; ++i) { - if (split_rd[i] > 0 && split_rd[i] < 1000000000) - sub_block_rdcost[rd_index] = (int)split_rd[i]; - ++rd_index; - } - for (int i = 0; i < 8; ++i) { - // Ratio between the sub-block RD and the whole-block RD. - float rd_ratio = 1.0f; - if (sub_block_rdcost[i] > 0 && sub_block_rdcost[i] < rdcost) - rd_ratio = (float)sub_block_rdcost[i] / (float)rdcost; - features[feature_index++] = rd_ratio; - } - assert(feature_index == 10); - - // Calculate scores using the NN model. - float score[16] = { 0.0f }; - av1_nn_predict(features, nn_config, score); - aom_clear_system_state(); - int int_score[16]; - int max_score = -1000; - for (int i = 0; i < 16; ++i) { - int_score[i] = (int)(100 * score[i]); - max_score = AOMMAX(int_score[i], max_score); - } - - // Make decisions based on the model scores. - int thresh = max_score; - switch (bsize) { - case BLOCK_16X16: thresh -= 150; break; - case BLOCK_32X32: thresh -= 100; break; - default: break; - } - *horza_partition_allowed = 0; - *horzb_partition_allowed = 0; - *verta_partition_allowed = 0; - *vertb_partition_allowed = 0; - for (int i = 0; i < 16; ++i) { - if (int_score[i] >= thresh) { - if ((i >> 0) & 1) *horza_partition_allowed = 1; - if ((i >> 1) & 1) *horzb_partition_allowed = 1; - if ((i >> 2) & 1) *verta_partition_allowed = 1; - if ((i >> 3) & 1) *vertb_partition_allowed = 1; - } - } -} - -#define FEATURES 18 -#define LABELS 4 -// Use a ML model to predict if horz4 and vert4 should be considered. -static void ml_prune_4_partition(const AV1_COMP *const cpi, MACROBLOCK *const x, - BLOCK_SIZE bsize, int part_ctx, - int64_t best_rd, int64_t horz_rd[2], - int64_t vert_rd[2], int64_t split_rd[4], - int *const partition_horz4_allowed, - int *const partition_vert4_allowed, - unsigned int pb_source_variance, int mi_row, - int mi_col) { - if (best_rd >= 1000000000) return; - const NN_CONFIG *nn_config = NULL; - switch (bsize) { - case BLOCK_16X16: nn_config = &av1_4_partition_nnconfig_16; break; - case BLOCK_32X32: nn_config = &av1_4_partition_nnconfig_32; break; - case BLOCK_64X64: nn_config = &av1_4_partition_nnconfig_64; break; - default: assert(0 && "Unexpected bsize."); - } - if (!nn_config) return; - - aom_clear_system_state(); - - // Generate features. - float features[FEATURES]; - int feature_index = 0; - features[feature_index++] = (float)part_ctx; - features[feature_index++] = (float)get_unsigned_bits(pb_source_variance); - - const int rdcost = (int)AOMMIN(INT_MAX, best_rd); - int sub_block_rdcost[8] = { 0 }; - int rd_index = 0; - for (int i = 0; i < 2; ++i) { - if (horz_rd[i] > 0 && horz_rd[i] < 1000000000) - sub_block_rdcost[rd_index] = (int)horz_rd[i]; - ++rd_index; - } - for (int i = 0; i < 2; ++i) { - if (vert_rd[i] > 0 && vert_rd[i] < 1000000000) - sub_block_rdcost[rd_index] = (int)vert_rd[i]; - ++rd_index; - } - for (int i = 0; i < 4; ++i) { - if (split_rd[i] > 0 && split_rd[i] < 1000000000) - sub_block_rdcost[rd_index] = (int)split_rd[i]; - ++rd_index; - } - for (int i = 0; i < 8; ++i) { - // Ratio between the sub-block RD and the whole-block RD. - float rd_ratio = 1.0f; - if (sub_block_rdcost[i] > 0 && sub_block_rdcost[i] < rdcost) - rd_ratio = (float)sub_block_rdcost[i] / (float)rdcost; - features[feature_index++] = rd_ratio; - } - - // Get variance of the 1:4 and 4:1 sub-blocks. - unsigned int horz_4_source_var[4] = { 0 }; - unsigned int vert_4_source_var[4] = { 0 }; - { - BLOCK_SIZE horz_4_bs = get_partition_subsize(bsize, PARTITION_HORZ_4); - BLOCK_SIZE vert_4_bs = get_partition_subsize(bsize, PARTITION_VERT_4); - av1_setup_src_planes(x, cpi->source, mi_row, mi_col, - av1_num_planes(&cpi->common), bsize); - const int src_stride = x->plane[0].src.stride; - const uint8_t *src = x->plane[0].src.buf; - const MACROBLOCKD *const xd = &x->e_mbd; - for (int i = 0; i < 4; ++i) { - const uint8_t *horz_src = - src + i * block_size_high[horz_4_bs] * src_stride; - const uint8_t *vert_src = src + i * block_size_wide[vert_4_bs]; - unsigned int horz_var, vert_var, sse; - if (is_cur_buf_hbd(xd)) { - switch (xd->bd) { - case 10: - horz_var = cpi->fn_ptr[horz_4_bs].vf( - horz_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_10), - 0, &sse); - vert_var = cpi->fn_ptr[vert_4_bs].vf( - vert_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_10), - 0, &sse); - break; - case 12: - horz_var = cpi->fn_ptr[horz_4_bs].vf( - horz_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_12), - 0, &sse); - vert_var = cpi->fn_ptr[vert_4_bs].vf( - vert_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_12), - 0, &sse); - break; - case 8: - default: - horz_var = cpi->fn_ptr[horz_4_bs].vf( - horz_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_8), - 0, &sse); - vert_var = cpi->fn_ptr[vert_4_bs].vf( - vert_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_8), - 0, &sse); - break; - } - horz_4_source_var[i] = - ROUND_POWER_OF_TWO(horz_var, num_pels_log2_lookup[horz_4_bs]); - vert_4_source_var[i] = - ROUND_POWER_OF_TWO(vert_var, num_pels_log2_lookup[vert_4_bs]); - } else { - horz_var = cpi->fn_ptr[horz_4_bs].vf(horz_src, src_stride, AV1_VAR_OFFS, - 0, &sse); - vert_var = cpi->fn_ptr[vert_4_bs].vf(vert_src, src_stride, AV1_VAR_OFFS, - 0, &sse); - horz_4_source_var[i] = - ROUND_POWER_OF_TWO(horz_var, num_pels_log2_lookup[horz_4_bs]); - vert_4_source_var[i] = - ROUND_POWER_OF_TWO(vert_var, num_pels_log2_lookup[vert_4_bs]); - } - } - } - - const float denom = (float)(pb_source_variance + 1); - const float low_b = 0.1f; - const float high_b = 10.0f; - for (int i = 0; i < 4; ++i) { - // Ratio between the 4:1 sub-block variance and the whole-block variance. - float var_ratio = (float)(horz_4_source_var[i] + 1) / denom; - if (var_ratio < low_b) var_ratio = low_b; - if (var_ratio > high_b) var_ratio = high_b; - features[feature_index++] = var_ratio; - } - for (int i = 0; i < 4; ++i) { - // Ratio between the 1:4 sub-block RD and the whole-block RD. - float var_ratio = (float)(vert_4_source_var[i] + 1) / denom; - if (var_ratio < low_b) var_ratio = low_b; - if (var_ratio > high_b) var_ratio = high_b; - features[feature_index++] = var_ratio; - } - assert(feature_index == FEATURES); - - // Calculate scores using the NN model. - float score[LABELS] = { 0.0f }; - av1_nn_predict(features, nn_config, score); - aom_clear_system_state(); - int int_score[LABELS]; - int max_score = -1000; - for (int i = 0; i < LABELS; ++i) { - int_score[i] = (int)(100 * score[i]); - max_score = AOMMAX(int_score[i], max_score); - } - - // Make decisions based on the model scores. - int thresh = max_score; - switch (bsize) { - case BLOCK_16X16: thresh -= 500; break; - case BLOCK_32X32: thresh -= 500; break; - case BLOCK_64X64: thresh -= 200; break; - default: break; - } - *partition_horz4_allowed = 0; - *partition_vert4_allowed = 0; - for (int i = 0; i < LABELS; ++i) { - if (int_score[i] >= thresh) { - if ((i >> 0) & 1) *partition_horz4_allowed = 1; - if ((i >> 1) & 1) *partition_vert4_allowed = 1; - } - } -} -#undef FEATURES -#undef LABELS - -#define FEATURES 4 -// ML-based partition search breakout. -static int ml_predict_breakout(const AV1_COMP *const cpi, BLOCK_SIZE bsize, - const MACROBLOCK *const x, - const RD_STATS *const rd_stats, - unsigned int pb_source_variance) { - const NN_CONFIG *nn_config = NULL; - int thresh = 0; - switch (bsize) { - case BLOCK_8X8: - nn_config = &av1_partition_breakout_nnconfig_8; - thresh = cpi->sf.ml_partition_search_breakout_thresh[0]; - break; - case BLOCK_16X16: - nn_config = &av1_partition_breakout_nnconfig_16; - thresh = cpi->sf.ml_partition_search_breakout_thresh[1]; - break; - case BLOCK_32X32: - nn_config = &av1_partition_breakout_nnconfig_32; - thresh = cpi->sf.ml_partition_search_breakout_thresh[2]; - break; - case BLOCK_64X64: - nn_config = &av1_partition_breakout_nnconfig_64; - thresh = cpi->sf.ml_partition_search_breakout_thresh[3]; - break; - case BLOCK_128X128: - nn_config = &av1_partition_breakout_nnconfig_128; - thresh = cpi->sf.ml_partition_search_breakout_thresh[4]; - break; - default: assert(0 && "Unexpected bsize."); - } - if (!nn_config || thresh < 0) return 0; - - // Generate feature values. - float features[FEATURES]; - int feature_index = 0; - aom_clear_system_state(); - - const int num_pels_log2 = num_pels_log2_lookup[bsize]; - float rate_f = (float)AOMMIN(rd_stats->rate, INT_MAX); - rate_f = ((float)x->rdmult / 128.0f / 512.0f / (float)(1 << num_pels_log2)) * - rate_f; - features[feature_index++] = rate_f; - - const float dist_f = - (float)(AOMMIN(rd_stats->dist, INT_MAX) >> num_pels_log2); - features[feature_index++] = dist_f; - - features[feature_index++] = (float)pb_source_variance; - - const int dc_q = (int)x->plane[0].dequant_QTX[0]; - features[feature_index++] = (float)(dc_q * dc_q) / 256.0f; - assert(feature_index == FEATURES); - - // Calculate score using the NN model. - float score = 0.0f; - av1_nn_predict(features, nn_config, &score); - aom_clear_system_state(); - - // Make decision. - return (int)(score * 100) >= thresh; -} -#undef FEATURES - -static void update_picked_ref_frames_mask(MACROBLOCK *const x, int ref_type, - BLOCK_SIZE bsize, int mib_size, - int mi_row, int mi_col) { +static AOM_INLINE void update_picked_ref_frames_mask(MACROBLOCK *const x, + int ref_type, + BLOCK_SIZE bsize, + int mib_size, int mi_row, + int mi_col) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
pc_tree->pc_tree_stats.sub_block_rdcost[i] = INT64_MAX; } if (bsize >= BLOCK_8X8) { BLOCK_SIZE subsize = get_partition_subsize(bsize, PARTITION_SPLIT); for (int idx = 0; idx < 4; ++idx) reset_partition(pc_tree->split[idx], subsize); } }
+ show +
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
static void rd_pick_sqr_partition(AV1_COMP *const cpi, ThreadData *td, TileDataEnc *tile_data, TOKENEXTRA **tp, int mi_row, int mi_col, BLOCK_SIZE bsize, RD_STATS *rd_cost, int64_t best_rd, PC_TREE *pc_tree, int64_t *none_rd) { const AV1_COMMON *const cm = &cpi->common; TileInfo *const tile_info = &tile_data->tile_info; MACROBLOCK *const x = &td->mb; MACROBLOCKD *const xd = &x->e_mbd; const int mi_step = mi_size_wide[bsize] / 2; RD_SEARCH_MACROBLOCK_CONTEXT x_ctx; const TOKENEXTRA *const tp_orig = *tp; PICK_MODE_CONTEXT *ctx_none = &pc_tree->none; int tmp_partition_cost[PARTITION_TYPES]; BLOCK_SIZE subsize; RD_STATS this_rdc, sum_rdc, best_rdc, pn_rdc; const int bsize_at_least_8x8 = (bsize >= BLOCK_8X8); int do_square_split = bsize_at_least_8x8; const int pl = bsize_at_least_8x8 ? partition_plane_context(xd, mi_row, mi_col, bsize) : 0; const int *partition_cost = pl >= 0 ? x->partition_cost[pl] : x->partition_cost[0]; const int num_planes = av1_num_planes(cm); int64_t split_rd[4] = { 0, 0, 0, 0 }; // Override skipping rectangular partition operations for edge blocks const int has_rows = (mi_row + mi_step < cm->mi_rows); const int has_cols = (mi_col + mi_step < cm->mi_cols); if (none_rd) *none_rd = 0; int partition_none_allowed = has_rows && has_cols; (void)*tp_orig; (void)split_rd; if (best_rd < 0) { pc_tree->none.rdcost = INT64_MAX; pc_tree->none.skip = 0; av1_invalid_rd_stats(rd_cost); return; } pc_tree->pc_tree_stats.valid = 1; // Override partition costs at the edges of the frame in the same // way as in read_partition (see decodeframe.c) if (!(has_rows && has_cols)) { assert(bsize_at_least_8x8 && pl >= 0); const aom_cdf_prob *partition_cdf = cm->fc->partition_cdf[pl]; for (int i = 0; i < PARTITION_TYPES; ++i) tmp_partition_cost[i] = INT_MAX; if (has_cols) { // At the bottom, the two possibilities are HORZ and SPLIT aom_cdf_prob bot_cdf[2]; partition_gather_vert_alike(bot_cdf, partition_cdf, bsize); static const int bot_inv_map[2] = { PARTITION_HORZ, PARTITION_SPLIT }; av1_cost_tokens_from_cdf(tmp_partition_cost, bot_cdf, bot_inv_map); } else if (has_rows) { // At the right, the two possibilities are VERT and SPLIT aom_cdf_prob rhs_cdf[2]; partition_gather_horz_alike(rhs_cdf, partition_cdf, bsize); static const int rhs_inv_map[2] = { PARTITION_VERT, PARTITION_SPLIT }; av1_cost_tokens_from_cdf(tmp_partition_cost, rhs_cdf, rhs_inv_map); } else { // At the bottom right, we always split tmp_partition_cost[PARTITION_SPLIT] = 0; } partition_cost = tmp_partition_cost; } #ifndef NDEBUG // Nothing should rely on the default value of this array (which is just // leftover from encoding the previous block. Setting it to fixed pattern // when debugging. // bit 0, 1, 2 are blk_skip of each plane // bit 4, 5, 6 are initialization checking of each plane memset(x->blk_skip, 0x77, sizeof(x->blk_skip)); #endif // NDEBUG assert(mi_size_wide[bsize] == mi_size_high[bsize]); av1_init_rd_stats(&this_rdc); av1_init_rd_stats(&sum_rdc); av1_invalid_rd_stats(&best_rdc); best_rdc.rdcost = best_rd; set_offsets(cpi, tile_info, x, mi_row, mi_col, bsize); if (bsize == BLOCK_16X16 && cpi->vaq_refresh) x->mb_energy = av1_log_block_var(cpi, x, bsize); xd->above_txfm_context = cm->above_txfm_context[tile_info->tile_row] + mi_col; xd->left_txfm_context = xd->left_txfm_context_buffer + (mi_row & MAX_MIB_MASK); save_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); #if CONFIG_DIST_8X8 if (x->using_dist_8x8) { if (block_size_high[bsize] <= 8 || block_size_wide[bsize] <= 8) do_square_split = 0; } #endif // PARTITION_NONE if (partition_none_allowed) { int pt_cost = 0; if (bsize_at_least_8x8) { pc_tree->partitioning = PARTITION_NONE; pt_cost = partition_cost[PARTITION_NONE] < INT_MAX ? partition_cost[PARTITION_NONE] : 0; } const int64_t partition_rd_cost = RDCOST(x->rdmult, pt_cost, 0); const int64_t best_remain_rdcost = best_rdc.rdcost == INT64_MAX ? INT64_MAX : (best_rdc.rdcost - partition_rd_cost); pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, &this_rdc, PARTITION_NONE, bsize, ctx_none, best_remain_rdcost, 0); pc_tree->pc_tree_stats.rdcost = ctx_none->rdcost; pc_tree->pc_tree_stats.skip = ctx_none->skip; if (none_rd) *none_rd = this_rdc.rdcost; if (this_rdc.rate != INT_MAX) { if (bsize_at_least_8x8) { this_rdc.rate += pt_cost; this_rdc.rdcost = RDCOST(x->rdmult, this_rdc.rate, this_rdc.dist); } if (this_rdc.rdcost < best_rdc.rdcost) { // Adjust dist breakout threshold according to the partition size. const int64_t dist_breakout_thr = cpi->sf.partition_search_breakout_dist_thr >> ((2 * (MAX_SB_SIZE_LOG2 - 2)) - (mi_size_wide_log2[bsize] + mi_size_high_log2[bsize])); const int rate_breakout_thr = cpi->sf.partition_search_breakout_rate_thr * num_pels_log2_lookup[bsize]; best_rdc = this_rdc; if (bsize_at_least_8x8) pc_tree->partitioning = PARTITION_NONE; pc_tree->cb_search_range = SEARCH_FULL_PLANE; if (!x->e_mbd.lossless[xd->mi[0]->segment_id] && ctx_none->skippable) { const int use_ml_based_breakout = bsize <= cpi->sf.use_square_partition_only_threshold && bsize > BLOCK_4X4 && xd->bd == 8; // TODO(anyone): Currently this is using the same model and threshold // values as in rd_pick_partition. Retraining the model and tuning the // threshold values might be helpful to improve the speed. if (use_ml_based_breakout) { if (ml_predict_breakout(cpi, bsize, x, &this_rdc, x->source_variance)) { do_square_split = 0; } } // If all y, u, v transform blocks in this partition are skippable, // and the dist & rate are within the thresholds, the partition search // is terminated for current branch of the partition search tree. The // dist & rate thresholds are set to 0 at speed 0 to disable the early // termination at that speed. if (best_rdc.dist < dist_breakout_thr && best_rdc.rate < rate_breakout_thr) { do_square_split = 0; } } if (cpi->sf.firstpass_simple_motion_search_early_term && cm->show_frame && bsize <= BLOCK_32X32 && bsize >= BLOCK_8X8 && !frame_is_intra_only(cm) && mi_row + mi_step < cm->mi_rows && mi_col + mi_step < cm->mi_cols && this_rdc.rdcost < INT64_MAX && this_rdc.rdcost >= 0 && this_rdc.rate < INT_MAX && this_rdc.rate >= 0 && do_square_split) { av1_firstpass_simple_motion_search_early_term( cpi, x, pc_tree, mi_row, mi_col, bsize, &this_rdc, &do_square_split); } } } restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); } // store estimated motion vector if (cpi->sf.adaptive_motion_search) store_pred_mv(x, ctx_none); int64_t temp_best_rdcost = best_rdc.rdcost; pn_rdc = best_rdc; // PARTITION_SPLIT if (do_square_split) { int reached_last_index = 0; subsize = get_partition_subsize(bsize, PARTITION_SPLIT); int idx; sum_rdc.rate = partition_cost[PARTITION_SPLIT]; sum_rdc.rdcost = RDCOST(x->rdmult, sum_rdc.rate, 0); for (idx = 0; idx < 4 && sum_rdc.rdcost < temp_best_rdcost; ++idx) { const int x_idx = (idx & 1) * mi_step; const int y_idx = (idx >> 1) * mi_step; if (mi_row + y_idx >= cm->mi_rows || mi_col + x_idx >= cm->mi_cols) continue; if (cpi->sf.adaptive_motion_search) load_pred_mv(x, ctx_none); pc_tree->split[idx]->index = idx; int64_t *p_split_rd = &split_rd[idx]; const int64_t best_remain_rdcost = (temp_best_rdcost == INT64_MAX) ? INT64_MAX : (temp_best_rdcost - sum_rdc.rdcost); rd_pick_sqr_partition( cpi, td, tile_data, tp, mi_row + y_idx, mi_col + x_idx, subsize, &this_rdc, best_remain_rdcost, pc_tree->split[idx], p_split_rd); pc_tree->pc_tree_stats.sub_block_rdcost[idx] = this_rdc.rdcost; pc_tree->pc_tree_stats.sub_block_skip[idx] = pc_tree->split[idx]->none.skip; if (this_rdc.rate == INT_MAX) { sum_rdc.rdcost = INT64_MAX; break; } else { sum_rdc.rate += this_rdc.rate; sum_rdc.dist += this_rdc.dist; sum_rdc.rdcost += this_rdc.rdcost; } } reached_last_index = (idx == 4); if (reached_last_index && sum_rdc.rdcost < best_rdc.rdcost) { sum_rdc.rdcost = RDCOST(x->rdmult, sum_rdc.rate, sum_rdc.dist); if (sum_rdc.rdcost < best_rdc.rdcost) { best_rdc = sum_rdc; pc_tree->partitioning = PARTITION_SPLIT; } } int has_split = 0; if (pc_tree->partitioning == PARTITION_SPLIT) { for (int cb_idx = 0; cb_idx <= AOMMIN(idx, 3); ++cb_idx) { if (pc_tree->split[cb_idx]->partitioning == PARTITION_SPLIT) ++has_split; } if (has_split >= 3 || sum_rdc.rdcost < (pn_rdc.rdcost >> 1)) { pc_tree->cb_search_range = SPLIT_PLANE; } } if (pc_tree->partitioning == PARTITION_NONE) { pc_tree->cb_search_range = SEARCH_SAME_PLANE; if (pn_rdc.dist <= sum_rdc.dist) pc_tree->cb_search_range = NONE_PARTITION_PLANE; } if (pn_rdc.rate == INT_MAX) pc_tree->cb_search_range = NONE_PARTITION_PLANE; restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); } // if (do_split) pc_tree->pc_tree_stats.split = pc_tree->partitioning == PARTITION_SPLIT; if (do_square_split) { for (int i = 0; i < 4; ++i) { pc_tree->pc_tree_stats.sub_block_split[i] = pc_tree->split[i]->partitioning == PARTITION_SPLIT; } } // TODO(jbb): This code added so that we avoid static analysis // warning related to the fact that best_rd isn't used after this // point. This code should be refactored so that the duplicate // checks occur in some sub function and thus are used... (void)best_rd; *rd_cost = best_rdc; if (best_rdc.rate < INT_MAX && best_rdc.dist < INT64_MAX && pc_tree->index != 3) { if (bsize == cm->seq_params.sb_size) { restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); } else { encode_sb(cpi, td, tile_data, tp, mi_row, mi_col, DRY_RUN_NORMAL, bsize, pc_tree, NULL); } } if (bsize == cm->seq_params.sb_size) { assert(best_rdc.rate < INT_MAX); assert(best_rdc.dist < INT64_MAX); } else { assert(tp_orig == *tp); } } // split_score indicates confidence of picking split partition; // none_score indicates confidence of picking none partition; #define FEATURE_SIZE 19 static int ml_prune_2pass_split_partition(const PC_TREE_STATS *pc_tree_stats, BLOCK_SIZE bsize, int *split_score, int *none_score) { if (!pc_tree_stats->valid) return 0; const float *split_weights = NULL; const float *none_weights = NULL; switch (bsize) { case BLOCK_4X4: break; case BLOCK_8X8: split_weights = av1_2pass_split_partition_weights_8; none_weights = av1_2pass_none_partition_weights_8; break; case BLOCK_16X16: split_weights = av1_2pass_split_partition_weights_16; none_weights = av1_2pass_none_partition_weights_16; break; case BLOCK_32X32: split_weights = av1_2pass_split_partition_weights_32; none_weights = av1_2pass_none_partition_weights_32; break; case BLOCK_64X64: split_weights = av1_2pass_split_partition_weights_64; none_weights = av1_2pass_none_partition_weights_64; break; case BLOCK_128X128: split_weights = av1_2pass_split_partition_weights_128; none_weights = av1_2pass_none_partition_weights_128; break; default: assert(0 && "Unexpected bsize."); } if (!split_weights || !none_weights) return 0; aom_clear_system_state(); float features[FEATURE_SIZE]; int feature_index = 0; features[feature_index++] = (float)pc_tree_stats->split; features[feature_index++] = (float)pc_tree_stats->skip; const int rdcost = (int)AOMMIN(INT_MAX, pc_tree_stats->rdcost); const int rd_valid = rdcost > 0 && rdcost < 1000000000; features[feature_index++] = (float)rd_valid; for (int i = 0; i < 4; ++i) { features[feature_index++] = (float)pc_tree_stats->sub_block_split[i]; features[feature_index++] = (float)pc_tree_stats->sub_block_skip[i]; const int sub_rdcost = (int)AOMMIN(INT_MAX, pc_tree_stats->sub_block_rdcost[i]); const int sub_rd_valid = sub_rdcost > 0 && sub_rdcost < 1000000000; features[feature_index++] = (float)sub_rd_valid; // Ratio between the sub-block RD and the whole-block RD. float rd_ratio = 1.0f; if (rd_valid && sub_rd_valid && sub_rdcost < rdcost) rd_ratio = (float)sub_rdcost / (float)rdcost; features[feature_index++] = rd_ratio; } assert(feature_index == FEATURE_SIZE); float score_1 = split_weights[FEATURE_SIZE]; float score_2 = none_weights[FEATURE_SIZE]; for (int i = 0; i < FEATURE_SIZE; ++i) { score_1 += features[i] * split_weights[i]; score_2 += features[i] * none_weights[i]; } *split_score = (int)(score_1 * 100); *none_score = (int)(score_2 * 100); return 1; } #undef FEATURE_SIZE static void ml_prune_rect_partition(const AV1_COMP *const cpi, const MACROBLOCK *const x, BLOCK_SIZE bsize, int64_t best_rd, int64_t none_rd, int64_t *split_rd, int *const dst_prune_horz, int *const dst_prune_vert) { if (bsize < BLOCK_8X8 || best_rd >= 1000000000) return; best_rd = AOMMAX(best_rd, 1); const NN_CONFIG *nn_config = NULL; const float prob_thresholds[5] = { 0.01f, 0.01f, 0.004f, 0.002f, 0.002f }; float cur_thresh = 0.0f; switch (bsize) { case BLOCK_8X8: nn_config = &av1_rect_partition_nnconfig_8; cur_thresh = prob_thresholds[0]; break; case BLOCK_16X16: nn_config = &av1_rect_partition_nnconfig_16; cur_thresh = prob_thresholds[1]; break; case BLOCK_32X32: nn_config = &av1_rect_partition_nnconfig_32; cur_thresh = prob_thresholds[2]; break; case BLOCK_64X64: nn_config = &av1_rect_partition_nnconfig_64; cur_thresh = prob_thresholds[3]; break; case BLOCK_128X128: nn_config = &av1_rect_partition_nnconfig_128; cur_thresh = prob_thresholds[4]; break; default: assert(0 && "Unexpected bsize."); } if (!nn_config) return; aom_clear_system_state(); // 1. Compute input features float features[9]; // RD cost ratios for (int i = 0; i < 5; i++) features[i] = 1.0f; if (none_rd > 0 && none_rd < 1000000000) features[0] = (float)none_rd / (float)best_rd; for (int i = 0; i < 4; i++) { if (split_rd[i] > 0 && split_rd[i] < 1000000000) features[1 + i] = (float)split_rd[i] / (float)best_rd; } // Variance ratios const MACROBLOCKD *const xd = &x->e_mbd; int whole_block_variance; if (is_cur_buf_hbd(xd)) { whole_block_variance = av1_high_get_sby_perpixel_variance( cpi, &x->plane[0].src, bsize, xd->bd); } else { whole_block_variance = av1_get_sby_perpixel_variance(cpi, &x->plane[0].src, bsize); } whole_block_variance = AOMMAX(whole_block_variance, 1); int split_variance[4]; const BLOCK_SIZE subsize = get_partition_subsize(bsize, PARTITION_SPLIT); struct buf_2d buf; buf.stride = x->plane[0].src.stride; const int bw = block_size_wide[bsize]; for (int i = 0; i < 4; ++i) { const int x_idx = (i & 1) * bw / 2; const int y_idx = (i >> 1) * bw / 2; buf.buf = x->plane[0].src.buf + x_idx + y_idx * buf.stride; if (is_cur_buf_hbd(xd)) { split_variance[i] = av1_high_get_sby_perpixel_variance(cpi, &buf, subsize, xd->bd); } else { split_variance[i] = av1_get_sby_perpixel_variance(cpi, &buf, subsize); } } for (int i = 0; i < 4; i++) features[5 + i] = (float)split_variance[i] / (float)whole_block_variance; // 2. Do the prediction and prune 0-2 partitions based on their probabilities float raw_scores[3] = { 0.0f }; av1_nn_predict(features, nn_config, raw_scores); aom_clear_system_state(); float probs[3] = { 0.0f }; av1_nn_softmax(raw_scores, probs, 3); // probs[0] is the probability of the fact that both rectangular partitions // are worse than current best_rd if (probs[1] <= cur_thresh) (*dst_prune_horz) = 1; if (probs[2] <= cur_thresh) (*dst_prune_vert) = 1; } // Use a ML model to predict if horz_a, horz_b, vert_a, and vert_b should be // considered. static void ml_prune_ab_partition(BLOCK_SIZE bsize, int part_ctx, int var_ctx, int64_t best_rd, int64_t horz_rd[2], int64_t vert_rd[2], int64_t split_rd[4], int *const horza_partition_allowed, int *const horzb_partition_allowed, int *const verta_partition_allowed, int *const vertb_partition_allowed) { if (bsize < BLOCK_8X8 || best_rd >= 1000000000) return; const NN_CONFIG *nn_config = NULL; switch (bsize) { case BLOCK_8X8: nn_config = NULL; break; case BLOCK_16X16: nn_config = &av1_ab_partition_nnconfig_16; break; case BLOCK_32X32: nn_config = &av1_ab_partition_nnconfig_32; break; case BLOCK_64X64: nn_config = &av1_ab_partition_nnconfig_64; break; case BLOCK_128X128: nn_config = &av1_ab_partition_nnconfig_128; break; default: assert(0 && "Unexpected bsize."); } if (!nn_config) return; aom_clear_system_state(); // Generate features. float features[10]; int feature_index = 0; features[feature_index++] = (float)part_ctx; features[feature_index++] = (float)var_ctx; const int rdcost = (int)AOMMIN(INT_MAX, best_rd); int sub_block_rdcost[8] = { 0 }; int rd_index = 0; for (int i = 0; i < 2; ++i) { if (horz_rd[i] > 0 && horz_rd[i] < 1000000000) sub_block_rdcost[rd_index] = (int)horz_rd[i]; ++rd_index; } for (int i = 0; i < 2; ++i) { if (vert_rd[i] > 0 && vert_rd[i] < 1000000000) sub_block_rdcost[rd_index] = (int)vert_rd[i]; ++rd_index; } for (int i = 0; i < 4; ++i) { if (split_rd[i] > 0 && split_rd[i] < 1000000000) sub_block_rdcost[rd_index] = (int)split_rd[i]; ++rd_index; } for (int i = 0; i < 8; ++i) { // Ratio between the sub-block RD and the whole-block RD. float rd_ratio = 1.0f; if (sub_block_rdcost[i] > 0 && sub_block_rdcost[i] < rdcost) rd_ratio = (float)sub_block_rdcost[i] / (float)rdcost; features[feature_index++] = rd_ratio; } assert(feature_index == 10); // Calculate scores using the NN model. float score[16] = { 0.0f }; av1_nn_predict(features, nn_config, score); aom_clear_system_state(); int int_score[16]; int max_score = -1000; for (int i = 0; i < 16; ++i) { int_score[i] = (int)(100 * score[i]); max_score = AOMMAX(int_score[i], max_score); } // Make decisions based on the model scores. int thresh = max_score; switch (bsize) { case BLOCK_16X16: thresh -= 150; break; case BLOCK_32X32: thresh -= 100; break; default: break; } *horza_partition_allowed = 0; *horzb_partition_allowed = 0; *verta_partition_allowed = 0; *vertb_partition_allowed = 0; for (int i = 0; i < 16; ++i) { if (int_score[i] >= thresh) { if ((i >> 0) & 1) *horza_partition_allowed = 1; if ((i >> 1) & 1) *horzb_partition_allowed = 1; if ((i >> 2) & 1) *verta_partition_allowed = 1; if ((i >> 3) & 1) *vertb_partition_allowed = 1; } } } #define FEATURES 18 #define LABELS 4 // Use a ML model to predict if horz4 and vert4 should be considered. static void ml_prune_4_partition(const AV1_COMP *const cpi, MACROBLOCK *const x, BLOCK_SIZE bsize, int part_ctx, int64_t best_rd, int64_t horz_rd[2], int64_t vert_rd[2], int64_t split_rd[4], int *const partition_horz4_allowed, int *const partition_vert4_allowed, unsigned int pb_source_variance, int mi_row, int mi_col) { if (best_rd >= 1000000000) return; const NN_CONFIG *nn_config = NULL; switch (bsize) { case BLOCK_16X16: nn_config = &av1_4_partition_nnconfig_16; break; case BLOCK_32X32: nn_config = &av1_4_partition_nnconfig_32; break; case BLOCK_64X64: nn_config = &av1_4_partition_nnconfig_64; break; default: assert(0 && "Unexpected bsize."); } if (!nn_config) return; aom_clear_system_state(); // Generate features. float features[FEATURES]; int feature_index = 0; features[feature_index++] = (float)part_ctx; features[feature_index++] = (float)get_unsigned_bits(pb_source_variance); const int rdcost = (int)AOMMIN(INT_MAX, best_rd); int sub_block_rdcost[8] = { 0 }; int rd_index = 0; for (int i = 0; i < 2; ++i) { if (horz_rd[i] > 0 && horz_rd[i] < 1000000000) sub_block_rdcost[rd_index] = (int)horz_rd[i]; ++rd_index; } for (int i = 0; i < 2; ++i) { if (vert_rd[i] > 0 && vert_rd[i] < 1000000000) sub_block_rdcost[rd_index] = (int)vert_rd[i]; ++rd_index; } for (int i = 0; i < 4; ++i) { if (split_rd[i] > 0 && split_rd[i] < 1000000000) sub_block_rdcost[rd_index] = (int)split_rd[i]; ++rd_index; } for (int i = 0; i < 8; ++i) { // Ratio between the sub-block RD and the whole-block RD. float rd_ratio = 1.0f; if (sub_block_rdcost[i] > 0 && sub_block_rdcost[i] < rdcost) rd_ratio = (float)sub_block_rdcost[i] / (float)rdcost; features[feature_index++] = rd_ratio; } // Get variance of the 1:4 and 4:1 sub-blocks. unsigned int horz_4_source_var[4] = { 0 }; unsigned int vert_4_source_var[4] = { 0 }; { BLOCK_SIZE horz_4_bs = get_partition_subsize(bsize, PARTITION_HORZ_4); BLOCK_SIZE vert_4_bs = get_partition_subsize(bsize, PARTITION_VERT_4); av1_setup_src_planes(x, cpi->source, mi_row, mi_col, av1_num_planes(&cpi->common), bsize); const int src_stride = x->plane[0].src.stride; const uint8_t *src = x->plane[0].src.buf; const MACROBLOCKD *const xd = &x->e_mbd; for (int i = 0; i < 4; ++i) { const uint8_t *horz_src = src + i * block_size_high[horz_4_bs] * src_stride; const uint8_t *vert_src = src + i * block_size_wide[vert_4_bs]; unsigned int horz_var, vert_var, sse; if (is_cur_buf_hbd(xd)) { switch (xd->bd) { case 10: horz_var = cpi->fn_ptr[horz_4_bs].vf( horz_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_10), 0, &sse); vert_var = cpi->fn_ptr[vert_4_bs].vf( vert_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_10), 0, &sse); break; case 12: horz_var = cpi->fn_ptr[horz_4_bs].vf( horz_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_12), 0, &sse); vert_var = cpi->fn_ptr[vert_4_bs].vf( vert_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_12), 0, &sse); break; case 8: default: horz_var = cpi->fn_ptr[horz_4_bs].vf( horz_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_8), 0, &sse); vert_var = cpi->fn_ptr[vert_4_bs].vf( vert_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_8), 0, &sse); break; } horz_4_source_var[i] = ROUND_POWER_OF_TWO(horz_var, num_pels_log2_lookup[horz_4_bs]); vert_4_source_var[i] = ROUND_POWER_OF_TWO(vert_var, num_pels_log2_lookup[vert_4_bs]); } else { horz_var = cpi->fn_ptr[horz_4_bs].vf(horz_src, src_stride, AV1_VAR_OFFS, 0, &sse); vert_var = cpi->fn_ptr[vert_4_bs].vf(vert_src, src_stride, AV1_VAR_OFFS, 0, &sse); horz_4_source_var[i] = ROUND_POWER_OF_TWO(horz_var, num_pels_log2_lookup[horz_4_bs]); vert_4_source_var[i] = ROUND_POWER_OF_TWO(vert_var, num_pels_log2_lookup[vert_4_bs]); } } } const float denom = (float)(pb_source_variance + 1); const float low_b = 0.1f; const float high_b = 10.0f; for (int i = 0; i < 4; ++i) { // Ratio between the 4:1 sub-block variance and the whole-block variance. float var_ratio = (float)(horz_4_source_var[i] + 1) / denom; if (var_ratio < low_b) var_ratio = low_b; if (var_ratio > high_b) var_ratio = high_b; features[feature_index++] = var_ratio; } for (int i = 0; i < 4; ++i) { // Ratio between the 1:4 sub-block RD and the whole-block RD. float var_ratio = (float)(vert_4_source_var[i] + 1) / denom; if (var_ratio < low_b) var_ratio = low_b; if (var_ratio > high_b) var_ratio = high_b; features[feature_index++] = var_ratio; } assert(feature_index == FEATURES); // Calculate scores using the NN model. float score[LABELS] = { 0.0f }; av1_nn_predict(features, nn_config, score); aom_clear_system_state(); int int_score[LABELS]; int max_score = -1000; for (int i = 0; i < LABELS; ++i) { int_score[i] = (int)(100 * score[i]); max_score = AOMMAX(int_score[i], max_score); } // Make decisions based on the model scores. int thresh = max_score; switch (bsize) { case BLOCK_16X16: thresh -= 500; break; case BLOCK_32X32: thresh -= 500; break; case BLOCK_64X64: thresh -= 200; break; default: break; } *partition_horz4_allowed = 0; *partition_vert4_allowed = 0; for (int i = 0; i < LABELS; ++i) { if (int_score[i] >= thresh) { if ((i >> 0) & 1) *partition_horz4_allowed = 1; if ((i >> 1) & 1) *partition_vert4_allowed = 1; } } } #undef FEATURES #undef LABELS #define FEATURES 4 // ML-based partition search breakout. static int ml_predict_breakout(const AV1_COMP *const cpi, BLOCK_SIZE bsize, const MACROBLOCK *const x, const RD_STATS *const rd_stats, unsigned int pb_source_variance) { const NN_CONFIG *nn_config = NULL; int thresh = 0; switch (bsize) { case BLOCK_8X8: nn_config = &av1_partition_breakout_nnconfig_8; thresh = cpi->sf.ml_partition_search_breakout_thresh[0]; break; case BLOCK_16X16: nn_config = &av1_partition_breakout_nnconfig_16; thresh = cpi->sf.ml_partition_search_breakout_thresh[1]; break; case BLOCK_32X32: nn_config = &av1_partition_breakout_nnconfig_32; thresh = cpi->sf.ml_partition_search_breakout_thresh[2]; break; case BLOCK_64X64: nn_config = &av1_partition_breakout_nnconfig_64; thresh = cpi->sf.ml_partition_search_breakout_thresh[3]; break; case BLOCK_128X128: nn_config = &av1_partition_breakout_nnconfig_128; thresh = cpi->sf.ml_partition_search_breakout_thresh[4]; break; default: assert(0 && "Unexpected bsize."); } if (!nn_config || thresh < 0) return 0; // Generate feature values. float features[FEATURES]; int feature_index = 0; aom_clear_system_state(); const int num_pels_log2 = num_pels_log2_lookup[bsize]; float rate_f = (float)AOMMIN(rd_stats->rate, INT_MAX); rate_f = ((float)x->rdmult / 128.0f / 512.0f / (float)(1 << num_pels_log2)) * rate_f; features[feature_index++] = rate_f; const float dist_f = (float)(AOMMIN(rd_stats->dist, INT_MAX) >> num_pels_log2); features[feature_index++] = dist_f; features[feature_index++] = (float)pb_source_variance; const int dc_q = (int)x->plane[0].dequant_QTX[0]; features[feature_index++] = (float)(dc_q * dc_q) / 256.0f; assert(feature_index == FEATURES); // Calculate score using the NN model. float score = 0.0f; av1_nn_predict(features, nn_config, &score); aom_clear_system_state(); // Make decision. return (int)(score * 100) >= thresh; } #undef FEATURES // Record the ref frames that have been selected by square partition blocks. static void update_picked_ref_frames_mask(MACROBLOCK *const x, int ref_type, BLOCK_SIZE bsize, int mib_size, int mi_row, int mi_col) {
+ show +
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
assert(mi_size_wide[bsize] == mi_size_high[bsize]); const int sb_size_mask = mib_size - 1; const int mi_row_in_sb = mi_row & sb_size_mask; const int mi_col_in_sb = mi_col & sb_size_mask; const int mi_size = mi_size_wide[bsize]; for (int i = mi_row_in_sb; i < mi_row_in_sb + mi_size; ++i) { for (int j = mi_col_in_sb; j < mi_col_in_sb + mi_size; ++j) { x->picked_ref_frames_mask[i * 32 + j] |= 1 << ref_type; } }

[CVE-2020-0478_1.diff] encodeframe.c #88
+ av1_rd_cost_update(x->rdmult, &sum_rdc); - sum_rdc.rdcost = RDCOST(x->rdmult, sum_rdc.rate, sum_rdc.dist); - if (sum_rdc.rdcost < best_rdc.rdcost) { - best_rdc = sum_rdc; - pc_tree->partitioning = PARTITION_VERT; + best_rdc = sum_rdc; + found_best_partition = true; + pc_tree->partitioning = PARTITION_VERT; + } else { + // Update VERT win flag + if (rect_part_win_info != NULL) { + rect_part_win_info->vert_win = false;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
#if CONFIG_COLLECT_PARTITION_STATS if (partition_timer_on) { aom_usec_timer_mark(&partition_timer); int64_t time = aom_usec_timer_elapsed(&partition_timer); partition_times[PARTITION_VERT] += time; partition_timer_on = 0; } #endif if (sum_rdc.rdcost < best_rdc.rdcost) {
+ show +
3745
3746
3747
3748
sum_rdc.rdcost = RDCOST(x->rdmult, sum_rdc.rate, sum_rdc.dist); if (sum_rdc.rdcost < best_rdc.rdcost) { best_rdc = sum_rdc; pc_tree->partitioning = PARTITION_VERT;
+ show +
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
} } restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); } if (pb_source_variance == UINT_MAX) { av1_setup_src_planes(x, cpi->source, mi_row, mi_col, num_planes, bsize); if (is_cur_buf_hbd(xd)) { pb_source_variance = av1_high_get_sby_perpixel_variance(

[CVE-2020-0478_1.diff] encodeframe.c #90
-#if CONFIG_DIST_8X8 - if (x->using_dist_8x8) { - if (block_size_high[bsize] <= 8 || block_size_wide[bsize] <= 8) { - horzab_partition_allowed = 0; - vertab_partition_allowed = 0; - } - } -#endif - - if (cpi->sf.prune_ext_partition_types_search_level) { - if (cpi->sf.prune_ext_partition_types_search_level == 1) { + if (cpi->sf.part_sf.prune_ext_partition_types_search_level) { + if (cpi->sf.part_sf.prune_ext_partition_types_search_level == 1) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
const int ext_partition_allowed = do_rectangular_split && bsize > BLOCK_8X8 && partition_none_allowed; // The standard AB partitions are allowed whenever ext-partition-types are // allowed int horzab_partition_allowed = ext_partition_allowed & cpi->oxcf.enable_ab_partitions; int vertab_partition_allowed = ext_partition_allowed & cpi->oxcf.enable_ab_partitions;
+ show +
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
#if CONFIG_DIST_8X8 if (x->using_dist_8x8) { if (block_size_high[bsize] <= 8 || block_size_wide[bsize] <= 8) { horzab_partition_allowed = 0; vertab_partition_allowed = 0; } } #endif if (cpi->sf.prune_ext_partition_types_search_level) { if (cpi->sf.prune_ext_partition_types_search_level == 1) {
+ show +
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
// TODO(debargha,huisu@google.com): may need to tune the threshold for // pb_source_variance. horzab_partition_allowed &= (pc_tree->partitioning == PARTITION_HORZ || (pc_tree->partitioning == PARTITION_NONE && pb_source_variance < 32) || pc_tree->partitioning == PARTITION_SPLIT); vertab_partition_allowed &= (pc_tree->partitioning == PARTITION_VERT || (pc_tree->partitioning == PARTITION_NONE && pb_source_variance < 32) || pc_tree->partitioning == PARTITION_SPLIT);

[CVE-2020-0478_1.diff] encodeframe.c #95
+ if (cpi->sf.part_sf.prune_ab_partition_using_split_info && + horza_partition_allowed) { + horza_partition_allowed &= evaluate_ab_partition_based_on_split( + pc_tree, PARTITION_HORZ, rect_part_win_info, x->qindex, 0, 1); + } + - rd_test_partition3(cpi, td, tile_data, tp, pc_tree, &best_rdc, - pc_tree->horizontala, ctx_none, mi_row, mi_col, bsize, - PARTITION_HORZ_A, mi_row, mi_col, bsize2, mi_row, - mi_col + mi_step, bsize2, mi_row + mi_step, mi_col, - subsize); + found_best_partition |= rd_test_partition3( + cpi, td, tile_data, tp, pc_tree, &best_rdc, pc_tree->horizontala, + ctx_none, mi_row, mi_col, bsize, PARTITION_HORZ_A, mi_row, mi_col, + bsize2, mi_row, mi_col + mi_step, bsize2, mi_row + mi_step, mi_col, + subsize);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
av1_init_rd_stats(&tmp_sum_rdc); tmp_sum_rdc.rate = x->partition_cost[pl][PARTITION_HORZ_A]; tmp_sum_rdc.rdcost = RDCOST(x->rdmult, tmp_sum_rdc.rate, 0); if (best_rdc.rdcost - tmp_sum_rdc.rdcost >= 0) { partition_attempts[PARTITION_HORZ_A] += 1; aom_usec_timer_start(&partition_timer); partition_timer_on = 1; } } #endif
+ show +
3907
3908
3909
3910
3911
rd_test_partition3(cpi, td, tile_data, tp, pc_tree, &best_rdc, pc_tree->horizontala, ctx_none, mi_row, mi_col, bsize, PARTITION_HORZ_A, mi_row, mi_col, bsize2, mi_row, mi_col + mi_step, bsize2, mi_row + mi_step, mi_col, subsize);
+ show +
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
#if CONFIG_COLLECT_PARTITION_STATS if (partition_timer_on) { aom_usec_timer_mark(&partition_timer); int64_t time = aom_usec_timer_elapsed(&partition_timer); partition_times[PARTITION_HORZ_A] += time; partition_timer_on = 0; } #endif restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); }

[CVE-2020-0478_1.diff] encodeframe.c #97
+ + if (cpi->sf.part_sf.prune_ab_partition_using_split_info && + horzb_partition_allowed) { + horzb_partition_allowed &= evaluate_ab_partition_based_on_split( + pc_tree, PARTITION_HORZ, rect_part_win_info, x->qindex, 2, 3); + } + - rd_test_partition3(cpi, td, tile_data, tp, pc_tree, &best_rdc, - pc_tree->horizontalb, ctx_none, mi_row, mi_col, bsize, - PARTITION_HORZ_B, mi_row, mi_col, subsize, - mi_row + mi_step, mi_col, bsize2, mi_row + mi_step, - mi_col + mi_step, bsize2); + found_best_partition |= rd_test_partition3( + cpi, td, tile_data, tp, pc_tree, &best_rdc, pc_tree->horizontalb, + ctx_none, mi_row, mi_col, bsize, PARTITION_HORZ_B, mi_row, mi_col, + subsize, mi_row + mi_step, mi_col, bsize2, mi_row + mi_step, + mi_col + mi_step, bsize2);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
av1_init_rd_stats(&tmp_sum_rdc); tmp_sum_rdc.rate = x->partition_cost[pl][PARTITION_HORZ_B]; tmp_sum_rdc.rdcost = RDCOST(x->rdmult, tmp_sum_rdc.rate, 0); if (best_rdc.rdcost - tmp_sum_rdc.rdcost >= 0) { partition_attempts[PARTITION_HORZ_B] += 1; aom_usec_timer_start(&partition_timer); partition_timer_on = 1; } } #endif
+ show +
3947
3948
3949
3950
3951
rd_test_partition3(cpi, td, tile_data, tp, pc_tree, &best_rdc, pc_tree->horizontalb, ctx_none, mi_row, mi_col, bsize, PARTITION_HORZ_B, mi_row, mi_col, subsize, mi_row + mi_step, mi_col, bsize2, mi_row + mi_step, mi_col + mi_step, bsize2);
+ show +
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
#if CONFIG_COLLECT_PARTITION_STATS if (partition_timer_on) { aom_usec_timer_mark(&partition_timer); int64_t time = aom_usec_timer_elapsed(&partition_timer); partition_times[PARTITION_HORZ_B] += time; partition_timer_on = 0; } #endif restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes);

[CVE-2020-0478_1.diff] encodeframe.c #99
+ if (cpi->sf.part_sf.prune_ab_partition_using_split_info && + verta_partition_allowed) { + verta_partition_allowed &= evaluate_ab_partition_based_on_split( + pc_tree, PARTITION_VERT, rect_part_win_info, x->qindex, 0, 2); + } + - rd_test_partition3(cpi, td, tile_data, tp, pc_tree, &best_rdc, - pc_tree->verticala, ctx_none, mi_row, mi_col, bsize, - PARTITION_VERT_A, mi_row, mi_col, bsize2, - mi_row + mi_step, mi_col, bsize2, mi_row, - mi_col + mi_step, subsize); + found_best_partition |= rd_test_partition3( + cpi, td, tile_data, tp, pc_tree, &best_rdc, pc_tree->verticala, + ctx_none, mi_row, mi_col, bsize, PARTITION_VERT_A, mi_row, mi_col, + bsize2, mi_row + mi_step, mi_col, bsize2, mi_row, mi_col + mi_step, + subsize);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
av1_init_rd_stats(&tmp_sum_rdc); tmp_sum_rdc.rate = x->partition_cost[pl][PARTITION_VERT_A]; tmp_sum_rdc.rdcost = RDCOST(x->rdmult, tmp_sum_rdc.rate, 0); if (best_rdc.rdcost - tmp_sum_rdc.rdcost >= 0) { partition_attempts[PARTITION_VERT_A] += 1; aom_usec_timer_start(&partition_timer); partition_timer_on = 1; } } #endif
+ show +
3989
3990
3991
3992
3993
rd_test_partition3(cpi, td, tile_data, tp, pc_tree, &best_rdc, pc_tree->verticala, ctx_none, mi_row, mi_col, bsize, PARTITION_VERT_A, mi_row, mi_col, bsize2, mi_row + mi_step, mi_col, bsize2, mi_row, mi_col + mi_step, subsize);
+ show +
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
#if CONFIG_COLLECT_PARTITION_STATS if (partition_timer_on) { aom_usec_timer_mark(&partition_timer); int64_t time = aom_usec_timer_elapsed(&partition_timer); partition_times[PARTITION_VERT_A] += time; partition_timer_on = 0; } #endif restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); }

[CVE-2020-0478_1.diff] encodeframe.c #101
+ + if (cpi->sf.part_sf.prune_ab_partition_using_split_info && + vertb_partition_allowed) { + vertb_partition_allowed &= evaluate_ab_partition_based_on_split( + pc_tree, PARTITION_VERT, rect_part_win_info, x->qindex, 1, 3); + } + - rd_test_partition3(cpi, td, tile_data, tp, pc_tree, &best_rdc, - pc_tree->verticalb, ctx_none, mi_row, mi_col, bsize, - PARTITION_VERT_B, mi_row, mi_col, subsize, mi_row, - mi_col + mi_step, bsize2, mi_row + mi_step, - mi_col + mi_step, bsize2); + found_best_partition |= rd_test_partition3( + cpi, td, tile_data, tp, pc_tree, &best_rdc, pc_tree->verticalb, + ctx_none, mi_row, mi_col, bsize, PARTITION_VERT_B, mi_row, mi_col, + subsize, mi_row, mi_col + mi_step, bsize2, mi_row + mi_step, + mi_col + mi_step, bsize2);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
tmp_sum_rdc.rate = x->partition_cost[pl][PARTITION_VERT_B]; tmp_sum_rdc.rdcost = RDCOST(x->rdmult, tmp_sum_rdc.rate, 0); if (!frame_is_intra_only(cm) && best_rdc.rdcost - tmp_sum_rdc.rdcost >= 0) { partition_attempts[PARTITION_VERT_B] += 1; aom_usec_timer_start(&partition_timer); partition_timer_on = 1; } } #endif
+ show +
4030
4031
4032
4033
4034
rd_test_partition3(cpi, td, tile_data, tp, pc_tree, &best_rdc, pc_tree->verticalb, ctx_none, mi_row, mi_col, bsize, PARTITION_VERT_B, mi_row, mi_col, subsize, mi_row, mi_col + mi_step, bsize2, mi_row + mi_step, mi_col + mi_step, bsize2);
+ show +
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
#if CONFIG_COLLECT_PARTITION_STATS if (partition_timer_on) { aom_usec_timer_mark(&partition_timer); int64_t time = aom_usec_timer_elapsed(&partition_timer); partition_times[PARTITION_VERT_B] += time; partition_timer_on = 0; } #endif restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); }

[CVE-2020-0478_1.diff] encodeframe.c #126
- av1_hash_table_create(&cm->cur_frame->hash_table); - av1_generate_block_2x2_hash_value(cpi->source, block_hash_values[0], - is_block_same[0], &cpi->td.mb); - av1_generate_block_hash_value(cpi->source, 4, block_hash_values[0], - block_hash_values[1], is_block_same[0], - is_block_same[1], &cpi->td.mb); - av1_add_to_hash_map_by_row_with_precal_data( - &cm->cur_frame->hash_table, block_hash_values[1], is_block_same[1][2], - pic_width, pic_height, 4); - av1_generate_block_hash_value(cpi->source, 8, block_hash_values[1], - block_hash_values[0], is_block_same[1], - is_block_same[0], &cpi->td.mb); - av1_add_to_hash_map_by_row_with_precal_data( - &cm->cur_frame->hash_table, block_hash_values[0], is_block_same[0][2], - pic_width, pic_height, 8); - av1_generate_block_hash_value(cpi->source, 16, block_hash_values[0], - block_hash_values[1], is_block_same[0], - is_block_same[1], &cpi->td.mb); - av1_add_to_hash_map_by_row_with_precal_data( - &cm->cur_frame->hash_table, block_hash_values[1], is_block_same[1][2], - pic_width, pic_height, 16); - av1_generate_block_hash_value(cpi->source, 32, block_hash_values[1], - block_hash_values[0], is_block_same[1], - is_block_same[0], &cpi->td.mb); - av1_add_to_hash_map_by_row_with_precal_data( - &cm->cur_frame->hash_table, block_hash_values[0], is_block_same[0][2], - pic_width, pic_height, 32); - av1_generate_block_hash_value(cpi->source, 64, block_hash_values[0], - block_hash_values[1], is_block_same[0], - is_block_same[1], &cpi->td.mb); - av1_add_to_hash_map_by_row_with_precal_data( - &cm->cur_frame->hash_table, block_hash_values[1], is_block_same[1][2], - pic_width, pic_height, 64); - - av1_generate_block_hash_value(cpi->source, 128, block_hash_values[1], - block_hash_values[0], is_block_same[1], - is_block_same[0], &cpi->td.mb); - av1_add_to_hash_map_by_row_with_precal_data( - &cm->cur_frame->hash_table, block_hash_values[0], is_block_same[0][2], - pic_width, pic_height, 128); + av1_hash_table_init(intrabc_hash_info); + av1_hash_table_create(&intrabc_hash_info->intrabc_hash_table); + hash_table_created = 1; + av1_generate_block_2x2_hash_value(intrabc_hash_info, cpi->source, + block_hash_values[0], is_block_same[0]); + // Hash data generated for screen contents is used for intraBC ME + const int min_alloc_size = block_size_wide[mi_params->mi_alloc_bsize]; + const int max_sb_size = + (1 << (cm->seq_params.mib_size_log2 + MI_SIZE_LOG2)); + int src_idx = 0; + for (int size = 4; size <= max_sb_size; size *= 2, src_idx = !src_idx) { + const int dst_idx = !src_idx; + av1_generate_block_hash_value( + intrabc_hash_info, cpi->source, size, block_hash_values[src_idx], + block_hash_values[dst_idx], is_block_same[src_idx], + is_block_same[dst_idx]); + if (size >= min_alloc_size) { + av1_add_to_hash_map_by_row_with_precal_data( + &intrabc_hash_info->intrabc_hash_table, block_hash_values[dst_idx], + is_block_same[dst_idx][2], pic_width, pic_height, size); + } + }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
CHECK_MEM_ERROR(cm, block_hash_values[k][j], aom_malloc(sizeof(uint32_t) * pic_width * pic_height)); } for (j = 0; j < 3; j++) { CHECK_MEM_ERROR(cm, is_block_same[k][j], aom_malloc(sizeof(int8_t) * pic_width * pic_height)); } }
+ show +
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
av1_hash_table_create(&cm->cur_frame->hash_table); av1_generate_block_2x2_hash_value(cpi->source, block_hash_values[0], is_block_same[0], &cpi->td.mb); av1_generate_block_hash_value(cpi->source, 4, block_hash_values[0], block_hash_values[1], is_block_same[0], is_block_same[1], &cpi->td.mb); av1_add_to_hash_map_by_row_with_precal_data( &cm->cur_frame->hash_table, block_hash_values[1], is_block_same[1][2], pic_width, pic_height, 4); av1_generate_block_hash_value(cpi->source, 8, block_hash_values[1], block_hash_values[0], is_block_same[1], is_block_same[0], &cpi->td.mb); av1_add_to_hash_map_by_row_with_precal_data( &cm->cur_frame->hash_table, block_hash_values[0], is_block_same[0][2], pic_width, pic_height, 8); av1_generate_block_hash_value(cpi->source, 16, block_hash_values[0], block_hash_values[1], is_block_same[0], is_block_same[1], &cpi->td.mb); av1_add_to_hash_map_by_row_with_precal_data( &cm->cur_frame->hash_table, block_hash_values[1], is_block_same[1][2], pic_width, pic_height, 16); av1_generate_block_hash_value(cpi->source, 32, block_hash_values[1], block_hash_values[0], is_block_same[1], is_block_same[0], &cpi->td.mb); av1_add_to_hash_map_by_row_with_precal_data( &cm->cur_frame->hash_table, block_hash_values[0], is_block_same[0][2], pic_width, pic_height, 32); av1_generate_block_hash_value(cpi->source, 64, block_hash_values[0], block_hash_values[1], is_block_same[0], is_block_same[1], &cpi->td.mb); av1_add_to_hash_map_by_row_with_precal_data( &cm->cur_frame->hash_table, block_hash_values[1], is_block_same[1][2], pic_width, pic_height, 64); av1_generate_block_hash_value(cpi->source, 128, block_hash_values[1], block_hash_values[0], is_block_same[1], is_block_same[0], &cpi->td.mb); av1_add_to_hash_map_by_row_with_precal_data( &cm->cur_frame->hash_table, block_hash_values[0], is_block_same[0][2], pic_width, pic_height, 128);
+ show +
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
for (k = 0; k < 2; k++) { for (j = 0; j < 2; j++) { aom_free(block_hash_values[k][j]); } for (j = 0; j < 3; j++) { aom_free(is_block_same[k][j]); } }

[CVE-2020-0470_1.diff] encodeframe.c #2
+int av1_get_refresh_frame_flags(const AV1_COMP *const cpi, + const EncodeFrameParams *const frame_params, + FRAME_UPDATE_TYPE frame_update_type, + const RefBufferStack *const ref_buffer_stack); + +int av1_get_refresh_ref_frame_map(int refresh_frame_flags); + +void av1_update_ref_frame_map(AV1_COMP *cpi, + FRAME_UPDATE_TYPE frame_update_type, + int show_existing_frame, int ref_map_index, + RefBufferStack *ref_buffer_stack); + +void av1_get_ref_frames(AV1_COMP *const cpi, RefBufferStack *ref_buffer_stack); + +int is_forced_keyframe_pending(struct lookahead_ctx *lookahead, + const int up_to_index, + const COMPRESSOR_STAGE compressor_stage); +#include "av1/encoder/corner_detect.h" +#include "av1/encoder/motion_search_facade.h" +#if !CONFIG_REALTIME_ONLY +#endif +#include "av1/encoder/tpl_model.h" -static void encode_superblock(const AV1_COMP *const cpi, TileDataEnc *tile_data, - ThreadData *td, TOKENEXTRA **t, RUN_TYPE dry_run, - int mi_row, int mi_col, BLOCK_SIZE bsize, - int *rate); -static int ml_predict_breakout(const AV1_COMP *const cpi, BLOCK_SIZE bsize, - const MACROBLOCK *const x, - const RD_STATS *const rd_stats, - unsigned int pb_source_variance); +#if CONFIG_TUNE_VMAF +#include "av1/encoder/tune_vmaf.h" +#endif + +static AOM_INLINE void encode_superblock(const AV1_COMP *const cpi, + TileDataEnc *tile_data, ThreadData *td, + TOKENEXTRA **t, RUN_TYPE dry_run, + BLOCK_SIZE bsize, int *rate);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
57
58
59
60
61
62
63
64
65
66
#include "av1/encoder/ml.h" #include "av1/encoder/partition_strategy.h" #include "av1/encoder/partition_model_weights.h" #include "av1/encoder/rd.h" #include "av1/encoder/rdopt.h" #include "av1/encoder/reconinter_enc.h" #include "av1/encoder/segmentation.h" #include "av1/encoder/tokenize.h" #include "av1/encoder/var_based_part.h"
+ show +
67
68
69
70
71
72
73
74
static void encode_superblock(const AV1_COMP *const cpi, TileDataEnc *tile_data, ThreadData *td, TOKENEXTRA **t, RUN_TYPE dry_run, int mi_row, int mi_col, BLOCK_SIZE bsize, int *rate); static int ml_predict_breakout(const AV1_COMP *const cpi, BLOCK_SIZE bsize, const MACROBLOCK *const x, const RD_STATS *const rd_stats, unsigned int pb_source_variance);
+ show +
75
76
77
78
79
80
81
82
83
84
// This is used as a reference when computing the source variance for the // purposes of activity masking. // Eventually this should be replaced by custom no-reference routines, // which will be faster. const uint8_t AV1_VAR_OFFS[MAX_SB_SIZE] = { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,

[CVE-2020-0470_1.diff] encodeframe.c #4
+typedef struct { + ENTROPY_CONTEXT a[MAX_MIB_SIZE * MAX_MB_PLANE]; + ENTROPY_CONTEXT l[MAX_MIB_SIZE * MAX_MB_PLANE]; + PARTITION_CONTEXT sa[MAX_MIB_SIZE]; + PARTITION_CONTEXT sl[MAX_MIB_SIZE]; + TXFM_CONTEXT *p_ta; + TXFM_CONTEXT *p_tl; + TXFM_CONTEXT ta[MAX_MIB_SIZE]; + TXFM_CONTEXT tl[MAX_MIB_SIZE]; +} RD_SEARCH_MACROBLOCK_CONTEXT; + +enum { PICK_MODE_RD = 0, PICK_MODE_NONRD }; + +enum { + SB_SINGLE_PASS, // Single pass encoding: all ctxs get updated normally + SB_DRY_PASS, // First pass of multi-pass: does not update the ctxs + SB_WET_PASS // Second pass of multi-pass: finalize and update the ctx +} UENUM1BYTE(SB_MULTI_PASS_MODE); + +// This struct is used to store the statistics used by sb-level multi-pass +// encoding. Currently, this is only used to make a copy of the state before we +// perform the first pass +typedef struct SB_FIRST_PASS_STATS { + RD_SEARCH_MACROBLOCK_CONTEXT x_ctx; + RD_COUNTS rd_count; + + int split_count; + FRAME_COUNTS fc; + InterModeRdModel inter_mode_rd_models[BLOCK_SIZES_ALL]; + int thresh_freq_fact[BLOCK_SIZES_ALL][MAX_MODES]; + int current_qindex; + +#if CONFIG_INTERNAL_STATS + unsigned int mode_chosen_counts[MAX_MODES]; +#endif // CONFIG_INTERNAL_STATS +} SB_FIRST_PASS_STATS; + - switch (bd) { - case 10: - var = - cpi->fn_ptr[bs].vf(ref->buf, ref->stride, - CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_10), 0, &sse); - break; - case 12: - var = - cpi->fn_ptr[bs].vf(ref->buf, ref->stride, - CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_12), 0, &sse); - break; - case 8: - default: - var = - cpi->fn_ptr[bs].vf(ref->buf, ref->stride, - CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_8), 0, &sse); - break; - } + assert(bd == 8 || bd == 10 || bd == 12); + const int off_index = (bd - 8) >> 1; + const uint16_t *high_var_offs[3] = { AV1_HIGH_VAR_OFFS_8, + AV1_HIGH_VAR_OFFS_10, + AV1_HIGH_VAR_OFFS_12 }; + var = + cpi->fn_ptr[bs].vf(ref->buf, ref->stride, + CONVERT_TO_BYTEPTR(high_var_offs[off_index]), 0, &sse);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
148
149
150
151
152
153
154
155
156
157
unsigned int sse; const unsigned int var = cpi->fn_ptr[bs].vf(ref->buf, ref->stride, AV1_VAR_OFFS, 0, &sse); return ROUND_POWER_OF_TWO(var, num_pels_log2_lookup[bs]); } unsigned int av1_high_get_sby_perpixel_variance(const AV1_COMP *cpi, const struct buf_2d *ref, BLOCK_SIZE bs, int bd) { unsigned int var, sse;
+ show +
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
switch (bd) { case 10: var = cpi->fn_ptr[bs].vf(ref->buf, ref->stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_10), 0, &sse); break; case 12: var = cpi->fn_ptr[bs].vf(ref->buf, ref->stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_12), 0, &sse); break; case 8: default: var = cpi->fn_ptr[bs].vf(ref->buf, ref->stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_8), 0, &sse); break;
+ show +
175
176
177
178
179
180
181
182
183
184
} return ROUND_POWER_OF_TWO(var, num_pels_log2_lookup[bs]); } static unsigned int get_sby_perpixel_diff_variance(const AV1_COMP *const cpi, const struct buf_2d *ref, int mi_row, int mi_col, BLOCK_SIZE bs) { unsigned int sse, var; uint8_t *last_y;

[CVE-2020-0470_1.diff] encodeframe.c #14
-static int set_segment_rdmult(const AV1_COMP *const cpi, MACROBLOCK *const x, - int8_t segment_id) { - const AV1_COMMON *const cm = &cpi->common; - av1_init_plane_quantizers(cpi, x, segment_id); - aom_clear_system_state(); - int segment_qindex = av1_get_qindex(&cm->seg, segment_id, cm->base_qindex); - return av1_compute_rd_mult(cpi, segment_qindex + cm->y_dc_delta_q); -} - -static int set_deltaq_rdmult(const AV1_COMP *const cpi, MACROBLOCKD *const xd) { - const AV1_COMMON *const cm = &cpi->common; - - return av1_compute_rd_mult( - cpi, cm->base_qindex + xd->delta_qindex + cm->y_dc_delta_q); -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
459
460
461
462
463
464
465
466
467
468
// the static analysis warnings. for (int i = 0; i < AOMMIN(num_planes, MAX_MB_PLANE); i++) { const int is_uv = i > 0; setup_pred_plane( &x->plane[i].src, bsize, src->buffers[i], src->crop_widths[is_uv], src->crop_heights[is_uv], src->strides[is_uv], mi_row, mi_col, NULL, x->e_mbd.plane[i].subsampling_x, x->e_mbd.plane[i].subsampling_y); } }
+ show +
469
470
471
472
473
474
475
476
477
478
479
480
481
482
static int set_segment_rdmult(const AV1_COMP *const cpi, MACROBLOCK *const x, int8_t segment_id) { const AV1_COMMON *const cm = &cpi->common; av1_init_plane_quantizers(cpi, x, segment_id); aom_clear_system_state(); int segment_qindex = av1_get_qindex(&cm->seg, segment_id, cm->base_qindex); return av1_compute_rd_mult(cpi, segment_qindex + cm->y_dc_delta_q); } static int set_deltaq_rdmult(const AV1_COMP *const cpi, MACROBLOCKD *const xd) { const AV1_COMMON *const cm = &cpi->common; return av1_compute_rd_mult( cpi, cm->base_qindex + xd->delta_qindex + cm->y_dc_delta_q);
+ show +
483
484
485
486
487
488
489
490
491
492
} static EdgeInfo edge_info(const struct buf_2d *ref, const BLOCK_SIZE bsize, const bool high_bd, const int bd) { const int width = block_size_wide[bsize]; const int height = block_size_high[bsize]; // Implementation requires width to be a multiple of 8. It also requires // height to be a multiple of 4, but this is always the case. assert(height % 4 == 0); if (width % 8 != 0) {

[CVE-2020-0470_1.diff] encodeframe.c #16
- if (!ctx->rd_mode_is_ready) { - ctx->skippable = 0; - - // Set to zero to make sure we do not use the previous encoded frame stats - mbmi->skip = 0; - - // Reset skip mode flag. - mbmi->skip_mode = 0; - } - - x->skip_chroma_rd = - !is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x, - xd->plane[1].subsampling_y); - - if (ctx->rd_mode_is_ready) { - x->skip = ctx->skip; - *x->mbmi_ext = ctx->mbmi_ext; - return; - } + ctx->skippable = 0; + // Set to zero to make sure we do not use the previous encoded frame stats + mbmi->skip = 0; + // Reset skip mode flag. + mbmi->skip_mode = 0;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
557
558
559
560
561
562
563
564
565
566
for (i = 0; i < num_planes; ++i) { p[i].coeff = ctx->coeff[i]; p[i].qcoeff = ctx->qcoeff[i]; pd[i].dqcoeff = ctx->dqcoeff[i]; p[i].eobs = ctx->eobs[i]; p[i].txb_entropy_ctx = ctx->txb_entropy_ctx[i]; } for (i = 0; i < 2; ++i) pd[i].color_index_map = ctx->color_index_map[i];
+ show +
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
if (!ctx->rd_mode_is_ready) { ctx->skippable = 0; // Set to zero to make sure we do not use the previous encoded frame stats mbmi->skip = 0; // Reset skip mode flag. mbmi->skip_mode = 0; } x->skip_chroma_rd = !is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x, xd->plane[1].subsampling_y); if (ctx->rd_mode_is_ready) { x->skip = ctx->skip; *x->mbmi_ext = ctx->mbmi_ext; return;
+ show +
585
586
587
588
589
590
591
592
593
594
} if (is_cur_buf_hbd(xd)) { x->source_variance = av1_high_get_sby_perpixel_variance( cpi, &x->plane[0].src, bsize, xd->bd); } else { x->source_variance = av1_get_sby_perpixel_variance(cpi, &x->plane[0].src, bsize); } if (use_pb_simple_motion_pred_sse(cpi)) {

[CVE-2020-0470_1.diff] encodeframe.c #18
+ + // Initialize default mode evaluation params + set_mode_eval_params(cpi, x, DEFAULT_EVAL); + - orig_rdmult = x->rdmult; - - if (aq_mode == VARIANCE_AQ) { - if (cpi->vaq_refresh) { - const int energy = bsize <= BLOCK_16X16 - ? x->mb_energy - : av1_log_block_var(cpi, x, bsize); - mbmi->segment_id = energy; - } - x->rdmult = set_segment_rdmult(cpi, x, mbmi->segment_id); - } else if (aq_mode == COMPLEXITY_AQ) { - x->rdmult = set_segment_rdmult(cpi, x, mbmi->segment_id); - } else if (aq_mode == CYCLIC_REFRESH_AQ) { - // If segment is boosted, use rdmult for that segment. - if (cyclic_refresh_segment_id_boosted(mbmi->segment_id)) - x->rdmult = av1_cyclic_refresh_get_rdmult(cpi->cyclic_refresh); - } else if (cpi->oxcf.enable_tpl_model) { - x->rdmult = x->cb_rdmult; - } - - if (deltaq_mode > 0) x->rdmult = set_deltaq_rdmult(cpi, xd); + const int orig_rdmult = x->rdmult; + setup_block_rdmult(cpi, x, mi_row, mi_col, bsize, aq_mode, mbmi); + // Set error per bit for current rdmult + set_error_per_bit(x, x->rdmult); + av1_rd_cost_update(x->rdmult, &best_rd);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
605
606
607
608
609
610
611
612
613
614
x->edge_strength_x = UINT16_MAX; x->edge_strength_y = UINT16_MAX; } else { EdgeInfo ei = edge_info(&x->plane[0].src, bsize, is_cur_buf_hbd(xd), xd->bd); x->edge_strength = ei.magnitude; x->edge_strength_x = ei.x; x->edge_strength_y = ei.y; } // Save rdmult before it might be changed, so it can be restored later.
+ show +
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
orig_rdmult = x->rdmult; if (aq_mode == VARIANCE_AQ) { if (cpi->vaq_refresh) { const int energy = bsize <= BLOCK_16X16 ? x->mb_energy : av1_log_block_var(cpi, x, bsize); mbmi->segment_id = energy; } x->rdmult = set_segment_rdmult(cpi, x, mbmi->segment_id); } else if (aq_mode == COMPLEXITY_AQ) { x->rdmult = set_segment_rdmult(cpi, x, mbmi->segment_id); } else if (aq_mode == CYCLIC_REFRESH_AQ) { // If segment is boosted, use rdmult for that segment. if (cyclic_refresh_segment_id_boosted(mbmi->segment_id)) x->rdmult = av1_cyclic_refresh_get_rdmult(cpi->cyclic_refresh); } else if (cpi->oxcf.enable_tpl_model) { x->rdmult = x->cb_rdmult; } if (deltaq_mode > 0) x->rdmult = set_deltaq_rdmult(cpi, xd);
+ show +
636
637
638
639
640
641
642
643
644
645
// Find best coding mode & reconstruct the MB so it is available // as a predictor for MBs that follow in the SB if (frame_is_intra_only(cm)) { #if CONFIG_COLLECT_COMPONENT_TIMING start_timing(cpi, av1_rd_pick_intra_mode_sb_time); #endif av1_rd_pick_intra_mode_sb(cpi, x, mi_row, mi_col, rd_cost, bsize, ctx, best_rd); #if CONFIG_COLLECT_COMPONENT_TIMING

[CVE-2020-0470_1.diff] encodeframe.c #21
- if ((rd_cost->rate != INT_MAX) && (aq_mode == COMPLEXITY_AQ) && - (bsize >= BLOCK_16X16) && - (cm->current_frame.frame_type == KEY_FRAME || - cpi->refresh_alt_ref_frame || cpi->refresh_alt2_ref_frame || - (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref))) { + if (rd_cost->rate != INT_MAX && aq_mode == COMPLEXITY_AQ && + bsize >= BLOCK_16X16) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
662
663
664
665
666
667
668
669
670
671
av1_rd_pick_inter_mode_sb(cpi, tile_data, x, mi_row, mi_col, rd_cost, bsize, ctx, best_rd); } } #if CONFIG_COLLECT_COMPONENT_TIMING end_timing(cpi, av1_rd_pick_inter_mode_sb_time); #endif } // Examine the resulting rate and for AQ mode 2 make a segment choice.
+ show +
672
673
674
675
676
if ((rd_cost->rate != INT_MAX) && (aq_mode == COMPLEXITY_AQ) && (bsize >= BLOCK_16X16) && (cm->current_frame.frame_type == KEY_FRAME || cpi->refresh_alt_ref_frame || cpi->refresh_alt2_ref_frame || (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref))) {
+ show +
677
678
679
680
681
682
683
684
685
686
av1_caq_select_segment(cpi, x, bsize, mi_row, mi_col, rd_cost->rate); } x->rdmult = orig_rdmult; // TODO(jingning) The rate-distortion optimization flow needs to be // refactored to provide proper exit/return handle. if (rd_cost->rate == INT_MAX) rd_cost->rdcost = INT64_MAX; ctx->rate = rd_cost->rate;

[CVE-2020-0470_1.diff] encodeframe.c #30
++counts->angle_delta[uv_mode - UV_V_PRED] - if (allow_update_cdf) { - update_cdf(fc->angle_delta_cdf[uv_mode - UV_V_PRED], - mbmi->angle_delta[PLANE_TYPE_UV] + MAX_ANGLE_DELTA, - 2 * MAX_ANGLE_DELTA + 1); - } + update_cdf(fc->angle_delta_cdf[uv_mode - UV_V_PRED], + mbmi->angle_delta[PLANE_TYPE_UV] + MAX_ANGLE_DELTA, + 2 * MAX_ANGLE_DELTA + 1); - if (av1_allow_palette(cm->allow_screen_content_tools, bsize)) - update_palette_cdf(xd, mbmi, counts, allow_update_cdf); + if (av1_allow_palette(cm->features.allow_screen_content_tools, bsize)) { + update_palette_cdf(xd, mbmi, counts); + } -static void update_stats(const AV1_COMMON *const cm, TileDataEnc *tile_data, - ThreadData *td, int mi_row, int mi_col) { +static AOM_INLINE void update_stats(const AV1_COMMON *const cm, + ThreadData *td) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
886
887
888
889
890
891
892
893
894
895
if (allow_update_cdf) update_cdf(cdf_v, CFL_IDX_V(idx), CFL_ALPHABET_SIZE); } } if (av1_is_directional_mode(get_uv_mode(uv_mode)) && av1_use_angle_delta(bsize)) { #if CONFIG_ENTROPY_STATS ++counts->angle_delta[uv_mode - UV_V_PRED] [mbmi->angle_delta[PLANE_TYPE_UV] + MAX_ANGLE_DELTA]; #endif
+ show +
896
897
898
899
900
901
902
903
904
905
906
907
if (allow_update_cdf) { update_cdf(fc->angle_delta_cdf[uv_mode - UV_V_PRED], mbmi->angle_delta[PLANE_TYPE_UV] + MAX_ANGLE_DELTA, 2 * MAX_ANGLE_DELTA + 1); } } if (av1_allow_palette(cm->allow_screen_content_tools, bsize)) update_palette_cdf(xd, mbmi, counts, allow_update_cdf); } static void update_stats(const AV1_COMMON *const cm, TileDataEnc *tile_data, ThreadData *td, int mi_row, int mi_col) {
+ show +
908
909
910
911
912
913
914
915
916
917
MACROBLOCK *x = &td->mb; MACROBLOCKD *const xd = &x->e_mbd; const MB_MODE_INFO *const mbmi = xd->mi[0]; const MB_MODE_INFO_EXT *const mbmi_ext = x->mbmi_ext; const CurrentFrame *const current_frame = &cm->current_frame; const BLOCK_SIZE bsize = mbmi->sb_type; FRAME_CONTEXT *fc = xd->tile_ctx; const uint8_t allow_update_cdf = tile_data->allow_update_cdf; // delta quant applies to both intra and inter

[CVE-2020-0470_1.diff] encodeframe.c #31
- const uint8_t allow_update_cdf = tile_data->allow_update_cdf; - - // delta quant applies to both intra and inter - const int super_block_upper_left = - ((mi_row & (cm->seq_params.mib_size - 1)) == 0) && - ((mi_col & (cm->seq_params.mib_size - 1)) == 0); -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
905
906
907
908
909
910
911
912
913
914
static void update_stats(const AV1_COMMON *const cm, TileDataEnc *tile_data, ThreadData *td, int mi_row, int mi_col) { MACROBLOCK *x = &td->mb; MACROBLOCKD *const xd = &x->e_mbd; const MB_MODE_INFO *const mbmi = xd->mi[0]; const MB_MODE_INFO_EXT *const mbmi_ext = x->mbmi_ext; const CurrentFrame *const current_frame = &cm->current_frame; const BLOCK_SIZE bsize = mbmi->sb_type; FRAME_CONTEXT *fc = xd->tile_ctx;
+ show +
915
916
917
918
919
920
const uint8_t allow_update_cdf = tile_data->allow_update_cdf; // delta quant applies to both intra and inter const int super_block_upper_left = ((mi_row & (cm->seq_params.mib_size - 1)) == 0) && ((mi_col & (cm->seq_params.mib_size - 1)) == 0);
+ show +
921
922
923
924
925
926
927
928
929
930
const int seg_ref_active = segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_REF_FRAME); if (current_frame->skip_mode_info.skip_mode_flag && !seg_ref_active && is_comp_ref_allowed(bsize)) { const int skip_mode_ctx = av1_get_skip_mode_context(xd); #if CONFIG_ENTROPY_STATS td->counts->skip_mode[skip_mode_ctx][mbmi->skip_mode]++; #endif

[CVE-2020-0470_1.diff] encodeframe.c #37
- memcpy(ctx->a + num_4x4_blocks_wide * p, - xd->above_context[p] + (tx_col >> xd->plane[p].subsampling_x), - (sizeof(ENTROPY_CONTEXT) * num_4x4_blocks_wide) >> - xd->plane[p].subsampling_x); - memcpy(ctx->l + num_4x4_blocks_high * p, - xd->left_context[p] + (tx_row >> xd->plane[p].subsampling_y), - (sizeof(ENTROPY_CONTEXT) * num_4x4_blocks_high) >> - xd->plane[p].subsampling_y); + memcpy( + ctx->a + mi_width * p, + xd->above_entropy_context[p] + (tx_col >> xd->plane[p].subsampling_x), + (sizeof(ENTROPY_CONTEXT) * mi_width) >> xd->plane[p].subsampling_x); + memcpy(ctx->l + mi_height * p, + xd->left_entropy_context[p] + (tx_row >> xd->plane[p].subsampling_y), + (sizeof(ENTROPY_CONTEXT) * mi_height) >> xd->plane[p].subsampling_y); - memcpy(ctx->sa, xd->above_seg_context + mi_col, - sizeof(*xd->above_seg_context) * mi_width); - memcpy(ctx->sl, xd->left_seg_context + (mi_row & MAX_MIB_MASK), - sizeof(xd->left_seg_context[0]) * mi_height); + memcpy(ctx->sa, xd->above_partition_context + mi_col, + sizeof(*xd->above_partition_context) * mi_width); + memcpy(ctx->sl, xd->left_partition_context + (mi_row & MAX_MIB_MASK), + sizeof(xd->left_partition_context[0]) * mi_height);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
block_size_wide[bsize] >> tx_size_wide_log2[0]; const int num_4x4_blocks_high = block_size_high[bsize] >> tx_size_high_log2[0]; int mi_width = mi_size_wide[bsize]; int mi_height = mi_size_high[bsize]; // buffer the above/left context information of the block in search. for (p = 0; p < num_planes; ++p) { int tx_col = mi_col; int tx_row = mi_row & MAX_MIB_MASK;
+ show +
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
memcpy(ctx->a + num_4x4_blocks_wide * p, xd->above_context[p] + (tx_col >> xd->plane[p].subsampling_x), (sizeof(ENTROPY_CONTEXT) * num_4x4_blocks_wide) >> xd->plane[p].subsampling_x); memcpy(ctx->l + num_4x4_blocks_high * p, xd->left_context[p] + (tx_row >> xd->plane[p].subsampling_y), (sizeof(ENTROPY_CONTEXT) * num_4x4_blocks_high) >> xd->plane[p].subsampling_y); } memcpy(ctx->sa, xd->above_seg_context + mi_col, sizeof(*xd->above_seg_context) * mi_width); memcpy(ctx->sl, xd->left_seg_context + (mi_row & MAX_MIB_MASK), sizeof(xd->left_seg_context[0]) * mi_height);
+ show +
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
memcpy(ctx->ta, xd->above_txfm_context, sizeof(*xd->above_txfm_context) * mi_width); memcpy(ctx->tl, xd->left_txfm_context, sizeof(*xd->left_txfm_context) * mi_height); ctx->p_ta = xd->above_txfm_context; ctx->p_tl = xd->left_txfm_context; } static void encode_b(const AV1_COMP *const cpi, TileDataEnc *tile_data, ThreadData *td, TOKENEXTRA **tp, int mi_row, int mi_col,

[CVE-2020-0470_1.diff] encodeframe.c #39
- update_stats(&cpi->common, tile_data, td, mi_row, mi_col); + + // delta quant applies to both intra and inter + const int super_block_upper_left = + ((mi_row & (cm->seq_params.mib_size - 1)) == 0) && + ((mi_col & (cm->seq_params.mib_size - 1)) == 0); + const DeltaQInfo *const delta_q_info = &cm->delta_q_info; + if (delta_q_info->delta_q_present_flag && + (bsize != cm->seq_params.sb_size || !mbmi->skip) && + super_block_upper_left) { + xd->current_qindex = mbmi->current_qindex; + if (delta_q_info->delta_lf_present_flag) { + if (delta_q_info->delta_lf_multi) { + const int frame_lf_count = + av1_num_planes(cm) > 1 ? FRAME_LF_COUNT : FRAME_LF_COUNT - 2; + for (int lf_id = 0; lf_id < frame_lf_count; ++lf_id) { + xd->delta_lf[lf_id] = mbmi->delta_lf[lf_id]; + } + } else { + xd->delta_lf_from_base = mbmi->delta_lf_from_base; + } + } + } + + RD_COUNTS *rdc = &td->rd_counts; + if (mbmi->skip_mode) { + assert(!frame_is_intra_only(cm)); + rdc->skip_mode_used_flag = 1; + if (cm->current_frame.reference_mode == REFERENCE_MODE_SELECT) { + assert(has_second_ref(mbmi)); + rdc->compound_ref_used_flag = 1; + } + set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]); + } else { + const int seg_ref_active = + segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_REF_FRAME); + if (!seg_ref_active) { + // If the segment reference feature is enabled we have only a single + // reference frame allowed for the segment so exclude it from + // the reference frame counts used to work out probabilities. + if (is_inter_block(mbmi)) { + av1_collect_neighbors_ref_counts(xd); + if (cm->current_frame.reference_mode == REFERENCE_MODE_SELECT) { + if (has_second_ref(mbmi)) { + // This flag is also updated for 4x4 blocks + rdc->compound_ref_used_flag = 1; + } + } + set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]); + } + } + } + + if (tile_data->allow_update_cdf) update_stats(&cpi->common, td); + + // Gather obmc and warped motion count to update the probability. + if ((!cpi->sf.inter_sf.disable_obmc && + cpi->sf.inter_sf.prune_obmc_prob_thresh > 0) || + (cm->features.allow_warped_motion && + cpi->sf.inter_sf.prune_warped_prob_thresh > 0)) { + const int inter_block = is_inter_block(mbmi); + const int seg_ref_active = + segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_REF_FRAME); + if (!seg_ref_active && inter_block) { + const MOTION_MODE motion_allowed = + cm->features.switchable_motion_mode + ? motion_mode_allowed(xd->global_motion, xd, mbmi, + cm->features.allow_warped_motion) + : SIMPLE_TRANSLATION; + + if (mbmi->ref_frame[1] != INTRA_FRAME) { + if (motion_allowed >= OBMC_CAUSAL) { + td->rd_counts.obmc_used[bsize][mbmi->motion_mode == OBMC_CAUSAL]++; + } + if (motion_allowed == WARPED_CAUSAL) { + td->rd_counts.warped_used[mbmi->motion_mode == WARPED_CAUSAL]++; + } + } + } + } + // TODO(Ravi/Remya): Move this copy function to a better logical place + // This function will copy the best mode information from block + // level (x->mbmi_ext) to frame level (cpi->mbmi_ext_info.frame_base). This + // frame level buffer (cpi->mbmi_ext_info.frame_base) will be used during + // bitstream preparation. + av1_copy_mbmi_ext_to_mbmi_ext_frame(x->mbmi_ext_frame, x->mbmi_ext, + av1_ref_frame_type(xd->mi[0]->ref_frame)); + x->rdmult = origin_mult; -static void encode_sb(const AV1_COMP *const cpi, ThreadData *td, - TileDataEnc *tile_data, TOKENEXTRA **tp, int mi_row, - int mi_col, RUN_TYPE dry_run, BLOCK_SIZE bsize, - PC_TREE *pc_tree, int *rate) { +static AOM_INLINE void encode_sb(const AV1_COMP *const cpi, ThreadData *td, + TileDataEnc *tile_data, TOKENEXTRA **tp, + int mi_row, int mi_col, RUN_TYPE dry_run, + BLOCK_SIZE bsize, PC_TREE *pc_tree, + int *rate) { + assert(bsize < BLOCK_SIZES_ALL); + const CommonModeInfoParams *const mi_params = &cm->mi_params; + assert(bsize < BLOCK_SIZES_ALL);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
mbmi->delta_lf[lf_id] = xd->delta_lf[lf_id]; mbmi->delta_lf_from_base = xd->delta_lf_from_base; } if (has_second_ref(mbmi)) { if (mbmi->compound_idx == 0 || mbmi->interinter_comp.type == COMPOUND_AVERAGE) mbmi->comp_group_idx = 0; else mbmi->comp_group_idx = 1; }
+ show +
1507
1508
1509
1510
1511
1512
1513
1514
update_stats(&cpi->common, tile_data, td, mi_row, mi_col); } } static void encode_sb(const AV1_COMP *const cpi, ThreadData *td, TileDataEnc *tile_data, TOKENEXTRA **tp, int mi_row, int mi_col, RUN_TYPE dry_run, BLOCK_SIZE bsize, PC_TREE *pc_tree, int *rate) {
+ show +
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
const AV1_COMMON *const cm = &cpi->common; MACROBLOCK *const x = &td->mb; MACROBLOCKD *const xd = &x->e_mbd; const int hbs = mi_size_wide[bsize] / 2; const int is_partition_root = bsize >= BLOCK_8X8; const int ctx = is_partition_root ? partition_plane_context(xd, mi_row, mi_col, bsize) : -1; const PARTITION_TYPE partition = pc_tree->partitioning; const BLOCK_SIZE subsize = get_partition_subsize(bsize, partition);

[CVE-2020-0470_1.diff] encodeframe.c #47
-static void rd_use_partition(AV1_COMP *cpi, ThreadData *td, - TileDataEnc *tile_data, MB_MODE_INFO **mib, - TOKENEXTRA **tp, int mi_row, int mi_col, - BLOCK_SIZE bsize, int *rate, int64_t *dist, - int do_recon, PC_TREE *pc_tree) { +static AOM_INLINE void rd_use_partition( + AV1_COMP *cpi, ThreadData *td, TileDataEnc *tile_data, MB_MODE_INFO **mib, + TOKENEXTRA **tp, int mi_row, int mi_col, BLOCK_SIZE bsize, int *rate, + int64_t *dist, int do_recon, PC_TREE *pc_tree) { + const CommonModeInfoParams *const mi_params = &cm->mi_params;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
mib[index]->sb_type = bsize; } } } else { // Else this is a partial SB. set_partial_sb_partition(cm, mi_upper_left, bh, bw, mi_rows_remaining, mi_cols_remaining, bsize, mib); } }
+ show +
1691
1692
1693
1694
1695
static void rd_use_partition(AV1_COMP *cpi, ThreadData *td, TileDataEnc *tile_data, MB_MODE_INFO **mib, TOKENEXTRA **tp, int mi_row, int mi_col, BLOCK_SIZE bsize, int *rate, int64_t *dist, int do_recon, PC_TREE *pc_tree) {
+ show +
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
AV1_COMMON *const cm = &cpi->common; const int num_planes = av1_num_planes(cm); TileInfo *const tile_info = &tile_data->tile_info; MACROBLOCK *const x = &td->mb; MACROBLOCKD *const xd = &x->e_mbd; const int bs = mi_size_wide[bsize]; const int hbs = bs / 2; int i; const int pl = (bsize >= BLOCK_8X8) ? partition_plane_context(xd, mi_row, mi_col, bsize)

[CVE-2020-0470_1.diff] encodeframe.c #63
-static void rd_pick_sqr_partition(AV1_COMP *const cpi, ThreadData *td, - TileDataEnc *tile_data, TOKENEXTRA **tp, - int mi_row, int mi_col, BLOCK_SIZE bsize, - RD_STATS *rd_cost, int64_t best_rd, - PC_TREE *pc_tree, int64_t *none_rd) { - const AV1_COMMON *const cm = &cpi->common; - TileInfo *const tile_info = &tile_data->tile_info; - MACROBLOCK *const x = &td->mb; - MACROBLOCKD *const xd = &x->e_mbd; - const int mi_step = mi_size_wide[bsize] / 2; - RD_SEARCH_MACROBLOCK_CONTEXT x_ctx; - const TOKENEXTRA *const tp_orig = *tp; - PICK_MODE_CONTEXT *ctx_none = &pc_tree->none; - int tmp_partition_cost[PARTITION_TYPES]; - BLOCK_SIZE subsize; - RD_STATS this_rdc, sum_rdc, best_rdc, pn_rdc; - const int bsize_at_least_8x8 = (bsize >= BLOCK_8X8); - int do_square_split = bsize_at_least_8x8; - const int pl = bsize_at_least_8x8 - ? partition_plane_context(xd, mi_row, mi_col, bsize) - : 0; - const int *partition_cost = - pl >= 0 ? x->partition_cost[pl] : x->partition_cost[0]; - const int num_planes = av1_num_planes(cm); - - int64_t split_rd[4] = { 0, 0, 0, 0 }; - - // Override skipping rectangular partition operations for edge blocks - const int has_rows = (mi_row + mi_step < cm->mi_rows); - const int has_cols = (mi_col + mi_step < cm->mi_cols); - - if (none_rd) *none_rd = 0; - - int partition_none_allowed = has_rows && has_cols; - - (void)*tp_orig; - (void)split_rd; - - if (best_rd < 0) { - pc_tree->none.rdcost = INT64_MAX; - pc_tree->none.skip = 0; - av1_invalid_rd_stats(rd_cost); - return; - } - pc_tree->pc_tree_stats.valid = 1; - - // Override partition costs at the edges of the frame in the same - // way as in read_partition (see decodeframe.c) - if (!(has_rows && has_cols)) { - assert(bsize_at_least_8x8 && pl >= 0); - const aom_cdf_prob *partition_cdf = cm->fc->partition_cdf[pl]; - for (int i = 0; i < PARTITION_TYPES; ++i) tmp_partition_cost[i] = INT_MAX; - if (has_cols) { - // At the bottom, the two possibilities are HORZ and SPLIT - aom_cdf_prob bot_cdf[2]; - partition_gather_vert_alike(bot_cdf, partition_cdf, bsize); - static const int bot_inv_map[2] = { PARTITION_HORZ, PARTITION_SPLIT }; - av1_cost_tokens_from_cdf(tmp_partition_cost, bot_cdf, bot_inv_map); - } else if (has_rows) { - // At the right, the two possibilities are VERT and SPLIT - aom_cdf_prob rhs_cdf[2]; - partition_gather_horz_alike(rhs_cdf, partition_cdf, bsize); - static const int rhs_inv_map[2] = { PARTITION_VERT, PARTITION_SPLIT }; - av1_cost_tokens_from_cdf(tmp_partition_cost, rhs_cdf, rhs_inv_map); - } else { - // At the bottom right, we always split - tmp_partition_cost[PARTITION_SPLIT] = 0; - } - - partition_cost = tmp_partition_cost; - } - -#ifndef NDEBUG - // Nothing should rely on the default value of this array (which is just - // leftover from encoding the previous block. Setting it to fixed pattern - // when debugging. - // bit 0, 1, 2 are blk_skip of each plane - // bit 4, 5, 6 are initialization checking of each plane - memset(x->blk_skip, 0x77, sizeof(x->blk_skip)); -#endif // NDEBUG - - assert(mi_size_wide[bsize] == mi_size_high[bsize]); - - av1_init_rd_stats(&this_rdc); - av1_init_rd_stats(&sum_rdc); - av1_invalid_rd_stats(&best_rdc); - best_rdc.rdcost = best_rd; - - set_offsets(cpi, tile_info, x, mi_row, mi_col, bsize); - - if (bsize == BLOCK_16X16 && cpi->vaq_refresh) - x->mb_energy = av1_log_block_var(cpi, x, bsize); - - xd->above_txfm_context = cm->above_txfm_context[tile_info->tile_row] + mi_col; - xd->left_txfm_context = - xd->left_txfm_context_buffer + (mi_row & MAX_MIB_MASK); - save_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); - -#if CONFIG_DIST_8X8 - if (x->using_dist_8x8) { - if (block_size_high[bsize] <= 8 || block_size_wide[bsize] <= 8) - do_square_split = 0; - } -#endif - - // PARTITION_NONE - if (partition_none_allowed) { - int pt_cost = 0; - if (bsize_at_least_8x8) { - pc_tree->partitioning = PARTITION_NONE; - pt_cost = partition_cost[PARTITION_NONE] < INT_MAX - ? partition_cost[PARTITION_NONE] - : 0; - } - const int64_t partition_rd_cost = RDCOST(x->rdmult, pt_cost, 0); - const int64_t best_remain_rdcost = - best_rdc.rdcost == INT64_MAX ? INT64_MAX - : (best_rdc.rdcost - partition_rd_cost); - pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, &this_rdc, PARTITION_NONE, - bsize, ctx_none, best_remain_rdcost, 0); - - pc_tree->pc_tree_stats.rdcost = ctx_none->rdcost; - pc_tree->pc_tree_stats.skip = ctx_none->skip; - - if (none_rd) *none_rd = this_rdc.rdcost; - if (this_rdc.rate != INT_MAX) { - if (bsize_at_least_8x8) { - this_rdc.rate += pt_cost; - this_rdc.rdcost = RDCOST(x->rdmult, this_rdc.rate, this_rdc.dist); - } - - if (this_rdc.rdcost < best_rdc.rdcost) { - // Adjust dist breakout threshold according to the partition size. - const int64_t dist_breakout_thr = - cpi->sf.partition_search_breakout_dist_thr >> - ((2 * (MAX_SB_SIZE_LOG2 - 2)) - - (mi_size_wide_log2[bsize] + mi_size_high_log2[bsize])); - const int rate_breakout_thr = - cpi->sf.partition_search_breakout_rate_thr * - num_pels_log2_lookup[bsize]; - - best_rdc = this_rdc; - if (bsize_at_least_8x8) pc_tree->partitioning = PARTITION_NONE; - - pc_tree->cb_search_range = SEARCH_FULL_PLANE; - - if (!x->e_mbd.lossless[xd->mi[0]->segment_id] && ctx_none->skippable) { - const int use_ml_based_breakout = - bsize <= cpi->sf.use_square_partition_only_threshold && - bsize > BLOCK_4X4 && xd->bd == 8; - - // TODO(anyone): Currently this is using the same model and threshold - // values as in rd_pick_partition. Retraining the model and tuning the - // threshold values might be helpful to improve the speed. - if (use_ml_based_breakout) { - if (ml_predict_breakout(cpi, bsize, x, &this_rdc, - x->source_variance)) { - do_square_split = 0; - } - } - - // If all y, u, v transform blocks in this partition are skippable, - // and the dist & rate are within the thresholds, the partition search - // is terminated for current branch of the partition search tree. The - // dist & rate thresholds are set to 0 at speed 0 to disable the early - // termination at that speed. - if (best_rdc.dist < dist_breakout_thr && - best_rdc.rate < rate_breakout_thr) { - do_square_split = 0; - } - } - - if (cpi->sf.firstpass_simple_motion_search_early_term && - cm->show_frame && bsize <= BLOCK_32X32 && bsize >= BLOCK_8X8 && - !frame_is_intra_only(cm) && mi_row + mi_step < cm->mi_rows && - mi_col + mi_step < cm->mi_cols && this_rdc.rdcost < INT64_MAX && - this_rdc.rdcost >= 0 && this_rdc.rate < INT_MAX && - this_rdc.rate >= 0 && do_square_split) { - av1_firstpass_simple_motion_search_early_term( - cpi, x, pc_tree, mi_row, mi_col, bsize, &this_rdc, - &do_square_split); - } - } - } - - restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); - } - - // store estimated motion vector - if (cpi->sf.adaptive_motion_search) store_pred_mv(x, ctx_none); - - int64_t temp_best_rdcost = best_rdc.rdcost; - pn_rdc = best_rdc; - - // PARTITION_SPLIT - if (do_square_split) { - int reached_last_index = 0; - subsize = get_partition_subsize(bsize, PARTITION_SPLIT); - int idx; - - sum_rdc.rate = partition_cost[PARTITION_SPLIT]; - sum_rdc.rdcost = RDCOST(x->rdmult, sum_rdc.rate, 0); - - for (idx = 0; idx < 4 && sum_rdc.rdcost < temp_best_rdcost; ++idx) { - const int x_idx = (idx & 1) * mi_step; - const int y_idx = (idx >> 1) * mi_step; - - if (mi_row + y_idx >= cm->mi_rows || mi_col + x_idx >= cm->mi_cols) - continue; - - if (cpi->sf.adaptive_motion_search) load_pred_mv(x, ctx_none); - - pc_tree->split[idx]->index = idx; - int64_t *p_split_rd = &split_rd[idx]; - const int64_t best_remain_rdcost = - (temp_best_rdcost == INT64_MAX) ? INT64_MAX - : (temp_best_rdcost - sum_rdc.rdcost); - rd_pick_sqr_partition( - cpi, td, tile_data, tp, mi_row + y_idx, mi_col + x_idx, subsize, - &this_rdc, best_remain_rdcost, pc_tree->split[idx], p_split_rd); - - pc_tree->pc_tree_stats.sub_block_rdcost[idx] = this_rdc.rdcost; - pc_tree->pc_tree_stats.sub_block_skip[idx] = - pc_tree->split[idx]->none.skip; - - if (this_rdc.rate == INT_MAX) { - sum_rdc.rdcost = INT64_MAX; - break; - } else { - sum_rdc.rate += this_rdc.rate; - sum_rdc.dist += this_rdc.dist; - sum_rdc.rdcost += this_rdc.rdcost; - } - } - reached_last_index = (idx == 4); - - if (reached_last_index && sum_rdc.rdcost < best_rdc.rdcost) { - sum_rdc.rdcost = RDCOST(x->rdmult, sum_rdc.rate, sum_rdc.dist); - - if (sum_rdc.rdcost < best_rdc.rdcost) { - best_rdc = sum_rdc; - pc_tree->partitioning = PARTITION_SPLIT; - } - } - - int has_split = 0; - if (pc_tree->partitioning == PARTITION_SPLIT) { - for (int cb_idx = 0; cb_idx <= AOMMIN(idx, 3); ++cb_idx) { - if (pc_tree->split[cb_idx]->partitioning == PARTITION_SPLIT) - ++has_split; - } - - if (has_split >= 3 || sum_rdc.rdcost < (pn_rdc.rdcost >> 1)) { - pc_tree->cb_search_range = SPLIT_PLANE; - } - } - - if (pc_tree->partitioning == PARTITION_NONE) { - pc_tree->cb_search_range = SEARCH_SAME_PLANE; - if (pn_rdc.dist <= sum_rdc.dist) - pc_tree->cb_search_range = NONE_PARTITION_PLANE; - } - - if (pn_rdc.rate == INT_MAX) pc_tree->cb_search_range = NONE_PARTITION_PLANE; - - restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); - } // if (do_split) - - pc_tree->pc_tree_stats.split = pc_tree->partitioning == PARTITION_SPLIT; - if (do_square_split) { - for (int i = 0; i < 4; ++i) { - pc_tree->pc_tree_stats.sub_block_split[i] = - pc_tree->split[i]->partitioning == PARTITION_SPLIT; - } - } - - // TODO(jbb): This code added so that we avoid static analysis - // warning related to the fact that best_rd isn't used after this - // point. This code should be refactored so that the duplicate - // checks occur in some sub function and thus are used... - (void)best_rd; - *rd_cost = best_rdc; - - if (best_rdc.rate < INT_MAX && best_rdc.dist < INT64_MAX && - pc_tree->index != 3) { - if (bsize == cm->seq_params.sb_size) { - restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); - } else { - encode_sb(cpi, td, tile_data, tp, mi_row, mi_col, DRY_RUN_NORMAL, bsize, - pc_tree, NULL); - } - } - - if (bsize == cm->seq_params.sb_size) { - assert(best_rdc.rate < INT_MAX); - assert(best_rdc.dist < INT64_MAX); - } else { - assert(tp_orig == *tp); - } -} - -// split_score indicates confidence of picking split partition; -// none_score indicates confidence of picking none partition; -#define FEATURE_SIZE 19 -static int ml_prune_2pass_split_partition(const PC_TREE_STATS *pc_tree_stats, - BLOCK_SIZE bsize, int *split_score, - int *none_score) { - if (!pc_tree_stats->valid) return 0; - const float *split_weights = NULL; - const float *none_weights = NULL; - switch (bsize) { - case BLOCK_4X4: break; - case BLOCK_8X8: - split_weights = av1_2pass_split_partition_weights_8; - none_weights = av1_2pass_none_partition_weights_8; - break; - case BLOCK_16X16: - split_weights = av1_2pass_split_partition_weights_16; - none_weights = av1_2pass_none_partition_weights_16; - break; - case BLOCK_32X32: - split_weights = av1_2pass_split_partition_weights_32; - none_weights = av1_2pass_none_partition_weights_32; - break; - case BLOCK_64X64: - split_weights = av1_2pass_split_partition_weights_64; - none_weights = av1_2pass_none_partition_weights_64; - break; - case BLOCK_128X128: - split_weights = av1_2pass_split_partition_weights_128; - none_weights = av1_2pass_none_partition_weights_128; - break; - default: assert(0 && "Unexpected bsize."); - } - if (!split_weights || !none_weights) return 0; - - aom_clear_system_state(); - - float features[FEATURE_SIZE]; - int feature_index = 0; - features[feature_index++] = (float)pc_tree_stats->split; - features[feature_index++] = (float)pc_tree_stats->skip; - const int rdcost = (int)AOMMIN(INT_MAX, pc_tree_stats->rdcost); - const int rd_valid = rdcost > 0 && rdcost < 1000000000; - features[feature_index++] = (float)rd_valid; - for (int i = 0; i < 4; ++i) { - features[feature_index++] = (float)pc_tree_stats->sub_block_split[i]; - features[feature_index++] = (float)pc_tree_stats->sub_block_skip[i]; - const int sub_rdcost = - (int)AOMMIN(INT_MAX, pc_tree_stats->sub_block_rdcost[i]); - const int sub_rd_valid = sub_rdcost > 0 && sub_rdcost < 1000000000; - features[feature_index++] = (float)sub_rd_valid; - // Ratio between the sub-block RD and the whole-block RD. - float rd_ratio = 1.0f; - if (rd_valid && sub_rd_valid && sub_rdcost < rdcost) - rd_ratio = (float)sub_rdcost / (float)rdcost; - features[feature_index++] = rd_ratio; - } - assert(feature_index == FEATURE_SIZE); - - float score_1 = split_weights[FEATURE_SIZE]; - float score_2 = none_weights[FEATURE_SIZE]; - for (int i = 0; i < FEATURE_SIZE; ++i) { - score_1 += features[i] * split_weights[i]; - score_2 += features[i] * none_weights[i]; - } - *split_score = (int)(score_1 * 100); - *none_score = (int)(score_2 * 100); - return 1; -} -#undef FEATURE_SIZE - -static void ml_prune_rect_partition(const AV1_COMP *const cpi, - const MACROBLOCK *const x, BLOCK_SIZE bsize, - int64_t best_rd, int64_t none_rd, - int64_t *split_rd, - int *const dst_prune_horz, - int *const dst_prune_vert) { - if (bsize < BLOCK_8X8 || best_rd >= 1000000000) return; - best_rd = AOMMAX(best_rd, 1); - const NN_CONFIG *nn_config = NULL; - const float prob_thresholds[5] = { 0.01f, 0.01f, 0.004f, 0.002f, 0.002f }; - float cur_thresh = 0.0f; - switch (bsize) { - case BLOCK_8X8: - nn_config = &av1_rect_partition_nnconfig_8; - cur_thresh = prob_thresholds[0]; - break; - case BLOCK_16X16: - nn_config = &av1_rect_partition_nnconfig_16; - cur_thresh = prob_thresholds[1]; - break; - case BLOCK_32X32: - nn_config = &av1_rect_partition_nnconfig_32; - cur_thresh = prob_thresholds[2]; - break; - case BLOCK_64X64: - nn_config = &av1_rect_partition_nnconfig_64; - cur_thresh = prob_thresholds[3]; - break; - case BLOCK_128X128: - nn_config = &av1_rect_partition_nnconfig_128; - cur_thresh = prob_thresholds[4]; - break; - default: assert(0 && "Unexpected bsize."); - } - if (!nn_config) return; - aom_clear_system_state(); - - // 1. Compute input features - float features[9]; - - // RD cost ratios - for (int i = 0; i < 5; i++) features[i] = 1.0f; - if (none_rd > 0 && none_rd < 1000000000) - features[0] = (float)none_rd / (float)best_rd; - for (int i = 0; i < 4; i++) { - if (split_rd[i] > 0 && split_rd[i] < 1000000000) - features[1 + i] = (float)split_rd[i] / (float)best_rd; - } - - // Variance ratios - const MACROBLOCKD *const xd = &x->e_mbd; - int whole_block_variance; - if (is_cur_buf_hbd(xd)) { - whole_block_variance = av1_high_get_sby_perpixel_variance( - cpi, &x->plane[0].src, bsize, xd->bd); - } else { - whole_block_variance = - av1_get_sby_perpixel_variance(cpi, &x->plane[0].src, bsize); - } - whole_block_variance = AOMMAX(whole_block_variance, 1); - - int split_variance[4]; - const BLOCK_SIZE subsize = get_partition_subsize(bsize, PARTITION_SPLIT); - struct buf_2d buf; - buf.stride = x->plane[0].src.stride; - const int bw = block_size_wide[bsize]; - for (int i = 0; i < 4; ++i) { - const int x_idx = (i & 1) * bw / 2; - const int y_idx = (i >> 1) * bw / 2; - buf.buf = x->plane[0].src.buf + x_idx + y_idx * buf.stride; - if (is_cur_buf_hbd(xd)) { - split_variance[i] = - av1_high_get_sby_perpixel_variance(cpi, &buf, subsize, xd->bd); - } else { - split_variance[i] = av1_get_sby_perpixel_variance(cpi, &buf, subsize); - } - } - - for (int i = 0; i < 4; i++) - features[5 + i] = (float)split_variance[i] / (float)whole_block_variance; - - // 2. Do the prediction and prune 0-2 partitions based on their probabilities - float raw_scores[3] = { 0.0f }; - av1_nn_predict(features, nn_config, raw_scores); - aom_clear_system_state(); - float probs[3] = { 0.0f }; - av1_nn_softmax(raw_scores, probs, 3); - - // probs[0] is the probability of the fact that both rectangular partitions - // are worse than current best_rd - if (probs[1] <= cur_thresh) (*dst_prune_horz) = 1; - if (probs[2] <= cur_thresh) (*dst_prune_vert) = 1; -} - -// Use a ML model to predict if horz_a, horz_b, vert_a, and vert_b should be -// considered. -static void ml_prune_ab_partition(BLOCK_SIZE bsize, int part_ctx, int var_ctx, - int64_t best_rd, int64_t horz_rd[2], - int64_t vert_rd[2], int64_t split_rd[4], - int *const horza_partition_allowed, - int *const horzb_partition_allowed, - int *const verta_partition_allowed, - int *const vertb_partition_allowed) { - if (bsize < BLOCK_8X8 || best_rd >= 1000000000) return; - const NN_CONFIG *nn_config = NULL; - switch (bsize) { - case BLOCK_8X8: nn_config = NULL; break; - case BLOCK_16X16: nn_config = &av1_ab_partition_nnconfig_16; break; - case BLOCK_32X32: nn_config = &av1_ab_partition_nnconfig_32; break; - case BLOCK_64X64: nn_config = &av1_ab_partition_nnconfig_64; break; - case BLOCK_128X128: nn_config = &av1_ab_partition_nnconfig_128; break; - default: assert(0 && "Unexpected bsize."); - } - if (!nn_config) return; - - aom_clear_system_state(); - - // Generate features. - float features[10]; - int feature_index = 0; - features[feature_index++] = (float)part_ctx; - features[feature_index++] = (float)var_ctx; - const int rdcost = (int)AOMMIN(INT_MAX, best_rd); - int sub_block_rdcost[8] = { 0 }; - int rd_index = 0; - for (int i = 0; i < 2; ++i) { - if (horz_rd[i] > 0 && horz_rd[i] < 1000000000) - sub_block_rdcost[rd_index] = (int)horz_rd[i]; - ++rd_index; - } - for (int i = 0; i < 2; ++i) { - if (vert_rd[i] > 0 && vert_rd[i] < 1000000000) - sub_block_rdcost[rd_index] = (int)vert_rd[i]; - ++rd_index; - } - for (int i = 0; i < 4; ++i) { - if (split_rd[i] > 0 && split_rd[i] < 1000000000) - sub_block_rdcost[rd_index] = (int)split_rd[i]; - ++rd_index; - } - for (int i = 0; i < 8; ++i) { - // Ratio between the sub-block RD and the whole-block RD. - float rd_ratio = 1.0f; - if (sub_block_rdcost[i] > 0 && sub_block_rdcost[i] < rdcost) - rd_ratio = (float)sub_block_rdcost[i] / (float)rdcost; - features[feature_index++] = rd_ratio; - } - assert(feature_index == 10); - - // Calculate scores using the NN model. - float score[16] = { 0.0f }; - av1_nn_predict(features, nn_config, score); - aom_clear_system_state(); - int int_score[16]; - int max_score = -1000; - for (int i = 0; i < 16; ++i) { - int_score[i] = (int)(100 * score[i]); - max_score = AOMMAX(int_score[i], max_score); - } - - // Make decisions based on the model scores. - int thresh = max_score; - switch (bsize) { - case BLOCK_16X16: thresh -= 150; break; - case BLOCK_32X32: thresh -= 100; break; - default: break; - } - *horza_partition_allowed = 0; - *horzb_partition_allowed = 0; - *verta_partition_allowed = 0; - *vertb_partition_allowed = 0; - for (int i = 0; i < 16; ++i) { - if (int_score[i] >= thresh) { - if ((i >> 0) & 1) *horza_partition_allowed = 1; - if ((i >> 1) & 1) *horzb_partition_allowed = 1; - if ((i >> 2) & 1) *verta_partition_allowed = 1; - if ((i >> 3) & 1) *vertb_partition_allowed = 1; - } - } -} - -#define FEATURES 18 -#define LABELS 4 -// Use a ML model to predict if horz4 and vert4 should be considered. -static void ml_prune_4_partition(const AV1_COMP *const cpi, MACROBLOCK *const x, - BLOCK_SIZE bsize, int part_ctx, - int64_t best_rd, int64_t horz_rd[2], - int64_t vert_rd[2], int64_t split_rd[4], - int *const partition_horz4_allowed, - int *const partition_vert4_allowed, - unsigned int pb_source_variance, int mi_row, - int mi_col) { - if (best_rd >= 1000000000) return; - const NN_CONFIG *nn_config = NULL; - switch (bsize) { - case BLOCK_16X16: nn_config = &av1_4_partition_nnconfig_16; break; - case BLOCK_32X32: nn_config = &av1_4_partition_nnconfig_32; break; - case BLOCK_64X64: nn_config = &av1_4_partition_nnconfig_64; break; - default: assert(0 && "Unexpected bsize."); - } - if (!nn_config) return; - - aom_clear_system_state(); - - // Generate features. - float features[FEATURES]; - int feature_index = 0; - features[feature_index++] = (float)part_ctx; - features[feature_index++] = (float)get_unsigned_bits(pb_source_variance); - - const int rdcost = (int)AOMMIN(INT_MAX, best_rd); - int sub_block_rdcost[8] = { 0 }; - int rd_index = 0; - for (int i = 0; i < 2; ++i) { - if (horz_rd[i] > 0 && horz_rd[i] < 1000000000) - sub_block_rdcost[rd_index] = (int)horz_rd[i]; - ++rd_index; - } - for (int i = 0; i < 2; ++i) { - if (vert_rd[i] > 0 && vert_rd[i] < 1000000000) - sub_block_rdcost[rd_index] = (int)vert_rd[i]; - ++rd_index; - } - for (int i = 0; i < 4; ++i) { - if (split_rd[i] > 0 && split_rd[i] < 1000000000) - sub_block_rdcost[rd_index] = (int)split_rd[i]; - ++rd_index; - } - for (int i = 0; i < 8; ++i) { - // Ratio between the sub-block RD and the whole-block RD. - float rd_ratio = 1.0f; - if (sub_block_rdcost[i] > 0 && sub_block_rdcost[i] < rdcost) - rd_ratio = (float)sub_block_rdcost[i] / (float)rdcost; - features[feature_index++] = rd_ratio; - } - - // Get variance of the 1:4 and 4:1 sub-blocks. - unsigned int horz_4_source_var[4] = { 0 }; - unsigned int vert_4_source_var[4] = { 0 }; - { - BLOCK_SIZE horz_4_bs = get_partition_subsize(bsize, PARTITION_HORZ_4); - BLOCK_SIZE vert_4_bs = get_partition_subsize(bsize, PARTITION_VERT_4); - av1_setup_src_planes(x, cpi->source, mi_row, mi_col, - av1_num_planes(&cpi->common), bsize); - const int src_stride = x->plane[0].src.stride; - const uint8_t *src = x->plane[0].src.buf; - const MACROBLOCKD *const xd = &x->e_mbd; - for (int i = 0; i < 4; ++i) { - const uint8_t *horz_src = - src + i * block_size_high[horz_4_bs] * src_stride; - const uint8_t *vert_src = src + i * block_size_wide[vert_4_bs]; - unsigned int horz_var, vert_var, sse; - if (is_cur_buf_hbd(xd)) { - switch (xd->bd) { - case 10: - horz_var = cpi->fn_ptr[horz_4_bs].vf( - horz_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_10), - 0, &sse); - vert_var = cpi->fn_ptr[vert_4_bs].vf( - vert_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_10), - 0, &sse); - break; - case 12: - horz_var = cpi->fn_ptr[horz_4_bs].vf( - horz_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_12), - 0, &sse); - vert_var = cpi->fn_ptr[vert_4_bs].vf( - vert_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_12), - 0, &sse); - break; - case 8: - default: - horz_var = cpi->fn_ptr[horz_4_bs].vf( - horz_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_8), - 0, &sse); - vert_var = cpi->fn_ptr[vert_4_bs].vf( - vert_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_8), - 0, &sse); - break; - } - horz_4_source_var[i] = - ROUND_POWER_OF_TWO(horz_var, num_pels_log2_lookup[horz_4_bs]); - vert_4_source_var[i] = - ROUND_POWER_OF_TWO(vert_var, num_pels_log2_lookup[vert_4_bs]); - } else { - horz_var = cpi->fn_ptr[horz_4_bs].vf(horz_src, src_stride, AV1_VAR_OFFS, - 0, &sse); - vert_var = cpi->fn_ptr[vert_4_bs].vf(vert_src, src_stride, AV1_VAR_OFFS, - 0, &sse); - horz_4_source_var[i] = - ROUND_POWER_OF_TWO(horz_var, num_pels_log2_lookup[horz_4_bs]); - vert_4_source_var[i] = - ROUND_POWER_OF_TWO(vert_var, num_pels_log2_lookup[vert_4_bs]); - } - } - } - - const float denom = (float)(pb_source_variance + 1); - const float low_b = 0.1f; - const float high_b = 10.0f; - for (int i = 0; i < 4; ++i) { - // Ratio between the 4:1 sub-block variance and the whole-block variance. - float var_ratio = (float)(horz_4_source_var[i] + 1) / denom; - if (var_ratio < low_b) var_ratio = low_b; - if (var_ratio > high_b) var_ratio = high_b; - features[feature_index++] = var_ratio; - } - for (int i = 0; i < 4; ++i) { - // Ratio between the 1:4 sub-block RD and the whole-block RD. - float var_ratio = (float)(vert_4_source_var[i] + 1) / denom; - if (var_ratio < low_b) var_ratio = low_b; - if (var_ratio > high_b) var_ratio = high_b; - features[feature_index++] = var_ratio; - } - assert(feature_index == FEATURES); - - // Calculate scores using the NN model. - float score[LABELS] = { 0.0f }; - av1_nn_predict(features, nn_config, score); - aom_clear_system_state(); - int int_score[LABELS]; - int max_score = -1000; - for (int i = 0; i < LABELS; ++i) { - int_score[i] = (int)(100 * score[i]); - max_score = AOMMAX(int_score[i], max_score); - } - - // Make decisions based on the model scores. - int thresh = max_score; - switch (bsize) { - case BLOCK_16X16: thresh -= 500; break; - case BLOCK_32X32: thresh -= 500; break; - case BLOCK_64X64: thresh -= 200; break; - default: break; - } - *partition_horz4_allowed = 0; - *partition_vert4_allowed = 0; - for (int i = 0; i < LABELS; ++i) { - if (int_score[i] >= thresh) { - if ((i >> 0) & 1) *partition_horz4_allowed = 1; - if ((i >> 1) & 1) *partition_vert4_allowed = 1; - } - } -} -#undef FEATURES -#undef LABELS - -#define FEATURES 4 -// ML-based partition search breakout. -static int ml_predict_breakout(const AV1_COMP *const cpi, BLOCK_SIZE bsize, - const MACROBLOCK *const x, - const RD_STATS *const rd_stats, - unsigned int pb_source_variance) { - const NN_CONFIG *nn_config = NULL; - int thresh = 0; - switch (bsize) { - case BLOCK_8X8: - nn_config = &av1_partition_breakout_nnconfig_8; - thresh = cpi->sf.ml_partition_search_breakout_thresh[0]; - break; - case BLOCK_16X16: - nn_config = &av1_partition_breakout_nnconfig_16; - thresh = cpi->sf.ml_partition_search_breakout_thresh[1]; - break; - case BLOCK_32X32: - nn_config = &av1_partition_breakout_nnconfig_32; - thresh = cpi->sf.ml_partition_search_breakout_thresh[2]; - break; - case BLOCK_64X64: - nn_config = &av1_partition_breakout_nnconfig_64; - thresh = cpi->sf.ml_partition_search_breakout_thresh[3]; - break; - case BLOCK_128X128: - nn_config = &av1_partition_breakout_nnconfig_128; - thresh = cpi->sf.ml_partition_search_breakout_thresh[4]; - break; - default: assert(0 && "Unexpected bsize."); - } - if (!nn_config || thresh < 0) return 0; - - // Generate feature values. - float features[FEATURES]; - int feature_index = 0; - aom_clear_system_state(); - - const int num_pels_log2 = num_pels_log2_lookup[bsize]; - float rate_f = (float)AOMMIN(rd_stats->rate, INT_MAX); - rate_f = ((float)x->rdmult / 128.0f / 512.0f / (float)(1 << num_pels_log2)) * - rate_f; - features[feature_index++] = rate_f; - - const float dist_f = - (float)(AOMMIN(rd_stats->dist, INT_MAX) >> num_pels_log2); - features[feature_index++] = dist_f; - - features[feature_index++] = (float)pb_source_variance; - - const int dc_q = (int)x->plane[0].dequant_QTX[0]; - features[feature_index++] = (float)(dc_q * dc_q) / 256.0f; - assert(feature_index == FEATURES); - - // Calculate score using the NN model. - float score = 0.0f; - av1_nn_predict(features, nn_config, &score); - aom_clear_system_state(); - - // Make decision. - return (int)(score * 100) >= thresh; -} -#undef FEATURES - -static void update_picked_ref_frames_mask(MACROBLOCK *const x, int ref_type, - BLOCK_SIZE bsize, int mib_size, - int mi_row, int mi_col) { +static AOM_INLINE void update_picked_ref_frames_mask(MACROBLOCK *const x, + int ref_type, + BLOCK_SIZE bsize, + int mib_size, int mi_row, + int mi_col) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
pc_tree->pc_tree_stats.sub_block_rdcost[i] = INT64_MAX; } if (bsize >= BLOCK_8X8) { BLOCK_SIZE subsize = get_partition_subsize(bsize, PARTITION_SPLIT); for (int idx = 0; idx < 4; ++idx) reset_partition(pc_tree->split[idx], subsize); } }
+ show +
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
static void rd_pick_sqr_partition(AV1_COMP *const cpi, ThreadData *td, TileDataEnc *tile_data, TOKENEXTRA **tp, int mi_row, int mi_col, BLOCK_SIZE bsize, RD_STATS *rd_cost, int64_t best_rd, PC_TREE *pc_tree, int64_t *none_rd) { const AV1_COMMON *const cm = &cpi->common; TileInfo *const tile_info = &tile_data->tile_info; MACROBLOCK *const x = &td->mb; MACROBLOCKD *const xd = &x->e_mbd; const int mi_step = mi_size_wide[bsize] / 2; RD_SEARCH_MACROBLOCK_CONTEXT x_ctx; const TOKENEXTRA *const tp_orig = *tp; PICK_MODE_CONTEXT *ctx_none = &pc_tree->none; int tmp_partition_cost[PARTITION_TYPES]; BLOCK_SIZE subsize; RD_STATS this_rdc, sum_rdc, best_rdc, pn_rdc; const int bsize_at_least_8x8 = (bsize >= BLOCK_8X8); int do_square_split = bsize_at_least_8x8; const int pl = bsize_at_least_8x8 ? partition_plane_context(xd, mi_row, mi_col, bsize) : 0; const int *partition_cost = pl >= 0 ? x->partition_cost[pl] : x->partition_cost[0]; const int num_planes = av1_num_planes(cm); int64_t split_rd[4] = { 0, 0, 0, 0 }; // Override skipping rectangular partition operations for edge blocks const int has_rows = (mi_row + mi_step < cm->mi_rows); const int has_cols = (mi_col + mi_step < cm->mi_cols); if (none_rd) *none_rd = 0; int partition_none_allowed = has_rows && has_cols; (void)*tp_orig; (void)split_rd; if (best_rd < 0) { pc_tree->none.rdcost = INT64_MAX; pc_tree->none.skip = 0; av1_invalid_rd_stats(rd_cost); return; } pc_tree->pc_tree_stats.valid = 1; // Override partition costs at the edges of the frame in the same // way as in read_partition (see decodeframe.c) if (!(has_rows && has_cols)) { assert(bsize_at_least_8x8 && pl >= 0); const aom_cdf_prob *partition_cdf = cm->fc->partition_cdf[pl]; for (int i = 0; i < PARTITION_TYPES; ++i) tmp_partition_cost[i] = INT_MAX; if (has_cols) { // At the bottom, the two possibilities are HORZ and SPLIT aom_cdf_prob bot_cdf[2]; partition_gather_vert_alike(bot_cdf, partition_cdf, bsize); static const int bot_inv_map[2] = { PARTITION_HORZ, PARTITION_SPLIT }; av1_cost_tokens_from_cdf(tmp_partition_cost, bot_cdf, bot_inv_map); } else if (has_rows) { // At the right, the two possibilities are VERT and SPLIT aom_cdf_prob rhs_cdf[2]; partition_gather_horz_alike(rhs_cdf, partition_cdf, bsize); static const int rhs_inv_map[2] = { PARTITION_VERT, PARTITION_SPLIT }; av1_cost_tokens_from_cdf(tmp_partition_cost, rhs_cdf, rhs_inv_map); } else { // At the bottom right, we always split tmp_partition_cost[PARTITION_SPLIT] = 0; } partition_cost = tmp_partition_cost; } #ifndef NDEBUG // Nothing should rely on the default value of this array (which is just // leftover from encoding the previous block. Setting it to fixed pattern // when debugging. // bit 0, 1, 2 are blk_skip of each plane // bit 4, 5, 6 are initialization checking of each plane memset(x->blk_skip, 0x77, sizeof(x->blk_skip)); #endif // NDEBUG assert(mi_size_wide[bsize] == mi_size_high[bsize]); av1_init_rd_stats(&this_rdc); av1_init_rd_stats(&sum_rdc); av1_invalid_rd_stats(&best_rdc); best_rdc.rdcost = best_rd; set_offsets(cpi, tile_info, x, mi_row, mi_col, bsize); if (bsize == BLOCK_16X16 && cpi->vaq_refresh) x->mb_energy = av1_log_block_var(cpi, x, bsize); xd->above_txfm_context = cm->above_txfm_context[tile_info->tile_row] + mi_col; xd->left_txfm_context = xd->left_txfm_context_buffer + (mi_row & MAX_MIB_MASK); save_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); #if CONFIG_DIST_8X8 if (x->using_dist_8x8) { if (block_size_high[bsize] <= 8 || block_size_wide[bsize] <= 8) do_square_split = 0; } #endif // PARTITION_NONE if (partition_none_allowed) { int pt_cost = 0; if (bsize_at_least_8x8) { pc_tree->partitioning = PARTITION_NONE; pt_cost = partition_cost[PARTITION_NONE] < INT_MAX ? partition_cost[PARTITION_NONE] : 0; } const int64_t partition_rd_cost = RDCOST(x->rdmult, pt_cost, 0); const int64_t best_remain_rdcost = best_rdc.rdcost == INT64_MAX ? INT64_MAX : (best_rdc.rdcost - partition_rd_cost); pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, &this_rdc, PARTITION_NONE, bsize, ctx_none, best_remain_rdcost, 0); pc_tree->pc_tree_stats.rdcost = ctx_none->rdcost; pc_tree->pc_tree_stats.skip = ctx_none->skip; if (none_rd) *none_rd = this_rdc.rdcost; if (this_rdc.rate != INT_MAX) { if (bsize_at_least_8x8) { this_rdc.rate += pt_cost; this_rdc.rdcost = RDCOST(x->rdmult, this_rdc.rate, this_rdc.dist); } if (this_rdc.rdcost < best_rdc.rdcost) { // Adjust dist breakout threshold according to the partition size. const int64_t dist_breakout_thr = cpi->sf.partition_search_breakout_dist_thr >> ((2 * (MAX_SB_SIZE_LOG2 - 2)) - (mi_size_wide_log2[bsize] + mi_size_high_log2[bsize])); const int rate_breakout_thr = cpi->sf.partition_search_breakout_rate_thr * num_pels_log2_lookup[bsize]; best_rdc = this_rdc; if (bsize_at_least_8x8) pc_tree->partitioning = PARTITION_NONE; pc_tree->cb_search_range = SEARCH_FULL_PLANE; if (!x->e_mbd.lossless[xd->mi[0]->segment_id] && ctx_none->skippable) { const int use_ml_based_breakout = bsize <= cpi->sf.use_square_partition_only_threshold && bsize > BLOCK_4X4 && xd->bd == 8; // TODO(anyone): Currently this is using the same model and threshold // values as in rd_pick_partition. Retraining the model and tuning the // threshold values might be helpful to improve the speed. if (use_ml_based_breakout) { if (ml_predict_breakout(cpi, bsize, x, &this_rdc, x->source_variance)) { do_square_split = 0; } } // If all y, u, v transform blocks in this partition are skippable, // and the dist & rate are within the thresholds, the partition search // is terminated for current branch of the partition search tree. The // dist & rate thresholds are set to 0 at speed 0 to disable the early // termination at that speed. if (best_rdc.dist < dist_breakout_thr && best_rdc.rate < rate_breakout_thr) { do_square_split = 0; } } if (cpi->sf.firstpass_simple_motion_search_early_term && cm->show_frame && bsize <= BLOCK_32X32 && bsize >= BLOCK_8X8 && !frame_is_intra_only(cm) && mi_row + mi_step < cm->mi_rows && mi_col + mi_step < cm->mi_cols && this_rdc.rdcost < INT64_MAX && this_rdc.rdcost >= 0 && this_rdc.rate < INT_MAX && this_rdc.rate >= 0 && do_square_split) { av1_firstpass_simple_motion_search_early_term( cpi, x, pc_tree, mi_row, mi_col, bsize, &this_rdc, &do_square_split); } } } restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); } // store estimated motion vector if (cpi->sf.adaptive_motion_search) store_pred_mv(x, ctx_none); int64_t temp_best_rdcost = best_rdc.rdcost; pn_rdc = best_rdc; // PARTITION_SPLIT if (do_square_split) { int reached_last_index = 0; subsize = get_partition_subsize(bsize, PARTITION_SPLIT); int idx; sum_rdc.rate = partition_cost[PARTITION_SPLIT]; sum_rdc.rdcost = RDCOST(x->rdmult, sum_rdc.rate, 0); for (idx = 0; idx < 4 && sum_rdc.rdcost < temp_best_rdcost; ++idx) { const int x_idx = (idx & 1) * mi_step; const int y_idx = (idx >> 1) * mi_step; if (mi_row + y_idx >= cm->mi_rows || mi_col + x_idx >= cm->mi_cols) continue; if (cpi->sf.adaptive_motion_search) load_pred_mv(x, ctx_none); pc_tree->split[idx]->index = idx; int64_t *p_split_rd = &split_rd[idx]; const int64_t best_remain_rdcost = (temp_best_rdcost == INT64_MAX) ? INT64_MAX : (temp_best_rdcost - sum_rdc.rdcost); rd_pick_sqr_partition( cpi, td, tile_data, tp, mi_row + y_idx, mi_col + x_idx, subsize, &this_rdc, best_remain_rdcost, pc_tree->split[idx], p_split_rd); pc_tree->pc_tree_stats.sub_block_rdcost[idx] = this_rdc.rdcost; pc_tree->pc_tree_stats.sub_block_skip[idx] = pc_tree->split[idx]->none.skip; if (this_rdc.rate == INT_MAX) { sum_rdc.rdcost = INT64_MAX; break; } else { sum_rdc.rate += this_rdc.rate; sum_rdc.dist += this_rdc.dist; sum_rdc.rdcost += this_rdc.rdcost; } } reached_last_index = (idx == 4); if (reached_last_index && sum_rdc.rdcost < best_rdc.rdcost) { sum_rdc.rdcost = RDCOST(x->rdmult, sum_rdc.rate, sum_rdc.dist); if (sum_rdc.rdcost < best_rdc.rdcost) { best_rdc = sum_rdc; pc_tree->partitioning = PARTITION_SPLIT; } } int has_split = 0; if (pc_tree->partitioning == PARTITION_SPLIT) { for (int cb_idx = 0; cb_idx <= AOMMIN(idx, 3); ++cb_idx) { if (pc_tree->split[cb_idx]->partitioning == PARTITION_SPLIT) ++has_split; } if (has_split >= 3 || sum_rdc.rdcost < (pn_rdc.rdcost >> 1)) { pc_tree->cb_search_range = SPLIT_PLANE; } } if (pc_tree->partitioning == PARTITION_NONE) { pc_tree->cb_search_range = SEARCH_SAME_PLANE; if (pn_rdc.dist <= sum_rdc.dist) pc_tree->cb_search_range = NONE_PARTITION_PLANE; } if (pn_rdc.rate == INT_MAX) pc_tree->cb_search_range = NONE_PARTITION_PLANE; restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); } // if (do_split) pc_tree->pc_tree_stats.split = pc_tree->partitioning == PARTITION_SPLIT; if (do_square_split) { for (int i = 0; i < 4; ++i) { pc_tree->pc_tree_stats.sub_block_split[i] = pc_tree->split[i]->partitioning == PARTITION_SPLIT; } } // TODO(jbb): This code added so that we avoid static analysis // warning related to the fact that best_rd isn't used after this // point. This code should be refactored so that the duplicate // checks occur in some sub function and thus are used... (void)best_rd; *rd_cost = best_rdc; if (best_rdc.rate < INT_MAX && best_rdc.dist < INT64_MAX && pc_tree->index != 3) { if (bsize == cm->seq_params.sb_size) { restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); } else { encode_sb(cpi, td, tile_data, tp, mi_row, mi_col, DRY_RUN_NORMAL, bsize, pc_tree, NULL); } } if (bsize == cm->seq_params.sb_size) { assert(best_rdc.rate < INT_MAX); assert(best_rdc.dist < INT64_MAX); } else { assert(tp_orig == *tp); } } // split_score indicates confidence of picking split partition; // none_score indicates confidence of picking none partition; #define FEATURE_SIZE 19 static int ml_prune_2pass_split_partition(const PC_TREE_STATS *pc_tree_stats, BLOCK_SIZE bsize, int *split_score, int *none_score) { if (!pc_tree_stats->valid) return 0; const float *split_weights = NULL; const float *none_weights = NULL; switch (bsize) { case BLOCK_4X4: break; case BLOCK_8X8: split_weights = av1_2pass_split_partition_weights_8; none_weights = av1_2pass_none_partition_weights_8; break; case BLOCK_16X16: split_weights = av1_2pass_split_partition_weights_16; none_weights = av1_2pass_none_partition_weights_16; break; case BLOCK_32X32: split_weights = av1_2pass_split_partition_weights_32; none_weights = av1_2pass_none_partition_weights_32; break; case BLOCK_64X64: split_weights = av1_2pass_split_partition_weights_64; none_weights = av1_2pass_none_partition_weights_64; break; case BLOCK_128X128: split_weights = av1_2pass_split_partition_weights_128; none_weights = av1_2pass_none_partition_weights_128; break; default: assert(0 && "Unexpected bsize."); } if (!split_weights || !none_weights) return 0; aom_clear_system_state(); float features[FEATURE_SIZE]; int feature_index = 0; features[feature_index++] = (float)pc_tree_stats->split; features[feature_index++] = (float)pc_tree_stats->skip; const int rdcost = (int)AOMMIN(INT_MAX, pc_tree_stats->rdcost); const int rd_valid = rdcost > 0 && rdcost < 1000000000; features[feature_index++] = (float)rd_valid; for (int i = 0; i < 4; ++i) { features[feature_index++] = (float)pc_tree_stats->sub_block_split[i]; features[feature_index++] = (float)pc_tree_stats->sub_block_skip[i]; const int sub_rdcost = (int)AOMMIN(INT_MAX, pc_tree_stats->sub_block_rdcost[i]); const int sub_rd_valid = sub_rdcost > 0 && sub_rdcost < 1000000000; features[feature_index++] = (float)sub_rd_valid; // Ratio between the sub-block RD and the whole-block RD. float rd_ratio = 1.0f; if (rd_valid && sub_rd_valid && sub_rdcost < rdcost) rd_ratio = (float)sub_rdcost / (float)rdcost; features[feature_index++] = rd_ratio; } assert(feature_index == FEATURE_SIZE); float score_1 = split_weights[FEATURE_SIZE]; float score_2 = none_weights[FEATURE_SIZE]; for (int i = 0; i < FEATURE_SIZE; ++i) { score_1 += features[i] * split_weights[i]; score_2 += features[i] * none_weights[i]; } *split_score = (int)(score_1 * 100); *none_score = (int)(score_2 * 100); return 1; } #undef FEATURE_SIZE static void ml_prune_rect_partition(const AV1_COMP *const cpi, const MACROBLOCK *const x, BLOCK_SIZE bsize, int64_t best_rd, int64_t none_rd, int64_t *split_rd, int *const dst_prune_horz, int *const dst_prune_vert) { if (bsize < BLOCK_8X8 || best_rd >= 1000000000) return; best_rd = AOMMAX(best_rd, 1); const NN_CONFIG *nn_config = NULL; const float prob_thresholds[5] = { 0.01f, 0.01f, 0.004f, 0.002f, 0.002f }; float cur_thresh = 0.0f; switch (bsize) { case BLOCK_8X8: nn_config = &av1_rect_partition_nnconfig_8; cur_thresh = prob_thresholds[0]; break; case BLOCK_16X16: nn_config = &av1_rect_partition_nnconfig_16; cur_thresh = prob_thresholds[1]; break; case BLOCK_32X32: nn_config = &av1_rect_partition_nnconfig_32; cur_thresh = prob_thresholds[2]; break; case BLOCK_64X64: nn_config = &av1_rect_partition_nnconfig_64; cur_thresh = prob_thresholds[3]; break; case BLOCK_128X128: nn_config = &av1_rect_partition_nnconfig_128; cur_thresh = prob_thresholds[4]; break; default: assert(0 && "Unexpected bsize."); } if (!nn_config) return; aom_clear_system_state(); // 1. Compute input features float features[9]; // RD cost ratios for (int i = 0; i < 5; i++) features[i] = 1.0f; if (none_rd > 0 && none_rd < 1000000000) features[0] = (float)none_rd / (float)best_rd; for (int i = 0; i < 4; i++) { if (split_rd[i] > 0 && split_rd[i] < 1000000000) features[1 + i] = (float)split_rd[i] / (float)best_rd; } // Variance ratios const MACROBLOCKD *const xd = &x->e_mbd; int whole_block_variance; if (is_cur_buf_hbd(xd)) { whole_block_variance = av1_high_get_sby_perpixel_variance( cpi, &x->plane[0].src, bsize, xd->bd); } else { whole_block_variance = av1_get_sby_perpixel_variance(cpi, &x->plane[0].src, bsize); } whole_block_variance = AOMMAX(whole_block_variance, 1); int split_variance[4]; const BLOCK_SIZE subsize = get_partition_subsize(bsize, PARTITION_SPLIT); struct buf_2d buf; buf.stride = x->plane[0].src.stride; const int bw = block_size_wide[bsize]; for (int i = 0; i < 4; ++i) { const int x_idx = (i & 1) * bw / 2; const int y_idx = (i >> 1) * bw / 2; buf.buf = x->plane[0].src.buf + x_idx + y_idx * buf.stride; if (is_cur_buf_hbd(xd)) { split_variance[i] = av1_high_get_sby_perpixel_variance(cpi, &buf, subsize, xd->bd); } else { split_variance[i] = av1_get_sby_perpixel_variance(cpi, &buf, subsize); } } for (int i = 0; i < 4; i++) features[5 + i] = (float)split_variance[i] / (float)whole_block_variance; // 2. Do the prediction and prune 0-2 partitions based on their probabilities float raw_scores[3] = { 0.0f }; av1_nn_predict(features, nn_config, raw_scores); aom_clear_system_state(); float probs[3] = { 0.0f }; av1_nn_softmax(raw_scores, probs, 3); // probs[0] is the probability of the fact that both rectangular partitions // are worse than current best_rd if (probs[1] <= cur_thresh) (*dst_prune_horz) = 1; if (probs[2] <= cur_thresh) (*dst_prune_vert) = 1; } // Use a ML model to predict if horz_a, horz_b, vert_a, and vert_b should be // considered. static void ml_prune_ab_partition(BLOCK_SIZE bsize, int part_ctx, int var_ctx, int64_t best_rd, int64_t horz_rd[2], int64_t vert_rd[2], int64_t split_rd[4], int *const horza_partition_allowed, int *const horzb_partition_allowed, int *const verta_partition_allowed, int *const vertb_partition_allowed) { if (bsize < BLOCK_8X8 || best_rd >= 1000000000) return; const NN_CONFIG *nn_config = NULL; switch (bsize) { case BLOCK_8X8: nn_config = NULL; break; case BLOCK_16X16: nn_config = &av1_ab_partition_nnconfig_16; break; case BLOCK_32X32: nn_config = &av1_ab_partition_nnconfig_32; break; case BLOCK_64X64: nn_config = &av1_ab_partition_nnconfig_64; break; case BLOCK_128X128: nn_config = &av1_ab_partition_nnconfig_128; break; default: assert(0 && "Unexpected bsize."); } if (!nn_config) return; aom_clear_system_state(); // Generate features. float features[10]; int feature_index = 0; features[feature_index++] = (float)part_ctx; features[feature_index++] = (float)var_ctx; const int rdcost = (int)AOMMIN(INT_MAX, best_rd); int sub_block_rdcost[8] = { 0 }; int rd_index = 0; for (int i = 0; i < 2; ++i) { if (horz_rd[i] > 0 && horz_rd[i] < 1000000000) sub_block_rdcost[rd_index] = (int)horz_rd[i]; ++rd_index; } for (int i = 0; i < 2; ++i) { if (vert_rd[i] > 0 && vert_rd[i] < 1000000000) sub_block_rdcost[rd_index] = (int)vert_rd[i]; ++rd_index; } for (int i = 0; i < 4; ++i) { if (split_rd[i] > 0 && split_rd[i] < 1000000000) sub_block_rdcost[rd_index] = (int)split_rd[i]; ++rd_index; } for (int i = 0; i < 8; ++i) { // Ratio between the sub-block RD and the whole-block RD. float rd_ratio = 1.0f; if (sub_block_rdcost[i] > 0 && sub_block_rdcost[i] < rdcost) rd_ratio = (float)sub_block_rdcost[i] / (float)rdcost; features[feature_index++] = rd_ratio; } assert(feature_index == 10); // Calculate scores using the NN model. float score[16] = { 0.0f }; av1_nn_predict(features, nn_config, score); aom_clear_system_state(); int int_score[16]; int max_score = -1000; for (int i = 0; i < 16; ++i) { int_score[i] = (int)(100 * score[i]); max_score = AOMMAX(int_score[i], max_score); } // Make decisions based on the model scores. int thresh = max_score; switch (bsize) { case BLOCK_16X16: thresh -= 150; break; case BLOCK_32X32: thresh -= 100; break; default: break; } *horza_partition_allowed = 0; *horzb_partition_allowed = 0; *verta_partition_allowed = 0; *vertb_partition_allowed = 0; for (int i = 0; i < 16; ++i) { if (int_score[i] >= thresh) { if ((i >> 0) & 1) *horza_partition_allowed = 1; if ((i >> 1) & 1) *horzb_partition_allowed = 1; if ((i >> 2) & 1) *verta_partition_allowed = 1; if ((i >> 3) & 1) *vertb_partition_allowed = 1; } } } #define FEATURES 18 #define LABELS 4 // Use a ML model to predict if horz4 and vert4 should be considered. static void ml_prune_4_partition(const AV1_COMP *const cpi, MACROBLOCK *const x, BLOCK_SIZE bsize, int part_ctx, int64_t best_rd, int64_t horz_rd[2], int64_t vert_rd[2], int64_t split_rd[4], int *const partition_horz4_allowed, int *const partition_vert4_allowed, unsigned int pb_source_variance, int mi_row, int mi_col) { if (best_rd >= 1000000000) return; const NN_CONFIG *nn_config = NULL; switch (bsize) { case BLOCK_16X16: nn_config = &av1_4_partition_nnconfig_16; break; case BLOCK_32X32: nn_config = &av1_4_partition_nnconfig_32; break; case BLOCK_64X64: nn_config = &av1_4_partition_nnconfig_64; break; default: assert(0 && "Unexpected bsize."); } if (!nn_config) return; aom_clear_system_state(); // Generate features. float features[FEATURES]; int feature_index = 0; features[feature_index++] = (float)part_ctx; features[feature_index++] = (float)get_unsigned_bits(pb_source_variance); const int rdcost = (int)AOMMIN(INT_MAX, best_rd); int sub_block_rdcost[8] = { 0 }; int rd_index = 0; for (int i = 0; i < 2; ++i) { if (horz_rd[i] > 0 && horz_rd[i] < 1000000000) sub_block_rdcost[rd_index] = (int)horz_rd[i]; ++rd_index; } for (int i = 0; i < 2; ++i) { if (vert_rd[i] > 0 && vert_rd[i] < 1000000000) sub_block_rdcost[rd_index] = (int)vert_rd[i]; ++rd_index; } for (int i = 0; i < 4; ++i) { if (split_rd[i] > 0 && split_rd[i] < 1000000000) sub_block_rdcost[rd_index] = (int)split_rd[i]; ++rd_index; } for (int i = 0; i < 8; ++i) { // Ratio between the sub-block RD and the whole-block RD. float rd_ratio = 1.0f; if (sub_block_rdcost[i] > 0 && sub_block_rdcost[i] < rdcost) rd_ratio = (float)sub_block_rdcost[i] / (float)rdcost; features[feature_index++] = rd_ratio; } // Get variance of the 1:4 and 4:1 sub-blocks. unsigned int horz_4_source_var[4] = { 0 }; unsigned int vert_4_source_var[4] = { 0 }; { BLOCK_SIZE horz_4_bs = get_partition_subsize(bsize, PARTITION_HORZ_4); BLOCK_SIZE vert_4_bs = get_partition_subsize(bsize, PARTITION_VERT_4); av1_setup_src_planes(x, cpi->source, mi_row, mi_col, av1_num_planes(&cpi->common), bsize); const int src_stride = x->plane[0].src.stride; const uint8_t *src = x->plane[0].src.buf; const MACROBLOCKD *const xd = &x->e_mbd; for (int i = 0; i < 4; ++i) { const uint8_t *horz_src = src + i * block_size_high[horz_4_bs] * src_stride; const uint8_t *vert_src = src + i * block_size_wide[vert_4_bs]; unsigned int horz_var, vert_var, sse; if (is_cur_buf_hbd(xd)) { switch (xd->bd) { case 10: horz_var = cpi->fn_ptr[horz_4_bs].vf( horz_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_10), 0, &sse); vert_var = cpi->fn_ptr[vert_4_bs].vf( vert_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_10), 0, &sse); break; case 12: horz_var = cpi->fn_ptr[horz_4_bs].vf( horz_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_12), 0, &sse); vert_var = cpi->fn_ptr[vert_4_bs].vf( vert_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_12), 0, &sse); break; case 8: default: horz_var = cpi->fn_ptr[horz_4_bs].vf( horz_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_8), 0, &sse); vert_var = cpi->fn_ptr[vert_4_bs].vf( vert_src, src_stride, CONVERT_TO_BYTEPTR(AV1_HIGH_VAR_OFFS_8), 0, &sse); break; } horz_4_source_var[i] = ROUND_POWER_OF_TWO(horz_var, num_pels_log2_lookup[horz_4_bs]); vert_4_source_var[i] = ROUND_POWER_OF_TWO(vert_var, num_pels_log2_lookup[vert_4_bs]); } else { horz_var = cpi->fn_ptr[horz_4_bs].vf(horz_src, src_stride, AV1_VAR_OFFS, 0, &sse); vert_var = cpi->fn_ptr[vert_4_bs].vf(vert_src, src_stride, AV1_VAR_OFFS, 0, &sse); horz_4_source_var[i] = ROUND_POWER_OF_TWO(horz_var, num_pels_log2_lookup[horz_4_bs]); vert_4_source_var[i] = ROUND_POWER_OF_TWO(vert_var, num_pels_log2_lookup[vert_4_bs]); } } } const float denom = (float)(pb_source_variance + 1); const float low_b = 0.1f; const float high_b = 10.0f; for (int i = 0; i < 4; ++i) { // Ratio between the 4:1 sub-block variance and the whole-block variance. float var_ratio = (float)(horz_4_source_var[i] + 1) / denom; if (var_ratio < low_b) var_ratio = low_b; if (var_ratio > high_b) var_ratio = high_b; features[feature_index++] = var_ratio; } for (int i = 0; i < 4; ++i) { // Ratio between the 1:4 sub-block RD and the whole-block RD. float var_ratio = (float)(vert_4_source_var[i] + 1) / denom; if (var_ratio < low_b) var_ratio = low_b; if (var_ratio > high_b) var_ratio = high_b; features[feature_index++] = var_ratio; } assert(feature_index == FEATURES); // Calculate scores using the NN model. float score[LABELS] = { 0.0f }; av1_nn_predict(features, nn_config, score); aom_clear_system_state(); int int_score[LABELS]; int max_score = -1000; for (int i = 0; i < LABELS; ++i) { int_score[i] = (int)(100 * score[i]); max_score = AOMMAX(int_score[i], max_score); } // Make decisions based on the model scores. int thresh = max_score; switch (bsize) { case BLOCK_16X16: thresh -= 500; break; case BLOCK_32X32: thresh -= 500; break; case BLOCK_64X64: thresh -= 200; break; default: break; } *partition_horz4_allowed = 0; *partition_vert4_allowed = 0; for (int i = 0; i < LABELS; ++i) { if (int_score[i] >= thresh) { if ((i >> 0) & 1) *partition_horz4_allowed = 1; if ((i >> 1) & 1) *partition_vert4_allowed = 1; } } } #undef FEATURES #undef LABELS #define FEATURES 4 // ML-based partition search breakout. static int ml_predict_breakout(const AV1_COMP *const cpi, BLOCK_SIZE bsize, const MACROBLOCK *const x, const RD_STATS *const rd_stats, unsigned int pb_source_variance) { const NN_CONFIG *nn_config = NULL; int thresh = 0; switch (bsize) { case BLOCK_8X8: nn_config = &av1_partition_breakout_nnconfig_8; thresh = cpi->sf.ml_partition_search_breakout_thresh[0]; break; case BLOCK_16X16: nn_config = &av1_partition_breakout_nnconfig_16; thresh = cpi->sf.ml_partition_search_breakout_thresh[1]; break; case BLOCK_32X32: nn_config = &av1_partition_breakout_nnconfig_32; thresh = cpi->sf.ml_partition_search_breakout_thresh[2]; break; case BLOCK_64X64: nn_config = &av1_partition_breakout_nnconfig_64; thresh = cpi->sf.ml_partition_search_breakout_thresh[3]; break; case BLOCK_128X128: nn_config = &av1_partition_breakout_nnconfig_128; thresh = cpi->sf.ml_partition_search_breakout_thresh[4]; break; default: assert(0 && "Unexpected bsize."); } if (!nn_config || thresh < 0) return 0; // Generate feature values. float features[FEATURES]; int feature_index = 0; aom_clear_system_state(); const int num_pels_log2 = num_pels_log2_lookup[bsize]; float rate_f = (float)AOMMIN(rd_stats->rate, INT_MAX); rate_f = ((float)x->rdmult / 128.0f / 512.0f / (float)(1 << num_pels_log2)) * rate_f; features[feature_index++] = rate_f; const float dist_f = (float)(AOMMIN(rd_stats->dist, INT_MAX) >> num_pels_log2); features[feature_index++] = dist_f; features[feature_index++] = (float)pb_source_variance; const int dc_q = (int)x->plane[0].dequant_QTX[0]; features[feature_index++] = (float)(dc_q * dc_q) / 256.0f; assert(feature_index == FEATURES); // Calculate score using the NN model. float score = 0.0f; av1_nn_predict(features, nn_config, &score); aom_clear_system_state(); // Make decision. return (int)(score * 100) >= thresh; } #undef FEATURES // Record the ref frames that have been selected by square partition blocks. static void update_picked_ref_frames_mask(MACROBLOCK *const x, int ref_type, BLOCK_SIZE bsize, int mib_size, int mi_row, int mi_col) {
+ show +
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
assert(mi_size_wide[bsize] == mi_size_high[bsize]); const int sb_size_mask = mib_size - 1; const int mi_row_in_sb = mi_row & sb_size_mask; const int mi_col_in_sb = mi_col & sb_size_mask; const int mi_size = mi_size_wide[bsize]; for (int i = mi_row_in_sb; i < mi_row_in_sb + mi_size; ++i) { for (int j = mi_col_in_sb; j < mi_col_in_sb + mi_size; ++j) { x->picked_ref_frames_mask[i * 32 + j] |= 1 << ref_type; } }

[CVE-2020-0470_1.diff] encodeframe.c #88
+ av1_rd_cost_update(x->rdmult, &sum_rdc); - sum_rdc.rdcost = RDCOST(x->rdmult, sum_rdc.rate, sum_rdc.dist); - if (sum_rdc.rdcost < best_rdc.rdcost) { - best_rdc = sum_rdc; - pc_tree->partitioning = PARTITION_VERT; + best_rdc = sum_rdc; + found_best_partition = true; + pc_tree->partitioning = PARTITION_VERT; + } else { + // Update VERT win flag + if (rect_part_win_info != NULL) { + rect_part_win_info->vert_win = false;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
#if CONFIG_COLLECT_PARTITION_STATS if (partition_timer_on) { aom_usec_timer_mark(&partition_timer); int64_t time = aom_usec_timer_elapsed(&partition_timer); partition_times[PARTITION_VERT] += time; partition_timer_on = 0; } #endif if (sum_rdc.rdcost < best_rdc.rdcost) {
+ show +
3745
3746
3747
3748
sum_rdc.rdcost = RDCOST(x->rdmult, sum_rdc.rate, sum_rdc.dist); if (sum_rdc.rdcost < best_rdc.rdcost) { best_rdc = sum_rdc; pc_tree->partitioning = PARTITION_VERT;
+ show +
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
} } restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); } if (pb_source_variance == UINT_MAX) { av1_setup_src_planes(x, cpi->source, mi_row, mi_col, num_planes, bsize); if (is_cur_buf_hbd(xd)) { pb_source_variance = av1_high_get_sby_perpixel_variance(

[CVE-2020-0470_1.diff] encodeframe.c #90
-#if CONFIG_DIST_8X8 - if (x->using_dist_8x8) { - if (block_size_high[bsize] <= 8 || block_size_wide[bsize] <= 8) { - horzab_partition_allowed = 0; - vertab_partition_allowed = 0; - } - } -#endif - - if (cpi->sf.prune_ext_partition_types_search_level) { - if (cpi->sf.prune_ext_partition_types_search_level == 1) { + if (cpi->sf.part_sf.prune_ext_partition_types_search_level) { + if (cpi->sf.part_sf.prune_ext_partition_types_search_level == 1) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
const int ext_partition_allowed = do_rectangular_split && bsize > BLOCK_8X8 && partition_none_allowed; // The standard AB partitions are allowed whenever ext-partition-types are // allowed int horzab_partition_allowed = ext_partition_allowed & cpi->oxcf.enable_ab_partitions; int vertab_partition_allowed = ext_partition_allowed & cpi->oxcf.enable_ab_partitions;
+ show +
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
#if CONFIG_DIST_8X8 if (x->using_dist_8x8) { if (block_size_high[bsize] <= 8 || block_size_wide[bsize] <= 8) { horzab_partition_allowed = 0; vertab_partition_allowed = 0; } } #endif if (cpi->sf.prune_ext_partition_types_search_level) { if (cpi->sf.prune_ext_partition_types_search_level == 1) {
+ show +
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
// TODO(debargha,huisu@google.com): may need to tune the threshold for // pb_source_variance. horzab_partition_allowed &= (pc_tree->partitioning == PARTITION_HORZ || (pc_tree->partitioning == PARTITION_NONE && pb_source_variance < 32) || pc_tree->partitioning == PARTITION_SPLIT); vertab_partition_allowed &= (pc_tree->partitioning == PARTITION_VERT || (pc_tree->partitioning == PARTITION_NONE && pb_source_variance < 32) || pc_tree->partitioning == PARTITION_SPLIT);

[CVE-2020-0470_1.diff] encodeframe.c #95
+ if (cpi->sf.part_sf.prune_ab_partition_using_split_info && + horza_partition_allowed) { + horza_partition_allowed &= evaluate_ab_partition_based_on_split( + pc_tree, PARTITION_HORZ, rect_part_win_info, x->qindex, 0, 1); + } + - rd_test_partition3(cpi, td, tile_data, tp, pc_tree, &best_rdc, - pc_tree->horizontala, ctx_none, mi_row, mi_col, bsize, - PARTITION_HORZ_A, mi_row, mi_col, bsize2, mi_row, - mi_col + mi_step, bsize2, mi_row + mi_step, mi_col, - subsize); + found_best_partition |= rd_test_partition3( + cpi, td, tile_data, tp, pc_tree, &best_rdc, pc_tree->horizontala, + ctx_none, mi_row, mi_col, bsize, PARTITION_HORZ_A, mi_row, mi_col, + bsize2, mi_row, mi_col + mi_step, bsize2, mi_row + mi_step, mi_col, + subsize);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
av1_init_rd_stats(&tmp_sum_rdc); tmp_sum_rdc.rate = x->partition_cost[pl][PARTITION_HORZ_A]; tmp_sum_rdc.rdcost = RDCOST(x->rdmult, tmp_sum_rdc.rate, 0); if (best_rdc.rdcost - tmp_sum_rdc.rdcost >= 0) { partition_attempts[PARTITION_HORZ_A] += 1; aom_usec_timer_start(&partition_timer); partition_timer_on = 1; } } #endif
+ show +
3907
3908
3909
3910
3911
rd_test_partition3(cpi, td, tile_data, tp, pc_tree, &best_rdc, pc_tree->horizontala, ctx_none, mi_row, mi_col, bsize, PARTITION_HORZ_A, mi_row, mi_col, bsize2, mi_row, mi_col + mi_step, bsize2, mi_row + mi_step, mi_col, subsize);
+ show +
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
#if CONFIG_COLLECT_PARTITION_STATS if (partition_timer_on) { aom_usec_timer_mark(&partition_timer); int64_t time = aom_usec_timer_elapsed(&partition_timer); partition_times[PARTITION_HORZ_A] += time; partition_timer_on = 0; } #endif restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); }

[CVE-2020-0470_1.diff] encodeframe.c #97
+ + if (cpi->sf.part_sf.prune_ab_partition_using_split_info && + horzb_partition_allowed) { + horzb_partition_allowed &= evaluate_ab_partition_based_on_split( + pc_tree, PARTITION_HORZ, rect_part_win_info, x->qindex, 2, 3); + } + - rd_test_partition3(cpi, td, tile_data, tp, pc_tree, &best_rdc, - pc_tree->horizontalb, ctx_none, mi_row, mi_col, bsize, - PARTITION_HORZ_B, mi_row, mi_col, subsize, - mi_row + mi_step, mi_col, bsize2, mi_row + mi_step, - mi_col + mi_step, bsize2); + found_best_partition |= rd_test_partition3( + cpi, td, tile_data, tp, pc_tree, &best_rdc, pc_tree->horizontalb, + ctx_none, mi_row, mi_col, bsize, PARTITION_HORZ_B, mi_row, mi_col, + subsize, mi_row + mi_step, mi_col, bsize2, mi_row + mi_step, + mi_col + mi_step, bsize2);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
av1_init_rd_stats(&tmp_sum_rdc); tmp_sum_rdc.rate = x->partition_cost[pl][PARTITION_HORZ_B]; tmp_sum_rdc.rdcost = RDCOST(x->rdmult, tmp_sum_rdc.rate, 0); if (best_rdc.rdcost - tmp_sum_rdc.rdcost >= 0) { partition_attempts[PARTITION_HORZ_B] += 1; aom_usec_timer_start(&partition_timer); partition_timer_on = 1; } } #endif
+ show +
3947
3948
3949
3950
3951
rd_test_partition3(cpi, td, tile_data, tp, pc_tree, &best_rdc, pc_tree->horizontalb, ctx_none, mi_row, mi_col, bsize, PARTITION_HORZ_B, mi_row, mi_col, subsize, mi_row + mi_step, mi_col, bsize2, mi_row + mi_step, mi_col + mi_step, bsize2);
+ show +
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
#if CONFIG_COLLECT_PARTITION_STATS if (partition_timer_on) { aom_usec_timer_mark(&partition_timer); int64_t time = aom_usec_timer_elapsed(&partition_timer); partition_times[PARTITION_HORZ_B] += time; partition_timer_on = 0; } #endif restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes);

[CVE-2020-0470_1.diff] encodeframe.c #99
+ if (cpi->sf.part_sf.prune_ab_partition_using_split_info && + verta_partition_allowed) { + verta_partition_allowed &= evaluate_ab_partition_based_on_split( + pc_tree, PARTITION_VERT, rect_part_win_info, x->qindex, 0, 2); + } + - rd_test_partition3(cpi, td, tile_data, tp, pc_tree, &best_rdc, - pc_tree->verticala, ctx_none, mi_row, mi_col, bsize, - PARTITION_VERT_A, mi_row, mi_col, bsize2, - mi_row + mi_step, mi_col, bsize2, mi_row, - mi_col + mi_step, subsize); + found_best_partition |= rd_test_partition3( + cpi, td, tile_data, tp, pc_tree, &best_rdc, pc_tree->verticala, + ctx_none, mi_row, mi_col, bsize, PARTITION_VERT_A, mi_row, mi_col, + bsize2, mi_row + mi_step, mi_col, bsize2, mi_row, mi_col + mi_step, + subsize);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
av1_init_rd_stats(&tmp_sum_rdc); tmp_sum_rdc.rate = x->partition_cost[pl][PARTITION_VERT_A]; tmp_sum_rdc.rdcost = RDCOST(x->rdmult, tmp_sum_rdc.rate, 0); if (best_rdc.rdcost - tmp_sum_rdc.rdcost >= 0) { partition_attempts[PARTITION_VERT_A] += 1; aom_usec_timer_start(&partition_timer); partition_timer_on = 1; } } #endif
+ show +
3989
3990
3991
3992
3993
rd_test_partition3(cpi, td, tile_data, tp, pc_tree, &best_rdc, pc_tree->verticala, ctx_none, mi_row, mi_col, bsize, PARTITION_VERT_A, mi_row, mi_col, bsize2, mi_row + mi_step, mi_col, bsize2, mi_row, mi_col + mi_step, subsize);
+ show +
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
#if CONFIG_COLLECT_PARTITION_STATS if (partition_timer_on) { aom_usec_timer_mark(&partition_timer); int64_t time = aom_usec_timer_elapsed(&partition_timer); partition_times[PARTITION_VERT_A] += time; partition_timer_on = 0; } #endif restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); }

[CVE-2020-0470_1.diff] encodeframe.c #101
+ + if (cpi->sf.part_sf.prune_ab_partition_using_split_info && + vertb_partition_allowed) { + vertb_partition_allowed &= evaluate_ab_partition_based_on_split( + pc_tree, PARTITION_VERT, rect_part_win_info, x->qindex, 1, 3); + } + - rd_test_partition3(cpi, td, tile_data, tp, pc_tree, &best_rdc, - pc_tree->verticalb, ctx_none, mi_row, mi_col, bsize, - PARTITION_VERT_B, mi_row, mi_col, subsize, mi_row, - mi_col + mi_step, bsize2, mi_row + mi_step, - mi_col + mi_step, bsize2); + found_best_partition |= rd_test_partition3( + cpi, td, tile_data, tp, pc_tree, &best_rdc, pc_tree->verticalb, + ctx_none, mi_row, mi_col, bsize, PARTITION_VERT_B, mi_row, mi_col, + subsize, mi_row, mi_col + mi_step, bsize2, mi_row + mi_step, + mi_col + mi_step, bsize2);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
tmp_sum_rdc.rate = x->partition_cost[pl][PARTITION_VERT_B]; tmp_sum_rdc.rdcost = RDCOST(x->rdmult, tmp_sum_rdc.rate, 0); if (!frame_is_intra_only(cm) && best_rdc.rdcost - tmp_sum_rdc.rdcost >= 0) { partition_attempts[PARTITION_VERT_B] += 1; aom_usec_timer_start(&partition_timer); partition_timer_on = 1; } } #endif
+ show +
4030
4031
4032
4033
4034
rd_test_partition3(cpi, td, tile_data, tp, pc_tree, &best_rdc, pc_tree->verticalb, ctx_none, mi_row, mi_col, bsize, PARTITION_VERT_B, mi_row, mi_col, subsize, mi_row, mi_col + mi_step, bsize2, mi_row + mi_step, mi_col + mi_step, bsize2);
+ show +
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
#if CONFIG_COLLECT_PARTITION_STATS if (partition_timer_on) { aom_usec_timer_mark(&partition_timer); int64_t time = aom_usec_timer_elapsed(&partition_timer); partition_times[PARTITION_VERT_B] += time; partition_timer_on = 0; } #endif restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes); }

[CVE-2020-0470_1.diff] encodeframe.c #126
- av1_hash_table_create(&cm->cur_frame->hash_table); - av1_generate_block_2x2_hash_value(cpi->source, block_hash_values[0], - is_block_same[0], &cpi->td.mb); - av1_generate_block_hash_value(cpi->source, 4, block_hash_values[0], - block_hash_values[1], is_block_same[0], - is_block_same[1], &cpi->td.mb); - av1_add_to_hash_map_by_row_with_precal_data( - &cm->cur_frame->hash_table, block_hash_values[1], is_block_same[1][2], - pic_width, pic_height, 4); - av1_generate_block_hash_value(cpi->source, 8, block_hash_values[1], - block_hash_values[0], is_block_same[1], - is_block_same[0], &cpi->td.mb); - av1_add_to_hash_map_by_row_with_precal_data( - &cm->cur_frame->hash_table, block_hash_values[0], is_block_same[0][2], - pic_width, pic_height, 8); - av1_generate_block_hash_value(cpi->source, 16, block_hash_values[0], - block_hash_values[1], is_block_same[0], - is_block_same[1], &cpi->td.mb); - av1_add_to_hash_map_by_row_with_precal_data( - &cm->cur_frame->hash_table, block_hash_values[1], is_block_same[1][2], - pic_width, pic_height, 16); - av1_generate_block_hash_value(cpi->source, 32, block_hash_values[1], - block_hash_values[0], is_block_same[1], - is_block_same[0], &cpi->td.mb); - av1_add_to_hash_map_by_row_with_precal_data( - &cm->cur_frame->hash_table, block_hash_values[0], is_block_same[0][2], - pic_width, pic_height, 32); - av1_generate_block_hash_value(cpi->source, 64, block_hash_values[0], - block_hash_values[1], is_block_same[0], - is_block_same[1], &cpi->td.mb); - av1_add_to_hash_map_by_row_with_precal_data( - &cm->cur_frame->hash_table, block_hash_values[1], is_block_same[1][2], - pic_width, pic_height, 64); - - av1_generate_block_hash_value(cpi->source, 128, block_hash_values[1], - block_hash_values[0], is_block_same[1], - is_block_same[0], &cpi->td.mb); - av1_add_to_hash_map_by_row_with_precal_data( - &cm->cur_frame->hash_table, block_hash_values[0], is_block_same[0][2], - pic_width, pic_height, 128); + av1_hash_table_init(intrabc_hash_info); + av1_hash_table_create(&intrabc_hash_info->intrabc_hash_table); + hash_table_created = 1; + av1_generate_block_2x2_hash_value(intrabc_hash_info, cpi->source, + block_hash_values[0], is_block_same[0]); + // Hash data generated for screen contents is used for intraBC ME + const int min_alloc_size = block_size_wide[mi_params->mi_alloc_bsize]; + const int max_sb_size = + (1 << (cm->seq_params.mib_size_log2 + MI_SIZE_LOG2)); + int src_idx = 0; + for (int size = 4; size <= max_sb_size; size *= 2, src_idx = !src_idx) { + const int dst_idx = !src_idx; + av1_generate_block_hash_value( + intrabc_hash_info, cpi->source, size, block_hash_values[src_idx], + block_hash_values[dst_idx], is_block_same[src_idx], + is_block_same[dst_idx]); + if (size >= min_alloc_size) { + av1_add_to_hash_map_by_row_with_precal_data( + &intrabc_hash_info->intrabc_hash_table, block_hash_values[dst_idx], + is_block_same[dst_idx][2], pic_width, pic_height, size); + } + }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodeframe.c
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
CHECK_MEM_ERROR(cm, block_hash_values[k][j], aom_malloc(sizeof(uint32_t) * pic_width * pic_height)); } for (j = 0; j < 3; j++) { CHECK_MEM_ERROR(cm, is_block_same[k][j], aom_malloc(sizeof(int8_t) * pic_width * pic_height)); } }
+ show +
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
av1_hash_table_create(&cm->cur_frame->hash_table); av1_generate_block_2x2_hash_value(cpi->source, block_hash_values[0], is_block_same[0], &cpi->td.mb); av1_generate_block_hash_value(cpi->source, 4, block_hash_values[0], block_hash_values[1], is_block_same[0], is_block_same[1], &cpi->td.mb); av1_add_to_hash_map_by_row_with_precal_data( &cm->cur_frame->hash_table, block_hash_values[1], is_block_same[1][2], pic_width, pic_height, 4); av1_generate_block_hash_value(cpi->source, 8, block_hash_values[1], block_hash_values[0], is_block_same[1], is_block_same[0], &cpi->td.mb); av1_add_to_hash_map_by_row_with_precal_data( &cm->cur_frame->hash_table, block_hash_values[0], is_block_same[0][2], pic_width, pic_height, 8); av1_generate_block_hash_value(cpi->source, 16, block_hash_values[0], block_hash_values[1], is_block_same[0], is_block_same[1], &cpi->td.mb); av1_add_to_hash_map_by_row_with_precal_data( &cm->cur_frame->hash_table, block_hash_values[1], is_block_same[1][2], pic_width, pic_height, 16); av1_generate_block_hash_value(cpi->source, 32, block_hash_values[1], block_hash_values[0], is_block_same[1], is_block_same[0], &cpi->td.mb); av1_add_to_hash_map_by_row_with_precal_data( &cm->cur_frame->hash_table, block_hash_values[0], is_block_same[0][2], pic_width, pic_height, 32); av1_generate_block_hash_value(cpi->source, 64, block_hash_values[0], block_hash_values[1], is_block_same[0], is_block_same[1], &cpi->td.mb); av1_add_to_hash_map_by_row_with_precal_data( &cm->cur_frame->hash_table, block_hash_values[1], is_block_same[1][2], pic_width, pic_height, 64); av1_generate_block_hash_value(cpi->source, 128, block_hash_values[1], block_hash_values[0], is_block_same[1], is_block_same[0], &cpi->td.mb); av1_add_to_hash_map_by_row_with_precal_data( &cm->cur_frame->hash_table, block_hash_values[0], is_block_same[0][2], pic_width, pic_height, 128);
+ show +
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
for (k = 0; k < 2; k++) { for (j = 0; j < 2; j++) { aom_free(block_hash_values[k][j]); } for (j = 0; j < 3; j++) { aom_free(is_block_same[k][j]); } }

[CVE-2020-0478_1.diff] speed_features.c #4
-// Sets a partition size down to which the auto partition code will always -// search (can go lower), based on the image dimensions. The logic here -// is that the extent to which ringing artefacts are offensive, depends -// partly on the screen area that over which they propogate. Propogation is -// limited by transform block size but the screen area take up by a given block -// size will be larger for a small image format stretched to full screen. -static BLOCK_SIZE set_partition_min_limit(const AV1_COMMON *const cm) { - unsigned int screen_area = (cm->width * cm->height); - - // Select block size based on image format size. - if (screen_area < 1280 * 720) { - // Formats smaller in area than 720P - return BLOCK_4X4; - } else if (screen_area < 1920 * 1080) { - // Format >= 720P and < 1080P - return BLOCK_8X8; - } else { - // Formats 1080P and up - return BLOCK_16X16; +static BLOCK_SIZE dim_to_size(int dim) { + switch (dim) { + case 4: return BLOCK_4X4; + case 8: return BLOCK_8X8; + case 16: return BLOCK_16X16; + case 32: return BLOCK_32X32; + case 64: return BLOCK_64X64; + case 128: return BLOCK_128X128; + default: assert(0); return 0;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/speed_features.c
67
68
69
70
71
72
73
74
75
76
static int frame_is_boosted(const AV1_COMP *cpi) { return frame_is_kf_gf_arf(cpi); } // Sets a partition size down to which the auto partition code will always // search (can go lower), based on the image dimensions. The logic here // is that the extent to which ringing artefacts are offensive, depends // partly on the screen area that over which they propogate. Propogation is // limited by transform block size but the screen area take up by a given block // size will be larger for a small image format stretched to full screen.
+ show +
77
78
79
80
81
82
83
84
85
86
87
88
89
static BLOCK_SIZE set_partition_min_limit(const AV1_COMMON *const cm) { unsigned int screen_area = (cm->width * cm->height); // Select block size based on image format size. if (screen_area < 1280 * 720) { // Formats smaller in area than 720P return BLOCK_4X4; } else if (screen_area < 1920 * 1080) { // Format >= 720P and < 1080P return BLOCK_8X8; } else { // Formats 1080P and up return BLOCK_16X16;
+ show +
90
91
92
93
94
95
96
97
98
99
} } static void set_good_speed_feature_framesize_dependent( const AV1_COMP *const cpi, SPEED_FEATURES *const sf, int speed) { const AV1_COMMON *const cm = &cpi->common; const int is_720p_or_larger = AOMMIN(cm->width, cm->height) >= 720; const int is_480p_or_larger = AOMMIN(cm->width, cm->height) >= 480; if (is_480p_or_larger) {

[CVE-2020-0470_1.diff] speed_features.c #4
-// Sets a partition size down to which the auto partition code will always -// search (can go lower), based on the image dimensions. The logic here -// is that the extent to which ringing artefacts are offensive, depends -// partly on the screen area that over which they propogate. Propogation is -// limited by transform block size but the screen area take up by a given block -// size will be larger for a small image format stretched to full screen. -static BLOCK_SIZE set_partition_min_limit(const AV1_COMMON *const cm) { - unsigned int screen_area = (cm->width * cm->height); - - // Select block size based on image format size. - if (screen_area < 1280 * 720) { - // Formats smaller in area than 720P - return BLOCK_4X4; - } else if (screen_area < 1920 * 1080) { - // Format >= 720P and < 1080P - return BLOCK_8X8; - } else { - // Formats 1080P and up - return BLOCK_16X16; +static BLOCK_SIZE dim_to_size(int dim) { + switch (dim) { + case 4: return BLOCK_4X4; + case 8: return BLOCK_8X8; + case 16: return BLOCK_16X16; + case 32: return BLOCK_32X32; + case 64: return BLOCK_64X64; + case 128: return BLOCK_128X128; + default: assert(0); return 0;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/speed_features.c
67
68
69
70
71
72
73
74
75
76
static int frame_is_boosted(const AV1_COMP *cpi) { return frame_is_kf_gf_arf(cpi); } // Sets a partition size down to which the auto partition code will always // search (can go lower), based on the image dimensions. The logic here // is that the extent to which ringing artefacts are offensive, depends // partly on the screen area that over which they propogate. Propogation is // limited by transform block size but the screen area take up by a given block // size will be larger for a small image format stretched to full screen.
+ show +
77
78
79
80
81
82
83
84
85
86
87
88
89
static BLOCK_SIZE set_partition_min_limit(const AV1_COMMON *const cm) { unsigned int screen_area = (cm->width * cm->height); // Select block size based on image format size. if (screen_area < 1280 * 720) { // Formats smaller in area than 720P return BLOCK_4X4; } else if (screen_area < 1920 * 1080) { // Format >= 720P and < 1080P return BLOCK_8X8; } else { // Formats 1080P and up return BLOCK_16X16;
+ show +
90
91
92
93
94
95
96
97
98
99
} } static void set_good_speed_feature_framesize_dependent( const AV1_COMP *const cpi, SPEED_FEATURES *const sf, int speed) { const AV1_COMMON *const cm = &cpi->common; const int is_720p_or_larger = AOMMIN(cm->width, cm->height) >= 720; const int is_480p_or_larger = AOMMIN(cm->width, cm->height) >= 480; if (is_480p_or_larger) {

[CVE-2020-0478_1.diff] ratectrl.c #31
-// Use this macro to turn on/off use of alt-refs in one-pass mode. -#define USE_ALTREF_FOR_ONE_PASS 1 - -static int calc_pframe_target_size_one_pass_vbr( - const AV1_COMP *const cpi, FRAME_UPDATE_TYPE frame_update_type) { - static const int af_ratio = 10; - const RATE_CONTROL *const rc = &cpi->rc; - int target; -#if USE_ALTREF_FOR_ONE_PASS - if (frame_update_type == KF_UPDATE || frame_update_type == GF_UPDATE || - frame_update_type == ARF_UPDATE) { - target = (rc->avg_frame_bandwidth * rc->baseline_gf_interval * af_ratio) / - (rc->baseline_gf_interval + af_ratio - 1); - } else { - target = (rc->avg_frame_bandwidth * rc->baseline_gf_interval) / - (rc->baseline_gf_interval + af_ratio - 1); - } -#else - target = rc->avg_frame_bandwidth; -#endif - return av1_rc_clamp_pframe_target_size(cpi, target, frame_update_type); -} - -static int calc_iframe_target_size_one_pass_vbr(const AV1_COMP *const cpi) { - static const int kf_ratio = 25; - const RATE_CONTROL *rc = &cpi->rc; - const int target = rc->avg_frame_bandwidth * kf_ratio; - return av1_rc_clamp_iframe_target_size(cpi, target); -} - -void av1_rc_get_one_pass_vbr_params(AV1_COMP *cpi, - FRAME_UPDATE_TYPE *const frame_update_type, - EncodeFrameParams *const frame_params, - unsigned int frame_flags) { - AV1_COMMON *const cm = &cpi->common; - RATE_CONTROL *const rc = &cpi->rc; - CurrentFrame *const current_frame = &cm->current_frame; - int target; - int altref_enabled = is_altref_enabled(cpi); - int sframe_dist = cpi->oxcf.sframe_dist; - int sframe_mode = cpi->oxcf.sframe_mode; - int sframe_enabled = cpi->oxcf.sframe_enabled; - // TODO(yaowu): replace the "auto_key && 0" below with proper decision logic. - if (*frame_update_type != ARF_UPDATE && - (current_frame->frame_number == 0 || (frame_flags & FRAMEFLAGS_KEY) || - rc->frames_to_key == 0 || (cpi->oxcf.auto_key && 0))) { - frame_params->frame_type = KEY_FRAME; - rc->this_key_frame_forced = - current_frame->frame_number != 0 && rc->frames_to_key == 0; - rc->frames_to_key = cpi->oxcf.key_freq; - rc->kf_boost = DEFAULT_KF_BOOST; - rc->source_alt_ref_active = 0; - } else { - frame_params->frame_type = INTER_FRAME; - if (sframe_enabled) { - if (altref_enabled) { - if (sframe_mode == 1) { - // sframe_mode == 1: insert sframe if it matches altref frame. - - if (current_frame->frame_number % sframe_dist == 0 && - current_frame->frame_number != 0 && - *frame_update_type == ARF_UPDATE) { - frame_params->frame_type = S_FRAME; - } - } else { - // sframe_mode != 1: if sframe will be inserted at the next available - // altref frame - - if (current_frame->frame_number % sframe_dist == 0 && - current_frame->frame_number != 0) { - rc->sframe_due = 1; - } - - if (rc->sframe_due && *frame_update_type == ARF_UPDATE) { - frame_params->frame_type = S_FRAME; - rc->sframe_due = 0; - } - } - } else { - if (current_frame->frame_number % sframe_dist == 0 && - current_frame->frame_number != 0) { - frame_params->frame_type = S_FRAME; - } - } - } - } - if (rc->frames_till_gf_update_due == 0) { - rc->baseline_gf_interval = (rc->min_gf_interval + rc->max_gf_interval) / 2; - rc->frames_till_gf_update_due = rc->baseline_gf_interval; - // NOTE: frames_till_gf_update_due must be <= frames_to_key. - if (rc->frames_till_gf_update_due > rc->frames_to_key) { - rc->frames_till_gf_update_due = rc->frames_to_key; - rc->constrained_gf_group = 1; - } else { - rc->constrained_gf_group = 0; - } - if (*frame_update_type == LF_UPDATE) *frame_update_type = GF_UPDATE; - rc->source_alt_ref_pending = USE_ALTREF_FOR_ONE_PASS; - rc->gfu_boost = DEFAULT_GF_BOOST; - } - - if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) - av1_cyclic_refresh_update_parameters(cpi); - - if (frame_params->frame_type == KEY_FRAME) - target = calc_iframe_target_size_one_pass_vbr(cpi); - else - target = calc_pframe_target_size_one_pass_vbr(cpi, *frame_update_type); - rc_set_frame_target(cpi, target, cm->width, cm->height); -} - -static int calc_pframe_target_size_one_pass_cbr( - const AV1_COMP *cpi, FRAME_UPDATE_TYPE frame_update_type) { - const AV1EncoderConfig *oxcf = &cpi->oxcf; - const RATE_CONTROL *rc = &cpi->rc; - const int64_t diff = rc->optimal_buffer_level - rc->buffer_level; - const int64_t one_pct_bits = 1 + rc->optimal_buffer_level / 100; - int min_frame_target = - AOMMAX(rc->avg_frame_bandwidth >> 4, FRAME_OVERHEAD_BITS); - int target; - - if (oxcf->gf_cbr_boost_pct) { - const int af_ratio_pct = oxcf->gf_cbr_boost_pct + 100; - if (frame_update_type == GF_UPDATE || frame_update_type == OVERLAY_UPDATE) { - target = - (rc->avg_frame_bandwidth * rc->baseline_gf_interval * af_ratio_pct) / - (rc->baseline_gf_interval * 100 + af_ratio_pct - 100); - } else { - target = (rc->avg_frame_bandwidth * rc->baseline_gf_interval * 100) / - (rc->baseline_gf_interval * 100 + af_ratio_pct - 100); - } - } else { - target = rc->avg_frame_bandwidth; - } - - if (diff > 0) { - // Lower the target bandwidth for this frame. - const int pct_low = (int)AOMMIN(diff / one_pct_bits, oxcf->under_shoot_pct); - target -= (target * pct_low) / 200; - } else if (diff < 0) { - // Increase the target bandwidth for this frame. - const int pct_high = - (int)AOMMIN(-diff / one_pct_bits, oxcf->over_shoot_pct); - target += (target * pct_high) / 200; - } - if (oxcf->rc_max_inter_bitrate_pct) { - const int max_rate = - rc->avg_frame_bandwidth * oxcf->rc_max_inter_bitrate_pct / 100; - target = AOMMIN(target, max_rate); - } - return AOMMAX(min_frame_target, target); -} - -static int calc_iframe_target_size_one_pass_cbr(const AV1_COMP *cpi) { - const RATE_CONTROL *rc = &cpi->rc; - int target; - if (cpi->common.current_frame.frame_number == 0) { - target = ((rc->starting_buffer_level / 2) > INT_MAX) - ? INT_MAX - : (int)(rc->starting_buffer_level / 2); - } else { - int kf_boost = 32; - double framerate = cpi->framerate; - - kf_boost = AOMMAX(kf_boost, (int)(2 * framerate - 16)); - if (rc->frames_since_key < framerate / 2) { - kf_boost = (int)(kf_boost * rc->frames_since_key / (framerate / 2)); - } - target = ((16 + kf_boost) * rc->avg_frame_bandwidth) >> 4; - } - return av1_rc_clamp_iframe_target_size(cpi, target); -} - -void av1_rc_get_one_pass_cbr_params(AV1_COMP *cpi, - FRAME_UPDATE_TYPE *const frame_update_type, - EncodeFrameParams *const frame_params, - unsigned int frame_flags) { - AV1_COMMON *const cm = &cpi->common; - RATE_CONTROL *const rc = &cpi->rc; - CurrentFrame *const current_frame = &cm->current_frame; - int target; - // TODO(yaowu): replace the "auto_key && 0" below with proper decision logic. - if ((current_frame->frame_number == 0 || (frame_flags & FRAMEFLAGS_KEY) || - rc->frames_to_key == 0 || (cpi->oxcf.auto_key && 0))) { - frame_params->frame_type = KEY_FRAME; - rc->this_key_frame_forced = - current_frame->frame_number != 0 && rc->frames_to_key == 0; - rc->frames_to_key = cpi->oxcf.key_freq; - rc->kf_boost = DEFAULT_KF_BOOST; - rc->source_alt_ref_active = 0; - } else { - frame_params->frame_type = INTER_FRAME; - } - if (rc->frames_till_gf_update_due == 0) { - if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) - av1_cyclic_refresh_set_golden_update(cpi); - else - rc->baseline_gf_interval = - (rc->min_gf_interval + rc->max_gf_interval) / 2; - rc->frames_till_gf_update_due = rc->baseline_gf_interval; - // NOTE: frames_till_gf_update_due must be <= frames_to_key. - if (rc->frames_till_gf_update_due > rc->frames_to_key) - rc->frames_till_gf_update_due = rc->frames_to_key; - if (*frame_update_type == LF_UPDATE) *frame_update_type = GF_UPDATE; - rc->gfu_boost = DEFAULT_GF_BOOST; - } - - // Any update/change of global cyclic refresh parameters (amount/delta-qp) - // should be done here, before the frame qp is selected. - if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) - av1_cyclic_refresh_update_parameters(cpi); - - if (frame_params->frame_type == KEY_FRAME) - target = calc_iframe_target_size_one_pass_cbr(cpi); - else - target = calc_pframe_target_size_one_pass_cbr(cpi, *frame_update_type); - - rc_set_frame_target(cpi, target, cm->width, cm->height); - // TODO(afergs): Decide whether to scale up, down, or not at all -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/ratectrl.c
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
void av1_rc_postencode_update_drop_frame(AV1_COMP *cpi) { // Update buffer level with zero size, update frame counters, and return. update_buffer_level(cpi, 0); cpi->rc.frames_since_key++; cpi->rc.frames_to_key--; cpi->rc.rc_2_frame = 0; cpi->rc.rc_1_frame = 0; } // Use this macro to turn on/off use of alt-refs in one-pass mode.
+ show +
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
#define USE_ALTREF_FOR_ONE_PASS 1 static int calc_pframe_target_size_one_pass_vbr( const AV1_COMP *const cpi, FRAME_UPDATE_TYPE frame_update_type) { static const int af_ratio = 10; const RATE_CONTROL *const rc = &cpi->rc; int target; #if USE_ALTREF_FOR_ONE_PASS if (frame_update_type == KF_UPDATE || frame_update_type == GF_UPDATE || frame_update_type == ARF_UPDATE) { target = (rc->avg_frame_bandwidth * rc->baseline_gf_interval * af_ratio) / (rc->baseline_gf_interval + af_ratio - 1); } else { target = (rc->avg_frame_bandwidth * rc->baseline_gf_interval) / (rc->baseline_gf_interval + af_ratio - 1); } #else target = rc->avg_frame_bandwidth; #endif return av1_rc_clamp_pframe_target_size(cpi, target, frame_update_type); } static int calc_iframe_target_size_one_pass_vbr(const AV1_COMP *const cpi) { static const int kf_ratio = 25; const RATE_CONTROL *rc = &cpi->rc; const int target = rc->avg_frame_bandwidth * kf_ratio; return av1_rc_clamp_iframe_target_size(cpi, target); } void av1_rc_get_one_pass_vbr_params(AV1_COMP *cpi, FRAME_UPDATE_TYPE *const frame_update_type, EncodeFrameParams *const frame_params, unsigned int frame_flags) { AV1_COMMON *const cm = &cpi->common; RATE_CONTROL *const rc = &cpi->rc; CurrentFrame *const current_frame = &cm->current_frame; int target; int altref_enabled = is_altref_enabled(cpi); int sframe_dist = cpi->oxcf.sframe_dist; int sframe_mode = cpi->oxcf.sframe_mode; int sframe_enabled = cpi->oxcf.sframe_enabled; // TODO(yaowu): replace the "auto_key && 0" below with proper decision logic. if (*frame_update_type != ARF_UPDATE && (current_frame->frame_number == 0 || (frame_flags & FRAMEFLAGS_KEY) || rc->frames_to_key == 0 || (cpi->oxcf.auto_key && 0))) { frame_params->frame_type = KEY_FRAME; rc->this_key_frame_forced = current_frame->frame_number != 0 && rc->frames_to_key == 0; rc->frames_to_key = cpi->oxcf.key_freq; rc->kf_boost = DEFAULT_KF_BOOST; rc->source_alt_ref_active = 0; } else { frame_params->frame_type = INTER_FRAME; if (sframe_enabled) { if (altref_enabled) { if (sframe_mode == 1) { // sframe_mode == 1: insert sframe if it matches altref frame. if (current_frame->frame_number % sframe_dist == 0 && current_frame->frame_number != 0 && *frame_update_type == ARF_UPDATE) { frame_params->frame_type = S_FRAME; } } else { // sframe_mode != 1: if sframe will be inserted at the next available // altref frame if (current_frame->frame_number % sframe_dist == 0 && current_frame->frame_number != 0) { rc->sframe_due = 1; } if (rc->sframe_due && *frame_update_type == ARF_UPDATE) { frame_params->frame_type = S_FRAME; rc->sframe_due = 0; } } } else { if (current_frame->frame_number % sframe_dist == 0 && current_frame->frame_number != 0) { frame_params->frame_type = S_FRAME; } } } } if (rc->frames_till_gf_update_due == 0) { rc->baseline_gf_interval = (rc->min_gf_interval + rc->max_gf_interval) / 2; rc->frames_till_gf_update_due = rc->baseline_gf_interval; // NOTE: frames_till_gf_update_due must be <= frames_to_key. if (rc->frames_till_gf_update_due > rc->frames_to_key) { rc->frames_till_gf_update_due = rc->frames_to_key; rc->constrained_gf_group = 1; } else { rc->constrained_gf_group = 0; } if (*frame_update_type == LF_UPDATE) *frame_update_type = GF_UPDATE; rc->source_alt_ref_pending = USE_ALTREF_FOR_ONE_PASS; rc->gfu_boost = DEFAULT_GF_BOOST; } if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) av1_cyclic_refresh_update_parameters(cpi); if (frame_params->frame_type == KEY_FRAME) target = calc_iframe_target_size_one_pass_vbr(cpi); else target = calc_pframe_target_size_one_pass_vbr(cpi, *frame_update_type); rc_set_frame_target(cpi, target, cm->width, cm->height); } static int calc_pframe_target_size_one_pass_cbr( const AV1_COMP *cpi, FRAME_UPDATE_TYPE frame_update_type) { const AV1EncoderConfig *oxcf = &cpi->oxcf; const RATE_CONTROL *rc = &cpi->rc; const int64_t diff = rc->optimal_buffer_level - rc->buffer_level; const int64_t one_pct_bits = 1 + rc->optimal_buffer_level / 100; int min_frame_target = AOMMAX(rc->avg_frame_bandwidth >> 4, FRAME_OVERHEAD_BITS); int target; if (oxcf->gf_cbr_boost_pct) { const int af_ratio_pct = oxcf->gf_cbr_boost_pct + 100; if (frame_update_type == GF_UPDATE || frame_update_type == OVERLAY_UPDATE) { target = (rc->avg_frame_bandwidth * rc->baseline_gf_interval * af_ratio_pct) / (rc->baseline_gf_interval * 100 + af_ratio_pct - 100); } else { target = (rc->avg_frame_bandwidth * rc->baseline_gf_interval * 100) / (rc->baseline_gf_interval * 100 + af_ratio_pct - 100); } } else { target = rc->avg_frame_bandwidth; } if (diff > 0) { // Lower the target bandwidth for this frame. const int pct_low = (int)AOMMIN(diff / one_pct_bits, oxcf->under_shoot_pct); target -= (target * pct_low) / 200; } else if (diff < 0) { // Increase the target bandwidth for this frame. const int pct_high = (int)AOMMIN(-diff / one_pct_bits, oxcf->over_shoot_pct); target += (target * pct_high) / 200; } if (oxcf->rc_max_inter_bitrate_pct) { const int max_rate = rc->avg_frame_bandwidth * oxcf->rc_max_inter_bitrate_pct / 100; target = AOMMIN(target, max_rate); } return AOMMAX(min_frame_target, target); } static int calc_iframe_target_size_one_pass_cbr(const AV1_COMP *cpi) { const RATE_CONTROL *rc = &cpi->rc; int target; if (cpi->common.current_frame.frame_number == 0) { target = ((rc->starting_buffer_level / 2) > INT_MAX) ? INT_MAX : (int)(rc->starting_buffer_level / 2); } else { int kf_boost = 32; double framerate = cpi->framerate; kf_boost = AOMMAX(kf_boost, (int)(2 * framerate - 16)); if (rc->frames_since_key < framerate / 2) { kf_boost = (int)(kf_boost * rc->frames_since_key / (framerate / 2)); } target = ((16 + kf_boost) * rc->avg_frame_bandwidth) >> 4; } return av1_rc_clamp_iframe_target_size(cpi, target); } void av1_rc_get_one_pass_cbr_params(AV1_COMP *cpi, FRAME_UPDATE_TYPE *const frame_update_type, EncodeFrameParams *const frame_params, unsigned int frame_flags) { AV1_COMMON *const cm = &cpi->common; RATE_CONTROL *const rc = &cpi->rc; CurrentFrame *const current_frame = &cm->current_frame; int target; // TODO(yaowu): replace the "auto_key && 0" below with proper decision logic. if ((current_frame->frame_number == 0 || (frame_flags & FRAMEFLAGS_KEY) || rc->frames_to_key == 0 || (cpi->oxcf.auto_key && 0))) { frame_params->frame_type = KEY_FRAME; rc->this_key_frame_forced = current_frame->frame_number != 0 && rc->frames_to_key == 0; rc->frames_to_key = cpi->oxcf.key_freq; rc->kf_boost = DEFAULT_KF_BOOST; rc->source_alt_ref_active = 0; } else { frame_params->frame_type = INTER_FRAME; } if (rc->frames_till_gf_update_due == 0) { if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) av1_cyclic_refresh_set_golden_update(cpi); else rc->baseline_gf_interval = (rc->min_gf_interval + rc->max_gf_interval) / 2; rc->frames_till_gf_update_due = rc->baseline_gf_interval; // NOTE: frames_till_gf_update_due must be <= frames_to_key. if (rc->frames_till_gf_update_due > rc->frames_to_key) rc->frames_till_gf_update_due = rc->frames_to_key; if (*frame_update_type == LF_UPDATE) *frame_update_type = GF_UPDATE; rc->gfu_boost = DEFAULT_GF_BOOST; } // Any update/change of global cyclic refresh parameters (amount/delta-qp) // should be done here, before the frame qp is selected. if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) av1_cyclic_refresh_update_parameters(cpi); if (frame_params->frame_type == KEY_FRAME) target = calc_iframe_target_size_one_pass_cbr(cpi); else target = calc_pframe_target_size_one_pass_cbr(cpi, *frame_update_type); rc_set_frame_target(cpi, target, cm->width, cm->height);
+ show +
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
// TODO(afergs): Decide whether to scale up, down, or not at all } int av1_find_qindex(double desired_q, aom_bit_depth_t bit_depth, int best_qindex, int worst_qindex) { assert(best_qindex <= worst_qindex); int low = best_qindex; int high = worst_qindex; while (low < high) { const int mid = (low + high) >> 1;

[CVE-2020-0478_1.diff] ratectrl.c #34
- int max_delta; - double position_factor = 1.0; + const int stats_count = + cpi->twopass.stats_buf_ctx->total_stats != NULL + ? (int)cpi->twopass.stats_buf_ctx->total_stats->count + : 0; + const int frame_window = AOMMIN( + 16, (int)(stats_count - (int)cpi->common.current_frame.frame_number)); - // How far through the clip are we. - // This number is used to damp the per frame rate correction. - // Range 0 - 1.0 - if (cpi->twopass.total_stats.count != 0.) { - position_factor = sqrt((double)cpi->common.current_frame.frame_number / - cpi->twopass.total_stats.count); - } - max_delta = (int)(position_factor * - ((*this_frame_target * VBR_PCT_ADJUSTMENT_LIMIT) / 100)); + if (frame_window > 0) { + const int max_delta = + AOMMIN(abs((int)(vbr_bits_off_target / frame_window)), + (*this_frame_target * VBR_PCT_ADJUSTMENT_LIMIT) / 100); - // vbr_bits_off_target > 0 means we have extra bits to spend - if (vbr_bits_off_target > 0) { - *this_frame_target += (vbr_bits_off_target > max_delta) - ? max_delta - : (int)vbr_bits_off_target; - } else { - *this_frame_target -= (vbr_bits_off_target < -max_delta) - ? max_delta - : (int)-vbr_bits_off_target; + // vbr_bits_off_target > 0 means we have extra bits to spend + // vbr_bits_off_target < 0 we are currently overshooting + *this_frame_target += (vbr_bits_off_target >= 0) ? max_delta : -max_delta;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/ratectrl.c
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
AOMMAX(AOMMAX((MBs * MAX_MB_RATE), MAXRATE_1080P), vbr_max_bits); av1_rc_set_gf_interval_range(cpi, rc); } #define VBR_PCT_ADJUSTMENT_LIMIT 50 // For VBR...adjustment to the frame target based on error from previous frames static void vbr_rate_correction(AV1_COMP *cpi, int *this_frame_target) { RATE_CONTROL *const rc = &cpi->rc; int64_t vbr_bits_off_target = rc->vbr_bits_off_target;
+ show +
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
int max_delta; double position_factor = 1.0; // How far through the clip are we. // This number is used to damp the per frame rate correction. // Range 0 - 1.0 if (cpi->twopass.total_stats.count != 0.) { position_factor = sqrt((double)cpi->common.current_frame.frame_number / cpi->twopass.total_stats.count); } max_delta = (int)(position_factor * ((*this_frame_target * VBR_PCT_ADJUSTMENT_LIMIT) / 100)); // vbr_bits_off_target > 0 means we have extra bits to spend if (vbr_bits_off_target > 0) { *this_frame_target += (vbr_bits_off_target > max_delta) ? max_delta : (int)vbr_bits_off_target; } else { *this_frame_target -= (vbr_bits_off_target < -max_delta) ? max_delta : (int)-vbr_bits_off_target;
+ show +
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
} // Fast redistribution of bits arising from massive local undershoot. // Dont do it for kf,arf,gf or overlay frames. if (!frame_is_kf_gf_arf(cpi) && !rc->is_src_frame_alt_ref && rc->vbr_bits_off_target_fast) { int one_frame_bits = AOMMAX(rc->avg_frame_bandwidth, *this_frame_target); int fast_extra_bits; fast_extra_bits = (int)AOMMIN(rc->vbr_bits_off_target_fast, one_frame_bits); fast_extra_bits = (int)AOMMIN(

[CVE-2020-0470_1.diff] ratectrl.c #31
-// Use this macro to turn on/off use of alt-refs in one-pass mode. -#define USE_ALTREF_FOR_ONE_PASS 1 - -static int calc_pframe_target_size_one_pass_vbr( - const AV1_COMP *const cpi, FRAME_UPDATE_TYPE frame_update_type) { - static const int af_ratio = 10; - const RATE_CONTROL *const rc = &cpi->rc; - int target; -#if USE_ALTREF_FOR_ONE_PASS - if (frame_update_type == KF_UPDATE || frame_update_type == GF_UPDATE || - frame_update_type == ARF_UPDATE) { - target = (rc->avg_frame_bandwidth * rc->baseline_gf_interval * af_ratio) / - (rc->baseline_gf_interval + af_ratio - 1); - } else { - target = (rc->avg_frame_bandwidth * rc->baseline_gf_interval) / - (rc->baseline_gf_interval + af_ratio - 1); - } -#else - target = rc->avg_frame_bandwidth; -#endif - return av1_rc_clamp_pframe_target_size(cpi, target, frame_update_type); -} - -static int calc_iframe_target_size_one_pass_vbr(const AV1_COMP *const cpi) { - static const int kf_ratio = 25; - const RATE_CONTROL *rc = &cpi->rc; - const int target = rc->avg_frame_bandwidth * kf_ratio; - return av1_rc_clamp_iframe_target_size(cpi, target); -} - -void av1_rc_get_one_pass_vbr_params(AV1_COMP *cpi, - FRAME_UPDATE_TYPE *const frame_update_type, - EncodeFrameParams *const frame_params, - unsigned int frame_flags) { - AV1_COMMON *const cm = &cpi->common; - RATE_CONTROL *const rc = &cpi->rc; - CurrentFrame *const current_frame = &cm->current_frame; - int target; - int altref_enabled = is_altref_enabled(cpi); - int sframe_dist = cpi->oxcf.sframe_dist; - int sframe_mode = cpi->oxcf.sframe_mode; - int sframe_enabled = cpi->oxcf.sframe_enabled; - // TODO(yaowu): replace the "auto_key && 0" below with proper decision logic. - if (*frame_update_type != ARF_UPDATE && - (current_frame->frame_number == 0 || (frame_flags & FRAMEFLAGS_KEY) || - rc->frames_to_key == 0 || (cpi->oxcf.auto_key && 0))) { - frame_params->frame_type = KEY_FRAME; - rc->this_key_frame_forced = - current_frame->frame_number != 0 && rc->frames_to_key == 0; - rc->frames_to_key = cpi->oxcf.key_freq; - rc->kf_boost = DEFAULT_KF_BOOST; - rc->source_alt_ref_active = 0; - } else { - frame_params->frame_type = INTER_FRAME; - if (sframe_enabled) { - if (altref_enabled) { - if (sframe_mode == 1) { - // sframe_mode == 1: insert sframe if it matches altref frame. - - if (current_frame->frame_number % sframe_dist == 0 && - current_frame->frame_number != 0 && - *frame_update_type == ARF_UPDATE) { - frame_params->frame_type = S_FRAME; - } - } else { - // sframe_mode != 1: if sframe will be inserted at the next available - // altref frame - - if (current_frame->frame_number % sframe_dist == 0 && - current_frame->frame_number != 0) { - rc->sframe_due = 1; - } - - if (rc->sframe_due && *frame_update_type == ARF_UPDATE) { - frame_params->frame_type = S_FRAME; - rc->sframe_due = 0; - } - } - } else { - if (current_frame->frame_number % sframe_dist == 0 && - current_frame->frame_number != 0) { - frame_params->frame_type = S_FRAME; - } - } - } - } - if (rc->frames_till_gf_update_due == 0) { - rc->baseline_gf_interval = (rc->min_gf_interval + rc->max_gf_interval) / 2; - rc->frames_till_gf_update_due = rc->baseline_gf_interval; - // NOTE: frames_till_gf_update_due must be <= frames_to_key. - if (rc->frames_till_gf_update_due > rc->frames_to_key) { - rc->frames_till_gf_update_due = rc->frames_to_key; - rc->constrained_gf_group = 1; - } else { - rc->constrained_gf_group = 0; - } - if (*frame_update_type == LF_UPDATE) *frame_update_type = GF_UPDATE; - rc->source_alt_ref_pending = USE_ALTREF_FOR_ONE_PASS; - rc->gfu_boost = DEFAULT_GF_BOOST; - } - - if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) - av1_cyclic_refresh_update_parameters(cpi); - - if (frame_params->frame_type == KEY_FRAME) - target = calc_iframe_target_size_one_pass_vbr(cpi); - else - target = calc_pframe_target_size_one_pass_vbr(cpi, *frame_update_type); - rc_set_frame_target(cpi, target, cm->width, cm->height); -} - -static int calc_pframe_target_size_one_pass_cbr( - const AV1_COMP *cpi, FRAME_UPDATE_TYPE frame_update_type) { - const AV1EncoderConfig *oxcf = &cpi->oxcf; - const RATE_CONTROL *rc = &cpi->rc; - const int64_t diff = rc->optimal_buffer_level - rc->buffer_level; - const int64_t one_pct_bits = 1 + rc->optimal_buffer_level / 100; - int min_frame_target = - AOMMAX(rc->avg_frame_bandwidth >> 4, FRAME_OVERHEAD_BITS); - int target; - - if (oxcf->gf_cbr_boost_pct) { - const int af_ratio_pct = oxcf->gf_cbr_boost_pct + 100; - if (frame_update_type == GF_UPDATE || frame_update_type == OVERLAY_UPDATE) { - target = - (rc->avg_frame_bandwidth * rc->baseline_gf_interval * af_ratio_pct) / - (rc->baseline_gf_interval * 100 + af_ratio_pct - 100); - } else { - target = (rc->avg_frame_bandwidth * rc->baseline_gf_interval * 100) / - (rc->baseline_gf_interval * 100 + af_ratio_pct - 100); - } - } else { - target = rc->avg_frame_bandwidth; - } - - if (diff > 0) { - // Lower the target bandwidth for this frame. - const int pct_low = (int)AOMMIN(diff / one_pct_bits, oxcf->under_shoot_pct); - target -= (target * pct_low) / 200; - } else if (diff < 0) { - // Increase the target bandwidth for this frame. - const int pct_high = - (int)AOMMIN(-diff / one_pct_bits, oxcf->over_shoot_pct); - target += (target * pct_high) / 200; - } - if (oxcf->rc_max_inter_bitrate_pct) { - const int max_rate = - rc->avg_frame_bandwidth * oxcf->rc_max_inter_bitrate_pct / 100; - target = AOMMIN(target, max_rate); - } - return AOMMAX(min_frame_target, target); -} - -static int calc_iframe_target_size_one_pass_cbr(const AV1_COMP *cpi) { - const RATE_CONTROL *rc = &cpi->rc; - int target; - if (cpi->common.current_frame.frame_number == 0) { - target = ((rc->starting_buffer_level / 2) > INT_MAX) - ? INT_MAX - : (int)(rc->starting_buffer_level / 2); - } else { - int kf_boost = 32; - double framerate = cpi->framerate; - - kf_boost = AOMMAX(kf_boost, (int)(2 * framerate - 16)); - if (rc->frames_since_key < framerate / 2) { - kf_boost = (int)(kf_boost * rc->frames_since_key / (framerate / 2)); - } - target = ((16 + kf_boost) * rc->avg_frame_bandwidth) >> 4; - } - return av1_rc_clamp_iframe_target_size(cpi, target); -} - -void av1_rc_get_one_pass_cbr_params(AV1_COMP *cpi, - FRAME_UPDATE_TYPE *const frame_update_type, - EncodeFrameParams *const frame_params, - unsigned int frame_flags) { - AV1_COMMON *const cm = &cpi->common; - RATE_CONTROL *const rc = &cpi->rc; - CurrentFrame *const current_frame = &cm->current_frame; - int target; - // TODO(yaowu): replace the "auto_key && 0" below with proper decision logic. - if ((current_frame->frame_number == 0 || (frame_flags & FRAMEFLAGS_KEY) || - rc->frames_to_key == 0 || (cpi->oxcf.auto_key && 0))) { - frame_params->frame_type = KEY_FRAME; - rc->this_key_frame_forced = - current_frame->frame_number != 0 && rc->frames_to_key == 0; - rc->frames_to_key = cpi->oxcf.key_freq; - rc->kf_boost = DEFAULT_KF_BOOST; - rc->source_alt_ref_active = 0; - } else { - frame_params->frame_type = INTER_FRAME; - } - if (rc->frames_till_gf_update_due == 0) { - if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) - av1_cyclic_refresh_set_golden_update(cpi); - else - rc->baseline_gf_interval = - (rc->min_gf_interval + rc->max_gf_interval) / 2; - rc->frames_till_gf_update_due = rc->baseline_gf_interval; - // NOTE: frames_till_gf_update_due must be <= frames_to_key. - if (rc->frames_till_gf_update_due > rc->frames_to_key) - rc->frames_till_gf_update_due = rc->frames_to_key; - if (*frame_update_type == LF_UPDATE) *frame_update_type = GF_UPDATE; - rc->gfu_boost = DEFAULT_GF_BOOST; - } - - // Any update/change of global cyclic refresh parameters (amount/delta-qp) - // should be done here, before the frame qp is selected. - if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) - av1_cyclic_refresh_update_parameters(cpi); - - if (frame_params->frame_type == KEY_FRAME) - target = calc_iframe_target_size_one_pass_cbr(cpi); - else - target = calc_pframe_target_size_one_pass_cbr(cpi, *frame_update_type); - - rc_set_frame_target(cpi, target, cm->width, cm->height); - // TODO(afergs): Decide whether to scale up, down, or not at all -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/ratectrl.c
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
void av1_rc_postencode_update_drop_frame(AV1_COMP *cpi) { // Update buffer level with zero size, update frame counters, and return. update_buffer_level(cpi, 0); cpi->rc.frames_since_key++; cpi->rc.frames_to_key--; cpi->rc.rc_2_frame = 0; cpi->rc.rc_1_frame = 0; } // Use this macro to turn on/off use of alt-refs in one-pass mode.
+ show +
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
#define USE_ALTREF_FOR_ONE_PASS 1 static int calc_pframe_target_size_one_pass_vbr( const AV1_COMP *const cpi, FRAME_UPDATE_TYPE frame_update_type) { static const int af_ratio = 10; const RATE_CONTROL *const rc = &cpi->rc; int target; #if USE_ALTREF_FOR_ONE_PASS if (frame_update_type == KF_UPDATE || frame_update_type == GF_UPDATE || frame_update_type == ARF_UPDATE) { target = (rc->avg_frame_bandwidth * rc->baseline_gf_interval * af_ratio) / (rc->baseline_gf_interval + af_ratio - 1); } else { target = (rc->avg_frame_bandwidth * rc->baseline_gf_interval) / (rc->baseline_gf_interval + af_ratio - 1); } #else target = rc->avg_frame_bandwidth; #endif return av1_rc_clamp_pframe_target_size(cpi, target, frame_update_type); } static int calc_iframe_target_size_one_pass_vbr(const AV1_COMP *const cpi) { static const int kf_ratio = 25; const RATE_CONTROL *rc = &cpi->rc; const int target = rc->avg_frame_bandwidth * kf_ratio; return av1_rc_clamp_iframe_target_size(cpi, target); } void av1_rc_get_one_pass_vbr_params(AV1_COMP *cpi, FRAME_UPDATE_TYPE *const frame_update_type, EncodeFrameParams *const frame_params, unsigned int frame_flags) { AV1_COMMON *const cm = &cpi->common; RATE_CONTROL *const rc = &cpi->rc; CurrentFrame *const current_frame = &cm->current_frame; int target; int altref_enabled = is_altref_enabled(cpi); int sframe_dist = cpi->oxcf.sframe_dist; int sframe_mode = cpi->oxcf.sframe_mode; int sframe_enabled = cpi->oxcf.sframe_enabled; // TODO(yaowu): replace the "auto_key && 0" below with proper decision logic. if (*frame_update_type != ARF_UPDATE && (current_frame->frame_number == 0 || (frame_flags & FRAMEFLAGS_KEY) || rc->frames_to_key == 0 || (cpi->oxcf.auto_key && 0))) { frame_params->frame_type = KEY_FRAME; rc->this_key_frame_forced = current_frame->frame_number != 0 && rc->frames_to_key == 0; rc->frames_to_key = cpi->oxcf.key_freq; rc->kf_boost = DEFAULT_KF_BOOST; rc->source_alt_ref_active = 0; } else { frame_params->frame_type = INTER_FRAME; if (sframe_enabled) { if (altref_enabled) { if (sframe_mode == 1) { // sframe_mode == 1: insert sframe if it matches altref frame. if (current_frame->frame_number % sframe_dist == 0 && current_frame->frame_number != 0 && *frame_update_type == ARF_UPDATE) { frame_params->frame_type = S_FRAME; } } else { // sframe_mode != 1: if sframe will be inserted at the next available // altref frame if (current_frame->frame_number % sframe_dist == 0 && current_frame->frame_number != 0) { rc->sframe_due = 1; } if (rc->sframe_due && *frame_update_type == ARF_UPDATE) { frame_params->frame_type = S_FRAME; rc->sframe_due = 0; } } } else { if (current_frame->frame_number % sframe_dist == 0 && current_frame->frame_number != 0) { frame_params->frame_type = S_FRAME; } } } } if (rc->frames_till_gf_update_due == 0) { rc->baseline_gf_interval = (rc->min_gf_interval + rc->max_gf_interval) / 2; rc->frames_till_gf_update_due = rc->baseline_gf_interval; // NOTE: frames_till_gf_update_due must be <= frames_to_key. if (rc->frames_till_gf_update_due > rc->frames_to_key) { rc->frames_till_gf_update_due = rc->frames_to_key; rc->constrained_gf_group = 1; } else { rc->constrained_gf_group = 0; } if (*frame_update_type == LF_UPDATE) *frame_update_type = GF_UPDATE; rc->source_alt_ref_pending = USE_ALTREF_FOR_ONE_PASS; rc->gfu_boost = DEFAULT_GF_BOOST; } if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) av1_cyclic_refresh_update_parameters(cpi); if (frame_params->frame_type == KEY_FRAME) target = calc_iframe_target_size_one_pass_vbr(cpi); else target = calc_pframe_target_size_one_pass_vbr(cpi, *frame_update_type); rc_set_frame_target(cpi, target, cm->width, cm->height); } static int calc_pframe_target_size_one_pass_cbr( const AV1_COMP *cpi, FRAME_UPDATE_TYPE frame_update_type) { const AV1EncoderConfig *oxcf = &cpi->oxcf; const RATE_CONTROL *rc = &cpi->rc; const int64_t diff = rc->optimal_buffer_level - rc->buffer_level; const int64_t one_pct_bits = 1 + rc->optimal_buffer_level / 100; int min_frame_target = AOMMAX(rc->avg_frame_bandwidth >> 4, FRAME_OVERHEAD_BITS); int target; if (oxcf->gf_cbr_boost_pct) { const int af_ratio_pct = oxcf->gf_cbr_boost_pct + 100; if (frame_update_type == GF_UPDATE || frame_update_type == OVERLAY_UPDATE) { target = (rc->avg_frame_bandwidth * rc->baseline_gf_interval * af_ratio_pct) / (rc->baseline_gf_interval * 100 + af_ratio_pct - 100); } else { target = (rc->avg_frame_bandwidth * rc->baseline_gf_interval * 100) / (rc->baseline_gf_interval * 100 + af_ratio_pct - 100); } } else { target = rc->avg_frame_bandwidth; } if (diff > 0) { // Lower the target bandwidth for this frame. const int pct_low = (int)AOMMIN(diff / one_pct_bits, oxcf->under_shoot_pct); target -= (target * pct_low) / 200; } else if (diff < 0) { // Increase the target bandwidth for this frame. const int pct_high = (int)AOMMIN(-diff / one_pct_bits, oxcf->over_shoot_pct); target += (target * pct_high) / 200; } if (oxcf->rc_max_inter_bitrate_pct) { const int max_rate = rc->avg_frame_bandwidth * oxcf->rc_max_inter_bitrate_pct / 100; target = AOMMIN(target, max_rate); } return AOMMAX(min_frame_target, target); } static int calc_iframe_target_size_one_pass_cbr(const AV1_COMP *cpi) { const RATE_CONTROL *rc = &cpi->rc; int target; if (cpi->common.current_frame.frame_number == 0) { target = ((rc->starting_buffer_level / 2) > INT_MAX) ? INT_MAX : (int)(rc->starting_buffer_level / 2); } else { int kf_boost = 32; double framerate = cpi->framerate; kf_boost = AOMMAX(kf_boost, (int)(2 * framerate - 16)); if (rc->frames_since_key < framerate / 2) { kf_boost = (int)(kf_boost * rc->frames_since_key / (framerate / 2)); } target = ((16 + kf_boost) * rc->avg_frame_bandwidth) >> 4; } return av1_rc_clamp_iframe_target_size(cpi, target); } void av1_rc_get_one_pass_cbr_params(AV1_COMP *cpi, FRAME_UPDATE_TYPE *const frame_update_type, EncodeFrameParams *const frame_params, unsigned int frame_flags) { AV1_COMMON *const cm = &cpi->common; RATE_CONTROL *const rc = &cpi->rc; CurrentFrame *const current_frame = &cm->current_frame; int target; // TODO(yaowu): replace the "auto_key && 0" below with proper decision logic. if ((current_frame->frame_number == 0 || (frame_flags & FRAMEFLAGS_KEY) || rc->frames_to_key == 0 || (cpi->oxcf.auto_key && 0))) { frame_params->frame_type = KEY_FRAME; rc->this_key_frame_forced = current_frame->frame_number != 0 && rc->frames_to_key == 0; rc->frames_to_key = cpi->oxcf.key_freq; rc->kf_boost = DEFAULT_KF_BOOST; rc->source_alt_ref_active = 0; } else { frame_params->frame_type = INTER_FRAME; } if (rc->frames_till_gf_update_due == 0) { if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) av1_cyclic_refresh_set_golden_update(cpi); else rc->baseline_gf_interval = (rc->min_gf_interval + rc->max_gf_interval) / 2; rc->frames_till_gf_update_due = rc->baseline_gf_interval; // NOTE: frames_till_gf_update_due must be <= frames_to_key. if (rc->frames_till_gf_update_due > rc->frames_to_key) rc->frames_till_gf_update_due = rc->frames_to_key; if (*frame_update_type == LF_UPDATE) *frame_update_type = GF_UPDATE; rc->gfu_boost = DEFAULT_GF_BOOST; } // Any update/change of global cyclic refresh parameters (amount/delta-qp) // should be done here, before the frame qp is selected. if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) av1_cyclic_refresh_update_parameters(cpi); if (frame_params->frame_type == KEY_FRAME) target = calc_iframe_target_size_one_pass_cbr(cpi); else target = calc_pframe_target_size_one_pass_cbr(cpi, *frame_update_type); rc_set_frame_target(cpi, target, cm->width, cm->height);
+ show +
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
// TODO(afergs): Decide whether to scale up, down, or not at all } int av1_find_qindex(double desired_q, aom_bit_depth_t bit_depth, int best_qindex, int worst_qindex) { assert(best_qindex <= worst_qindex); int low = best_qindex; int high = worst_qindex; while (low < high) { const int mid = (low + high) >> 1;

[CVE-2020-0470_1.diff] ratectrl.c #34
- int max_delta; - double position_factor = 1.0; + const int stats_count = + cpi->twopass.stats_buf_ctx->total_stats != NULL + ? (int)cpi->twopass.stats_buf_ctx->total_stats->count + : 0; + const int frame_window = AOMMIN( + 16, (int)(stats_count - (int)cpi->common.current_frame.frame_number)); - // How far through the clip are we. - // This number is used to damp the per frame rate correction. - // Range 0 - 1.0 - if (cpi->twopass.total_stats.count != 0.) { - position_factor = sqrt((double)cpi->common.current_frame.frame_number / - cpi->twopass.total_stats.count); - } - max_delta = (int)(position_factor * - ((*this_frame_target * VBR_PCT_ADJUSTMENT_LIMIT) / 100)); + if (frame_window > 0) { + const int max_delta = + AOMMIN(abs((int)(vbr_bits_off_target / frame_window)), + (*this_frame_target * VBR_PCT_ADJUSTMENT_LIMIT) / 100); - // vbr_bits_off_target > 0 means we have extra bits to spend - if (vbr_bits_off_target > 0) { - *this_frame_target += (vbr_bits_off_target > max_delta) - ? max_delta - : (int)vbr_bits_off_target; - } else { - *this_frame_target -= (vbr_bits_off_target < -max_delta) - ? max_delta - : (int)-vbr_bits_off_target; + // vbr_bits_off_target > 0 means we have extra bits to spend + // vbr_bits_off_target < 0 we are currently overshooting + *this_frame_target += (vbr_bits_off_target >= 0) ? max_delta : -max_delta;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/ratectrl.c
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
AOMMAX(AOMMAX((MBs * MAX_MB_RATE), MAXRATE_1080P), vbr_max_bits); av1_rc_set_gf_interval_range(cpi, rc); } #define VBR_PCT_ADJUSTMENT_LIMIT 50 // For VBR...adjustment to the frame target based on error from previous frames static void vbr_rate_correction(AV1_COMP *cpi, int *this_frame_target) { RATE_CONTROL *const rc = &cpi->rc; int64_t vbr_bits_off_target = rc->vbr_bits_off_target;
+ show +
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
int max_delta; double position_factor = 1.0; // How far through the clip are we. // This number is used to damp the per frame rate correction. // Range 0 - 1.0 if (cpi->twopass.total_stats.count != 0.) { position_factor = sqrt((double)cpi->common.current_frame.frame_number / cpi->twopass.total_stats.count); } max_delta = (int)(position_factor * ((*this_frame_target * VBR_PCT_ADJUSTMENT_LIMIT) / 100)); // vbr_bits_off_target > 0 means we have extra bits to spend if (vbr_bits_off_target > 0) { *this_frame_target += (vbr_bits_off_target > max_delta) ? max_delta : (int)vbr_bits_off_target; } else { *this_frame_target -= (vbr_bits_off_target < -max_delta) ? max_delta : (int)-vbr_bits_off_target;
+ show +
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
} // Fast redistribution of bits arising from massive local undershoot. // Dont do it for kf,arf,gf or overlay frames. if (!frame_is_kf_gf_arf(cpi) && !rc->is_src_frame_alt_ref && rc->vbr_bits_off_target_fast) { int one_frame_bits = AOMMAX(rc->avg_frame_bandwidth, *this_frame_target); int fast_extra_bits; fast_extra_bits = (int)AOMMIN(rc->vbr_bits_off_target_fast, one_frame_bits); fast_extra_bits = (int)AOMMIN(

[CVE-2020-0478_1.diff] rd.c #1
+void av1_rc_set_frame_target(struct AV1_COMP *cpi, int target, int width, + int height); + +int av1_calc_pframe_target_size_one_pass_vbr( + const struct AV1_COMP *const cpi, FRAME_UPDATE_TYPE frame_update_type); + +int av1_calc_iframe_target_size_one_pass_vbr(const struct AV1_COMP *const cpi); + +int av1_calc_pframe_target_size_one_pass_cbr( + const struct AV1_COMP *cpi, FRAME_UPDATE_TYPE frame_update_type); + +int av1_calc_iframe_target_size_one_pass_cbr(const struct AV1_COMP *cpi); + +void av1_get_one_pass_rt_params(struct AV1_COMP *cpi, + struct EncodeFrameParams *const frame_params, + unsigned int frame_flags); + -static const int use_intra_ext_tx_for_txsize[EXT_TX_SETS_INTRA][EXT_TX_SIZES] = - { - { 1, 1, 1, 1 }, // unused - { 1, 1, 0, 0 }, - { 0, 0, 1, 0 }, - }; +static const int use_intra_ext_tx_for_txsize[EXT_TX_SETS_INTRA] + [EXT_TX_SIZES] = { + { 1, 1, 1, 1 }, // unused + { 1, 1, 0, 0 }, + { 0, 0, 1, 0 }, + }; -static const int use_inter_ext_tx_for_txsize[EXT_TX_SETS_INTER][EXT_TX_SIZES] = - { - { 1, 1, 1, 1 }, // unused - { 1, 1, 0, 0 }, - { 0, 0, 1, 0 }, - { 0, 0, 0, 1 }, - }; +static const int use_inter_ext_tx_for_txsize[EXT_TX_SETS_INTER] + [EXT_TX_SIZES] = { + { 1, 1, 1, 1 }, // unused + { 1, 1, 0, 0 }, + { 0, 0, 1, 0 }, + { 0, 1, 1, 1 }, + };
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rd.c
45
46
47
48
49
50
51
52
53
54
#define RD_THRESH_POW 1.25 // The baseline rd thresholds for breaking out of the rd loop for // certain modes are assumed to be based on 8x8 blocks. // This table is used to correct for block size. // The factors here are << 2 (2 = x0.5, 32 = x8 etc). static const uint8_t rd_thresh_block_size_factor[BLOCK_SIZES_ALL] = { 2, 3, 3, 4, 6, 6, 8, 12, 12, 16, 24, 24, 32, 48, 48, 64, 4, 4, 8, 8, 16, 16 };
+ show +
55
56
57
58
59
60
61
62
63
64
65
66
67
68
static const int use_intra_ext_tx_for_txsize[EXT_TX_SETS_INTRA][EXT_TX_SIZES] = { { 1, 1, 1, 1 }, // unused { 1, 1, 0, 0 }, { 0, 0, 1, 0 }, }; static const int use_inter_ext_tx_for_txsize[EXT_TX_SETS_INTER][EXT_TX_SIZES] = { { 1, 1, 1, 1 }, // unused { 1, 1, 0, 0 }, { 0, 0, 1, 0 }, { 0, 0, 0, 1 }, };
+ show +
69
70
71
72
73
74
75
76
77
78
static const int av1_ext_tx_set_idx_to_type[2][AOMMAX(EXT_TX_SETS_INTRA, EXT_TX_SETS_INTER)] = { { // Intra EXT_TX_SET_DCTONLY, EXT_TX_SET_DTT4_IDTX_1DDCT, EXT_TX_SET_DTT4_IDTX, }, {

[CVE-2020-0478_1.diff] rd.c #3
-static int sad_per_bit16lut_8[QINDEX_RANGE]; -static int sad_per_bit4lut_8[QINDEX_RANGE]; -static int sad_per_bit16lut_10[QINDEX_RANGE]; -static int sad_per_bit4lut_10[QINDEX_RANGE]; -static int sad_per_bit16lut_12[QINDEX_RANGE]; -static int sad_per_bit4lut_12[QINDEX_RANGE]; +static int sad_per_bit_lut_8[QINDEX_RANGE]; +static int sad_per_bit_lut_10[QINDEX_RANGE]; +static int sad_per_bit_lut_12[QINDEX_RANGE]; -static void init_me_luts_bd(int *bit16lut, int *bit4lut, int range, +static void init_me_luts_bd(int *bit16lut, int range,
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rd.c
305
306
307
308
309
310
311
312
313
314
NULL); } for (i = 0; i < COMP_GROUP_IDX_CONTEXTS; ++i) { av1_cost_tokens_from_cdf(x->comp_group_idx_cost[i], fc->comp_group_idx_cdf[i], NULL); } } } // Values are now correlated to quantizer.
+ show +
315
316
317
318
319
320
321
322
static int sad_per_bit16lut_8[QINDEX_RANGE]; static int sad_per_bit4lut_8[QINDEX_RANGE]; static int sad_per_bit16lut_10[QINDEX_RANGE]; static int sad_per_bit4lut_10[QINDEX_RANGE]; static int sad_per_bit16lut_12[QINDEX_RANGE]; static int sad_per_bit4lut_12[QINDEX_RANGE]; static void init_me_luts_bd(int *bit16lut, int *bit4lut, int range,
+ show +
323
324
325
326
327
328
329
330
331
332
aom_bit_depth_t bit_depth) { int i; // Initialize the sad lut tables using a formulaic calculation for now. // This is to make it easier to resolve the impact of experimental changes // to the quantizer tables. for (i = 0; i < range; i++) { const double q = av1_convert_qindex_to_q(i, bit_depth); bit16lut[i] = (int)(0.0418 * q + 2.4107); bit4lut[i] = (int)(0.063 * q + 2.742); }

[CVE-2020-0478_1.diff] rd.c #8
- case AOM_BITS_8: - x->sadperbit16 = sad_per_bit16lut_8[qindex]; - x->sadperbit4 = sad_per_bit4lut_8[qindex]; - break; - case AOM_BITS_10: - x->sadperbit16 = sad_per_bit16lut_10[qindex]; - x->sadperbit4 = sad_per_bit4lut_10[qindex]; - break; - case AOM_BITS_12: - x->sadperbit16 = sad_per_bit16lut_12[qindex]; - x->sadperbit4 = sad_per_bit4lut_12[qindex]; - break; + case AOM_BITS_8: x->sadperbit = sad_per_bit_lut_8[qindex]; break; + case AOM_BITS_10: x->sadperbit = sad_per_bit_lut_10[qindex]; break; + case AOM_BITS_12: x->sadperbit = sad_per_bit_lut_12[qindex]; break;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rd.c
415
416
417
418
419
420
421
422
423
424
default: assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12"); return -1; } // TODO(debargha): Adjust the function below. return AOMMAX((int)(pow(q, RD_THRESH_POW) * 5.12), 8); } void av1_initialize_me_consts(const AV1_COMP *cpi, MACROBLOCK *x, int qindex) { switch (cpi->common.seq_params.bit_depth) {
+ show +
425
426
427
428
429
430
431
432
433
434
435
436
case AOM_BITS_8: x->sadperbit16 = sad_per_bit16lut_8[qindex]; x->sadperbit4 = sad_per_bit4lut_8[qindex]; break; case AOM_BITS_10: x->sadperbit16 = sad_per_bit16lut_10[qindex]; x->sadperbit4 = sad_per_bit4lut_10[qindex]; break; case AOM_BITS_12: x->sadperbit16 = sad_per_bit16lut_12[qindex]; x->sadperbit4 = sad_per_bit4lut_12[qindex]; break;
+ show +
437
438
439
440
441
442
443
444
445
446
default: assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12"); } } static void set_block_thresholds(const AV1_COMMON *cm, RD_OPT *rd) { int i, bsize, segment_id; for (segment_id = 0; segment_id < MAX_SEGMENTS; ++segment_id) { const int qindex =

[CVE-2020-0478_1.diff] rd.c #9
- const int qindex = - clamp(av1_get_qindex(&cm->seg, segment_id, cm->base_qindex) + - cm->y_dc_delta_q, - 0, MAXQ); + const int qindex = clamp( + av1_get_qindex(&cm->seg, segment_id, cm->quant_params.base_qindex) + + cm->quant_params.y_dc_delta_q, + 0, MAXQ);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rd.c
436
437
438
439
440
441
442
443
444
445
break; default: assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12"); } } static void set_block_thresholds(const AV1_COMMON *cm, RD_OPT *rd) { int i, bsize, segment_id; for (segment_id = 0; segment_id < MAX_SEGMENTS; ++segment_id) {
+ show +
446
447
448
449
const int qindex = clamp(av1_get_qindex(&cm->seg, segment_id, cm->base_qindex) + cm->y_dc_delta_q, 0, MAXQ);
+ show +
450
451
452
453
454
455
456
457
458
459
const int q = compute_rd_thresh_factor(qindex, cm->seq_params.bit_depth); for (bsize = 0; bsize < BLOCK_SIZES_ALL; ++bsize) { // Threshold here seems unnecessarily harsh but fine given actual // range of values used for cpi->sf.thresh_mult[]. const int t = q * rd_thresh_block_size_factor[bsize]; const int thresh_max = INT_MAX / t; for (i = 0; i < MAX_MODES; ++i) rd->threshes[segment_id][bsize][i] = rd->thresh_mult[i] < thresh_max

[CVE-2020-0478_1.diff] rd.c #18
-int av1_raster_block_offset(BLOCK_SIZE plane_bsize, int raster_block, - int stride) { - const int bw = mi_size_wide_log2[plane_bsize]; - const int y = 4 * (raster_block >> bw); - const int x = 4 * (raster_block & ((1 << bw) - 1)); - return y * stride + x; -} - -int16_t *av1_raster_block_offset_int16(BLOCK_SIZE plane_bsize, int raster_block, - int16_t *base) { - const int stride = block_size_wide[plane_bsize]; - return base + av1_raster_block_offset(plane_bsize, raster_block, stride); -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rd.c
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
for (i = 0; i < num_planes; ++i) { setup_pred_plane(dst + i, xd->mi[0]->sb_type, dst[i].buf, i ? src->uv_crop_width : src->y_crop_width, i ? src->uv_crop_height : src->y_crop_height, dst[i].stride, mi_row, mi_col, i ? scale_uv : scale, xd->plane[i].subsampling_x, xd->plane[i].subsampling_y); } }
+ show +
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
int av1_raster_block_offset(BLOCK_SIZE plane_bsize, int raster_block, int stride) { const int bw = mi_size_wide_log2[plane_bsize]; const int y = 4 * (raster_block >> bw); const int x = 4 * (raster_block & ((1 << bw) - 1)); return y * stride + x; } int16_t *av1_raster_block_offset_int16(BLOCK_SIZE plane_bsize, int raster_block, int16_t *base) { const int stride = block_size_wide[plane_bsize]; return base + av1_raster_block_offset(plane_bsize, raster_block, stride);
+ show +
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
} YV12_BUFFER_CONFIG *av1_get_scaled_ref_frame(const AV1_COMP *cpi, int ref_frame) { assert(ref_frame >= LAST_FRAME && ref_frame <= ALTREF_FRAME); RefCntBuffer *const scaled_buf = cpi->scaled_ref_buf[ref_frame - 1]; const RefCntBuffer *const ref_buf = get_ref_frame_buf(&cpi->common, ref_frame); return (scaled_buf != ref_buf && scaled_buf != NULL) ? &scaled_buf->buf : NULL;

[CVE-2020-0470_1.diff] rd.c #1
+void av1_rc_set_frame_target(struct AV1_COMP *cpi, int target, int width, + int height); + +int av1_calc_pframe_target_size_one_pass_vbr( + const struct AV1_COMP *const cpi, FRAME_UPDATE_TYPE frame_update_type); + +int av1_calc_iframe_target_size_one_pass_vbr(const struct AV1_COMP *const cpi); + +int av1_calc_pframe_target_size_one_pass_cbr( + const struct AV1_COMP *cpi, FRAME_UPDATE_TYPE frame_update_type); + +int av1_calc_iframe_target_size_one_pass_cbr(const struct AV1_COMP *cpi); + +void av1_get_one_pass_rt_params(struct AV1_COMP *cpi, + struct EncodeFrameParams *const frame_params, + unsigned int frame_flags); + -static const int use_intra_ext_tx_for_txsize[EXT_TX_SETS_INTRA][EXT_TX_SIZES] = - { - { 1, 1, 1, 1 }, // unused - { 1, 1, 0, 0 }, - { 0, 0, 1, 0 }, - }; +static const int use_intra_ext_tx_for_txsize[EXT_TX_SETS_INTRA] + [EXT_TX_SIZES] = { + { 1, 1, 1, 1 }, // unused + { 1, 1, 0, 0 }, + { 0, 0, 1, 0 }, + }; -static const int use_inter_ext_tx_for_txsize[EXT_TX_SETS_INTER][EXT_TX_SIZES] = - { - { 1, 1, 1, 1 }, // unused - { 1, 1, 0, 0 }, - { 0, 0, 1, 0 }, - { 0, 0, 0, 1 }, - }; +static const int use_inter_ext_tx_for_txsize[EXT_TX_SETS_INTER] + [EXT_TX_SIZES] = { + { 1, 1, 1, 1 }, // unused + { 1, 1, 0, 0 }, + { 0, 0, 1, 0 }, + { 0, 1, 1, 1 }, + };
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rd.c
45
46
47
48
49
50
51
52
53
54
#define RD_THRESH_POW 1.25 // The baseline rd thresholds for breaking out of the rd loop for // certain modes are assumed to be based on 8x8 blocks. // This table is used to correct for block size. // The factors here are << 2 (2 = x0.5, 32 = x8 etc). static const uint8_t rd_thresh_block_size_factor[BLOCK_SIZES_ALL] = { 2, 3, 3, 4, 6, 6, 8, 12, 12, 16, 24, 24, 32, 48, 48, 64, 4, 4, 8, 8, 16, 16 };
+ show +
55
56
57
58
59
60
61
62
63
64
65
66
67
68
static const int use_intra_ext_tx_for_txsize[EXT_TX_SETS_INTRA][EXT_TX_SIZES] = { { 1, 1, 1, 1 }, // unused { 1, 1, 0, 0 }, { 0, 0, 1, 0 }, }; static const int use_inter_ext_tx_for_txsize[EXT_TX_SETS_INTER][EXT_TX_SIZES] = { { 1, 1, 1, 1 }, // unused { 1, 1, 0, 0 }, { 0, 0, 1, 0 }, { 0, 0, 0, 1 }, };
+ show +
69
70
71
72
73
74
75
76
77
78
static const int av1_ext_tx_set_idx_to_type[2][AOMMAX(EXT_TX_SETS_INTRA, EXT_TX_SETS_INTER)] = { { // Intra EXT_TX_SET_DCTONLY, EXT_TX_SET_DTT4_IDTX_1DDCT, EXT_TX_SET_DTT4_IDTX, }, {

[CVE-2020-0470_1.diff] rd.c #3
-static int sad_per_bit16lut_8[QINDEX_RANGE]; -static int sad_per_bit4lut_8[QINDEX_RANGE]; -static int sad_per_bit16lut_10[QINDEX_RANGE]; -static int sad_per_bit4lut_10[QINDEX_RANGE]; -static int sad_per_bit16lut_12[QINDEX_RANGE]; -static int sad_per_bit4lut_12[QINDEX_RANGE]; +static int sad_per_bit_lut_8[QINDEX_RANGE]; +static int sad_per_bit_lut_10[QINDEX_RANGE]; +static int sad_per_bit_lut_12[QINDEX_RANGE]; -static void init_me_luts_bd(int *bit16lut, int *bit4lut, int range, +static void init_me_luts_bd(int *bit16lut, int range,
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rd.c
305
306
307
308
309
310
311
312
313
314
NULL); } for (i = 0; i < COMP_GROUP_IDX_CONTEXTS; ++i) { av1_cost_tokens_from_cdf(x->comp_group_idx_cost[i], fc->comp_group_idx_cdf[i], NULL); } } } // Values are now correlated to quantizer.
+ show +
315
316
317
318
319
320
321
322
static int sad_per_bit16lut_8[QINDEX_RANGE]; static int sad_per_bit4lut_8[QINDEX_RANGE]; static int sad_per_bit16lut_10[QINDEX_RANGE]; static int sad_per_bit4lut_10[QINDEX_RANGE]; static int sad_per_bit16lut_12[QINDEX_RANGE]; static int sad_per_bit4lut_12[QINDEX_RANGE]; static void init_me_luts_bd(int *bit16lut, int *bit4lut, int range,
+ show +
323
324
325
326
327
328
329
330
331
332
aom_bit_depth_t bit_depth) { int i; // Initialize the sad lut tables using a formulaic calculation for now. // This is to make it easier to resolve the impact of experimental changes // to the quantizer tables. for (i = 0; i < range; i++) { const double q = av1_convert_qindex_to_q(i, bit_depth); bit16lut[i] = (int)(0.0418 * q + 2.4107); bit4lut[i] = (int)(0.063 * q + 2.742); }

[CVE-2020-0470_1.diff] rd.c #8
- case AOM_BITS_8: - x->sadperbit16 = sad_per_bit16lut_8[qindex]; - x->sadperbit4 = sad_per_bit4lut_8[qindex]; - break; - case AOM_BITS_10: - x->sadperbit16 = sad_per_bit16lut_10[qindex]; - x->sadperbit4 = sad_per_bit4lut_10[qindex]; - break; - case AOM_BITS_12: - x->sadperbit16 = sad_per_bit16lut_12[qindex]; - x->sadperbit4 = sad_per_bit4lut_12[qindex]; - break; + case AOM_BITS_8: x->sadperbit = sad_per_bit_lut_8[qindex]; break; + case AOM_BITS_10: x->sadperbit = sad_per_bit_lut_10[qindex]; break; + case AOM_BITS_12: x->sadperbit = sad_per_bit_lut_12[qindex]; break;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rd.c
415
416
417
418
419
420
421
422
423
424
default: assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12"); return -1; } // TODO(debargha): Adjust the function below. return AOMMAX((int)(pow(q, RD_THRESH_POW) * 5.12), 8); } void av1_initialize_me_consts(const AV1_COMP *cpi, MACROBLOCK *x, int qindex) { switch (cpi->common.seq_params.bit_depth) {
+ show +
425
426
427
428
429
430
431
432
433
434
435
436
case AOM_BITS_8: x->sadperbit16 = sad_per_bit16lut_8[qindex]; x->sadperbit4 = sad_per_bit4lut_8[qindex]; break; case AOM_BITS_10: x->sadperbit16 = sad_per_bit16lut_10[qindex]; x->sadperbit4 = sad_per_bit4lut_10[qindex]; break; case AOM_BITS_12: x->sadperbit16 = sad_per_bit16lut_12[qindex]; x->sadperbit4 = sad_per_bit4lut_12[qindex]; break;
+ show +
437
438
439
440
441
442
443
444
445
446
default: assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12"); } } static void set_block_thresholds(const AV1_COMMON *cm, RD_OPT *rd) { int i, bsize, segment_id; for (segment_id = 0; segment_id < MAX_SEGMENTS; ++segment_id) { const int qindex =

[CVE-2020-0470_1.diff] rd.c #9
- const int qindex = - clamp(av1_get_qindex(&cm->seg, segment_id, cm->base_qindex) + - cm->y_dc_delta_q, - 0, MAXQ); + const int qindex = clamp( + av1_get_qindex(&cm->seg, segment_id, cm->quant_params.base_qindex) + + cm->quant_params.y_dc_delta_q, + 0, MAXQ);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rd.c
436
437
438
439
440
441
442
443
444
445
break; default: assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12"); } } static void set_block_thresholds(const AV1_COMMON *cm, RD_OPT *rd) { int i, bsize, segment_id; for (segment_id = 0; segment_id < MAX_SEGMENTS; ++segment_id) {
+ show +
446
447
448
449
const int qindex = clamp(av1_get_qindex(&cm->seg, segment_id, cm->base_qindex) + cm->y_dc_delta_q, 0, MAXQ);
+ show +
450
451
452
453
454
455
456
457
458
459
const int q = compute_rd_thresh_factor(qindex, cm->seq_params.bit_depth); for (bsize = 0; bsize < BLOCK_SIZES_ALL; ++bsize) { // Threshold here seems unnecessarily harsh but fine given actual // range of values used for cpi->sf.thresh_mult[]. const int t = q * rd_thresh_block_size_factor[bsize]; const int thresh_max = INT_MAX / t; for (i = 0; i < MAX_MODES; ++i) rd->threshes[segment_id][bsize][i] = rd->thresh_mult[i] < thresh_max

[CVE-2020-0470_1.diff] rd.c #18
-int av1_raster_block_offset(BLOCK_SIZE plane_bsize, int raster_block, - int stride) { - const int bw = mi_size_wide_log2[plane_bsize]; - const int y = 4 * (raster_block >> bw); - const int x = 4 * (raster_block & ((1 << bw) - 1)); - return y * stride + x; -} - -int16_t *av1_raster_block_offset_int16(BLOCK_SIZE plane_bsize, int raster_block, - int16_t *base) { - const int stride = block_size_wide[plane_bsize]; - return base + av1_raster_block_offset(plane_bsize, raster_block, stride); -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rd.c
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
for (i = 0; i < num_planes; ++i) { setup_pred_plane(dst + i, xd->mi[0]->sb_type, dst[i].buf, i ? src->uv_crop_width : src->y_crop_width, i ? src->uv_crop_height : src->y_crop_height, dst[i].stride, mi_row, mi_col, i ? scale_uv : scale, xd->plane[i].subsampling_x, xd->plane[i].subsampling_y); } }
+ show +
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
int av1_raster_block_offset(BLOCK_SIZE plane_bsize, int raster_block, int stride) { const int bw = mi_size_wide_log2[plane_bsize]; const int y = 4 * (raster_block >> bw); const int x = 4 * (raster_block & ((1 << bw) - 1)); return y * stride + x; } int16_t *av1_raster_block_offset_int16(BLOCK_SIZE plane_bsize, int raster_block, int16_t *base) { const int stride = block_size_wide[plane_bsize]; return base + av1_raster_block_offset(plane_bsize, raster_block, stride);
+ show +
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
} YV12_BUFFER_CONFIG *av1_get_scaled_ref_frame(const AV1_COMP *cpi, int ref_frame) { assert(ref_frame >= LAST_FRAME && ref_frame <= ALTREF_FRAME); RefCntBuffer *const scaled_buf = cpi->scaled_ref_buf[ref_frame - 1]; const RefCntBuffer *const ref_buf = get_ref_frame_buf(&cpi->common, ref_frame); return (scaled_buf != ref_buf && scaled_buf != NULL) ? &scaled_buf->buf : NULL;

[CVE-2020-0478_1.diff] rdopt.h #2
-#if CONFIG_DIST_8X8 -int64_t av1_dist_8x8(const struct AV1_COMP *const cpi, const MACROBLOCK *x, - const uint8_t *src, int src_stride, const uint8_t *dst, - int dst_stride, const BLOCK_SIZE tx_bsize, int bsw, - int bsh, int visible_w, int visible_h, int qindex); -#endif -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rdopt.h
60
61
62
63
64
65
66
67
68
69
} #endif // Returns the number of colors in 'src'. int av1_count_colors(const uint8_t *src, int stride, int rows, int cols, int *val_count); // Same as av1_count_colors(), but for high-bitdepth mode. int av1_count_colors_highbd(const uint8_t *src8, int stride, int rows, int cols, int bit_depth, int *val_count);
+ show +
70
71
72
73
74
75
#if CONFIG_DIST_8X8 int64_t av1_dist_8x8(const struct AV1_COMP *const cpi, const MACROBLOCK *x, const uint8_t *src, int src_stride, const uint8_t *dst, int dst_stride, const BLOCK_SIZE tx_bsize, int bsw, int bsh, int visible_w, int visible_h, int qindex); #endif
+ show +
76
77
78
79
80
81
82
83
84
85
static INLINE int av1_cost_skip_txb(MACROBLOCK *x, const TXB_CTX *const txb_ctx, int plane, TX_SIZE tx_size) { const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size); const PLANE_TYPE plane_type = get_plane_type(plane); const LV_MAP_COEFF_COST *const coeff_costs = &x->coeff_costs[txs_ctx][plane_type]; return coeff_costs->txb_skip_cost[txb_ctx->txb_skip_ctx][1]; }

[CVE-2020-0470_1.diff] rdopt.h #2
-#if CONFIG_DIST_8X8 -int64_t av1_dist_8x8(const struct AV1_COMP *const cpi, const MACROBLOCK *x, - const uint8_t *src, int src_stride, const uint8_t *dst, - int dst_stride, const BLOCK_SIZE tx_bsize, int bsw, - int bsh, int visible_w, int visible_h, int qindex); -#endif -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/rdopt.h
60
61
62
63
64
65
66
67
68
69
} #endif // Returns the number of colors in 'src'. int av1_count_colors(const uint8_t *src, int stride, int rows, int cols, int *val_count); // Same as av1_count_colors(), but for high-bitdepth mode. int av1_count_colors_highbd(const uint8_t *src8, int stride, int rows, int cols, int bit_depth, int *val_count);
+ show +
70
71
72
73
74
75
#if CONFIG_DIST_8X8 int64_t av1_dist_8x8(const struct AV1_COMP *const cpi, const MACROBLOCK *x, const uint8_t *src, int src_stride, const uint8_t *dst, int dst_stride, const BLOCK_SIZE tx_bsize, int bsw, int bsh, int visible_w, int visible_h, int qindex); #endif
+ show +
76
77
78
79
80
81
82
83
84
85
static INLINE int av1_cost_skip_txb(MACROBLOCK *x, const TXB_CTX *const txb_ctx, int plane, TX_SIZE tx_size) { const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size); const PLANE_TYPE plane_type = get_plane_type(plane); const LV_MAP_COEFF_COST *const coeff_costs = &x->coeff_costs[txs_ctx][plane_type]; return coeff_costs->txb_skip_cost[txb_ctx->txb_skip_ctx][1]; }

[CVE-2020-0478_1.diff] tokenize.c #2
- if (!dry_run) { - av1_update_and_record_txb_context(plane, block, blk_row, blk_col, - plane_bsize, tx_size, arg); - } else if (dry_run == DRY_RUN_NORMAL) { - av1_update_txb_context_b(plane, block, blk_row, blk_col, plane_bsize, - tx_size, arg); - } else { - printf("DRY_RUN_COSTCOEFFS is not supported yet\n"); - assert(0); - } + av1_update_and_record_txb_context(plane, block, blk_row, blk_col, + plane_bsize, tx_size, arg); +
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/tokenize.c
144
145
146
147
148
149
150
151
152
153
const TX_SIZE plane_tx_size = plane ? av1_get_max_uv_txsize(mbmi->sb_type, pd->subsampling_x, pd->subsampling_y) : mbmi->inter_tx_size[av1_get_txb_size_index(plane_bsize, blk_row, blk_col)]; if (tx_size == plane_tx_size || plane) { plane_bsize = get_plane_block_size(mbmi->sb_type, pd->subsampling_x, pd->subsampling_y);
+ show +
154
155
156
157
158
159
160
161
162
if (!dry_run) { av1_update_and_record_txb_context(plane, block, blk_row, blk_col, plane_bsize, tx_size, arg); } else if (dry_run == DRY_RUN_NORMAL) { av1_update_txb_context_b(plane, block, blk_row, blk_col, plane_bsize, tx_size, arg); } else { printf("DRY_RUN_COSTCOEFFS is not supported yet\n"); assert(0);
+ show +
163
164
165
166
167
168
169
170
171
172
} } else { // Half the block size in transform block unit. const TX_SIZE sub_txs = sub_tx_size_map[tx_size]; const int bsw = tx_size_wide_unit[sub_txs]; const int bsh = tx_size_high_unit[sub_txs]; const int step = bsw * bsh; assert(bsw > 0 && bsh > 0);

[CVE-2020-0470_1.diff] tokenize.c #2
- if (!dry_run) { - av1_update_and_record_txb_context(plane, block, blk_row, blk_col, - plane_bsize, tx_size, arg); - } else if (dry_run == DRY_RUN_NORMAL) { - av1_update_txb_context_b(plane, block, blk_row, blk_col, plane_bsize, - tx_size, arg); - } else { - printf("DRY_RUN_COSTCOEFFS is not supported yet\n"); - assert(0); - } + av1_update_and_record_txb_context(plane, block, blk_row, blk_col, + plane_bsize, tx_size, arg); +
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/tokenize.c
144
145
146
147
148
149
150
151
152
153
const TX_SIZE plane_tx_size = plane ? av1_get_max_uv_txsize(mbmi->sb_type, pd->subsampling_x, pd->subsampling_y) : mbmi->inter_tx_size[av1_get_txb_size_index(plane_bsize, blk_row, blk_col)]; if (tx_size == plane_tx_size || plane) { plane_bsize = get_plane_block_size(mbmi->sb_type, pd->subsampling_x, pd->subsampling_y);
+ show +
154
155
156
157
158
159
160
161
162
if (!dry_run) { av1_update_and_record_txb_context(plane, block, blk_row, blk_col, plane_bsize, tx_size, arg); } else if (dry_run == DRY_RUN_NORMAL) { av1_update_txb_context_b(plane, block, blk_row, blk_col, plane_bsize, tx_size, arg); } else { printf("DRY_RUN_COSTCOEFFS is not supported yet\n"); assert(0);
+ show +
163
164
165
166
167
168
169
170
171
172
} } else { // Half the block size in transform block unit. const TX_SIZE sub_txs = sub_tx_size_map[tx_size]; const int bsw = tx_size_wide_unit[sub_txs]; const int bsh = tx_size_high_unit[sub_txs]; const int step = bsw * bsh; assert(bsw > 0 && bsh > 0);

[CVE-2020-0478_1.diff] firstpass.h #3
-enum { - KF_UPDATE, - LF_UPDATE, - GF_UPDATE, - ARF_UPDATE, - OVERLAY_UPDATE, - INTNL_OVERLAY_UPDATE, // Internal Overlay Frame - INTNL_ARF_UPDATE, // Internal Altref Frame - FRAME_UPDATE_TYPES -} UENUM1BYTE(FRAME_UPDATE_TYPE); -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/firstpass.h
88
89
90
91
92
93
94
95
96
97
double new_mv_count; // Duration of the frame / collection of frames. double duration; // 1.0 if stats are for a single frame, OR // Number of frames in this collection for which the stats are accumulated. double count; // standard deviation for (0, 0) motion prediction error double raw_error_stdev; } FIRSTPASS_STATS;
+ show +
98
99
100
101
102
103
104
105
106
107
enum { KF_UPDATE, LF_UPDATE, GF_UPDATE, ARF_UPDATE, OVERLAY_UPDATE, INTNL_OVERLAY_UPDATE, // Internal Overlay Frame INTNL_ARF_UPDATE, // Internal Altref Frame FRAME_UPDATE_TYPES } UENUM1BYTE(FRAME_UPDATE_TYPE);
+ show +
108
109
110
111
112
113
114
115
116
117
#define FC_ANIMATION_THRESH 0.15 enum { FC_NORMAL = 0, FC_GRAPHICS_ANIMATION = 1, FRAME_CONTENT_TYPES = 2 } UENUM1BYTE(FRAME_CONTENT_TYPE); typedef struct { unsigned char index;

[CVE-2020-0470_1.diff] firstpass.h #3
-enum { - KF_UPDATE, - LF_UPDATE, - GF_UPDATE, - ARF_UPDATE, - OVERLAY_UPDATE, - INTNL_OVERLAY_UPDATE, // Internal Overlay Frame - INTNL_ARF_UPDATE, // Internal Altref Frame - FRAME_UPDATE_TYPES -} UENUM1BYTE(FRAME_UPDATE_TYPE); -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/firstpass.h
88
89
90
91
92
93
94
95
96
97
double new_mv_count; // Duration of the frame / collection of frames. double duration; // 1.0 if stats are for a single frame, OR // Number of frames in this collection for which the stats are accumulated. double count; // standard deviation for (0, 0) motion prediction error double raw_error_stdev; } FIRSTPASS_STATS;
+ show +
98
99
100
101
102
103
104
105
106
107
enum { KF_UPDATE, LF_UPDATE, GF_UPDATE, ARF_UPDATE, OVERLAY_UPDATE, INTNL_OVERLAY_UPDATE, // Internal Overlay Frame INTNL_ARF_UPDATE, // Internal Altref Frame FRAME_UPDATE_TYPES } UENUM1BYTE(FRAME_UPDATE_TYPE);
+ show +
108
109
110
111
112
113
114
115
116
117
#define FC_ANIMATION_THRESH 0.15 enum { FC_NORMAL = 0, FC_GRAPHICS_ANIMATION = 1, FRAME_CONTENT_TYPES = 2 } UENUM1BYTE(FRAME_CONTENT_TYPE); typedef struct { unsigned char index;

[CVE-2020-0478_1.diff] av1_fwd_txfm2d.c #1
- case TXFM_TYPE_DCT4: return av1_fdct4_new; - case TXFM_TYPE_DCT8: return av1_fdct8_new; - case TXFM_TYPE_DCT16: return av1_fdct16_new; - case TXFM_TYPE_DCT32: return av1_fdct32_new; - case TXFM_TYPE_DCT64: return av1_fdct64_new; - case TXFM_TYPE_ADST4: return av1_fadst4_new; - case TXFM_TYPE_ADST8: return av1_fadst8_new; - case TXFM_TYPE_ADST16: return av1_fadst16_new; + case TXFM_TYPE_DCT4: return av1_fdct4; + case TXFM_TYPE_DCT8: return av1_fdct8; + case TXFM_TYPE_DCT16: return av1_fdct16; + case TXFM_TYPE_DCT32: return av1_fdct32; + case TXFM_TYPE_DCT64: return av1_fdct64; + case TXFM_TYPE_ADST4: return av1_fadst4; + case TXFM_TYPE_ADST8: return av1_fadst8; + case TXFM_TYPE_ADST16: return av1_fadst16;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/av1_fwd_txfm2d.c
15
16
17
18
19
20
21
22
23
24
#include "config/av1_rtcd.h" #include "aom_dsp/txfm_common.h" #include "av1/common/enums.h" #include "av1/common/av1_txfm.h" #include "av1/encoder/av1_fwd_txfm1d.h" #include "av1/encoder/av1_fwd_txfm1d_cfg.h" static INLINE TxfmFunc fwd_txfm_type_to_func(TXFM_TYPE txfm_type) { switch (txfm_type) {
+ show +
25
26
27
28
29
30
31
32
case TXFM_TYPE_DCT4: return av1_fdct4_new; case TXFM_TYPE_DCT8: return av1_fdct8_new; case TXFM_TYPE_DCT16: return av1_fdct16_new; case TXFM_TYPE_DCT32: return av1_fdct32_new; case TXFM_TYPE_DCT64: return av1_fdct64_new; case TXFM_TYPE_ADST4: return av1_fadst4_new; case TXFM_TYPE_ADST8: return av1_fadst8_new; case TXFM_TYPE_ADST16: return av1_fadst16_new;
+ show +
33
34
35
36
37
38
39
40
41
42
case TXFM_TYPE_IDENTITY4: return av1_fidentity4_c; case TXFM_TYPE_IDENTITY8: return av1_fidentity8_c; case TXFM_TYPE_IDENTITY16: return av1_fidentity16_c; case TXFM_TYPE_IDENTITY32: return av1_fidentity32_c; default: assert(0); return NULL; } } void av1_gen_fwd_stage_range(int8_t *stage_range_col, int8_t *stage_range_row, const TXFM_2D_FLIP_CFG *cfg, int bd) {

[CVE-2020-0478_1.diff] av1_fwd_txfm2d.c #3
-const int8_t fwd_cos_bit_col[MAX_TXWH_IDX /*txw_idx*/] - [MAX_TXWH_IDX /*txh_idx*/] = { - { 13, 13, 13, 0, 0 }, - { 13, 13, 13, 12, 0 }, - { 13, 13, 13, 12, 13 }, - { 0, 13, 13, 12, 13 }, - { 0, 0, 13, 12, 13 } - }; +const int8_t av1_fwd_cos_bit_col[MAX_TXWH_IDX /*txw_idx*/] + [MAX_TXWH_IDX /*txh_idx*/] = { + { 13, 13, 13, 0, 0 }, + { 13, 13, 13, 12, 0 }, + { 13, 13, 13, 12, 13 }, + { 0, 13, 13, 12, 13 }, + { 0, 0, 13, 12, 13 } + }; -const int8_t fwd_cos_bit_row[MAX_TXWH_IDX /*txw_idx*/] - [MAX_TXWH_IDX /*txh_idx*/] = { - { 13, 13, 12, 0, 0 }, - { 13, 13, 13, 12, 0 }, - { 13, 13, 12, 13, 12 }, - { 0, 12, 13, 12, 11 }, - { 0, 0, 12, 11, 10 } - }; +const int8_t av1_fwd_cos_bit_row[MAX_TXWH_IDX /*txw_idx*/] + [MAX_TXWH_IDX /*txh_idx*/] = { + { 13, 13, 12, 0, 0 }, + { 13, 13, 13, 12, 0 }, + { 13, 13, 12, 13, 12 }, + { 0, 12, 13, 12, 11 }, + { 0, 0, 12, 11, 10 } + };
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/av1_fwd_txfm2d.c
328
329
330
331
332
333
334
335
336
337
static const int8_t fwd_shift_64x16[3] = { 2, -4, 0 }; const int8_t *fwd_txfm_shift_ls[TX_SIZES_ALL] = { fwd_shift_4x4, fwd_shift_8x8, fwd_shift_16x16, fwd_shift_32x32, fwd_shift_64x64, fwd_shift_4x8, fwd_shift_8x4, fwd_shift_8x16, fwd_shift_16x8, fwd_shift_16x32, fwd_shift_32x16, fwd_shift_32x64, fwd_shift_64x32, fwd_shift_4x16, fwd_shift_16x4, fwd_shift_8x32, fwd_shift_32x8, fwd_shift_16x64, fwd_shift_64x16, };
+ show +
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
const int8_t fwd_cos_bit_col[MAX_TXWH_IDX /*txw_idx*/] [MAX_TXWH_IDX /*txh_idx*/] = { { 13, 13, 13, 0, 0 }, { 13, 13, 13, 12, 0 }, { 13, 13, 13, 12, 13 }, { 0, 13, 13, 12, 13 }, { 0, 0, 13, 12, 13 } }; const int8_t fwd_cos_bit_row[MAX_TXWH_IDX /*txw_idx*/] [MAX_TXWH_IDX /*txh_idx*/] = { { 13, 13, 12, 0, 0 }, { 13, 13, 13, 12, 0 }, { 13, 13, 12, 13, 12 }, { 0, 12, 13, 12, 11 }, { 0, 0, 12, 11, 10 } };
+ show +
355
356
357
358
359
360
361
362
363
364
static const int8_t fdct4_range_mult2[4] = { 0, 2, 3, 3 }; static const int8_t fdct8_range_mult2[6] = { 0, 2, 4, 5, 5, 5 }; static const int8_t fdct16_range_mult2[8] = { 0, 2, 4, 6, 7, 7, 7, 7 }; static const int8_t fdct32_range_mult2[10] = { 0, 2, 4, 6, 8, 9, 9, 9, 9, 9 }; static const int8_t fdct64_range_mult2[12] = { 0, 2, 4, 6, 8, 10, 11, 11, 11, 11, 11, 11 }; static const int8_t fadst4_range_mult2[7] = { 0, 2, 4, 3, 3, 3, 3 }; static const int8_t fadst8_range_mult2[8] = { 0, 0, 1, 3, 3, 5, 5, 5 };

[CVE-2020-0478_1.diff] av1_fwd_txfm2d.c #5
- const int txw_idx = tx_size_wide_log2[tx_size] - tx_size_wide_log2[0]; - const int txh_idx = tx_size_high_log2[tx_size] - tx_size_high_log2[0]; - cfg->shift = fwd_txfm_shift_ls[tx_size]; - cfg->cos_bit_col = fwd_cos_bit_col[txw_idx][txh_idx]; - cfg->cos_bit_row = fwd_cos_bit_row[txw_idx][txh_idx]; + const int txw_idx = get_txw_idx(tx_size); + const int txh_idx = get_txh_idx(tx_size); + cfg->shift = av1_fwd_txfm_shift_ls[tx_size]; + cfg->cos_bit_col = av1_fwd_cos_bit_col[txw_idx][txh_idx]; + cfg->cos_bit_row = av1_fwd_cos_bit_row[txw_idx][txh_idx];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/av1_fwd_txfm2d.c
409
410
411
412
413
414
415
416
417
418
} } void av1_get_fwd_txfm_cfg(TX_TYPE tx_type, TX_SIZE tx_size, TXFM_2D_FLIP_CFG *cfg) { assert(cfg != NULL); cfg->tx_size = tx_size; set_flip_cfg(tx_type, cfg); const TX_TYPE_1D tx_type_1d_col = vtx_tab[tx_type]; const TX_TYPE_1D tx_type_1d_row = htx_tab[tx_type];
+ show +
419
420
421
422
423
const int txw_idx = tx_size_wide_log2[tx_size] - tx_size_wide_log2[0]; const int txh_idx = tx_size_high_log2[tx_size] - tx_size_high_log2[0]; cfg->shift = fwd_txfm_shift_ls[tx_size]; cfg->cos_bit_col = fwd_cos_bit_col[txw_idx][txh_idx]; cfg->cos_bit_row = fwd_cos_bit_row[txw_idx][txh_idx];
+ show +
424
425
426
427
428
429
cfg->txfm_type_col = av1_txfm_type_ls[txh_idx][tx_type_1d_col]; cfg->txfm_type_row = av1_txfm_type_ls[txw_idx][tx_type_1d_row]; cfg->stage_num_col = av1_txfm_stage_num_list[cfg->txfm_type_col]; cfg->stage_num_row = av1_txfm_stage_num_list[cfg->txfm_type_row]; set_fwd_txfm_non_scale_range(cfg); }

[CVE-2020-0470_1.diff] av1_fwd_txfm2d.c #1
- case TXFM_TYPE_DCT4: return av1_fdct4_new; - case TXFM_TYPE_DCT8: return av1_fdct8_new; - case TXFM_TYPE_DCT16: return av1_fdct16_new; - case TXFM_TYPE_DCT32: return av1_fdct32_new; - case TXFM_TYPE_DCT64: return av1_fdct64_new; - case TXFM_TYPE_ADST4: return av1_fadst4_new; - case TXFM_TYPE_ADST8: return av1_fadst8_new; - case TXFM_TYPE_ADST16: return av1_fadst16_new; + case TXFM_TYPE_DCT4: return av1_fdct4; + case TXFM_TYPE_DCT8: return av1_fdct8; + case TXFM_TYPE_DCT16: return av1_fdct16; + case TXFM_TYPE_DCT32: return av1_fdct32; + case TXFM_TYPE_DCT64: return av1_fdct64; + case TXFM_TYPE_ADST4: return av1_fadst4; + case TXFM_TYPE_ADST8: return av1_fadst8; + case TXFM_TYPE_ADST16: return av1_fadst16;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/av1_fwd_txfm2d.c
15
16
17
18
19
20
21
22
23
24
#include "config/av1_rtcd.h" #include "aom_dsp/txfm_common.h" #include "av1/common/enums.h" #include "av1/common/av1_txfm.h" #include "av1/encoder/av1_fwd_txfm1d.h" #include "av1/encoder/av1_fwd_txfm1d_cfg.h" static INLINE TxfmFunc fwd_txfm_type_to_func(TXFM_TYPE txfm_type) { switch (txfm_type) {
+ show +
25
26
27
28
29
30
31
32
case TXFM_TYPE_DCT4: return av1_fdct4_new; case TXFM_TYPE_DCT8: return av1_fdct8_new; case TXFM_TYPE_DCT16: return av1_fdct16_new; case TXFM_TYPE_DCT32: return av1_fdct32_new; case TXFM_TYPE_DCT64: return av1_fdct64_new; case TXFM_TYPE_ADST4: return av1_fadst4_new; case TXFM_TYPE_ADST8: return av1_fadst8_new; case TXFM_TYPE_ADST16: return av1_fadst16_new;
+ show +
33
34
35
36
37
38
39
40
41
42
case TXFM_TYPE_IDENTITY4: return av1_fidentity4_c; case TXFM_TYPE_IDENTITY8: return av1_fidentity8_c; case TXFM_TYPE_IDENTITY16: return av1_fidentity16_c; case TXFM_TYPE_IDENTITY32: return av1_fidentity32_c; default: assert(0); return NULL; } } void av1_gen_fwd_stage_range(int8_t *stage_range_col, int8_t *stage_range_row, const TXFM_2D_FLIP_CFG *cfg, int bd) {

[CVE-2020-0470_1.diff] av1_fwd_txfm2d.c #3
-const int8_t fwd_cos_bit_col[MAX_TXWH_IDX /*txw_idx*/] - [MAX_TXWH_IDX /*txh_idx*/] = { - { 13, 13, 13, 0, 0 }, - { 13, 13, 13, 12, 0 }, - { 13, 13, 13, 12, 13 }, - { 0, 13, 13, 12, 13 }, - { 0, 0, 13, 12, 13 } - }; +const int8_t av1_fwd_cos_bit_col[MAX_TXWH_IDX /*txw_idx*/] + [MAX_TXWH_IDX /*txh_idx*/] = { + { 13, 13, 13, 0, 0 }, + { 13, 13, 13, 12, 0 }, + { 13, 13, 13, 12, 13 }, + { 0, 13, 13, 12, 13 }, + { 0, 0, 13, 12, 13 } + }; -const int8_t fwd_cos_bit_row[MAX_TXWH_IDX /*txw_idx*/] - [MAX_TXWH_IDX /*txh_idx*/] = { - { 13, 13, 12, 0, 0 }, - { 13, 13, 13, 12, 0 }, - { 13, 13, 12, 13, 12 }, - { 0, 12, 13, 12, 11 }, - { 0, 0, 12, 11, 10 } - }; +const int8_t av1_fwd_cos_bit_row[MAX_TXWH_IDX /*txw_idx*/] + [MAX_TXWH_IDX /*txh_idx*/] = { + { 13, 13, 12, 0, 0 }, + { 13, 13, 13, 12, 0 }, + { 13, 13, 12, 13, 12 }, + { 0, 12, 13, 12, 11 }, + { 0, 0, 12, 11, 10 } + };
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/av1_fwd_txfm2d.c
328
329
330
331
332
333
334
335
336
337
static const int8_t fwd_shift_64x16[3] = { 2, -4, 0 }; const int8_t *fwd_txfm_shift_ls[TX_SIZES_ALL] = { fwd_shift_4x4, fwd_shift_8x8, fwd_shift_16x16, fwd_shift_32x32, fwd_shift_64x64, fwd_shift_4x8, fwd_shift_8x4, fwd_shift_8x16, fwd_shift_16x8, fwd_shift_16x32, fwd_shift_32x16, fwd_shift_32x64, fwd_shift_64x32, fwd_shift_4x16, fwd_shift_16x4, fwd_shift_8x32, fwd_shift_32x8, fwd_shift_16x64, fwd_shift_64x16, };
+ show +
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
const int8_t fwd_cos_bit_col[MAX_TXWH_IDX /*txw_idx*/] [MAX_TXWH_IDX /*txh_idx*/] = { { 13, 13, 13, 0, 0 }, { 13, 13, 13, 12, 0 }, { 13, 13, 13, 12, 13 }, { 0, 13, 13, 12, 13 }, { 0, 0, 13, 12, 13 } }; const int8_t fwd_cos_bit_row[MAX_TXWH_IDX /*txw_idx*/] [MAX_TXWH_IDX /*txh_idx*/] = { { 13, 13, 12, 0, 0 }, { 13, 13, 13, 12, 0 }, { 13, 13, 12, 13, 12 }, { 0, 12, 13, 12, 11 }, { 0, 0, 12, 11, 10 } };
+ show +
355
356
357
358
359
360
361
362
363
364
static const int8_t fdct4_range_mult2[4] = { 0, 2, 3, 3 }; static const int8_t fdct8_range_mult2[6] = { 0, 2, 4, 5, 5, 5 }; static const int8_t fdct16_range_mult2[8] = { 0, 2, 4, 6, 7, 7, 7, 7 }; static const int8_t fdct32_range_mult2[10] = { 0, 2, 4, 6, 8, 9, 9, 9, 9, 9 }; static const int8_t fdct64_range_mult2[12] = { 0, 2, 4, 6, 8, 10, 11, 11, 11, 11, 11, 11 }; static const int8_t fadst4_range_mult2[7] = { 0, 2, 4, 3, 3, 3, 3 }; static const int8_t fadst8_range_mult2[8] = { 0, 0, 1, 3, 3, 5, 5, 5 };

[CVE-2020-0470_1.diff] av1_fwd_txfm2d.c #5
- const int txw_idx = tx_size_wide_log2[tx_size] - tx_size_wide_log2[0]; - const int txh_idx = tx_size_high_log2[tx_size] - tx_size_high_log2[0]; - cfg->shift = fwd_txfm_shift_ls[tx_size]; - cfg->cos_bit_col = fwd_cos_bit_col[txw_idx][txh_idx]; - cfg->cos_bit_row = fwd_cos_bit_row[txw_idx][txh_idx]; + const int txw_idx = get_txw_idx(tx_size); + const int txh_idx = get_txh_idx(tx_size); + cfg->shift = av1_fwd_txfm_shift_ls[tx_size]; + cfg->cos_bit_col = av1_fwd_cos_bit_col[txw_idx][txh_idx]; + cfg->cos_bit_row = av1_fwd_cos_bit_row[txw_idx][txh_idx];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/av1_fwd_txfm2d.c
409
410
411
412
413
414
415
416
417
418
} } void av1_get_fwd_txfm_cfg(TX_TYPE tx_type, TX_SIZE tx_size, TXFM_2D_FLIP_CFG *cfg) { assert(cfg != NULL); cfg->tx_size = tx_size; set_flip_cfg(tx_type, cfg); const TX_TYPE_1D tx_type_1d_col = vtx_tab[tx_type]; const TX_TYPE_1D tx_type_1d_row = htx_tab[tx_type];
+ show +
419
420
421
422
423
const int txw_idx = tx_size_wide_log2[tx_size] - tx_size_wide_log2[0]; const int txh_idx = tx_size_high_log2[tx_size] - tx_size_high_log2[0]; cfg->shift = fwd_txfm_shift_ls[tx_size]; cfg->cos_bit_col = fwd_cos_bit_col[txw_idx][txh_idx]; cfg->cos_bit_row = fwd_cos_bit_row[txw_idx][txh_idx];
+ show +
424
425
426
427
428
429
cfg->txfm_type_col = av1_txfm_type_ls[txh_idx][tx_type_1d_col]; cfg->txfm_type_row = av1_txfm_type_ls[txw_idx][tx_type_1d_row]; cfg->stage_num_col = av1_txfm_stage_num_list[cfg->txfm_type_col]; cfg->stage_num_row = av1_txfm_stage_num_list[cfg->txfm_type_row]; set_fwd_txfm_non_scale_range(cfg); }

[CVE-2020-0478_1.diff] aq_cyclicrefresh.c #1
-struct CYCLIC_REFRESH { - // Percentage of blocks per frame that are targeted as candidates - // for cyclic refresh. - int percent_refresh; - // Maximum q-delta as percentage of base q. - int max_qdelta_perc; - // Superblock starting index for cycling through the frame. - int sb_index; - // Controls how long block will need to wait to be refreshed again, in - // excess of the cycle time, i.e., in the case of all zero motion, block - // will be refreshed every (100/percent_refresh + time_for_refresh) frames. - int time_for_refresh; - // Target number of (4x4) blocks that are set for delta-q. - int target_num_seg_blocks; - // Actual number of (4x4) blocks that were applied delta-q. - int actual_num_seg1_blocks; - int actual_num_seg2_blocks; - // RD mult. parameters for segment 1. - int rdmult; - // Cyclic refresh map. - int8_t *map; - // Map of the last q a block was coded at. - uint8_t *last_coded_q_map; - // Thresholds applied to the projected rate/distortion of the coding block, - // when deciding whether block should be refreshed. - int64_t thresh_rate_sb; - int64_t thresh_dist_sb; - // Threshold applied to the motion vector (in units of 1/8 pel) of the - // coding block, when deciding whether block should be refreshed. - int16_t motion_thresh; - // Rate target ratio to set q delta. - double rate_ratio_qdelta; - // Boost factor for rate target ratio, for segment CR_SEGMENT_ID_BOOST2. - int rate_boost_fac; - double low_content_avg; - int qindex_delta[3]; - double weight_segment; - int apply_cyclic_refresh; -}; -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/aq_cyclicrefresh.c
12
13
14
15
16
17
18
19
20
21
#include <limits.h> #include <math.h> #include "av1/common/seg_common.h" #include "av1/encoder/aq_cyclicrefresh.h" #include "av1/encoder/ratectrl.h" #include "av1/encoder/segmentation.h" #include "aom_dsp/aom_dsp_common.h" #include "aom_ports/system_state.h"
+ show +
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
struct CYCLIC_REFRESH { // Percentage of blocks per frame that are targeted as candidates // for cyclic refresh. int percent_refresh; // Maximum q-delta as percentage of base q. int max_qdelta_perc; // Superblock starting index for cycling through the frame. int sb_index; // Controls how long block will need to wait to be refreshed again, in // excess of the cycle time, i.e., in the case of all zero motion, block // will be refreshed every (100/percent_refresh + time_for_refresh) frames. int time_for_refresh; // Target number of (4x4) blocks that are set for delta-q. int target_num_seg_blocks; // Actual number of (4x4) blocks that were applied delta-q. int actual_num_seg1_blocks; int actual_num_seg2_blocks; // RD mult. parameters for segment 1. int rdmult; // Cyclic refresh map. int8_t *map; // Map of the last q a block was coded at. uint8_t *last_coded_q_map; // Thresholds applied to the projected rate/distortion of the coding block, // when deciding whether block should be refreshed. int64_t thresh_rate_sb; int64_t thresh_dist_sb; // Threshold applied to the motion vector (in units of 1/8 pel) of the // coding block, when deciding whether block should be refreshed. int16_t motion_thresh; // Rate target ratio to set q delta. double rate_ratio_qdelta; // Boost factor for rate target ratio, for segment CR_SEGMENT_ID_BOOST2. int rate_boost_fac; double low_content_avg; int qindex_delta[3]; double weight_segment; int apply_cyclic_refresh; };
+ show +
61
62
63
64
65
66
67
68
69
70
CYCLIC_REFRESH *av1_cyclic_refresh_alloc(int mi_rows, int mi_cols) { size_t last_coded_q_map_size; CYCLIC_REFRESH *const cr = aom_calloc(1, sizeof(*cr)); if (cr == NULL) return NULL; cr->map = aom_calloc(mi_rows * mi_cols, sizeof(*cr->map)); if (cr->map == NULL) { av1_cyclic_refresh_free(cr); return NULL;

[CVE-2020-0470_1.diff] aq_cyclicrefresh.c #1
-struct CYCLIC_REFRESH { - // Percentage of blocks per frame that are targeted as candidates - // for cyclic refresh. - int percent_refresh; - // Maximum q-delta as percentage of base q. - int max_qdelta_perc; - // Superblock starting index for cycling through the frame. - int sb_index; - // Controls how long block will need to wait to be refreshed again, in - // excess of the cycle time, i.e., in the case of all zero motion, block - // will be refreshed every (100/percent_refresh + time_for_refresh) frames. - int time_for_refresh; - // Target number of (4x4) blocks that are set for delta-q. - int target_num_seg_blocks; - // Actual number of (4x4) blocks that were applied delta-q. - int actual_num_seg1_blocks; - int actual_num_seg2_blocks; - // RD mult. parameters for segment 1. - int rdmult; - // Cyclic refresh map. - int8_t *map; - // Map of the last q a block was coded at. - uint8_t *last_coded_q_map; - // Thresholds applied to the projected rate/distortion of the coding block, - // when deciding whether block should be refreshed. - int64_t thresh_rate_sb; - int64_t thresh_dist_sb; - // Threshold applied to the motion vector (in units of 1/8 pel) of the - // coding block, when deciding whether block should be refreshed. - int16_t motion_thresh; - // Rate target ratio to set q delta. - double rate_ratio_qdelta; - // Boost factor for rate target ratio, for segment CR_SEGMENT_ID_BOOST2. - int rate_boost_fac; - double low_content_avg; - int qindex_delta[3]; - double weight_segment; - int apply_cyclic_refresh; -}; -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/aq_cyclicrefresh.c
12
13
14
15
16
17
18
19
20
21
#include <limits.h> #include <math.h> #include "av1/common/seg_common.h" #include "av1/encoder/aq_cyclicrefresh.h" #include "av1/encoder/ratectrl.h" #include "av1/encoder/segmentation.h" #include "aom_dsp/aom_dsp_common.h" #include "aom_ports/system_state.h"
+ show +
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
struct CYCLIC_REFRESH { // Percentage of blocks per frame that are targeted as candidates // for cyclic refresh. int percent_refresh; // Maximum q-delta as percentage of base q. int max_qdelta_perc; // Superblock starting index for cycling through the frame. int sb_index; // Controls how long block will need to wait to be refreshed again, in // excess of the cycle time, i.e., in the case of all zero motion, block // will be refreshed every (100/percent_refresh + time_for_refresh) frames. int time_for_refresh; // Target number of (4x4) blocks that are set for delta-q. int target_num_seg_blocks; // Actual number of (4x4) blocks that were applied delta-q. int actual_num_seg1_blocks; int actual_num_seg2_blocks; // RD mult. parameters for segment 1. int rdmult; // Cyclic refresh map. int8_t *map; // Map of the last q a block was coded at. uint8_t *last_coded_q_map; // Thresholds applied to the projected rate/distortion of the coding block, // when deciding whether block should be refreshed. int64_t thresh_rate_sb; int64_t thresh_dist_sb; // Threshold applied to the motion vector (in units of 1/8 pel) of the // coding block, when deciding whether block should be refreshed. int16_t motion_thresh; // Rate target ratio to set q delta. double rate_ratio_qdelta; // Boost factor for rate target ratio, for segment CR_SEGMENT_ID_BOOST2. int rate_boost_fac; double low_content_avg; int qindex_delta[3]; double weight_segment; int apply_cyclic_refresh; };
+ show +
61
62
63
64
65
66
67
68
69
70
CYCLIC_REFRESH *av1_cyclic_refresh_alloc(int mi_rows, int mi_cols) { size_t last_coded_q_map_size; CYCLIC_REFRESH *const cr = aom_calloc(1, sizeof(*cr)); if (cr == NULL) return NULL; cr->map = aom_calloc(mi_rows * mi_cols, sizeof(*cr->map)); if (cr->map == NULL) { av1_cyclic_refresh_free(cr); return NULL;

[CVE-2020-0478_1.diff] partition_strategy.c #4
- const int new_mv_row = x->best_mv.as_mv.row / 8; - const int new_mv_col = x->best_mv.as_mv.col / 8; - if (save_mv_code == 4) { - pc_tree->mv_ref_fulls[ref].row = new_mv_row; - pc_tree->mv_ref_fulls[ref].col = new_mv_col; - } else if (save_mv_code >= 0 && save_mv_code < 4) { - // Propagate the new motion vectors to a lower level - pc_tree->split[save_mv_code]->mv_ref_fulls[ref].row = new_mv_row; - pc_tree->split[save_mv_code]->mv_ref_fulls[ref].col = new_mv_col; - } else { - assert(save_mv_code == -1 && - "Unknown code in simple_motion_search_get_best_ref."); + if (save_mv) { + pc_tree->start_mvs[ref].row = best_mv.as_mv.row / 8; + pc_tree->start_mvs[ref].col = best_mv.as_mv.col / 8; + + if (bsize >= BLOCK_8X8) { + for (int r_idx = 0; r_idx < 4; r_idx++) { + // Propagate the new motion vectors to a lower level + PC_TREE *sub_tree = pc_tree->split[r_idx]; + sub_tree->start_mvs[ref] = pc_tree->start_mvs[ref]; + } + }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/partition_strategy.c
175
176
177
178
179
180
181
182
183
184
mv_ref_fulls[ref], num_planes, use_subpixel); curr_var = cpi->fn_ptr[bsize].vf( x->plane[0].src.buf, x->plane[0].src.stride, xd->plane[0].dst.buf, xd->plane[0].dst.stride, &curr_sse); if (curr_sse < *best_sse) { *best_sse = curr_sse; *best_var = curr_var; best_ref = ref; }
+ show +
185
186
187
188
189
190
191
192
193
194
195
196
const int new_mv_row = x->best_mv.as_mv.row / 8; const int new_mv_col = x->best_mv.as_mv.col / 8; if (save_mv_code == 4) { pc_tree->mv_ref_fulls[ref].row = new_mv_row; pc_tree->mv_ref_fulls[ref].col = new_mv_col; } else if (save_mv_code >= 0 && save_mv_code < 4) { // Propagate the new motion vectors to a lower level pc_tree->split[save_mv_code]->mv_ref_fulls[ref].row = new_mv_row; pc_tree->split[save_mv_code]->mv_ref_fulls[ref].col = new_mv_col; } else { assert(save_mv_code == -1 && "Unknown code in simple_motion_search_get_best_ref.");
+ show +
197
198
199
200
201
202
203
204
205
206
} } } return best_ref; } // Performs fullpixel simple_motion_search with LAST_FRAME and ALTREF_FRAME on // each subblock and extract the variance and sse of residues. Then store the // var and sse from each partition subblock to features. The DC qindex is also

[CVE-2020-0478_1.diff] partition_strategy.c #8
-void av1_simple_motion_search_early_term_none( - AV1_COMP *const cpi, MACROBLOCK *x, PC_TREE *pc_tree, int mi_row, - int mi_col, BLOCK_SIZE bsize, const RD_STATS *none_rdc, - int *early_terminate, float *simple_motion_features, - int *simple_motion_features_are_valid) { +void av1_simple_motion_search_early_term_none(AV1_COMP *const cpi, + MACROBLOCK *x, PC_TREE *pc_tree, + int mi_row, int mi_col, + BLOCK_SIZE bsize, + const RD_STATS *none_rdc, + int *early_terminate) { - int f_idx = 0; - if (!*simple_motion_features_are_valid) { - simple_motion_search_prune_part_features(cpi, x, pc_tree, mi_row, mi_col, - bsize, simple_motion_features); - *simple_motion_features_are_valid = 1; - } - f_idx = 25; + float features[FEATURE_SIZE_SMS_TERM_NONE] = { 0.0f }; + simple_motion_search_prune_part_features(cpi, x, pc_tree, mi_row, mi_col, + bsize, features, + FEATURE_SMS_PRUNE_PART_FLAG); + int f_idx = FEATURE_SIZE_SMS_PRUNE_PART; - simple_motion_features[f_idx++] = logf(1.0f + (float)none_rdc->rate); - simple_motion_features[f_idx++] = logf(1.0f + (float)none_rdc->dist); - simple_motion_features[f_idx++] = logf(1.0f + (float)none_rdc->rdcost); + features[f_idx++] = logf(1.0f + (float)none_rdc->rate); + features[f_idx++] = logf(1.0f + (float)none_rdc->dist); + features[f_idx++] = logf(1.0f + (float)none_rdc->rdcost);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/partition_strategy.c
391
392
393
394
395
396
397
398
399
400
(void)do_square_split; (void)do_rectangular_split; } // Early terminates PARTITION_NONE using simple_motion_search features and the // rate, distortion, and rdcost of PARTITION_NONE. This is only called when: // - The frame is a show frame // - The frame is not intra only // - The current bsize is > BLOCK_8X8 // - blk_row + blk_height/2 < total_rows and blk_col + blk_width/2 < total_cols
+ show +
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
void av1_simple_motion_search_early_term_none( AV1_COMP *const cpi, MACROBLOCK *x, PC_TREE *pc_tree, int mi_row, int mi_col, BLOCK_SIZE bsize, const RD_STATS *none_rdc, int *early_terminate, float *simple_motion_features, int *simple_motion_features_are_valid) { // TODO(chiyotsai@google.com): There are other features we can extract from // PARTITION_NONE. Play with this later. int f_idx = 0; if (!*simple_motion_features_are_valid) { simple_motion_search_prune_part_features(cpi, x, pc_tree, mi_row, mi_col, bsize, simple_motion_features); *simple_motion_features_are_valid = 1; } f_idx = 25; simple_motion_features[f_idx++] = logf(1.0f + (float)none_rdc->rate); simple_motion_features[f_idx++] = logf(1.0f + (float)none_rdc->dist); simple_motion_features[f_idx++] = logf(1.0f + (float)none_rdc->rdcost);
+ show +
419
420
421
422
423
424
425
426
427
428
assert(f_idx == FEATURE_SIZE_SMS_TERM_NONE); const float *ml_mean = NULL; const float *ml_std = NULL; const float *ml_model = NULL; if (bsize == BLOCK_128X128) { ml_mean = av1_simple_motion_search_term_none_mean_128; ml_std = av1_simple_motion_search_term_none_std_128;

[CVE-2020-0478_1.diff] partition_strategy.c #10
-static void firstpass_simple_motion_search_features( - AV1_COMP *const cpi, MACROBLOCK *x, PC_TREE *pc_tree, int mi_row, - int mi_col, BLOCK_SIZE bsize, float *features) { - assert(mi_size_wide[bsize] == mi_size_high[bsize]); - assert(cpi->ref_frame_flags & av1_ref_frame_flag_list[LAST_FRAME] || - cpi->ref_frame_flags & av1_ref_frame_flag_list[ALTREF_FRAME]); - - // Setting up motion search - const int ref_list[] = { LAST_FRAME, ALTREF_FRAME }; - const int num_refs = 2; - const int use_subpixel = 0; - - unsigned int int_features[10] = { 0 }; - - int f_idx = 0; - // Doing whole block first to update the mv - simple_motion_search_get_best_ref( - cpi, x, pc_tree, mi_row, mi_col, bsize, ref_list, num_refs, use_subpixel, - 4, &int_features[f_idx], &int_features[f_idx + 1]); - f_idx += 2; - - // Split subblocks - const BLOCK_SIZE subsize = get_partition_subsize(bsize, PARTITION_SPLIT); - const int w_mi = mi_size_wide[bsize]; - const int h_mi = mi_size_high[bsize]; - for (int r_idx = 0; r_idx < 4; r_idx++) { - const int sub_mi_col = mi_col + (r_idx & 1) * w_mi / 2; - const int sub_mi_row = mi_row + (r_idx >> 1) * h_mi / 2; - - simple_motion_search_get_best_ref( - cpi, x, pc_tree, sub_mi_row, sub_mi_col, subsize, ref_list, num_refs, - use_subpixel, r_idx, &int_features[f_idx], &int_features[f_idx + 1]); - f_idx += 2; - } - - aom_clear_system_state(); - for (int idx = 0; idx < f_idx; idx++) { - features[idx] = logf(1.0f + (float)int_features[idx]); - } - - const MACROBLOCKD *xd = &x->e_mbd; - set_offsets_for_motion_search(cpi, x, mi_row, mi_col, bsize); - - // Q_INDEX - const int dc_q = av1_dc_quant_QTX(x->qindex, 0, xd->bd) >> (xd->bd - 8); - features[f_idx++] = logf(1.0f + (float)(dc_q * dc_q) / 256.0f); - - // Neighbor stuff - const int has_above = !!xd->above_mbmi; - const int has_left = !!xd->left_mbmi; - const BLOCK_SIZE above_bsize = has_above ? xd->above_mbmi->sb_type : bsize; - const BLOCK_SIZE left_bsize = has_left ? xd->left_mbmi->sb_type : bsize; - features[f_idx++] = (float)has_above; - features[f_idx++] = (float)mi_size_wide_log2[above_bsize]; - features[f_idx++] = (float)mi_size_high_log2[above_bsize]; - features[f_idx++] = (float)has_left; - features[f_idx++] = (float)mi_size_wide_log2[left_bsize]; - features[f_idx++] = (float)mi_size_high_log2[left_bsize]; -} - -void av1_firstpass_simple_motion_search_early_term(AV1_COMP *const cpi, - MACROBLOCK *x, - PC_TREE *pc_tree, int mi_row, - int mi_col, BLOCK_SIZE bsize, - const RD_STATS *none_rdc, - int *do_square_split) { - const NN_CONFIG *nn_config = NULL; - float thresh = 0.0f; - const float *ml_mean = NULL, *ml_std = NULL; - if (bsize == BLOCK_32X32) { - nn_config = &av1_fp_simple_motion_search_term_none_nn_config_32; - ml_mean = av1_fp_simple_motion_search_term_none_mean_32; - ml_std = av1_fp_simple_motion_search_term_none_std_32; - thresh = av1_fp_simple_motion_search_term_none_thresh_32; - } else if (bsize == BLOCK_16X16) { - nn_config = &av1_fp_simple_motion_search_term_none_nn_config_16; - ml_mean = av1_fp_simple_motion_search_term_none_mean_16; - ml_std = av1_fp_simple_motion_search_term_none_std_16; - thresh = av1_fp_simple_motion_search_term_none_thresh_16; - } else if (bsize == BLOCK_8X8) { - nn_config = &av1_fp_simple_motion_search_term_none_nn_config_8; - ml_mean = av1_fp_simple_motion_search_term_none_mean_8; - ml_std = av1_fp_simple_motion_search_term_none_std_8; - thresh = av1_fp_simple_motion_search_term_none_thresh_8; - } else { - assert(0 && - "Unexpected bsize in firstpass_simple_motion_search_early_term"); - return; - } - - float ml_features[FEATURE_SIZE_FP_SMS_TERM_NONE] = { 0.0f }; - - firstpass_simple_motion_search_features(cpi, x, pc_tree, mi_row, mi_col, - bsize, ml_features); - int f_idx = 17; - - ml_features[f_idx++] = logf(1.0f + (float)none_rdc->rate); - ml_features[f_idx++] = logf(1.0f + (float)none_rdc->dist); - ml_features[f_idx++] = logf(1.0f + (float)none_rdc->rdcost); - - for (f_idx = 0; f_idx < 20; f_idx++) { - ml_features[f_idx] = (ml_features[f_idx] - ml_mean[f_idx]) / ml_std[f_idx]; - } - - // Get probabilities - float score = 0.0f; - - av1_nn_predict(ml_features, nn_config, &score); - aom_clear_system_state(); - - // Determine if we should prune square partitions. - if (score < thresh) { - *do_square_split = 0; - } -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/partition_strategy.c
450
451
452
453
454
455
456
457
458
459
(simple_motion_features[f_idx] - ml_mean[f_idx]) / ml_std[f_idx]; } score += ml_model[FEATURE_SIZE_SMS_TERM_NONE]; if (score >= 0.0f) { *early_terminate = 1; } } }
+ show +
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
static void firstpass_simple_motion_search_features( AV1_COMP *const cpi, MACROBLOCK *x, PC_TREE *pc_tree, int mi_row, int mi_col, BLOCK_SIZE bsize, float *features) { assert(mi_size_wide[bsize] == mi_size_high[bsize]); assert(cpi->ref_frame_flags & av1_ref_frame_flag_list[LAST_FRAME] || cpi->ref_frame_flags & av1_ref_frame_flag_list[ALTREF_FRAME]); // Setting up motion search const int ref_list[] = { LAST_FRAME, ALTREF_FRAME }; const int num_refs = 2; const int use_subpixel = 0; unsigned int int_features[10] = { 0 }; int f_idx = 0; // Doing whole block first to update the mv simple_motion_search_get_best_ref( cpi, x, pc_tree, mi_row, mi_col, bsize, ref_list, num_refs, use_subpixel, 4, &int_features[f_idx], &int_features[f_idx + 1]); f_idx += 2; // Split subblocks const BLOCK_SIZE subsize = get_partition_subsize(bsize, PARTITION_SPLIT); const int w_mi = mi_size_wide[bsize]; const int h_mi = mi_size_high[bsize]; for (int r_idx = 0; r_idx < 4; r_idx++) { const int sub_mi_col = mi_col + (r_idx & 1) * w_mi / 2; const int sub_mi_row = mi_row + (r_idx >> 1) * h_mi / 2; simple_motion_search_get_best_ref( cpi, x, pc_tree, sub_mi_row, sub_mi_col, subsize, ref_list, num_refs, use_subpixel, r_idx, &int_features[f_idx], &int_features[f_idx + 1]); f_idx += 2; } aom_clear_system_state(); for (int idx = 0; idx < f_idx; idx++) { features[idx] = logf(1.0f + (float)int_features[idx]); } const MACROBLOCKD *xd = &x->e_mbd; set_offsets_for_motion_search(cpi, x, mi_row, mi_col, bsize); // Q_INDEX const int dc_q = av1_dc_quant_QTX(x->qindex, 0, xd->bd) >> (xd->bd - 8); features[f_idx++] = logf(1.0f + (float)(dc_q * dc_q) / 256.0f); // Neighbor stuff const int has_above = !!xd->above_mbmi; const int has_left = !!xd->left_mbmi; const BLOCK_SIZE above_bsize = has_above ? xd->above_mbmi->sb_type : bsize; const BLOCK_SIZE left_bsize = has_left ? xd->left_mbmi->sb_type : bsize; features[f_idx++] = (float)has_above; features[f_idx++] = (float)mi_size_wide_log2[above_bsize]; features[f_idx++] = (float)mi_size_high_log2[above_bsize]; features[f_idx++] = (float)has_left; features[f_idx++] = (float)mi_size_wide_log2[left_bsize]; features[f_idx++] = (float)mi_size_high_log2[left_bsize]; } void av1_firstpass_simple_motion_search_early_term(AV1_COMP *const cpi, MACROBLOCK *x, PC_TREE *pc_tree, int mi_row, int mi_col, BLOCK_SIZE bsize, const RD_STATS *none_rdc, int *do_square_split) { const NN_CONFIG *nn_config = NULL; float thresh = 0.0f; const float *ml_mean = NULL, *ml_std = NULL; if (bsize == BLOCK_32X32) { nn_config = &av1_fp_simple_motion_search_term_none_nn_config_32; ml_mean = av1_fp_simple_motion_search_term_none_mean_32; ml_std = av1_fp_simple_motion_search_term_none_std_32; thresh = av1_fp_simple_motion_search_term_none_thresh_32; } else if (bsize == BLOCK_16X16) { nn_config = &av1_fp_simple_motion_search_term_none_nn_config_16; ml_mean = av1_fp_simple_motion_search_term_none_mean_16; ml_std = av1_fp_simple_motion_search_term_none_std_16; thresh = av1_fp_simple_motion_search_term_none_thresh_16; } else if (bsize == BLOCK_8X8) { nn_config = &av1_fp_simple_motion_search_term_none_nn_config_8; ml_mean = av1_fp_simple_motion_search_term_none_mean_8; ml_std = av1_fp_simple_motion_search_term_none_std_8; thresh = av1_fp_simple_motion_search_term_none_thresh_8; } else { assert(0 && "Unexpected bsize in firstpass_simple_motion_search_early_term"); return; } float ml_features[FEATURE_SIZE_FP_SMS_TERM_NONE] = { 0.0f }; firstpass_simple_motion_search_features(cpi, x, pc_tree, mi_row, mi_col, bsize, ml_features); int f_idx = 17; ml_features[f_idx++] = logf(1.0f + (float)none_rdc->rate); ml_features[f_idx++] = logf(1.0f + (float)none_rdc->dist); ml_features[f_idx++] = logf(1.0f + (float)none_rdc->rdcost); for (f_idx = 0; f_idx < 20; f_idx++) { ml_features[f_idx] = (ml_features[f_idx] - ml_mean[f_idx]) / ml_std[f_idx]; } // Get probabilities float score = 0.0f; av1_nn_predict(ml_features, nn_config, &score); aom_clear_system_state(); // Determine if we should prune square partitions. if (score < thresh) { *do_square_split = 0;
+ show +
573
574
575
576
577
578
579
580
581
582
} } void av1_get_max_min_partition_features(AV1_COMP *const cpi, MACROBLOCK *x, int mi_row, int mi_col, float *features) { AV1_COMMON *const cm = &cpi->common; MACROBLOCKD *xd = &x->e_mbd; const BLOCK_SIZE sb_size = cm->seq_params.sb_size;

[CVE-2020-0470_1.diff] partition_strategy.c #4
- const int new_mv_row = x->best_mv.as_mv.row / 8; - const int new_mv_col = x->best_mv.as_mv.col / 8; - if (save_mv_code == 4) { - pc_tree->mv_ref_fulls[ref].row = new_mv_row; - pc_tree->mv_ref_fulls[ref].col = new_mv_col; - } else if (save_mv_code >= 0 && save_mv_code < 4) { - // Propagate the new motion vectors to a lower level - pc_tree->split[save_mv_code]->mv_ref_fulls[ref].row = new_mv_row; - pc_tree->split[save_mv_code]->mv_ref_fulls[ref].col = new_mv_col; - } else { - assert(save_mv_code == -1 && - "Unknown code in simple_motion_search_get_best_ref."); + if (save_mv) { + pc_tree->start_mvs[ref].row = best_mv.as_mv.row / 8; + pc_tree->start_mvs[ref].col = best_mv.as_mv.col / 8; + + if (bsize >= BLOCK_8X8) { + for (int r_idx = 0; r_idx < 4; r_idx++) { + // Propagate the new motion vectors to a lower level + PC_TREE *sub_tree = pc_tree->split[r_idx]; + sub_tree->start_mvs[ref] = pc_tree->start_mvs[ref]; + } + }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/partition_strategy.c
175
176
177
178
179
180
181
182
183
184
mv_ref_fulls[ref], num_planes, use_subpixel); curr_var = cpi->fn_ptr[bsize].vf( x->plane[0].src.buf, x->plane[0].src.stride, xd->plane[0].dst.buf, xd->plane[0].dst.stride, &curr_sse); if (curr_sse < *best_sse) { *best_sse = curr_sse; *best_var = curr_var; best_ref = ref; }
+ show +
185
186
187
188
189
190
191
192
193
194
195
196
const int new_mv_row = x->best_mv.as_mv.row / 8; const int new_mv_col = x->best_mv.as_mv.col / 8; if (save_mv_code == 4) { pc_tree->mv_ref_fulls[ref].row = new_mv_row; pc_tree->mv_ref_fulls[ref].col = new_mv_col; } else if (save_mv_code >= 0 && save_mv_code < 4) { // Propagate the new motion vectors to a lower level pc_tree->split[save_mv_code]->mv_ref_fulls[ref].row = new_mv_row; pc_tree->split[save_mv_code]->mv_ref_fulls[ref].col = new_mv_col; } else { assert(save_mv_code == -1 && "Unknown code in simple_motion_search_get_best_ref.");
+ show +
197
198
199
200
201
202
203
204
205
206
} } } return best_ref; } // Performs fullpixel simple_motion_search with LAST_FRAME and ALTREF_FRAME on // each subblock and extract the variance and sse of residues. Then store the // var and sse from each partition subblock to features. The DC qindex is also

[CVE-2020-0470_1.diff] partition_strategy.c #8
-void av1_simple_motion_search_early_term_none( - AV1_COMP *const cpi, MACROBLOCK *x, PC_TREE *pc_tree, int mi_row, - int mi_col, BLOCK_SIZE bsize, const RD_STATS *none_rdc, - int *early_terminate, float *simple_motion_features, - int *simple_motion_features_are_valid) { +void av1_simple_motion_search_early_term_none(AV1_COMP *const cpi, + MACROBLOCK *x, PC_TREE *pc_tree, + int mi_row, int mi_col, + BLOCK_SIZE bsize, + const RD_STATS *none_rdc, + int *early_terminate) { - int f_idx = 0; - if (!*simple_motion_features_are_valid) { - simple_motion_search_prune_part_features(cpi, x, pc_tree, mi_row, mi_col, - bsize, simple_motion_features); - *simple_motion_features_are_valid = 1; - } - f_idx = 25; + float features[FEATURE_SIZE_SMS_TERM_NONE] = { 0.0f }; + simple_motion_search_prune_part_features(cpi, x, pc_tree, mi_row, mi_col, + bsize, features, + FEATURE_SMS_PRUNE_PART_FLAG); + int f_idx = FEATURE_SIZE_SMS_PRUNE_PART; - simple_motion_features[f_idx++] = logf(1.0f + (float)none_rdc->rate); - simple_motion_features[f_idx++] = logf(1.0f + (float)none_rdc->dist); - simple_motion_features[f_idx++] = logf(1.0f + (float)none_rdc->rdcost); + features[f_idx++] = logf(1.0f + (float)none_rdc->rate); + features[f_idx++] = logf(1.0f + (float)none_rdc->dist); + features[f_idx++] = logf(1.0f + (float)none_rdc->rdcost);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/partition_strategy.c
391
392
393
394
395
396
397
398
399
400
(void)do_square_split; (void)do_rectangular_split; } // Early terminates PARTITION_NONE using simple_motion_search features and the // rate, distortion, and rdcost of PARTITION_NONE. This is only called when: // - The frame is a show frame // - The frame is not intra only // - The current bsize is > BLOCK_8X8 // - blk_row + blk_height/2 < total_rows and blk_col + blk_width/2 < total_cols
+ show +
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
void av1_simple_motion_search_early_term_none( AV1_COMP *const cpi, MACROBLOCK *x, PC_TREE *pc_tree, int mi_row, int mi_col, BLOCK_SIZE bsize, const RD_STATS *none_rdc, int *early_terminate, float *simple_motion_features, int *simple_motion_features_are_valid) { // TODO(chiyotsai@google.com): There are other features we can extract from // PARTITION_NONE. Play with this later. int f_idx = 0; if (!*simple_motion_features_are_valid) { simple_motion_search_prune_part_features(cpi, x, pc_tree, mi_row, mi_col, bsize, simple_motion_features); *simple_motion_features_are_valid = 1; } f_idx = 25; simple_motion_features[f_idx++] = logf(1.0f + (float)none_rdc->rate); simple_motion_features[f_idx++] = logf(1.0f + (float)none_rdc->dist); simple_motion_features[f_idx++] = logf(1.0f + (float)none_rdc->rdcost);
+ show +
419
420
421
422
423
424
425
426
427
428
assert(f_idx == FEATURE_SIZE_SMS_TERM_NONE); const float *ml_mean = NULL; const float *ml_std = NULL; const float *ml_model = NULL; if (bsize == BLOCK_128X128) { ml_mean = av1_simple_motion_search_term_none_mean_128; ml_std = av1_simple_motion_search_term_none_std_128;

[CVE-2020-0470_1.diff] partition_strategy.c #10
-static void firstpass_simple_motion_search_features( - AV1_COMP *const cpi, MACROBLOCK *x, PC_TREE *pc_tree, int mi_row, - int mi_col, BLOCK_SIZE bsize, float *features) { - assert(mi_size_wide[bsize] == mi_size_high[bsize]); - assert(cpi->ref_frame_flags & av1_ref_frame_flag_list[LAST_FRAME] || - cpi->ref_frame_flags & av1_ref_frame_flag_list[ALTREF_FRAME]); - - // Setting up motion search - const int ref_list[] = { LAST_FRAME, ALTREF_FRAME }; - const int num_refs = 2; - const int use_subpixel = 0; - - unsigned int int_features[10] = { 0 }; - - int f_idx = 0; - // Doing whole block first to update the mv - simple_motion_search_get_best_ref( - cpi, x, pc_tree, mi_row, mi_col, bsize, ref_list, num_refs, use_subpixel, - 4, &int_features[f_idx], &int_features[f_idx + 1]); - f_idx += 2; - - // Split subblocks - const BLOCK_SIZE subsize = get_partition_subsize(bsize, PARTITION_SPLIT); - const int w_mi = mi_size_wide[bsize]; - const int h_mi = mi_size_high[bsize]; - for (int r_idx = 0; r_idx < 4; r_idx++) { - const int sub_mi_col = mi_col + (r_idx & 1) * w_mi / 2; - const int sub_mi_row = mi_row + (r_idx >> 1) * h_mi / 2; - - simple_motion_search_get_best_ref( - cpi, x, pc_tree, sub_mi_row, sub_mi_col, subsize, ref_list, num_refs, - use_subpixel, r_idx, &int_features[f_idx], &int_features[f_idx + 1]); - f_idx += 2; - } - - aom_clear_system_state(); - for (int idx = 0; idx < f_idx; idx++) { - features[idx] = logf(1.0f + (float)int_features[idx]); - } - - const MACROBLOCKD *xd = &x->e_mbd; - set_offsets_for_motion_search(cpi, x, mi_row, mi_col, bsize); - - // Q_INDEX - const int dc_q = av1_dc_quant_QTX(x->qindex, 0, xd->bd) >> (xd->bd - 8); - features[f_idx++] = logf(1.0f + (float)(dc_q * dc_q) / 256.0f); - - // Neighbor stuff - const int has_above = !!xd->above_mbmi; - const int has_left = !!xd->left_mbmi; - const BLOCK_SIZE above_bsize = has_above ? xd->above_mbmi->sb_type : bsize; - const BLOCK_SIZE left_bsize = has_left ? xd->left_mbmi->sb_type : bsize; - features[f_idx++] = (float)has_above; - features[f_idx++] = (float)mi_size_wide_log2[above_bsize]; - features[f_idx++] = (float)mi_size_high_log2[above_bsize]; - features[f_idx++] = (float)has_left; - features[f_idx++] = (float)mi_size_wide_log2[left_bsize]; - features[f_idx++] = (float)mi_size_high_log2[left_bsize]; -} - -void av1_firstpass_simple_motion_search_early_term(AV1_COMP *const cpi, - MACROBLOCK *x, - PC_TREE *pc_tree, int mi_row, - int mi_col, BLOCK_SIZE bsize, - const RD_STATS *none_rdc, - int *do_square_split) { - const NN_CONFIG *nn_config = NULL; - float thresh = 0.0f; - const float *ml_mean = NULL, *ml_std = NULL; - if (bsize == BLOCK_32X32) { - nn_config = &av1_fp_simple_motion_search_term_none_nn_config_32; - ml_mean = av1_fp_simple_motion_search_term_none_mean_32; - ml_std = av1_fp_simple_motion_search_term_none_std_32; - thresh = av1_fp_simple_motion_search_term_none_thresh_32; - } else if (bsize == BLOCK_16X16) { - nn_config = &av1_fp_simple_motion_search_term_none_nn_config_16; - ml_mean = av1_fp_simple_motion_search_term_none_mean_16; - ml_std = av1_fp_simple_motion_search_term_none_std_16; - thresh = av1_fp_simple_motion_search_term_none_thresh_16; - } else if (bsize == BLOCK_8X8) { - nn_config = &av1_fp_simple_motion_search_term_none_nn_config_8; - ml_mean = av1_fp_simple_motion_search_term_none_mean_8; - ml_std = av1_fp_simple_motion_search_term_none_std_8; - thresh = av1_fp_simple_motion_search_term_none_thresh_8; - } else { - assert(0 && - "Unexpected bsize in firstpass_simple_motion_search_early_term"); - return; - } - - float ml_features[FEATURE_SIZE_FP_SMS_TERM_NONE] = { 0.0f }; - - firstpass_simple_motion_search_features(cpi, x, pc_tree, mi_row, mi_col, - bsize, ml_features); - int f_idx = 17; - - ml_features[f_idx++] = logf(1.0f + (float)none_rdc->rate); - ml_features[f_idx++] = logf(1.0f + (float)none_rdc->dist); - ml_features[f_idx++] = logf(1.0f + (float)none_rdc->rdcost); - - for (f_idx = 0; f_idx < 20; f_idx++) { - ml_features[f_idx] = (ml_features[f_idx] - ml_mean[f_idx]) / ml_std[f_idx]; - } - - // Get probabilities - float score = 0.0f; - - av1_nn_predict(ml_features, nn_config, &score); - aom_clear_system_state(); - - // Determine if we should prune square partitions. - if (score < thresh) { - *do_square_split = 0; - } -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/partition_strategy.c
450
451
452
453
454
455
456
457
458
459
(simple_motion_features[f_idx] - ml_mean[f_idx]) / ml_std[f_idx]; } score += ml_model[FEATURE_SIZE_SMS_TERM_NONE]; if (score >= 0.0f) { *early_terminate = 1; } } }
+ show +
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
static void firstpass_simple_motion_search_features( AV1_COMP *const cpi, MACROBLOCK *x, PC_TREE *pc_tree, int mi_row, int mi_col, BLOCK_SIZE bsize, float *features) { assert(mi_size_wide[bsize] == mi_size_high[bsize]); assert(cpi->ref_frame_flags & av1_ref_frame_flag_list[LAST_FRAME] || cpi->ref_frame_flags & av1_ref_frame_flag_list[ALTREF_FRAME]); // Setting up motion search const int ref_list[] = { LAST_FRAME, ALTREF_FRAME }; const int num_refs = 2; const int use_subpixel = 0; unsigned int int_features[10] = { 0 }; int f_idx = 0; // Doing whole block first to update the mv simple_motion_search_get_best_ref( cpi, x, pc_tree, mi_row, mi_col, bsize, ref_list, num_refs, use_subpixel, 4, &int_features[f_idx], &int_features[f_idx + 1]); f_idx += 2; // Split subblocks const BLOCK_SIZE subsize = get_partition_subsize(bsize, PARTITION_SPLIT); const int w_mi = mi_size_wide[bsize]; const int h_mi = mi_size_high[bsize]; for (int r_idx = 0; r_idx < 4; r_idx++) { const int sub_mi_col = mi_col + (r_idx & 1) * w_mi / 2; const int sub_mi_row = mi_row + (r_idx >> 1) * h_mi / 2; simple_motion_search_get_best_ref( cpi, x, pc_tree, sub_mi_row, sub_mi_col, subsize, ref_list, num_refs, use_subpixel, r_idx, &int_features[f_idx], &int_features[f_idx + 1]); f_idx += 2; } aom_clear_system_state(); for (int idx = 0; idx < f_idx; idx++) { features[idx] = logf(1.0f + (float)int_features[idx]); } const MACROBLOCKD *xd = &x->e_mbd; set_offsets_for_motion_search(cpi, x, mi_row, mi_col, bsize); // Q_INDEX const int dc_q = av1_dc_quant_QTX(x->qindex, 0, xd->bd) >> (xd->bd - 8); features[f_idx++] = logf(1.0f + (float)(dc_q * dc_q) / 256.0f); // Neighbor stuff const int has_above = !!xd->above_mbmi; const int has_left = !!xd->left_mbmi; const BLOCK_SIZE above_bsize = has_above ? xd->above_mbmi->sb_type : bsize; const BLOCK_SIZE left_bsize = has_left ? xd->left_mbmi->sb_type : bsize; features[f_idx++] = (float)has_above; features[f_idx++] = (float)mi_size_wide_log2[above_bsize]; features[f_idx++] = (float)mi_size_high_log2[above_bsize]; features[f_idx++] = (float)has_left; features[f_idx++] = (float)mi_size_wide_log2[left_bsize]; features[f_idx++] = (float)mi_size_high_log2[left_bsize]; } void av1_firstpass_simple_motion_search_early_term(AV1_COMP *const cpi, MACROBLOCK *x, PC_TREE *pc_tree, int mi_row, int mi_col, BLOCK_SIZE bsize, const RD_STATS *none_rdc, int *do_square_split) { const NN_CONFIG *nn_config = NULL; float thresh = 0.0f; const float *ml_mean = NULL, *ml_std = NULL; if (bsize == BLOCK_32X32) { nn_config = &av1_fp_simple_motion_search_term_none_nn_config_32; ml_mean = av1_fp_simple_motion_search_term_none_mean_32; ml_std = av1_fp_simple_motion_search_term_none_std_32; thresh = av1_fp_simple_motion_search_term_none_thresh_32; } else if (bsize == BLOCK_16X16) { nn_config = &av1_fp_simple_motion_search_term_none_nn_config_16; ml_mean = av1_fp_simple_motion_search_term_none_mean_16; ml_std = av1_fp_simple_motion_search_term_none_std_16; thresh = av1_fp_simple_motion_search_term_none_thresh_16; } else if (bsize == BLOCK_8X8) { nn_config = &av1_fp_simple_motion_search_term_none_nn_config_8; ml_mean = av1_fp_simple_motion_search_term_none_mean_8; ml_std = av1_fp_simple_motion_search_term_none_std_8; thresh = av1_fp_simple_motion_search_term_none_thresh_8; } else { assert(0 && "Unexpected bsize in firstpass_simple_motion_search_early_term"); return; } float ml_features[FEATURE_SIZE_FP_SMS_TERM_NONE] = { 0.0f }; firstpass_simple_motion_search_features(cpi, x, pc_tree, mi_row, mi_col, bsize, ml_features); int f_idx = 17; ml_features[f_idx++] = logf(1.0f + (float)none_rdc->rate); ml_features[f_idx++] = logf(1.0f + (float)none_rdc->dist); ml_features[f_idx++] = logf(1.0f + (float)none_rdc->rdcost); for (f_idx = 0; f_idx < 20; f_idx++) { ml_features[f_idx] = (ml_features[f_idx] - ml_mean[f_idx]) / ml_std[f_idx]; } // Get probabilities float score = 0.0f; av1_nn_predict(ml_features, nn_config, &score); aom_clear_system_state(); // Determine if we should prune square partitions. if (score < thresh) { *do_square_split = 0;
+ show +
573
574
575
576
577
578
579
580
581
582
} } void av1_get_max_min_partition_features(AV1_COMP *const cpi, MACROBLOCK *x, int mi_row, int mi_col, float *features) { AV1_COMMON *const cm = &cpi->common; MACROBLOCKD *xd = &x->e_mbd; const BLOCK_SIZE sb_size = cm->seq_params.sb_size;

[CVE-2020-0478_1.diff] encodetxb.c #4
-void av1_set_coeff_buffer(const AV1_COMP *const cpi, MACROBLOCK *const x, - int mi_row, int mi_col) { - const AV1_COMMON *const cm = &cpi->common; - int mib_size_log2 = cm->seq_params.mib_size_log2; - int stride = (cm->mi_cols >> mib_size_log2) + 1; - int offset = (mi_row >> mib_size_log2) * stride + (mi_col >> mib_size_log2); - x->mbmi_ext->cb_coef_buff = &cpi->coeff_buffer_base[offset]; - x->mbmi_ext->cb_offset = x->cb_offset; - assert(x->cb_offset < (1 << num_pels_log2_lookup[cm->seq_params.sb_size])); -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodetxb.c
66
67
68
69
70
71
72
73
74
75
((cm->mi_cols >> cm->seq_params.mib_size_log2) + 1); av1_free_txb_buf(cpi); // TODO(jingning): This should be further reduced. CHECK_MEM_ERROR(cm, cpi->coeff_buffer_base, aom_memalign(32, sizeof(*cpi->coeff_buffer_base) * size)); } void av1_free_txb_buf(AV1_COMP *cpi) { aom_free(cpi->coeff_buffer_base); }
+ show +
76
77
78
79
80
81
82
83
84
void av1_set_coeff_buffer(const AV1_COMP *const cpi, MACROBLOCK *const x, int mi_row, int mi_col) { const AV1_COMMON *const cm = &cpi->common; int mib_size_log2 = cm->seq_params.mib_size_log2; int stride = (cm->mi_cols >> mib_size_log2) + 1; int offset = (mi_row >> mib_size_log2) * stride + (mi_col >> mib_size_log2); x->mbmi_ext->cb_coef_buff = &cpi->coeff_buffer_base[offset]; x->mbmi_ext->cb_offset = x->cb_offset; assert(x->cb_offset < (1 << num_pels_log2_lookup[cm->seq_params.sb_size]));
+ show +
85
86
87
88
89
90
91
92
93
94
} static void write_golomb(aom_writer *w, int level) { int x = level + 1; int i = x; int length = 0; while (i) { i >>= 1; ++length;

[CVE-2020-0478_1.diff] encodetxb.c #12
-static void write_coeffs_txb_wrap(const AV1_COMMON *cm, MACROBLOCK *x, - aom_writer *w, int plane, int block, - int blk_row, int blk_col, TX_SIZE tx_size) { - MACROBLOCKD *xd = &x->e_mbd; - const int txb_offset = - x->mbmi_ext->cb_offset / (TX_SIZE_W_MIN * TX_SIZE_H_MIN); - tran_low_t *tcoeff_txb = - x->mbmi_ext->cb_coef_buff->tcoeff[plane] + x->mbmi_ext->cb_offset; - uint16_t *eob_txb = x->mbmi_ext->cb_coef_buff->eobs[plane] + txb_offset; - uint8_t *txb_skip_ctx_txb = - x->mbmi_ext->cb_coef_buff->txb_skip_ctx[plane] + txb_offset; - int *dc_sign_ctx_txb = - x->mbmi_ext->cb_coef_buff->dc_sign_ctx[plane] + txb_offset; - tran_low_t *tcoeff = BLOCK_OFFSET(tcoeff_txb, block); - uint16_t eob = eob_txb[block]; - TXB_CTX txb_ctx = { txb_skip_ctx_txb[block], dc_sign_ctx_txb[block] }; - av1_write_coeffs_txb(cm, xd, w, blk_row, blk_col, plane, tx_size, tcoeff, eob, - &txb_ctx); -} - -void av1_write_coeffs_mb(const AV1_COMMON *const cm, MACROBLOCK *x, int mi_row, - int mi_col, aom_writer *w, BLOCK_SIZE bsize) { +void av1_write_coeffs_mb(const AV1_COMMON *const cm, MACROBLOCK *x, + aom_writer *w, BLOCK_SIZE bsize) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodetxb.c
627
628
629
630
631
632
633
634
635
636
} } } typedef struct encode_txb_args { const AV1_COMMON *cm; MACROBLOCK *x; aom_writer *w; } ENCODE_TXB_ARGS;
+ show +
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
static void write_coeffs_txb_wrap(const AV1_COMMON *cm, MACROBLOCK *x, aom_writer *w, int plane, int block, int blk_row, int blk_col, TX_SIZE tx_size) { MACROBLOCKD *xd = &x->e_mbd; const int txb_offset = x->mbmi_ext->cb_offset / (TX_SIZE_W_MIN * TX_SIZE_H_MIN); tran_low_t *tcoeff_txb = x->mbmi_ext->cb_coef_buff->tcoeff[plane] + x->mbmi_ext->cb_offset; uint16_t *eob_txb = x->mbmi_ext->cb_coef_buff->eobs[plane] + txb_offset; uint8_t *txb_skip_ctx_txb = x->mbmi_ext->cb_coef_buff->txb_skip_ctx[plane] + txb_offset; int *dc_sign_ctx_txb = x->mbmi_ext->cb_coef_buff->dc_sign_ctx[plane] + txb_offset; tran_low_t *tcoeff = BLOCK_OFFSET(tcoeff_txb, block); uint16_t eob = eob_txb[block]; TXB_CTX txb_ctx = { txb_skip_ctx_txb[block], dc_sign_ctx_txb[block] }; av1_write_coeffs_txb(cm, xd, w, blk_row, blk_col, plane, tx_size, tcoeff, eob, &txb_ctx); } void av1_write_coeffs_mb(const AV1_COMMON *const cm, MACROBLOCK *x, int mi_row, int mi_col, aom_writer *w, BLOCK_SIZE bsize) {
+ show +
659
660
661
662
663
664
665
666
667
668
MACROBLOCKD *xd = &x->e_mbd; const int num_planes = av1_num_planes(cm); int block[MAX_MB_PLANE] = { 0 }; int row, col; assert(bsize == get_plane_block_size(bsize, xd->plane[0].subsampling_x, xd->plane[0].subsampling_y)); const int max_blocks_wide = max_block_wide(xd, bsize, 0); const int max_blocks_high = max_block_high(xd, bsize, 0); const BLOCK_SIZE max_unit_bsize = BLOCK_64X64; int mu_blocks_wide = block_size_wide[max_unit_bsize] >> tx_size_wide_log2[0];

[CVE-2020-0478_1.diff] encodetxb.c #22
-#define WAREHOUSE_EFFICIENTS_TXB_CASE(tx_class_literal) \ - case tx_class_literal: \ - return warehouse_efficients_txb(cm, x, plane, block, tx_size, txb_ctx, p, \ - eob, plane_type, coeff_costs, xd, tx_type, \ - tx_class_literal); - switch (tx_class) { - WAREHOUSE_EFFICIENTS_TXB_CASE(TX_CLASS_2D); - WAREHOUSE_EFFICIENTS_TXB_CASE(TX_CLASS_HORIZ); - WAREHOUSE_EFFICIENTS_TXB_CASE(TX_CLASS_VERT); -#undef WAREHOUSE_EFFICIENTS_TXB_CASE - default: assert(false); return 0; + return warehouse_efficients_txb(x, plane, block, tx_size, txb_ctx, p, eob, + plane_type, coeff_costs, xd, tx_type, + tx_class, reduced_tx_set_used); +} + +int av1_cost_coeffs_txb_laplacian(const MACROBLOCK *x, const int plane, + const int block, const TX_SIZE tx_size, + const TX_TYPE tx_type, + const TXB_CTX *const txb_ctx, + const int reduced_tx_set_used, + const int adjust_eob) { + const struct macroblock_plane *p = &x->plane[plane]; + int eob = p->eobs[block]; + + if (adjust_eob) { + const SCAN_ORDER *scan_order = get_scan(tx_size, tx_type); + const int16_t *scan = scan_order->scan; + tran_low_t *tcoeff = p->coeff + BLOCK_OFFSET(block); + tran_low_t *qcoeff = p->qcoeff + BLOCK_OFFSET(block); + const MACROBLOCKD *xd = &x->e_mbd; + const struct macroblockd_plane *const pd = &xd->plane[plane]; + tran_low_t *dqcoeff = pd->dqcoeff + BLOCK_OFFSET(block); + update_coeff_eob_fast(&eob, av1_get_tx_scale(tx_size), p->dequant_QTX, scan, + tcoeff, qcoeff, dqcoeff); + p->eobs[block] = eob; + + const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size); + const PLANE_TYPE plane_type = get_plane_type(plane); + const LV_MAP_COEFF_COST *const coeff_costs = + &x->coeff_costs[txs_ctx][plane_type]; + if (eob == 0) { + return coeff_costs->txb_skip_cost[txb_ctx->txb_skip_ctx][1]; + } + + const MACROBLOCKD *const xd = &x->e_mbd; + const TX_CLASS tx_class = tx_type_to_class[tx_type]; + + return warehouse_efficients_txb_laplacian( + x, plane, block, tx_size, txb_ctx, eob, plane_type, coeff_costs, xd, + tx_type, tx_class, reduced_tx_set_used);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodetxb.c
838
839
840
841
842
843
844
845
846
847
const PLANE_TYPE plane_type = get_plane_type(plane); const LV_MAP_COEFF_COST *const coeff_costs = &x->coeff_costs[txs_ctx][plane_type]; if (eob == 0) { return coeff_costs->txb_skip_cost[txb_ctx->txb_skip_ctx][1]; } const MACROBLOCKD *const xd = &x->e_mbd; const TX_CLASS tx_class = tx_type_to_class[tx_type];
+ show +
848
849
850
851
852
853
854
855
856
857
858
#define WAREHOUSE_EFFICIENTS_TXB_CASE(tx_class_literal) \ case tx_class_literal: \ return warehouse_efficients_txb(cm, x, plane, block, tx_size, txb_ctx, p, \ eob, plane_type, coeff_costs, xd, tx_type, \ tx_class_literal); switch (tx_class) { WAREHOUSE_EFFICIENTS_TXB_CASE(TX_CLASS_2D); WAREHOUSE_EFFICIENTS_TXB_CASE(TX_CLASS_HORIZ); WAREHOUSE_EFFICIENTS_TXB_CASE(TX_CLASS_VERT); #undef WAREHOUSE_EFFICIENTS_TXB_CASE default: assert(false); return 0;
+ show +
859
860
861
862
863
864
865
866
867
868
} } static int optimize_txb(TxbInfo *txb_info, const LV_MAP_COEFF_COST *txb_costs, const LV_MAP_EOB_COST *txb_eob_costs, int *rate_cost) { int update = 0; if (txb_info->eob == 0) return update; const int16_t *const scan = txb_info->scan_order->scan; // forward optimize the nz_map` const int init_eob = txb_info->eob;

[CVE-2020-0478_1.diff] encodetxb.c #37
-void av1_update_txb_context_b(int plane, int block, int blk_row, int blk_col, - BLOCK_SIZE plane_bsize, TX_SIZE tx_size, - void *arg) { - struct tokenize_b_args *const args = arg; - const AV1_COMP *cpi = args->cpi; - const AV1_COMMON *cm = &cpi->common; - ThreadData *const td = args->td; - MACROBLOCK *const x = &td->mb; - MACROBLOCKD *const xd = &x->e_mbd; - struct macroblock_plane *p = &x->plane[plane]; - struct macroblockd_plane *pd = &xd->plane[plane]; - const uint16_t eob = p->eobs[block]; - const tran_low_t *qcoeff = BLOCK_OFFSET(p->qcoeff, block); - const PLANE_TYPE plane_type = pd->plane_type; - const TX_TYPE tx_type = av1_get_tx_type(plane_type, xd, blk_row, blk_col, - tx_size, cm->reduced_tx_set_used); - const SCAN_ORDER *const scan_order = get_scan(tx_size, tx_type); - const int cul_level = av1_get_txb_entropy_context(qcoeff, scan_order, eob); - av1_set_contexts(xd, pd, plane, plane_bsize, tx_size, cul_level, blk_col, - blk_row); -} - -static void update_tx_type_count(const AV1_COMMON *cm, MACROBLOCKD *xd, - int blk_row, int blk_col, int plane, - TX_SIZE tx_size, FRAME_COUNTS *counts, +static void update_tx_type_count(const AV1_COMP *cpi, const AV1_COMMON *cm, + MACROBLOCKD *xd, int blk_row, int blk_col, + int plane, TX_SIZE tx_size, + FRAME_COUNTS *counts, + const int reduced_tx_set_used = cm->features.reduced_tx_set_used;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodetxb.c
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
cul_level += abs(qcoeff[scan[c]]); if (cul_level > COEFF_CONTEXT_MASK) break; } cul_level = AOMMIN(COEFF_CONTEXT_MASK, cul_level); set_dc_sign(&cul_level, qcoeff[0]); return cul_level; }
+ show +
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
void av1_update_txb_context_b(int plane, int block, int blk_row, int blk_col, BLOCK_SIZE plane_bsize, TX_SIZE tx_size, void *arg) { struct tokenize_b_args *const args = arg; const AV1_COMP *cpi = args->cpi; const AV1_COMMON *cm = &cpi->common; ThreadData *const td = args->td; MACROBLOCK *const x = &td->mb; MACROBLOCKD *const xd = &x->e_mbd; struct macroblock_plane *p = &x->plane[plane]; struct macroblockd_plane *pd = &xd->plane[plane]; const uint16_t eob = p->eobs[block]; const tran_low_t *qcoeff = BLOCK_OFFSET(p->qcoeff, block); const PLANE_TYPE plane_type = pd->plane_type; const TX_TYPE tx_type = av1_get_tx_type(plane_type, xd, blk_row, blk_col, tx_size, cm->reduced_tx_set_used); const SCAN_ORDER *const scan_order = get_scan(tx_size, tx_type); const int cul_level = av1_get_txb_entropy_context(qcoeff, scan_order, eob); av1_set_contexts(xd, pd, plane, plane_bsize, tx_size, cul_level, blk_col, blk_row); } static void update_tx_type_count(const AV1_COMMON *cm, MACROBLOCKD *xd, int blk_row, int blk_col, int plane, TX_SIZE tx_size, FRAME_COUNTS *counts,
+ show +
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
uint8_t allow_update_cdf) { MB_MODE_INFO *mbmi = xd->mi[0]; int is_inter = is_inter_block(mbmi); FRAME_CONTEXT *fc = xd->tile_ctx; #if !CONFIG_ENTROPY_STATS (void)counts; #endif // !CONFIG_ENTROPY_STATS // Only y plane's tx_type is updated if (plane > 0) return;

[CVE-2020-0470_1.diff] encodetxb.c #4
-void av1_set_coeff_buffer(const AV1_COMP *const cpi, MACROBLOCK *const x, - int mi_row, int mi_col) { - const AV1_COMMON *const cm = &cpi->common; - int mib_size_log2 = cm->seq_params.mib_size_log2; - int stride = (cm->mi_cols >> mib_size_log2) + 1; - int offset = (mi_row >> mib_size_log2) * stride + (mi_col >> mib_size_log2); - x->mbmi_ext->cb_coef_buff = &cpi->coeff_buffer_base[offset]; - x->mbmi_ext->cb_offset = x->cb_offset; - assert(x->cb_offset < (1 << num_pels_log2_lookup[cm->seq_params.sb_size])); -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodetxb.c
66
67
68
69
70
71
72
73
74
75
((cm->mi_cols >> cm->seq_params.mib_size_log2) + 1); av1_free_txb_buf(cpi); // TODO(jingning): This should be further reduced. CHECK_MEM_ERROR(cm, cpi->coeff_buffer_base, aom_memalign(32, sizeof(*cpi->coeff_buffer_base) * size)); } void av1_free_txb_buf(AV1_COMP *cpi) { aom_free(cpi->coeff_buffer_base); }
+ show +
76
77
78
79
80
81
82
83
84
void av1_set_coeff_buffer(const AV1_COMP *const cpi, MACROBLOCK *const x, int mi_row, int mi_col) { const AV1_COMMON *const cm = &cpi->common; int mib_size_log2 = cm->seq_params.mib_size_log2; int stride = (cm->mi_cols >> mib_size_log2) + 1; int offset = (mi_row >> mib_size_log2) * stride + (mi_col >> mib_size_log2); x->mbmi_ext->cb_coef_buff = &cpi->coeff_buffer_base[offset]; x->mbmi_ext->cb_offset = x->cb_offset; assert(x->cb_offset < (1 << num_pels_log2_lookup[cm->seq_params.sb_size]));
+ show +
85
86
87
88
89
90
91
92
93
94
} static void write_golomb(aom_writer *w, int level) { int x = level + 1; int i = x; int length = 0; while (i) { i >>= 1; ++length;

[CVE-2020-0470_1.diff] encodetxb.c #12
-static void write_coeffs_txb_wrap(const AV1_COMMON *cm, MACROBLOCK *x, - aom_writer *w, int plane, int block, - int blk_row, int blk_col, TX_SIZE tx_size) { - MACROBLOCKD *xd = &x->e_mbd; - const int txb_offset = - x->mbmi_ext->cb_offset / (TX_SIZE_W_MIN * TX_SIZE_H_MIN); - tran_low_t *tcoeff_txb = - x->mbmi_ext->cb_coef_buff->tcoeff[plane] + x->mbmi_ext->cb_offset; - uint16_t *eob_txb = x->mbmi_ext->cb_coef_buff->eobs[plane] + txb_offset; - uint8_t *txb_skip_ctx_txb = - x->mbmi_ext->cb_coef_buff->txb_skip_ctx[plane] + txb_offset; - int *dc_sign_ctx_txb = - x->mbmi_ext->cb_coef_buff->dc_sign_ctx[plane] + txb_offset; - tran_low_t *tcoeff = BLOCK_OFFSET(tcoeff_txb, block); - uint16_t eob = eob_txb[block]; - TXB_CTX txb_ctx = { txb_skip_ctx_txb[block], dc_sign_ctx_txb[block] }; - av1_write_coeffs_txb(cm, xd, w, blk_row, blk_col, plane, tx_size, tcoeff, eob, - &txb_ctx); -} - -void av1_write_coeffs_mb(const AV1_COMMON *const cm, MACROBLOCK *x, int mi_row, - int mi_col, aom_writer *w, BLOCK_SIZE bsize) { +void av1_write_coeffs_mb(const AV1_COMMON *const cm, MACROBLOCK *x, + aom_writer *w, BLOCK_SIZE bsize) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodetxb.c
627
628
629
630
631
632
633
634
635
636
} } } typedef struct encode_txb_args { const AV1_COMMON *cm; MACROBLOCK *x; aom_writer *w; } ENCODE_TXB_ARGS;
+ show +
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
static void write_coeffs_txb_wrap(const AV1_COMMON *cm, MACROBLOCK *x, aom_writer *w, int plane, int block, int blk_row, int blk_col, TX_SIZE tx_size) { MACROBLOCKD *xd = &x->e_mbd; const int txb_offset = x->mbmi_ext->cb_offset / (TX_SIZE_W_MIN * TX_SIZE_H_MIN); tran_low_t *tcoeff_txb = x->mbmi_ext->cb_coef_buff->tcoeff[plane] + x->mbmi_ext->cb_offset; uint16_t *eob_txb = x->mbmi_ext->cb_coef_buff->eobs[plane] + txb_offset; uint8_t *txb_skip_ctx_txb = x->mbmi_ext->cb_coef_buff->txb_skip_ctx[plane] + txb_offset; int *dc_sign_ctx_txb = x->mbmi_ext->cb_coef_buff->dc_sign_ctx[plane] + txb_offset; tran_low_t *tcoeff = BLOCK_OFFSET(tcoeff_txb, block); uint16_t eob = eob_txb[block]; TXB_CTX txb_ctx = { txb_skip_ctx_txb[block], dc_sign_ctx_txb[block] }; av1_write_coeffs_txb(cm, xd, w, blk_row, blk_col, plane, tx_size, tcoeff, eob, &txb_ctx); } void av1_write_coeffs_mb(const AV1_COMMON *const cm, MACROBLOCK *x, int mi_row, int mi_col, aom_writer *w, BLOCK_SIZE bsize) {
+ show +
659
660
661
662
663
664
665
666
667
668
MACROBLOCKD *xd = &x->e_mbd; const int num_planes = av1_num_planes(cm); int block[MAX_MB_PLANE] = { 0 }; int row, col; assert(bsize == get_plane_block_size(bsize, xd->plane[0].subsampling_x, xd->plane[0].subsampling_y)); const int max_blocks_wide = max_block_wide(xd, bsize, 0); const int max_blocks_high = max_block_high(xd, bsize, 0); const BLOCK_SIZE max_unit_bsize = BLOCK_64X64; int mu_blocks_wide = block_size_wide[max_unit_bsize] >> tx_size_wide_log2[0];

[CVE-2020-0470_1.diff] encodetxb.c #22
-#define WAREHOUSE_EFFICIENTS_TXB_CASE(tx_class_literal) \ - case tx_class_literal: \ - return warehouse_efficients_txb(cm, x, plane, block, tx_size, txb_ctx, p, \ - eob, plane_type, coeff_costs, xd, tx_type, \ - tx_class_literal); - switch (tx_class) { - WAREHOUSE_EFFICIENTS_TXB_CASE(TX_CLASS_2D); - WAREHOUSE_EFFICIENTS_TXB_CASE(TX_CLASS_HORIZ); - WAREHOUSE_EFFICIENTS_TXB_CASE(TX_CLASS_VERT); -#undef WAREHOUSE_EFFICIENTS_TXB_CASE - default: assert(false); return 0; + return warehouse_efficients_txb(x, plane, block, tx_size, txb_ctx, p, eob, + plane_type, coeff_costs, xd, tx_type, + tx_class, reduced_tx_set_used); +} + +int av1_cost_coeffs_txb_laplacian(const MACROBLOCK *x, const int plane, + const int block, const TX_SIZE tx_size, + const TX_TYPE tx_type, + const TXB_CTX *const txb_ctx, + const int reduced_tx_set_used, + const int adjust_eob) { + const struct macroblock_plane *p = &x->plane[plane]; + int eob = p->eobs[block]; + + if (adjust_eob) { + const SCAN_ORDER *scan_order = get_scan(tx_size, tx_type); + const int16_t *scan = scan_order->scan; + tran_low_t *tcoeff = p->coeff + BLOCK_OFFSET(block); + tran_low_t *qcoeff = p->qcoeff + BLOCK_OFFSET(block); + const MACROBLOCKD *xd = &x->e_mbd; + const struct macroblockd_plane *const pd = &xd->plane[plane]; + tran_low_t *dqcoeff = pd->dqcoeff + BLOCK_OFFSET(block); + update_coeff_eob_fast(&eob, av1_get_tx_scale(tx_size), p->dequant_QTX, scan, + tcoeff, qcoeff, dqcoeff); + p->eobs[block] = eob; + + const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size); + const PLANE_TYPE plane_type = get_plane_type(plane); + const LV_MAP_COEFF_COST *const coeff_costs = + &x->coeff_costs[txs_ctx][plane_type]; + if (eob == 0) { + return coeff_costs->txb_skip_cost[txb_ctx->txb_skip_ctx][1]; + } + + const MACROBLOCKD *const xd = &x->e_mbd; + const TX_CLASS tx_class = tx_type_to_class[tx_type]; + + return warehouse_efficients_txb_laplacian( + x, plane, block, tx_size, txb_ctx, eob, plane_type, coeff_costs, xd, + tx_type, tx_class, reduced_tx_set_used);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodetxb.c
838
839
840
841
842
843
844
845
846
847
const PLANE_TYPE plane_type = get_plane_type(plane); const LV_MAP_COEFF_COST *const coeff_costs = &x->coeff_costs[txs_ctx][plane_type]; if (eob == 0) { return coeff_costs->txb_skip_cost[txb_ctx->txb_skip_ctx][1]; } const MACROBLOCKD *const xd = &x->e_mbd; const TX_CLASS tx_class = tx_type_to_class[tx_type];
+ show +
848
849
850
851
852
853
854
855
856
857
858
#define WAREHOUSE_EFFICIENTS_TXB_CASE(tx_class_literal) \ case tx_class_literal: \ return warehouse_efficients_txb(cm, x, plane, block, tx_size, txb_ctx, p, \ eob, plane_type, coeff_costs, xd, tx_type, \ tx_class_literal); switch (tx_class) { WAREHOUSE_EFFICIENTS_TXB_CASE(TX_CLASS_2D); WAREHOUSE_EFFICIENTS_TXB_CASE(TX_CLASS_HORIZ); WAREHOUSE_EFFICIENTS_TXB_CASE(TX_CLASS_VERT); #undef WAREHOUSE_EFFICIENTS_TXB_CASE default: assert(false); return 0;
+ show +
859
860
861
862
863
864
865
866
867
868
} } static int optimize_txb(TxbInfo *txb_info, const LV_MAP_COEFF_COST *txb_costs, const LV_MAP_EOB_COST *txb_eob_costs, int *rate_cost) { int update = 0; if (txb_info->eob == 0) return update; const int16_t *const scan = txb_info->scan_order->scan; // forward optimize the nz_map` const int init_eob = txb_info->eob;

[CVE-2020-0470_1.diff] encodetxb.c #37
-void av1_update_txb_context_b(int plane, int block, int blk_row, int blk_col, - BLOCK_SIZE plane_bsize, TX_SIZE tx_size, - void *arg) { - struct tokenize_b_args *const args = arg; - const AV1_COMP *cpi = args->cpi; - const AV1_COMMON *cm = &cpi->common; - ThreadData *const td = args->td; - MACROBLOCK *const x = &td->mb; - MACROBLOCKD *const xd = &x->e_mbd; - struct macroblock_plane *p = &x->plane[plane]; - struct macroblockd_plane *pd = &xd->plane[plane]; - const uint16_t eob = p->eobs[block]; - const tran_low_t *qcoeff = BLOCK_OFFSET(p->qcoeff, block); - const PLANE_TYPE plane_type = pd->plane_type; - const TX_TYPE tx_type = av1_get_tx_type(plane_type, xd, blk_row, blk_col, - tx_size, cm->reduced_tx_set_used); - const SCAN_ORDER *const scan_order = get_scan(tx_size, tx_type); - const int cul_level = av1_get_txb_entropy_context(qcoeff, scan_order, eob); - av1_set_contexts(xd, pd, plane, plane_bsize, tx_size, cul_level, blk_col, - blk_row); -} - -static void update_tx_type_count(const AV1_COMMON *cm, MACROBLOCKD *xd, - int blk_row, int blk_col, int plane, - TX_SIZE tx_size, FRAME_COUNTS *counts, +static void update_tx_type_count(const AV1_COMP *cpi, const AV1_COMMON *cm, + MACROBLOCKD *xd, int blk_row, int blk_col, + int plane, TX_SIZE tx_size, + FRAME_COUNTS *counts, + const int reduced_tx_set_used = cm->features.reduced_tx_set_used;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/encodetxb.c
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
cul_level += abs(qcoeff[scan[c]]); if (cul_level > COEFF_CONTEXT_MASK) break; } cul_level = AOMMIN(COEFF_CONTEXT_MASK, cul_level); set_dc_sign(&cul_level, qcoeff[0]); return cul_level; }
+ show +
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
void av1_update_txb_context_b(int plane, int block, int blk_row, int blk_col, BLOCK_SIZE plane_bsize, TX_SIZE tx_size, void *arg) { struct tokenize_b_args *const args = arg; const AV1_COMP *cpi = args->cpi; const AV1_COMMON *cm = &cpi->common; ThreadData *const td = args->td; MACROBLOCK *const x = &td->mb; MACROBLOCKD *const xd = &x->e_mbd; struct macroblock_plane *p = &x->plane[plane]; struct macroblockd_plane *pd = &xd->plane[plane]; const uint16_t eob = p->eobs[block]; const tran_low_t *qcoeff = BLOCK_OFFSET(p->qcoeff, block); const PLANE_TYPE plane_type = pd->plane_type; const TX_TYPE tx_type = av1_get_tx_type(plane_type, xd, blk_row, blk_col, tx_size, cm->reduced_tx_set_used); const SCAN_ORDER *const scan_order = get_scan(tx_size, tx_type); const int cul_level = av1_get_txb_entropy_context(qcoeff, scan_order, eob); av1_set_contexts(xd, pd, plane, plane_bsize, tx_size, cul_level, blk_col, blk_row); } static void update_tx_type_count(const AV1_COMMON *cm, MACROBLOCKD *xd, int blk_row, int blk_col, int plane, TX_SIZE tx_size, FRAME_COUNTS *counts,
+ show +
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
uint8_t allow_update_cdf) { MB_MODE_INFO *mbmi = xd->mi[0]; int is_inter = is_inter_block(mbmi); FRAME_CONTEXT *fc = xd->tile_ctx; #if !CONFIG_ENTROPY_STATS (void)counts; #endif // !CONFIG_ENTROPY_STATS // Only y plane's tx_type is updated if (plane > 0) return;

[CVE-2020-0478_1.diff] av1_txfm1d_sse4.h #1
-void av1_fdct4_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); -void av1_fdct8_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); -void av1_fdct16_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); -void av1_fdct32_new_sse4_1(__m128i *input, __m128i *output, int cos_bit, - const int stride); -void av1_fdct64_new_sse4_1(__m128i *input, __m128i *output, int8_t cos_bit, - const int instride, const int outstride); -void av1_fadst4_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); -void av1_fadst8_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); -void av1_fadst16_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); +void av1_fdct4_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); +void av1_fdct8_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); +void av1_fdct16_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); +void av1_fdct32_sse4_1(__m128i *input, __m128i *output, int cos_bit, + const int stride); +void av1_fdct64_sse4_1(__m128i *input, __m128i *output, int8_t cos_bit, + const int instride, const int outstride); +void av1_fadst4_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); +void av1_fadst8_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); +void av1_fadst16_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); -void av1_idct4_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); -void av1_idct8_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); -void av1_idct16_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); -void av1_idct32_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); -void av1_idct64_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); +void av1_idct4_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); +void av1_idct8_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); +void av1_idct16_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); +void av1_idct32_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); +void av1_idct64_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); -void av1_iadst4_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); -void av1_iadst8_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); -void av1_iadst16_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); +void av1_iadst4_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); +void av1_iadst8_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); +void av1_iadst16_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); -void av1_idtx32_new_sse4_1(__m128i *input, __m128i *output, int cos_bit, - const int col_num); +void av1_idtx32_sse4_1(__m128i *input, __m128i *output, int cos_bit, + const int col_num);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/av1_txfm1d_sse4.h
13
14
15
16
17
18
19
20
21
22
#define AOM_AV1_ENCODER_X86_AV1_TXFM1D_SSE4_H_ #include <smmintrin.h> #include "av1/common/av1_txfm.h" #include "av1/common/x86/av1_txfm_sse4.h" #ifdef __cplusplus extern "C" { #endif
+ show +
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
void av1_fdct4_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_fdct8_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_fdct16_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_fdct32_new_sse4_1(__m128i *input, __m128i *output, int cos_bit, const int stride); void av1_fdct64_new_sse4_1(__m128i *input, __m128i *output, int8_t cos_bit, const int instride, const int outstride); void av1_fadst4_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_fadst8_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_fadst16_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_idct4_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_idct8_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_idct16_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_idct32_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_idct64_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_iadst4_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_iadst8_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_iadst16_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_idtx32_new_sse4_1(__m128i *input, __m128i *output, int cos_bit, const int col_num);
+ show +
60
61
62
63
64
65
66
67
68
69
static INLINE void transpose_32_4x4(int stride, const __m128i *input, __m128i *output) { __m128i temp0 = _mm_unpacklo_epi32(input[0 * stride], input[2 * stride]); __m128i temp1 = _mm_unpackhi_epi32(input[0 * stride], input[2 * stride]); __m128i temp2 = _mm_unpacklo_epi32(input[1 * stride], input[3 * stride]); __m128i temp3 = _mm_unpackhi_epi32(input[1 * stride], input[3 * stride]); output[0 * stride] = _mm_unpacklo_epi32(temp0, temp2); output[1 * stride] = _mm_unpackhi_epi32(temp0, temp2);

[CVE-2020-0470_1.diff] av1_txfm1d_sse4.h #1
-void av1_fdct4_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); -void av1_fdct8_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); -void av1_fdct16_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); -void av1_fdct32_new_sse4_1(__m128i *input, __m128i *output, int cos_bit, - const int stride); -void av1_fdct64_new_sse4_1(__m128i *input, __m128i *output, int8_t cos_bit, - const int instride, const int outstride); -void av1_fadst4_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); -void av1_fadst8_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); -void av1_fadst16_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); +void av1_fdct4_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); +void av1_fdct8_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); +void av1_fdct16_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); +void av1_fdct32_sse4_1(__m128i *input, __m128i *output, int cos_bit, + const int stride); +void av1_fdct64_sse4_1(__m128i *input, __m128i *output, int8_t cos_bit, + const int instride, const int outstride); +void av1_fadst4_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); +void av1_fadst8_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); +void av1_fadst16_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); -void av1_idct4_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); -void av1_idct8_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); -void av1_idct16_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); -void av1_idct32_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); -void av1_idct64_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); +void av1_idct4_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); +void av1_idct8_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); +void av1_idct16_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); +void av1_idct32_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); +void av1_idct64_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); -void av1_iadst4_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); -void av1_iadst8_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); -void av1_iadst16_new_sse4_1(const __m128i *input, __m128i *output, - const int8_t cos_bit, const int8_t *stage_range); +void av1_iadst4_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); +void av1_iadst8_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); +void av1_iadst16_sse4_1(const __m128i *input, __m128i *output, + const int8_t cos_bit, const int8_t *stage_range); -void av1_idtx32_new_sse4_1(__m128i *input, __m128i *output, int cos_bit, - const int col_num); +void av1_idtx32_sse4_1(__m128i *input, __m128i *output, int cos_bit, + const int col_num);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/av1_txfm1d_sse4.h
13
14
15
16
17
18
19
20
21
22
#define AOM_AV1_ENCODER_X86_AV1_TXFM1D_SSE4_H_ #include <smmintrin.h> #include "av1/common/av1_txfm.h" #include "av1/common/x86/av1_txfm_sse4.h" #ifdef __cplusplus extern "C" { #endif
+ show +
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
void av1_fdct4_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_fdct8_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_fdct16_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_fdct32_new_sse4_1(__m128i *input, __m128i *output, int cos_bit, const int stride); void av1_fdct64_new_sse4_1(__m128i *input, __m128i *output, int8_t cos_bit, const int instride, const int outstride); void av1_fadst4_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_fadst8_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_fadst16_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_idct4_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_idct8_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_idct16_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_idct32_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_idct64_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_iadst4_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_iadst8_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_iadst16_new_sse4_1(const __m128i *input, __m128i *output, const int8_t cos_bit, const int8_t *stage_range); void av1_idtx32_new_sse4_1(__m128i *input, __m128i *output, int cos_bit, const int col_num);
+ show +
60
61
62
63
64
65
66
67
68
69
static INLINE void transpose_32_4x4(int stride, const __m128i *input, __m128i *output) { __m128i temp0 = _mm_unpacklo_epi32(input[0 * stride], input[2 * stride]); __m128i temp1 = _mm_unpackhi_epi32(input[0 * stride], input[2 * stride]); __m128i temp2 = _mm_unpacklo_epi32(input[1 * stride], input[3 * stride]); __m128i temp3 = _mm_unpackhi_epi32(input[1 * stride], input[3 * stride]); output[0 * stride] = _mm_unpacklo_epi32(temp0, temp2); output[1 * stride] = _mm_unpackhi_epi32(temp0, temp2);

[CVE-2020-0478_1.diff] temporal_filter_sse4.c #18
-void av1_apply_temporal_filter_sse4_1( - const uint8_t *y_src, int y_src_stride, const uint8_t *y_pre, - int y_pre_stride, const uint8_t *u_src, const uint8_t *v_src, - int uv_src_stride, const uint8_t *u_pre, const uint8_t *v_pre, - int uv_pre_stride, unsigned int block_width, unsigned int block_height, - int ss_x, int ss_y, int strength, const int *blk_fw, int use_whole_blk, - uint32_t *y_accum, uint16_t *y_count, uint32_t *u_accum, uint16_t *u_count, - uint32_t *v_accum, uint16_t *v_count) { +static void apply_temporal_filter_yuv( + const YV12_BUFFER_CONFIG *ref_frame, const MACROBLOCKD *mbd, + const BLOCK_SIZE block_size, const int mb_row, const int mb_col, + const int strength, const int use_subblock, + const int *subblock_filter_weights, const uint8_t *pred, uint32_t *accum, + uint16_t *count) { + const int use_whole_blk = !use_subblock; + const int *blk_fw = subblock_filter_weights; + + // Block information (Y-plane). + const unsigned int block_height = block_size_high[block_size]; + const unsigned int block_width = block_size_wide[block_size]; + const int mb_pels = block_height * block_width; + const int y_src_stride = ref_frame->y_stride; + const int y_pre_stride = block_width; + const int mb_y_src_offset = + mb_row * block_height * ref_frame->y_stride + mb_col * block_width; + + // Block information (UV-plane). + const int ss_y = mbd->plane[1].subsampling_y; + const int ss_x = mbd->plane[1].subsampling_x; + const unsigned int uv_height = block_height >> ss_y; + const unsigned int uv_width = block_width >> ss_x; + const int uv_src_stride = ref_frame->uv_stride; + const int uv_pre_stride = block_width >> ss_x; + const int mb_uv_src_offset = + mb_row * uv_height * ref_frame->uv_stride + mb_col * uv_width; + + const uint8_t *y_src = ref_frame->y_buffer + mb_y_src_offset; + const uint8_t *u_src = ref_frame->u_buffer + mb_uv_src_offset; + const uint8_t *v_src = ref_frame->v_buffer + mb_uv_src_offset; + const uint8_t *y_pre = pred; + const uint8_t *u_pre = pred + mb_pels; + const uint8_t *v_pre = pred + mb_pels * 2; + uint32_t *y_accum = accum; + uint32_t *u_accum = accum + mb_pels; + uint32_t *v_accum = accum + mb_pels * 2; + uint16_t *y_count = count; + uint16_t *u_count = count + mb_pels; + uint16_t *v_count = count + mb_pels * 2; +
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/temporal_filter_sse4.c
914
915
916
917
918
919
920
921
922
923
av1_apply_temporal_filter_chroma_8( y_src + blk_col, y_src_stride, y_pre + blk_col, y_pre_stride, u_src + uv_blk_col, v_src + uv_blk_col, uv_src_stride, u_pre + uv_blk_col, v_pre + uv_blk_col, uv_pre_stride, uv_width, uv_height, ss_x, ss_y, strength, u_accum + uv_blk_col, u_count + uv_blk_col, v_accum + uv_blk_col, v_count + uv_blk_col, y_dist + blk_col, u_dist + uv_blk_col, v_dist + uv_blk_col, neighbors, top_weight, bottom_weight, NULL); }
+ show +
924
925
926
927
928
929
930
931
void av1_apply_temporal_filter_sse4_1( const uint8_t *y_src, int y_src_stride, const uint8_t *y_pre, int y_pre_stride, const uint8_t *u_src, const uint8_t *v_src, int uv_src_stride, const uint8_t *u_pre, const uint8_t *v_pre, int uv_pre_stride, unsigned int block_width, unsigned int block_height, int ss_x, int ss_y, int strength, const int *blk_fw, int use_whole_blk, uint32_t *y_accum, uint16_t *y_count, uint32_t *u_accum, uint16_t *u_count, uint32_t *v_accum, uint16_t *v_count) {
+ show +
932
933
934
935
936
937
938
939
940
941
const unsigned int chroma_height = block_height >> ss_y, chroma_width = block_width >> ss_x; DECLARE_ALIGNED(16, uint16_t, y_dist[BH * DIST_STRIDE]) = { 0 }; DECLARE_ALIGNED(16, uint16_t, u_dist[BH * DIST_STRIDE]) = { 0 }; DECLARE_ALIGNED(16, uint16_t, v_dist[BH * DIST_STRIDE]) = { 0 }; const int *blk_fw_ptr = blk_fw; uint16_t *y_dist_ptr = y_dist + 1, *u_dist_ptr = u_dist + 1, *v_dist_ptr = v_dist + 1;

[CVE-2020-0478_1.diff] temporal_filter_sse4.c #19
- av1_apply_temporal_filter_luma( - y_src, y_src_stride, y_pre, y_pre_stride, u_src, v_src, uv_src_stride, - u_pre, v_pre, uv_pre_stride, block_width, block_height, ss_x, ss_y, - strength, blk_fw_ptr, use_whole_blk, y_accum, y_count, y_dist_ptr, - u_dist_ptr, v_dist_ptr); + apply_temporal_filter_luma(y_src, y_src_stride, y_pre, y_pre_stride, u_src, + v_src, uv_src_stride, u_pre, v_pre, uv_pre_stride, + block_width, block_height, ss_x, ss_y, strength, + blk_fw_ptr, use_whole_blk, y_accum, y_count, + y_dist_ptr, u_dist_ptr, v_dist_ptr); - av1_apply_temporal_filter_chroma( + apply_temporal_filter_chroma( + +//////////////////////// +// Low bit-depth Ends // +//////////////////////// + +/////////////////////////// +// High bit-depth Begins // +/////////////////////////// + +// Compute (a-b)**2 for 8 pixels with size 16-bit +static INLINE void highbd_store_dist_8(const uint16_t *a, const uint16_t *b, + uint32_t *dst) { + const __m128i zero = _mm_setzero_si128(); + const __m128i a_reg = _mm_loadu_si128((const __m128i *)a); + const __m128i b_reg = _mm_loadu_si128((const __m128i *)b); + + const __m128i a_first = _mm_cvtepu16_epi32(a_reg); + const __m128i a_second = _mm_unpackhi_epi16(a_reg, zero); + const __m128i b_first = _mm_cvtepu16_epi32(b_reg); + const __m128i b_second = _mm_unpackhi_epi16(b_reg, zero); + + __m128i dist_first, dist_second; + + dist_first = _mm_sub_epi32(a_first, b_first); + dist_second = _mm_sub_epi32(a_second, b_second); + dist_first = _mm_mullo_epi32(dist_first, dist_first); + dist_second = _mm_mullo_epi32(dist_second, dist_second); + + _mm_storeu_si128((__m128i *)dst, dist_first); + _mm_storeu_si128((__m128i *)(dst + 4), dist_second); +} + +// Sum up three neighboring distortions for the pixels +static INLINE void highbd_get_sum_4(const uint32_t *dist, __m128i *sum) { + __m128i dist_reg, dist_left, dist_right; + + dist_reg = _mm_loadu_si128((const __m128i *)dist); + dist_left = _mm_loadu_si128((const __m128i *)(dist - 1)); + dist_right = _mm_loadu_si128((const __m128i *)(dist + 1)); + + *sum = _mm_add_epi32(dist_reg, dist_left); + *sum = _mm_add_epi32(*sum, dist_right); +} + +static INLINE void highbd_get_sum_8(const uint32_t *dist, __m128i *sum_first, + __m128i *sum_second) { + highbd_get_sum_4(dist, sum_first); + highbd_get_sum_4(dist + 4, sum_second); +} + +// Average the value based on the number of values summed (9 for pixels away +// from the border, 4 for pixels in corners, and 6 for other edge values, plus +// however many values from y/uv plane are). +// +// Add in the rounding factor and shift, clamp to 16, invert and shift. Multiply +// by weight. +static INLINE void highbd_average_4(__m128i *output, const __m128i *sum, + const __m128i *mul_constants, + const int strength, const int rounding, + const int weight) { + // _mm_srl_epi16 uses the lower 64 bit value for the shift. + const __m128i strength_u128 = _mm_set_epi32(0, 0, 0, strength); + const __m128i rounding_u32 = _mm_set1_epi32(rounding); + const __m128i weight_u32 = _mm_set1_epi32(weight); + const __m128i sixteen = _mm_set1_epi32(16); + const __m128i zero = _mm_setzero_si128(); + + // modifier * 3 / index; + const __m128i sum_lo = _mm_unpacklo_epi32(*sum, zero); + const __m128i sum_hi = _mm_unpackhi_epi32(*sum, zero); + const __m128i const_lo = _mm_unpacklo_epi32(*mul_constants, zero); + const __m128i const_hi = _mm_unpackhi_epi32(*mul_constants, zero); + + const __m128i mul_lo = _mm_mul_epu32(sum_lo, const_lo); + const __m128i mul_lo_div = _mm_srli_epi64(mul_lo, 32); + const __m128i mul_hi = _mm_mul_epu32(sum_hi, const_hi); + const __m128i mul_hi_div = _mm_srli_epi64(mul_hi, 32); + + // Now we have + // mul_lo: 00 a1 00 a0 + // mul_hi: 00 a3 00 a2 + // Unpack as 64 bit words to get even and odd elements + // unpack_lo: 00 a2 00 a0 + // unpack_hi: 00 a3 00 a1 + // Then we can shift and OR the results to get everything in 32-bits + const __m128i mul_even = _mm_unpacklo_epi64(mul_lo_div, mul_hi_div); + const __m128i mul_odd = _mm_unpackhi_epi64(mul_lo_div, mul_hi_div); + const __m128i mul_odd_shift = _mm_slli_si128(mul_odd, 4); + const __m128i mul = _mm_or_si128(mul_even, mul_odd_shift); + + // Round + *output = _mm_add_epi32(mul, rounding_u32); + *output = _mm_srl_epi32(*output, strength_u128); + + // Multiply with the weight + *output = _mm_min_epu32(*output, sixteen); + *output = _mm_sub_epi32(sixteen, *output); + *output = _mm_mullo_epi32(*output, weight_u32); +} + +static INLINE void highbd_average_8(__m128i *output_0, __m128i *output_1, + const __m128i *sum_0_u32, + const __m128i *sum_1_u32, + const __m128i *mul_constants_0, + const __m128i *mul_constants_1, + const int strength, const int rounding, + const int weight) { + highbd_average_4(output_0, sum_0_u32, mul_constants_0, strength, rounding, + weight); + highbd_average_4(output_1, sum_1_u32, mul_constants_1, strength, rounding, + weight); +} + +// Add 'sum_u32' to 'count'. Multiply by 'pred' and add to 'accumulator.' +static INLINE void highbd_accumulate_and_store_8(const __m128i sum_first_u32, + const __m128i sum_second_u32, + const uint16_t *pred, + uint16_t *count, + uint32_t *accumulator) { + // Cast down to 16-bit ints + const __m128i sum_u16 = _mm_packus_epi32(sum_first_u32, sum_second_u32); + const __m128i zero = _mm_setzero_si128(); + + __m128i pred_u16 = _mm_loadu_si128((const __m128i *)pred); + __m128i count_u16 = _mm_loadu_si128((const __m128i *)count); + + __m128i pred_0_u32, pred_1_u32; + __m128i accum_0_u32, accum_1_u32; + + count_u16 = _mm_adds_epu16(count_u16, sum_u16); + _mm_storeu_si128((__m128i *)count, count_u16); + + pred_u16 = _mm_mullo_epi16(sum_u16, pred_u16); + + pred_0_u32 = _mm_cvtepu16_epi32(pred_u16); + pred_1_u32 = _mm_unpackhi_epi16(pred_u16, zero); + + accum_0_u32 = _mm_loadu_si128((const __m128i *)accumulator); + accum_1_u32 = _mm_loadu_si128((const __m128i *)(accumulator + 4)); + + accum_0_u32 = _mm_add_epi32(pred_0_u32, accum_0_u32); + accum_1_u32 = _mm_add_epi32(pred_1_u32, accum_1_u32); + + _mm_storeu_si128((__m128i *)accumulator, accum_0_u32); + _mm_storeu_si128((__m128i *)(accumulator + 4), accum_1_u32); +} + +static INLINE void highbd_read_dist_4(const uint32_t *dist, __m128i *dist_reg) { + *dist_reg = _mm_loadu_si128((const __m128i *)dist); +} + +static INLINE void highbd_read_dist_8(const uint32_t *dist, __m128i *reg_first, + __m128i *reg_second) { + highbd_read_dist_4(dist, reg_first); + highbd_read_dist_4(dist + 4, reg_second); +} + +static INLINE void highbd_read_chroma_dist_row_8( + int ss_x, const uint32_t *u_dist, const uint32_t *v_dist, __m128i *u_first, + __m128i *u_second, __m128i *v_first, __m128i *v_second) { + if (!ss_x) { + // If there is no chroma subsampling in the horizontal direction, then we + // need to load 8 entries from chroma. + highbd_read_dist_8(u_dist, u_first, u_second); + highbd_read_dist_8(v_dist, v_first, v_second); + } else { // ss_x == 1 + // Otherwise, we only need to load 8 entries + __m128i u_reg, v_reg; + + highbd_read_dist_4(u_dist, &u_reg); + + *u_first = _mm_unpacklo_epi32(u_reg, u_reg); + *u_second = _mm_unpackhi_epi32(u_reg, u_reg); + + highbd_read_dist_4(v_dist, &v_reg); + + *v_first = _mm_unpacklo_epi32(v_reg, v_reg); + *v_second = _mm_unpackhi_epi32(v_reg, v_reg); + } +} + +static void highbd_apply_temporal_filter_luma_8( + const uint16_t *y_src, int y_src_stride, const uint16_t *y_pre, + int y_pre_stride, const uint16_t *u_src, const uint16_t *v_src, + int uv_src_stride, const uint16_t *u_pre, const uint16_t *v_pre, + int uv_pre_stride, unsigned int block_width, unsigned int block_height, + int ss_x, int ss_y, int strength, int use_whole_blk, uint32_t *y_accum, + uint16_t *y_count, const uint32_t *y_dist, const uint32_t *u_dist, + const uint32_t *v_dist, const uint32_t *const *neighbors_first, + const uint32_t *const *neighbors_second, int top_weight, + int bottom_weight) { + const int rounding = (1 << strength) >> 1; + int weight = top_weight; + + __m128i mul_first, mul_second; + + __m128i sum_row_1_first, sum_row_1_second; + __m128i sum_row_2_first, sum_row_2_second; + __m128i sum_row_3_first, sum_row_3_second; + + __m128i u_first, u_second; + __m128i v_first, v_second; + + __m128i sum_row_first; + __m128i sum_row_second; + + // Loop variables + unsigned int h; + + assert(strength >= 0 && strength <= 14 && + "invalid adjusted temporal filter strength"); + assert(block_width == 8); + + (void)block_width; + + // First row + mul_first = _mm_loadu_si128((const __m128i *)neighbors_first[0]); + mul_second = _mm_loadu_si128((const __m128i *)neighbors_second[0]); + + // Add luma values + highbd_get_sum_8(y_dist, &sum_row_2_first, &sum_row_2_second); + highbd_get_sum_8(y_dist + DIST_STRIDE, &sum_row_3_first, &sum_row_3_second); + + // We don't need to saturate here because the maximum value is UINT12_MAX ** 2 + // * 9 ~= 2**24 * 9 < 2 ** 28 < INT32_MAX + sum_row_first = _mm_add_epi32(sum_row_2_first, sum_row_3_first); + sum_row_second = _mm_add_epi32(sum_row_2_second, sum_row_3_second); + + // Add chroma values + highbd_read_chroma_dist_row_8(ss_x, u_dist, v_dist, &u_first, &u_second, + &v_first, &v_second); + + // Max value here is 2 ** 24 * (9 + 2), so no saturation is needed + sum_row_first = _mm_add_epi32(sum_row_first, u_first); + sum_row_second = _mm_add_epi32(sum_row_second, u_second); + + sum_row_first = _mm_add_epi32(sum_row_first, v_first); + sum_row_second = _mm_add_epi32(sum_row_second, v_second); + + // Get modifier and store result + highbd_average_8(&sum_row_first, &sum_row_second, &sum_row_first, + &sum_row_second, &mul_first, &mul_second, strength, rounding, + weight); + + highbd_accumulate_and_store_8(sum_row_first, sum_row_second, y_pre, y_count, + y_accum); + + y_src += y_src_stride; + y_pre += y_pre_stride; + y_count += y_pre_stride; + y_accum += y_pre_stride; + y_dist += DIST_STRIDE; + + u_src += uv_src_stride; + u_pre += uv_pre_stride; + u_dist += DIST_STRIDE; + v_src += uv_src_stride; + v_pre += uv_pre_stride; + v_dist += DIST_STRIDE; + + // Then all the rows except the last one + mul_first = _mm_loadu_si128((const __m128i *)neighbors_first[1]); + mul_second = _mm_loadu_si128((const __m128i *)neighbors_second[1]); + + for (h = 1; h < block_height - 1; ++h) { + // Move the weight to bottom half + if (!use_whole_blk && h == block_height / 2) { + weight = bottom_weight; + } + // Shift the rows up + sum_row_1_first = sum_row_2_first; + sum_row_1_second = sum_row_2_second; + sum_row_2_first = sum_row_3_first; + sum_row_2_second = sum_row_3_second; + + // Add luma values to the modifier + sum_row_first = _mm_add_epi32(sum_row_1_first, sum_row_2_first); + sum_row_second = _mm_add_epi32(sum_row_1_second, sum_row_2_second); + + highbd_get_sum_8(y_dist + DIST_STRIDE, &sum_row_3_first, &sum_row_3_second); + + sum_row_first = _mm_add_epi32(sum_row_first, sum_row_3_first); + sum_row_second = _mm_add_epi32(sum_row_second, sum_row_3_second); + + // Add chroma values to the modifier + if (ss_y == 0 || h % 2 == 0) { + // Only calculate the new chroma distortion if we are at a pixel that + // corresponds to a new chroma row + highbd_read_chroma_dist_row_8(ss_x, u_dist, v_dist, &u_first, &u_second, + &v_first, &v_second); + + u_src += uv_src_stride; + u_pre += uv_pre_stride; + u_dist += DIST_STRIDE; + v_src += uv_src_stride; + v_pre += uv_pre_stride; + v_dist += DIST_STRIDE; + } + + sum_row_first = _mm_add_epi32(sum_row_first, u_first); + sum_row_second = _mm_add_epi32(sum_row_second, u_second); + sum_row_first = _mm_add_epi32(sum_row_first, v_first); + sum_row_second = _mm_add_epi32(sum_row_second, v_second); + + // Get modifier and store result + highbd_average_8(&sum_row_first, &sum_row_second, &sum_row_first, + &sum_row_second, &mul_first, &mul_second, strength, + rounding, weight); + highbd_accumulate_and_store_8(sum_row_first, sum_row_second, y_pre, y_count, + y_accum); + + y_src += y_src_stride; + y_pre += y_pre_stride; + y_count += y_pre_stride; + y_accum += y_pre_stride; + y_dist += DIST_STRIDE; + } + + // The last row + mul_first = _mm_loadu_si128((const __m128i *)neighbors_first[0]); + mul_second = _mm_loadu_si128((const __m128i *)neighbors_second[0]); + + // Shift the rows up + sum_row_1_first = sum_row_2_first; + sum_row_1_second = sum_row_2_second; + sum_row_2_first = sum_row_3_first; + sum_row_2_second = sum_row_3_second; + + // Add luma values to the modifier + sum_row_first = _mm_add_epi32(sum_row_1_first, sum_row_2_first); + sum_row_second = _mm_add_epi32(sum_row_1_second, sum_row_2_second); + + // Add chroma values to the modifier + if (ss_y == 0) { + // Only calculate the new chroma distortion if we are at a pixel that + // corresponds to a new chroma row + highbd_read_chroma_dist_row_8(ss_x, u_dist, v_dist, &u_first, &u_second, + &v_first, &v_second); + } + + sum_row_first = _mm_add_epi32(sum_row_first, u_first); + sum_row_second = _mm_add_epi32(sum_row_second, u_second); + sum_row_first = _mm_add_epi32(sum_row_first, v_first); + sum_row_second = _mm_add_epi32(sum_row_second, v_second); + + // Get modifier and store result + highbd_average_8(&sum_row_first, &sum_row_second, &sum_row_first, + &sum_row_second, &mul_first, &mul_second, strength, rounding, + weight); + highbd_accumulate_and_store_8(sum_row_first, sum_row_second, y_pre, y_count, + y_accum); +} + +// Perform temporal filter for the luma component. +static void highbd_apply_temporal_filter_luma( + const uint16_t *y_src, int y_src_stride, const uint16_t *y_pre, + int y_pre_stride, const uint16_t *u_src, const uint16_t *v_src, + int uv_src_stride, const uint16_t *u_pre, const uint16_t *v_pre, + int uv_pre_stride, unsigned int block_width, unsigned int block_height, + int ss_x, int ss_y, int strength, const int *blk_fw, int use_whole_blk, + uint32_t *y_accum, uint16_t *y_count, const uint32_t *y_dist, + const uint32_t *u_dist, const uint32_t *v_dist) { + unsigned int blk_col = 0, uv_blk_col = 0; + const unsigned int blk_col_step = 8, uv_blk_col_step = 8 >> ss_x; + const unsigned int mid_width = block_width >> 1, + last_width = block_width - blk_col_step; + int top_weight = blk_fw[0], + bottom_weight = use_whole_blk ? blk_fw[0] : blk_fw[2]; + const uint32_t *const *neighbors_first; + const uint32_t *const *neighbors_second; + + // Left + neighbors_first = HIGHBD_LUMA_LEFT_COLUMN_NEIGHBORS; + neighbors_second = HIGHBD_LUMA_MIDDLE_COLUMN_NEIGHBORS; + highbd_apply_temporal_filter_luma_8( + y_src + blk_col, y_src_stride, y_pre + blk_col, y_pre_stride, + u_src + uv_blk_col, v_src + uv_blk_col, uv_src_stride, u_pre + uv_blk_col, + v_pre + uv_blk_col, uv_pre_stride, blk_col_step, block_height, ss_x, ss_y, + strength, use_whole_blk, y_accum + blk_col, y_count + blk_col, + y_dist + blk_col, u_dist + uv_blk_col, v_dist + uv_blk_col, + neighbors_first, neighbors_second, top_weight, bottom_weight); + + blk_col += blk_col_step; + uv_blk_col += uv_blk_col_step; + + // Middle First + neighbors_first = HIGHBD_LUMA_MIDDLE_COLUMN_NEIGHBORS; + for (; blk_col < mid_width; + blk_col += blk_col_step, uv_blk_col += uv_blk_col_step) { + highbd_apply_temporal_filter_luma_8( + y_src + blk_col, y_src_stride, y_pre + blk_col, y_pre_stride, + u_src + uv_blk_col, v_src + uv_blk_col, uv_src_stride, + u_pre + uv_blk_col, v_pre + uv_blk_col, uv_pre_stride, blk_col_step, + block_height, ss_x, ss_y, strength, use_whole_blk, y_accum + blk_col, + y_count + blk_col, y_dist + blk_col, u_dist + uv_blk_col, + v_dist + uv_blk_col, neighbors_first, neighbors_second, top_weight, + bottom_weight); + } + + if (!use_whole_blk) { + top_weight = blk_fw[1]; + bottom_weight = blk_fw[3]; + } + + // Middle Second + for (; blk_col < last_width; + blk_col += blk_col_step, uv_blk_col += uv_blk_col_step) { + highbd_apply_temporal_filter_luma_8( + y_src + blk_col, y_src_stride, y_pre + blk_col, y_pre_stride, + u_src + uv_blk_col, v_src + uv_blk_col, uv_src_stride, + u_pre + uv_blk_col, v_pre + uv_blk_col, uv_pre_stride, blk_col_step, + block_height, ss_x, ss_y, strength, use_whole_blk, y_accum + blk_col, + y_count + blk_col, y_dist + blk_col, u_dist + uv_blk_col, + v_dist + uv_blk_col, neighbors_first, neighbors_second, top_weight, + bottom_weight); + } + + // Right + neighbors_second = HIGHBD_LUMA_RIGHT_COLUMN_NEIGHBORS; + highbd_apply_temporal_filter_luma_8( + y_src + blk_col, y_src_stride, y_pre + blk_col, y_pre_stride, + u_src + uv_blk_col, v_src + uv_blk_col, uv_src_stride, u_pre + uv_blk_col, + v_pre + uv_blk_col, uv_pre_stride, blk_col_step, block_height, ss_x, ss_y, + strength, use_whole_blk, y_accum + blk_col, y_count + blk_col, + y_dist + blk_col, u_dist + uv_blk_col, v_dist + uv_blk_col, + neighbors_first, neighbors_second, top_weight, bottom_weight); +} + +// Add a row of luma distortion that corresponds to 8 chroma mods. If we are +// subsampling in x direction, then we have 16 lumas, else we have 8. +static INLINE void highbd_add_luma_dist_to_8_chroma_mod( + const uint32_t *y_dist, int ss_x, int ss_y, __m128i *u_mod_fst, + __m128i *u_mod_snd, __m128i *v_mod_fst, __m128i *v_mod_snd) { + __m128i y_reg_fst, y_reg_snd; + if (!ss_x) { + highbd_read_dist_8(y_dist, &y_reg_fst, &y_reg_snd); + if (ss_y == 1) { + __m128i y_tmp_fst, y_tmp_snd; + highbd_read_dist_8(y_dist + DIST_STRIDE, &y_tmp_fst, &y_tmp_snd); + y_reg_fst = _mm_add_epi32(y_reg_fst, y_tmp_fst); + y_reg_snd = _mm_add_epi32(y_reg_snd, y_tmp_snd); + } + } else { + // Temporary + __m128i y_fst, y_snd; + + // First 8 + highbd_read_dist_8(y_dist, &y_fst, &y_snd); + if (ss_y == 1) { + __m128i y_tmp_fst, y_tmp_snd; + highbd_read_dist_8(y_dist + DIST_STRIDE, &y_tmp_fst, &y_tmp_snd); + + y_fst = _mm_add_epi32(y_fst, y_tmp_fst); + y_snd = _mm_add_epi32(y_snd, y_tmp_snd); + } + + y_reg_fst = _mm_hadd_epi32(y_fst, y_snd); + + // Second 8 + highbd_read_dist_8(y_dist + 8, &y_fst, &y_snd); + if (ss_y == 1) { + __m128i y_tmp_fst, y_tmp_snd; + highbd_read_dist_8(y_dist + 8 + DIST_STRIDE, &y_tmp_fst, &y_tmp_snd); + + y_fst = _mm_add_epi32(y_fst, y_tmp_fst); + y_snd = _mm_add_epi32(y_snd, y_tmp_snd); + } + + y_reg_snd = _mm_hadd_epi32(y_fst, y_snd); + } + + *u_mod_fst = _mm_add_epi32(*u_mod_fst, y_reg_fst); + *u_mod_snd = _mm_add_epi32(*u_mod_snd, y_reg_snd); + *v_mod_fst = _mm_add_epi32(*v_mod_fst, y_reg_fst); + *v_mod_snd = _mm_add_epi32(*v_mod_snd, y_reg_snd); +} + +// Apply temporal filter to the chroma components. This performs temporal +// filtering on a chroma block of 8 X uv_height. If blk_fw is not NULL, use +// blk_fw as an array of size 4 for the weights for each of the 4 subblocks, +// else use top_weight for top half, and bottom weight for bottom half. +static void highbd_apply_temporal_filter_chroma_8( + const uint16_t *y_src, int y_src_stride, const uint16_t *y_pre, + int y_pre_stride, const uint16_t *u_src, const uint16_t *v_src, + int uv_src_stride, const uint16_t *u_pre, const uint16_t *v_pre, + int uv_pre_stride, unsigned int uv_block_width, + unsigned int uv_block_height, int ss_x, int ss_y, int strength, + uint32_t *u_accum, uint16_t *u_count, uint32_t *v_accum, uint16_t *v_count, + const uint32_t *y_dist, const uint32_t *u_dist, const uint32_t *v_dist, + const uint32_t *const *neighbors_fst, const uint32_t *const *neighbors_snd, + int top_weight, int bottom_weight, const int *blk_fw) { + const int rounding = (1 << strength) >> 1; + int weight = top_weight; + + __m128i mul_fst, mul_snd; + + __m128i u_sum_row_1_fst, u_sum_row_2_fst, u_sum_row_3_fst; + __m128i v_sum_row_1_fst, v_sum_row_2_fst, v_sum_row_3_fst; + __m128i u_sum_row_1_snd, u_sum_row_2_snd, u_sum_row_3_snd; + __m128i v_sum_row_1_snd, v_sum_row_2_snd, v_sum_row_3_snd; + + __m128i u_sum_row_fst, v_sum_row_fst; + __m128i u_sum_row_snd, v_sum_row_snd; + + // Loop variable + unsigned int h; + + (void)uv_block_width; + + // First row + mul_fst = _mm_loadu_si128((const __m128i *)neighbors_fst[0]); + mul_snd = _mm_loadu_si128((const __m128i *)neighbors_snd[0]); + + // Add chroma values + highbd_get_sum_8(u_dist, &u_sum_row_2_fst, &u_sum_row_2_snd); + highbd_get_sum_8(u_dist + DIST_STRIDE, &u_sum_row_3_fst, &u_sum_row_3_snd); + + u_sum_row_fst = _mm_add_epi32(u_sum_row_2_fst, u_sum_row_3_fst); + u_sum_row_snd = _mm_add_epi32(u_sum_row_2_snd, u_sum_row_3_snd); + + highbd_get_sum_8(v_dist, &v_sum_row_2_fst, &v_sum_row_2_snd); + highbd_get_sum_8(v_dist + DIST_STRIDE, &v_sum_row_3_fst, &v_sum_row_3_snd); + + v_sum_row_fst = _mm_add_epi32(v_sum_row_2_fst, v_sum_row_3_fst); + v_sum_row_snd = _mm_add_epi32(v_sum_row_2_snd, v_sum_row_3_snd); + + // Add luma values + highbd_add_luma_dist_to_8_chroma_mod(y_dist, ss_x, ss_y, &u_sum_row_fst, + &u_sum_row_snd, &v_sum_row_fst, + &v_sum_row_snd); + + // Get modifier and store result + if (blk_fw) { + highbd_average_4(&u_sum_row_fst, &u_sum_row_fst, &mul_fst, strength, + rounding, blk_fw[0]); + highbd_average_4(&u_sum_row_snd, &u_sum_row_snd, &mul_snd, strength, + rounding, blk_fw[1]); + + highbd_average_4(&v_sum_row_fst, &v_sum_row_fst, &mul_fst, strength, + rounding, blk_fw[0]); + highbd_average_4(&v_sum_row_snd, &v_sum_row_snd, &mul_snd, strength, + rounding, blk_fw[1]); + + } else { + highbd_average_8(&u_sum_row_fst, &u_sum_row_snd, &u_sum_row_fst, + &u_sum_row_snd, &mul_fst, &mul_snd, strength, rounding, + weight); + highbd_average_8(&v_sum_row_fst, &v_sum_row_snd, &v_sum_row_fst, + &v_sum_row_snd, &mul_fst, &mul_snd, strength, rounding, + weight); + } + highbd_accumulate_and_store_8(u_sum_row_fst, u_sum_row_snd, u_pre, u_count, + u_accum); + highbd_accumulate_and_store_8(v_sum_row_fst, v_sum_row_snd, v_pre, v_count, + v_accum); + + u_src += uv_src_stride; + u_pre += uv_pre_stride; + u_dist += DIST_STRIDE; + v_src += uv_src_stride; + v_pre += uv_pre_stride; + v_dist += DIST_STRIDE; + u_count += uv_pre_stride; + u_accum += uv_pre_stride; + v_count += uv_pre_stride; + v_accum += uv_pre_stride; + + y_src += y_src_stride * (1 + ss_y); + y_pre += y_pre_stride * (1 + ss_y); + y_dist += DIST_STRIDE * (1 + ss_y); + + // Then all the rows except the last one + mul_fst = _mm_loadu_si128((const __m128i *)neighbors_fst[1]); + mul_snd = _mm_loadu_si128((const __m128i *)neighbors_snd[1]); + + for (h = 1; h < uv_block_height - 1; ++h) { + // Move the weight pointer to the bottom half of the blocks + if (h == uv_block_height / 2) { + if (blk_fw) { + blk_fw += 2; + } else { + weight = bottom_weight; + } + } + + // Shift the rows up + u_sum_row_1_fst = u_sum_row_2_fst; + u_sum_row_2_fst = u_sum_row_3_fst; + u_sum_row_1_snd = u_sum_row_2_snd; + u_sum_row_2_snd = u_sum_row_3_snd; + + v_sum_row_1_fst = v_sum_row_2_fst; + v_sum_row_2_fst = v_sum_row_3_fst; + v_sum_row_1_snd = v_sum_row_2_snd; + v_sum_row_2_snd = v_sum_row_3_snd; + + // Add chroma values + u_sum_row_fst = _mm_add_epi32(u_sum_row_1_fst, u_sum_row_2_fst); + u_sum_row_snd = _mm_add_epi32(u_sum_row_1_snd, u_sum_row_2_snd); + highbd_get_sum_8(u_dist + DIST_STRIDE, &u_sum_row_3_fst, &u_sum_row_3_snd); + u_sum_row_fst = _mm_add_epi32(u_sum_row_fst, u_sum_row_3_fst); + u_sum_row_snd = _mm_add_epi32(u_sum_row_snd, u_sum_row_3_snd); + + v_sum_row_fst = _mm_add_epi32(v_sum_row_1_fst, v_sum_row_2_fst); + v_sum_row_snd = _mm_add_epi32(v_sum_row_1_snd, v_sum_row_2_snd); + highbd_get_sum_8(v_dist + DIST_STRIDE, &v_sum_row_3_fst, &v_sum_row_3_snd); + v_sum_row_fst = _mm_add_epi32(v_sum_row_fst, v_sum_row_3_fst); + v_sum_row_snd = _mm_add_epi32(v_sum_row_snd, v_sum_row_3_snd); + + // Add luma values + highbd_add_luma_dist_to_8_chroma_mod(y_dist, ss_x, ss_y, &u_sum_row_fst, + &u_sum_row_snd, &v_sum_row_fst, + &v_sum_row_snd); + + // Get modifier and store result + if (blk_fw) { + highbd_average_4(&u_sum_row_fst, &u_sum_row_fst, &mul_fst, strength, + rounding, blk_fw[0]); + highbd_average_4(&u_sum_row_snd, &u_sum_row_snd, &mul_snd, strength, + rounding, blk_fw[1]); + + highbd_average_4(&v_sum_row_fst, &v_sum_row_fst, &mul_fst, strength, + rounding, blk_fw[0]); + highbd_average_4(&v_sum_row_snd, &v_sum_row_snd, &mul_snd, strength, + rounding, blk_fw[1]); + + } else { + highbd_average_8(&u_sum_row_fst, &u_sum_row_snd, &u_sum_row_fst, + &u_sum_row_snd, &mul_fst, &mul_snd, strength, rounding, + weight); + highbd_average_8(&v_sum_row_fst, &v_sum_row_snd, &v_sum_row_fst, + &v_sum_row_snd, &mul_fst, &mul_snd, strength, rounding, + weight); + } + + highbd_accumulate_and_store_8(u_sum_row_fst, u_sum_row_snd, u_pre, u_count, + u_accum); + highbd_accumulate_and_store_8(v_sum_row_fst, v_sum_row_snd, v_pre, v_count, + v_accum); + + u_src += uv_src_stride; + u_pre += uv_pre_stride; + u_dist += DIST_STRIDE; + v_src += uv_src_stride; + v_pre += uv_pre_stride; + v_dist += DIST_STRIDE; + u_count += uv_pre_stride; + u_accum += uv_pre_stride; + v_count += uv_pre_stride; + v_accum += uv_pre_stride; + + y_src += y_src_stride * (1 + ss_y); + y_pre += y_pre_stride * (1 + ss_y); + y_dist += DIST_STRIDE * (1 + ss_y); + } + + // The last row + mul_fst = _mm_loadu_si128((const __m128i *)neighbors_fst[0]); + mul_snd = _mm_loadu_si128((const __m128i *)neighbors_snd[0]); + + // Shift the rows up + u_sum_row_1_fst = u_sum_row_2_fst; + u_sum_row_2_fst = u_sum_row_3_fst; + u_sum_row_1_snd = u_sum_row_2_snd; + u_sum_row_2_snd = u_sum_row_3_snd; + + v_sum_row_1_fst = v_sum_row_2_fst; + v_sum_row_2_fst = v_sum_row_3_fst; + v_sum_row_1_snd = v_sum_row_2_snd; + v_sum_row_2_snd = v_sum_row_3_snd; + + // Add chroma values + u_sum_row_fst = _mm_add_epi32(u_sum_row_1_fst, u_sum_row_2_fst); + v_sum_row_fst = _mm_add_epi32(v_sum_row_1_fst, v_sum_row_2_fst); + u_sum_row_snd = _mm_add_epi32(u_sum_row_1_snd, u_sum_row_2_snd); + v_sum_row_snd = _mm_add_epi32(v_sum_row_1_snd, v_sum_row_2_snd); + + // Add luma values + highbd_add_luma_dist_to_8_chroma_mod(y_dist, ss_x, ss_y, &u_sum_row_fst, + &u_sum_row_snd, &v_sum_row_fst, + &v_sum_row_snd); + + // Get modifier and store result + if (blk_fw) { + highbd_average_4(&u_sum_row_fst, &u_sum_row_fst, &mul_fst, strength, + rounding, blk_fw[0]); + highbd_average_4(&u_sum_row_snd, &u_sum_row_snd, &mul_snd, strength, + rounding, blk_fw[1]); + + highbd_average_4(&v_sum_row_fst, &v_sum_row_fst, &mul_fst, strength, + rounding, blk_fw[0]); + highbd_average_4(&v_sum_row_snd, &v_sum_row_snd, &mul_snd, strength, + rounding, blk_fw[1]); + + } else { + highbd_average_8(&u_sum_row_fst, &u_sum_row_snd, &u_sum_row_fst, + &u_sum_row_snd, &mul_fst, &mul_snd, strength, rounding, + weight); + highbd_average_8(&v_sum_row_fst, &v_sum_row_snd, &v_sum_row_fst, + &v_sum_row_snd, &mul_fst, &mul_snd, strength, rounding, + weight); + } + + highbd_accumulate_and_store_8(u_sum_row_fst, u_sum_row_snd, u_pre, u_count, + u_accum); + highbd_accumulate_and_store_8(v_sum_row_fst, v_sum_row_snd, v_pre, v_count, + v_accum); +} + +// Perform temporal filter for the chroma components. +static void highbd_apply_temporal_filter_chroma( + const uint16_t *y_src, int y_src_stride, const uint16_t *y_pre, + int y_pre_stride, const uint16_t *u_src, const uint16_t *v_src, + int uv_src_stride, const uint16_t *u_pre, const uint16_t *v_pre, + int uv_pre_stride, unsigned int block_width, unsigned int block_height, + int ss_x, int ss_y, int strength, const int *blk_fw, int use_whole_blk, + uint32_t *u_accum, uint16_t *u_count, uint32_t *v_accum, uint16_t *v_count, + const uint32_t *y_dist, const uint32_t *u_dist, const uint32_t *v_dist) { + const unsigned int uv_width = block_width >> ss_x, + uv_height = block_height >> ss_y; + + unsigned int blk_col = 0, uv_blk_col = 0; + const unsigned int uv_blk_col_step = 8, blk_col_step = 8 << ss_x; + const unsigned int uv_mid_width = uv_width >> 1, + uv_last_width = uv_width - uv_blk_col_step; + int top_weight = blk_fw[0], + bottom_weight = use_whole_blk ? blk_fw[0] : blk_fw[2]; + const uint32_t *const *neighbors_fst; + const uint32_t *const *neighbors_snd; + + if (uv_width == 8) { + // Special Case: We are subsampling in x direction on a 16x16 block. Since + // we are operating on a row of 8 chroma pixels, we can't use the usual + // left-middle-right pattern. + assert(ss_x); + + if (ss_y) { + neighbors_fst = HIGHBD_CHROMA_DOUBLE_SS_LEFT_COLUMN_NEIGHBORS; + neighbors_snd = HIGHBD_CHROMA_DOUBLE_SS_RIGHT_COLUMN_NEIGHBORS; + } else { + neighbors_fst = HIGHBD_CHROMA_SINGLE_SS_LEFT_COLUMN_NEIGHBORS; + neighbors_snd = HIGHBD_CHROMA_SINGLE_SS_RIGHT_COLUMN_NEIGHBORS; + } + + if (use_whole_blk) { + highbd_apply_temporal_filter_chroma_8( + y_src + blk_col, y_src_stride, y_pre + blk_col, y_pre_stride, + u_src + uv_blk_col, v_src + uv_blk_col, uv_src_stride, + u_pre + uv_blk_col, v_pre + uv_blk_col, uv_pre_stride, uv_width, + uv_height, ss_x, ss_y, strength, u_accum + uv_blk_col, + u_count + uv_blk_col, v_accum + uv_blk_col, v_count + uv_blk_col, + y_dist + blk_col, u_dist + uv_blk_col, v_dist + uv_blk_col, + neighbors_fst, neighbors_snd, top_weight, bottom_weight, NULL); + } else { + highbd_apply_temporal_filter_chroma_8( + y_src + blk_col, y_src_stride, y_pre + blk_col, y_pre_stride, + u_src + uv_blk_col, v_src + uv_blk_col, uv_src_stride, + u_pre + uv_blk_col, v_pre + uv_blk_col, uv_pre_stride, uv_width, + uv_height, ss_x, ss_y, strength, u_accum + uv_blk_col, + u_count + uv_blk_col, v_accum + uv_blk_col, v_count + uv_blk_col, + y_dist + blk_col, u_dist + uv_blk_col, v_dist + uv_blk_col, + neighbors_fst, neighbors_snd, 0, 0, blk_fw); + } + + return; + } + + // Left + if (ss_x && ss_y) { + neighbors_fst = HIGHBD_CHROMA_DOUBLE_SS_LEFT_COLUMN_NEIGHBORS; + neighbors_snd = HIGHBD_CHROMA_DOUBLE_SS_MIDDLE_COLUMN_NEIGHBORS; + } else if (ss_x || ss_y) { + neighbors_fst = HIGHBD_CHROMA_SINGLE_SS_LEFT_COLUMN_NEIGHBORS; + neighbors_snd = HIGHBD_CHROMA_SINGLE_SS_MIDDLE_COLUMN_NEIGHBORS; + } else { + neighbors_fst = HIGHBD_CHROMA_NO_SS_LEFT_COLUMN_NEIGHBORS; + neighbors_snd = HIGHBD_CHROMA_NO_SS_MIDDLE_COLUMN_NEIGHBORS; + } + + highbd_apply_temporal_filter_chroma_8( + y_src + blk_col, y_src_stride, y_pre + blk_col, y_pre_stride, + u_src + uv_blk_col, v_src + uv_blk_col, uv_src_stride, u_pre + uv_blk_col, + v_pre + uv_blk_col, uv_pre_stride, uv_width, uv_height, ss_x, ss_y, + strength, u_accum + uv_blk_col, u_count + uv_blk_col, + v_accum + uv_blk_col, v_count + uv_blk_col, y_dist + blk_col, + u_dist + uv_blk_col, v_dist + uv_blk_col, neighbors_fst, neighbors_snd, + top_weight, bottom_weight, NULL); + + blk_col += blk_col_step; + uv_blk_col += uv_blk_col_step; + + // Middle First + if (ss_x && ss_y) { + neighbors_fst = HIGHBD_CHROMA_DOUBLE_SS_MIDDLE_COLUMN_NEIGHBORS; + } else if (ss_x || ss_y) { + neighbors_fst = HIGHBD_CHROMA_SINGLE_SS_MIDDLE_COLUMN_NEIGHBORS; + } else { + neighbors_fst = HIGHBD_CHROMA_NO_SS_MIDDLE_COLUMN_NEIGHBORS; + } + + for (; uv_blk_col < uv_mid_width; + blk_col += blk_col_step, uv_blk_col += uv_blk_col_step) { + highbd_apply_temporal_filter_chroma_8( + y_src + blk_col, y_src_stride, y_pre + blk_col, y_pre_stride, + u_src + uv_blk_col, v_src + uv_blk_col, uv_src_stride, + u_pre + uv_blk_col, v_pre + uv_blk_col, uv_pre_stride, uv_width, + uv_height, ss_x, ss_y, strength, u_accum + uv_blk_col, + u_count + uv_blk_col, v_accum + uv_blk_col, v_count + uv_blk_col, + y_dist + blk_col, u_dist + uv_blk_col, v_dist + uv_blk_col, + neighbors_fst, neighbors_snd, top_weight, bottom_weight, NULL); + } + + if (!use_whole_blk) { + top_weight = blk_fw[1]; + bottom_weight = blk_fw[3]; + } + + // Middle Second + for (; uv_blk_col < uv_last_width; + blk_col += blk_col_step, uv_blk_col += uv_blk_col_step) { + highbd_apply_temporal_filter_chroma_8( + y_src + blk_col, y_src_stride, y_pre + blk_col, y_pre_stride, + u_src + uv_blk_col, v_src + uv_blk_col, uv_src_stride, + u_pre + uv_blk_col, v_pre + uv_blk_col, uv_pre_stride, uv_width, + uv_height, ss_x, ss_y, strength, u_accum + uv_blk_col, + u_count + uv_blk_col, v_accum + uv_blk_col, v_count + uv_blk_col, + y_dist + blk_col, u_dist + uv_blk_col, v_dist + uv_blk_col, + neighbors_fst, neighbors_snd, top_weight, bottom_weight, NULL); + } + + // Right + if (ss_x && ss_y) { + neighbors_snd = HIGHBD_CHROMA_DOUBLE_SS_RIGHT_COLUMN_NEIGHBORS; + } else if (ss_x || ss_y) { + neighbors_snd = HIGHBD_CHROMA_SINGLE_SS_RIGHT_COLUMN_NEIGHBORS; + } else { + neighbors_snd = HIGHBD_CHROMA_NO_SS_RIGHT_COLUMN_NEIGHBORS; + } + + highbd_apply_temporal_filter_chroma_8( + y_src + blk_col, y_src_stride, y_pre + blk_col, y_pre_stride, + u_src + uv_blk_col, v_src + uv_blk_col, uv_src_stride, u_pre + uv_blk_col, + v_pre + uv_blk_col, uv_pre_stride, uv_width, uv_height, ss_x, ss_y, + strength, u_accum + uv_blk_col, u_count + uv_blk_col, + v_accum + uv_blk_col, v_count + uv_blk_col, y_dist + blk_col, + u_dist + uv_blk_col, v_dist + uv_blk_col, neighbors_fst, neighbors_snd, + top_weight, bottom_weight, NULL); +} + +static void highbd_apply_temporal_filter_yuv( + const YV12_BUFFER_CONFIG *ref_frame, const MACROBLOCKD *mbd, + const BLOCK_SIZE block_size, const int mb_row, const int mb_col, + const int strength, const int use_subblock, + const int *subblock_filter_weights, const uint8_t *pred, uint32_t *accum, + uint16_t *count) { + const int use_whole_blk = !use_subblock; + const int *blk_fw = subblock_filter_weights; + + // Block information (Y-plane). + const unsigned int block_height = block_size_high[block_size]; + const unsigned int block_width = block_size_wide[block_size]; + const int mb_pels = block_height * block_width; + const int y_src_stride = ref_frame->y_stride; + const int y_pre_stride = block_width; + const int mb_y_src_offset = + mb_row * block_height * ref_frame->y_stride + mb_col * block_width; + + // Block information (UV-plane). + const int ss_y = mbd->plane[1].subsampling_y; + const int ss_x = mbd->plane[1].subsampling_x; + const unsigned int uv_height = block_height >> ss_y; + const unsigned int uv_width = block_width >> ss_x; + const int uv_src_stride = ref_frame->uv_stride; + const int uv_pre_stride = block_width >> ss_x; + const int mb_uv_src_offset = + mb_row * uv_height * ref_frame->uv_stride + mb_col * uv_width; + + const uint8_t *y_src = ref_frame->y_buffer + mb_y_src_offset; + const uint8_t *u_src = ref_frame->u_buffer + mb_uv_src_offset; + const uint8_t *v_src = ref_frame->v_buffer + mb_uv_src_offset; + const uint8_t *y_pre = pred; + const uint8_t *u_pre = pred + mb_pels; + const uint8_t *v_pre = pred + mb_pels * 2; + uint32_t *y_accum = accum; + uint32_t *u_accum = accum + mb_pels; + uint32_t *v_accum = accum + mb_pels * 2; + uint16_t *y_count = count; + uint16_t *u_count = count + mb_pels; + uint16_t *v_count = count + mb_pels * 2; + + const unsigned int chroma_height = block_height >> ss_y, + chroma_width = block_width >> ss_x; + + DECLARE_ALIGNED(16, uint32_t, y_dist[BH * DIST_STRIDE]) = { 0 }; + DECLARE_ALIGNED(16, uint32_t, u_dist[BH * DIST_STRIDE]) = { 0 }; + DECLARE_ALIGNED(16, uint32_t, v_dist[BH * DIST_STRIDE]) = { 0 }; + + uint32_t *y_dist_ptr = y_dist + 1, *u_dist_ptr = u_dist + 1, + *v_dist_ptr = v_dist + 1; + const uint16_t *y_src_ptr = CONVERT_TO_SHORTPTR(y_src), + *u_src_ptr = CONVERT_TO_SHORTPTR(u_src), + *v_src_ptr = CONVERT_TO_SHORTPTR(v_src); + const uint16_t *y_pre_ptr = CONVERT_TO_SHORTPTR(y_pre), + *u_pre_ptr = CONVERT_TO_SHORTPTR(u_pre), + *v_pre_ptr = CONVERT_TO_SHORTPTR(v_pre); + + // Loop variables + unsigned int row, blk_col; + + assert(block_width <= BW && "block width too large"); + assert(block_height <= BH && "block height too large"); + assert(block_width % 16 == 0 && "block width must be multiple of 16"); + assert(block_height % 2 == 0 && "block height must be even"); + assert((ss_x == 0 || ss_x == 1) && (ss_y == 0 || ss_y == 1) && + "invalid chroma subsampling"); + assert(strength >= 0 && strength <= 14 && + "invalid adjusted temporal filter strength"); + assert(blk_fw[0] >= 0 && "filter weight must be positive"); + assert( + (use_whole_blk || (blk_fw[1] >= 0 && blk_fw[2] >= 0 && blk_fw[3] >= 0)) && + "subblock filter weight must be positive"); + assert(blk_fw[0] <= 2 && "sublock filter weight must be less than 2"); + assert( + (use_whole_blk || (blk_fw[1] <= 2 && blk_fw[2] <= 2 && blk_fw[3] <= 2)) && + "subblock filter weight must be less than 2"); + + // Precompute the difference squared + for (row = 0; row < block_height; row++) { + for (blk_col = 0; blk_col < block_width; blk_col += 8) { + highbd_store_dist_8(y_src_ptr + blk_col, y_pre_ptr + blk_col, + y_dist_ptr + blk_col); + } + y_src_ptr += y_src_stride; + y_pre_ptr += y_pre_stride; + y_dist_ptr += DIST_STRIDE; + } + + for (row = 0; row < chroma_height; row++) { + for (blk_col = 0; blk_col < chroma_width; blk_col += 8) { + highbd_store_dist_8(u_src_ptr + blk_col, u_pre_ptr + blk_col, + u_dist_ptr + blk_col); + highbd_store_dist_8(v_src_ptr + blk_col, v_pre_ptr + blk_col, + v_dist_ptr + blk_col); + } + + u_src_ptr += uv_src_stride; + u_pre_ptr += uv_pre_stride; + u_dist_ptr += DIST_STRIDE; + v_src_ptr += uv_src_stride; + v_pre_ptr += uv_pre_stride; + v_dist_ptr += DIST_STRIDE; + } + + y_src_ptr = CONVERT_TO_SHORTPTR(y_src), + u_src_ptr = CONVERT_TO_SHORTPTR(u_src), + v_src_ptr = CONVERT_TO_SHORTPTR(v_src); + y_pre_ptr = CONVERT_TO_SHORTPTR(y_pre), + u_pre_ptr = CONVERT_TO_SHORTPTR(u_pre), + v_pre_ptr = CONVERT_TO_SHORTPTR(v_pre); + + y_dist_ptr = y_dist + 1; + u_dist_ptr = u_dist + 1; + v_dist_ptr = v_dist + 1; + + highbd_apply_temporal_filter_luma( + y_src_ptr, y_src_stride, y_pre_ptr, y_pre_stride, u_src_ptr, v_src_ptr, + uv_src_stride, u_pre_ptr, v_pre_ptr, uv_pre_stride, block_width, + block_height, ss_x, ss_y, strength, blk_fw, use_whole_blk, y_accum, + y_count, y_dist_ptr, u_dist_ptr, v_dist_ptr); + + highbd_apply_temporal_filter_chroma( + y_src_ptr, y_src_stride, y_pre_ptr, y_pre_stride, u_src_ptr, v_src_ptr, + uv_src_stride, u_pre_ptr, v_pre_ptr, uv_pre_stride, block_width, + block_height, ss_x, ss_y, strength, blk_fw, use_whole_blk, u_accum, + u_count, v_accum, v_count, y_dist_ptr, u_dist_ptr, v_dist_ptr); +} + +///////////////////////// +// High bit-depth Ends // +///////////////////////// + +void av1_apply_temporal_filter_yuv_sse4_1( + const YV12_BUFFER_CONFIG *ref_frame, const MACROBLOCKD *mbd, + const BLOCK_SIZE block_size, const int mb_row, const int mb_col, + const int num_planes, const int strength, const int use_subblock, + const int *subblock_filter_weights, const uint8_t *pred, uint32_t *accum, + uint16_t *count) { + const int is_high_bitdepth = ref_frame->flags & YV12_FLAG_HIGHBITDEPTH; + // TODO(any): Need to support when `num_planes != 3`, like C implementation. + assert(num_planes == 3); + (void)num_planes; + if (is_high_bitdepth) { + highbd_apply_temporal_filter_yuv( + ref_frame, mbd, block_size, mb_row, mb_col, strength, use_subblock, + subblock_filter_weights, pred, accum, count); + } else { + apply_temporal_filter_yuv(ref_frame, mbd, block_size, mb_row, mb_col, + strength, use_subblock, subblock_filter_weights, + pred, accum, count); + } +}
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/temporal_filter_sse4.c
985
986
987
988
989
990
991
992
993
994
u_dist_ptr += DIST_STRIDE; v_src_ptr += uv_src_stride; v_pre_ptr += uv_pre_stride; v_dist_ptr += DIST_STRIDE; } y_dist_ptr = y_dist + 1; u_dist_ptr = u_dist + 1; v_dist_ptr = v_dist + 1;
+ show +
995
996
997
998
999
1000
1001
av1_apply_temporal_filter_luma( y_src, y_src_stride, y_pre, y_pre_stride, u_src, v_src, uv_src_stride, u_pre, v_pre, uv_pre_stride, block_width, block_height, ss_x, ss_y, strength, blk_fw_ptr, use_whole_blk, y_accum, y_count, y_dist_ptr, u_dist_ptr, v_dist_ptr); av1_apply_temporal_filter_chroma(
+ show +
1002
1003
1004
1005
1006
y_src, y_src_stride, y_pre, y_pre_stride, u_src, v_src, uv_src_stride, u_pre, v_pre, uv_pre_stride, block_width, block_height, ss_x, ss_y, strength, blk_fw_ptr, use_whole_blk, u_accum, u_count, v_accum, v_count, y_dist_ptr, u_dist_ptr, v_dist_ptr); }

[CVE-2020-0470_1.diff] temporal_filter_sse4.c #18
-void av1_apply_temporal_filter_sse4_1( - const uint8_t *y_src, int y_src_stride, const uint8_t *y_pre, - int y_pre_stride, const uint8_t *u_src, const uint8_t *v_src, - int uv_src_stride, const uint8_t *u_pre, const uint8_t *v_pre, - int uv_pre_stride, unsigned int block_width, unsigned int block_height, - int ss_x, int ss_y, int strength, const int *blk_fw, int use_whole_blk, - uint32_t *y_accum, uint16_t *y_count, uint32_t *u_accum, uint16_t *u_count, - uint32_t *v_accum, uint16_t *v_count) { +static void apply_temporal_filter_yuv( + const YV12_BUFFER_CONFIG *ref_frame, const MACROBLOCKD *mbd, + const BLOCK_SIZE block_size, const int mb_row, const int mb_col, + const int strength, const int use_subblock, + const int *subblock_filter_weights, const uint8_t *pred, uint32_t *accum, + uint16_t *count) { + const int use_whole_blk = !use_subblock; + const int *blk_fw = subblock_filter_weights; + + // Block information (Y-plane). + const unsigned int block_height = block_size_high[block_size]; + const unsigned int block_width = block_size_wide[block_size]; + const int mb_pels = block_height * block_width; + const int y_src_stride = ref_frame->y_stride; + const int y_pre_stride = block_width; + const int mb_y_src_offset = + mb_row * block_height * ref_frame->y_stride + mb_col * block_width; + + // Block information (UV-plane). + const int ss_y = mbd->plane[1].subsampling_y; + const int ss_x = mbd->plane[1].subsampling_x; + const unsigned int uv_height = block_height >> ss_y; + const unsigned int uv_width = block_width >> ss_x; + const int uv_src_stride = ref_frame->uv_stride; + const int uv_pre_stride = block_width >> ss_x; + const int mb_uv_src_offset = + mb_row * uv_height * ref_frame->uv_stride + mb_col * uv_width; + + const uint8_t *y_src = ref_frame->y_buffer + mb_y_src_offset; + const uint8_t *u_src = ref_frame->u_buffer + mb_uv_src_offset; + const uint8_t *v_src = ref_frame->v_buffer + mb_uv_src_offset; + const uint8_t *y_pre = pred; + const uint8_t *u_pre = pred + mb_pels; + const uint8_t *v_pre = pred + mb_pels * 2; + uint32_t *y_accum = accum; + uint32_t *u_accum = accum + mb_pels; + uint32_t *v_accum = accum + mb_pels * 2; + uint16_t *y_count = count; + uint16_t *u_count = count + mb_pels; + uint16_t *v_count = count + mb_pels * 2; +
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/temporal_filter_sse4.c
914
915
916
917
918
919
920
921
922
923
av1_apply_temporal_filter_chroma_8( y_src + blk_col, y_src_stride, y_pre + blk_col, y_pre_stride, u_src + uv_blk_col, v_src + uv_blk_col, uv_src_stride, u_pre + uv_blk_col, v_pre + uv_blk_col, uv_pre_stride, uv_width, uv_height, ss_x, ss_y, strength, u_accum + uv_blk_col, u_count + uv_blk_col, v_accum + uv_blk_col, v_count + uv_blk_col, y_dist + blk_col, u_dist + uv_blk_col, v_dist + uv_blk_col, neighbors, top_weight, bottom_weight, NULL); }
+ show +
924
925
926
927
928
929
930
931
void av1_apply_temporal_filter_sse4_1( const uint8_t *y_src, int y_src_stride, const uint8_t *y_pre, int y_pre_stride, const uint8_t *u_src, const uint8_t *v_src, int uv_src_stride, const uint8_t *u_pre, const uint8_t *v_pre, int uv_pre_stride, unsigned int block_width, unsigned int block_height, int ss_x, int ss_y, int strength, const int *blk_fw, int use_whole_blk, uint32_t *y_accum, uint16_t *y_count, uint32_t *u_accum, uint16_t *u_count, uint32_t *v_accum, uint16_t *v_count) {
+ show +
932
933
934
935
936
937
938
939
940
941
const unsigned int chroma_height = block_height >> ss_y, chroma_width = block_width >> ss_x; DECLARE_ALIGNED(16, uint16_t, y_dist[BH * DIST_STRIDE]) = { 0 }; DECLARE_ALIGNED(16, uint16_t, u_dist[BH * DIST_STRIDE]) = { 0 }; DECLARE_ALIGNED(16, uint16_t, v_dist[BH * DIST_STRIDE]) = { 0 }; const int *blk_fw_ptr = blk_fw; uint16_t *y_dist_ptr = y_dist + 1, *u_dist_ptr = u_dist + 1, *v_dist_ptr = v_dist + 1;

[CVE-2020-0470_1.diff] temporal_filter_sse4.c #19
- av1_apply_temporal_filter_luma( - y_src, y_src_stride, y_pre, y_pre_stride, u_src, v_src, uv_src_stride, - u_pre, v_pre, uv_pre_stride, block_width, block_height, ss_x, ss_y, - strength, blk_fw_ptr, use_whole_blk, y_accum, y_count, y_dist_ptr, - u_dist_ptr, v_dist_ptr); + apply_temporal_filter_luma(y_src, y_src_stride, y_pre, y_pre_stride, u_src, + v_src, uv_src_stride, u_pre, v_pre, uv_pre_stride, + block_width, block_height, ss_x, ss_y, strength, + blk_fw_ptr, use_whole_blk, y_accum, y_count, + y_dist_ptr, u_dist_ptr, v_dist_ptr); - av1_apply_temporal_filter_chroma( + apply_temporal_filter_chroma( + +//////////////////////// +// Low bit-depth Ends // +//////////////////////// + +/////////////////////////// +// High bit-depth Begins // +/////////////////////////// + +// Compute (a-b)**2 for 8 pixels with size 16-bit +static INLINE void highbd_store_dist_8(const uint16_t *a, const uint16_t *b, + uint32_t *dst) { + const __m128i zero = _mm_setzero_si128(); + const __m128i a_reg = _mm_loadu_si128((const __m128i *)a); + const __m128i b_reg = _mm_loadu_si128((const __m128i *)b); + + const __m128i a_first = _mm_cvtepu16_epi32(a_reg); + const __m128i a_second = _mm_unpackhi_epi16(a_reg, zero); + const __m128i b_first = _mm_cvtepu16_epi32(b_reg); + const __m128i b_second = _mm_unpackhi_epi16(b_reg, zero); + + __m128i dist_first, dist_second; + + dist_first = _mm_sub_epi32(a_first, b_first); + dist_second = _mm_sub_epi32(a_second, b_second); + dist_first = _mm_mullo_epi32(dist_first, dist_first); + dist_second = _mm_mullo_epi32(dist_second, dist_second); + + _mm_storeu_si128((__m128i *)dst, dist_first); + _mm_storeu_si128((__m128i *)(dst + 4), dist_second); +} + +// Sum up three neighboring distortions for the pixels +static INLINE void highbd_get_sum_4(const uint32_t *dist, __m128i *sum) { + __m128i dist_reg, dist_left, dist_right; + + dist_reg = _mm_loadu_si128((const __m128i *)dist); + dist_left = _mm_loadu_si128((const __m128i *)(dist - 1)); + dist_right = _mm_loadu_si128((const __m128i *)(dist + 1)); + + *sum = _mm_add_epi32(dist_reg, dist_left); + *sum = _mm_add_epi32(*sum, dist_right); +} + +static INLINE void highbd_get_sum_8(const uint32_t *dist, __m128i *sum_first, + __m128i *sum_second) { + highbd_get_sum_4(dist, sum_first); + highbd_get_sum_4(dist + 4, sum_second); +} + +// Average the value based on the number of values summed (9 for pixels away +// from the border, 4 for pixels in corners, and 6 for other edge values, plus +// however many values from y/uv plane are). +// +// Add in the rounding factor and shift, clamp to 16, invert and shift. Multiply +// by weight. +static INLINE void highbd_average_4(__m128i *output, const __m128i *sum, + const __m128i *mul_constants, + const int strength, const int rounding, + const int weight) { + // _mm_srl_epi16 uses the lower 64 bit value for the shift. + const __m128i strength_u128 = _mm_set_epi32(0, 0, 0, strength); + const __m128i rounding_u32 = _mm_set1_epi32(rounding); + const __m128i weight_u32 = _mm_set1_epi32(weight); + const __m128i sixteen = _mm_set1_epi32(16); + const __m128i zero = _mm_setzero_si128(); + + // modifier * 3 / index; + const __m128i sum_lo = _mm_unpacklo_epi32(*sum, zero); + const __m128i sum_hi = _mm_unpackhi_epi32(*sum, zero); + const __m128i const_lo = _mm_unpacklo_epi32(*mul_constants, zero); + const __m128i const_hi = _mm_unpackhi_epi32(*mul_constants, zero); + + const __m128i mul_lo = _mm_mul_epu32(sum_lo, const_lo); + const __m128i mul_lo_div = _mm_srli_epi64(mul_lo, 32); + const __m128i mul_hi = _mm_mul_epu32(sum_hi, const_hi); + const __m128i mul_hi_div = _mm_srli_epi64(mul_hi, 32); + + // Now we have + // mul_lo: 00 a1 00 a0 + // mul_hi: 00 a3 00 a2 + // Unpack as 64 bit words to get even and odd elements + // unpack_lo: 00 a2 00 a0 + // unpack_hi: 00 a3 00 a1 + // Then we can shift and OR the results to get everything in 32-bits + const __m128i mul_even = _mm_unpacklo_epi64(mul_lo_div, mul_hi_div); + const __m128i mul_odd = _mm_unpackhi_epi64(mul_lo_div, mul_hi_div); + const __m128i mul_odd_shift = _mm_slli_si128(mul_odd, 4); + const __m128i mul = _mm_or_si128(mul_even, mul_odd_shift); + + // Round + *output = _mm_add_epi32(mul, rounding_u32); + *output = _mm_srl_epi32(*output, strength_u128); + + // Multiply with the weight + *output = _mm_min_epu32(*output, sixteen); + *output = _mm_sub_epi32(sixteen, *output); + *output = _mm_mullo_epi32(*output, weight_u32); +} + +static INLINE void highbd_average_8(__m128i *output_0, __m128i *output_1, + const __m128i *sum_0_u32, + const __m128i *sum_1_u32, + const __m128i *mul_constants_0, + const __m128i *mul_constants_1, + const int strength, const int rounding, + const int weight) { + highbd_average_4(output_0, sum_0_u32, mul_constants_0, strength, rounding, + weight); + highbd_average_4(output_1, sum_1_u32, mul_constants_1, strength, rounding, + weight); +} + +// Add 'sum_u32' to 'count'. Multiply by 'pred' and add to 'accumulator.' +static INLINE void highbd_accumulate_and_store_8(const __m128i sum_first_u32, + const __m128i sum_second_u32, + const uint16_t *pred, + uint16_t *count, + uint32_t *accumulator) { + // Cast down to 16-bit ints + const __m128i sum_u16 = _mm_packus_epi32(sum_first_u32, sum_second_u32); + const __m128i zero = _mm_setzero_si128(); + + __m128i pred_u16 = _mm_loadu_si128((const __m128i *)pred); + __m128i count_u16 = _mm_loadu_si128((const __m128i *)count); + + __m128i pred_0_u32, pred_1_u32; + __m128i accum_0_u32, accum_1_u32; + + count_u16 = _mm_adds_epu16(count_u16, sum_u16); + _mm_storeu_si128((__m128i *)count, count_u16); + + pred_u16 = _mm_mullo_epi16(sum_u16, pred_u16); + + pred_0_u32 = _mm_cvtepu16_epi32(pred_u16); + pred_1_u32 = _mm_unpackhi_epi16(pred_u16, zero); + + accum_0_u32 = _mm_loadu_si128((const __m128i *)accumulator); + accum_1_u32 = _mm_loadu_si128((const __m128i *)(accumulator + 4)); + + accum_0_u32 = _mm_add_epi32(pred_0_u32, accum_0_u32); + accum_1_u32 = _mm_add_epi32(pred_1_u32, accum_1_u32); + + _mm_storeu_si128((__m128i *)accumulator, accum_0_u32); + _mm_storeu_si128((__m128i *)(accumulator + 4), accum_1_u32); +} + +static INLINE void highbd_read_dist_4(const uint32_t *dist, __m128i *dist_reg) { + *dist_reg = _mm_loadu_si128((const __m128i *)dist); +} + +static INLINE void highbd_read_dist_8(const uint32_t *dist, __m128i *reg_first, + __m128i *reg_second) { + highbd_read_dist_4(dist, reg_first); + highbd_read_dist_4(dist + 4, reg_second); +} + +static INLINE void highbd_read_chroma_dist_row_8( + int ss_x, const uint32_t *u_dist, const uint32_t *v_dist, __m128i *u_first, + __m128i *u_second, __m128i *v_first, __m128i *v_second) { + if (!ss_x) { + // If there is no chroma subsampling in the horizontal direction, then we + // need to load 8 entries from chroma. + highbd_read_dist_8(u_dist, u_first, u_second); + highbd_read_dist_8(v_dist, v_first, v_second); + } else { // ss_x == 1 + // Otherwise, we only need to load 8 entries + __m128i u_reg, v_reg; + + highbd_read_dist_4(u_dist, &u_reg); + + *u_first = _mm_unpacklo_epi32(u_reg, u_reg); + *u_second = _mm_unpackhi_epi32(u_reg, u_reg); + + highbd_read_dist_4(v_dist, &v_reg); + + *v_first = _mm_unpacklo_epi32(v_reg, v_reg); + *v_second = _mm_unpackhi_epi32(v_reg, v_reg); + } +} + +static void highbd_apply_temporal_filter_luma_8( + const uint16_t *y_src, int y_src_stride, const uint16_t *y_pre, + int y_pre_stride, const uint16_t *u_src, const uint16_t *v_src, + int uv_src_stride, const uint16_t *u_pre, const uint16_t *v_pre, + int uv_pre_stride, unsigned int block_width, unsigned int block_height, + int ss_x, int ss_y, int strength, int use_whole_blk, uint32_t *y_accum, + uint16_t *y_count, const uint32_t *y_dist, const uint32_t *u_dist, + const uint32_t *v_dist, const uint32_t *const *neighbors_first, + const uint32_t *const *neighbors_second, int top_weight, + int bottom_weight) { + const int rounding = (1 << strength) >> 1; + int weight = top_weight; + + __m128i mul_first, mul_second; + + __m128i sum_row_1_first, sum_row_1_second; + __m128i sum_row_2_first, sum_row_2_second; + __m128i sum_row_3_first, sum_row_3_second; + + __m128i u_first, u_second; + __m128i v_first, v_second; + + __m128i sum_row_first; + __m128i sum_row_second; + + // Loop variables + unsigned int h; + + assert(strength >= 0 && strength <= 14 && + "invalid adjusted temporal filter strength"); + assert(block_width == 8); + + (void)block_width; + + // First row + mul_first = _mm_loadu_si128((const __m128i *)neighbors_first[0]); + mul_second = _mm_loadu_si128((const __m128i *)neighbors_second[0]); + + // Add luma values + highbd_get_sum_8(y_dist, &sum_row_2_first, &sum_row_2_second); + highbd_get_sum_8(y_dist + DIST_STRIDE, &sum_row_3_first, &sum_row_3_second); + + // We don't need to saturate here because the maximum value is UINT12_MAX ** 2 + // * 9 ~= 2**24 * 9 < 2 ** 28 < INT32_MAX + sum_row_first = _mm_add_epi32(sum_row_2_first, sum_row_3_first); + sum_row_second = _mm_add_epi32(sum_row_2_second, sum_row_3_second); + + // Add chroma values + highbd_read_chroma_dist_row_8(ss_x, u_dist, v_dist, &u_first, &u_second, + &v_first, &v_second); + + // Max value here is 2 ** 24 * (9 + 2), so no saturation is needed + sum_row_first = _mm_add_epi32(sum_row_first, u_first); + sum_row_second = _mm_add_epi32(sum_row_second, u_second); + + sum_row_first = _mm_add_epi32(sum_row_first, v_first); + sum_row_second = _mm_add_epi32(sum_row_second, v_second); + + // Get modifier and store result + highbd_average_8(&sum_row_first, &sum_row_second, &sum_row_first, + &sum_row_second, &mul_first, &mul_second, strength, rounding, + weight); + + highbd_accumulate_and_store_8(sum_row_first, sum_row_second, y_pre, y_count, + y_accum); + + y_src += y_src_stride; + y_pre += y_pre_stride; + y_count += y_pre_stride; + y_accum += y_pre_stride; + y_dist += DIST_STRIDE; + + u_src += uv_src_stride; + u_pre += uv_pre_stride; + u_dist += DIST_STRIDE; + v_src += uv_src_stride; + v_pre += uv_pre_stride; + v_dist += DIST_STRIDE; + + // Then all the rows except the last one + mul_first = _mm_loadu_si128((const __m128i *)neighbors_first[1]); + mul_second = _mm_loadu_si128((const __m128i *)neighbors_second[1]); + + for (h = 1; h < block_height - 1; ++h) { + // Move the weight to bottom half + if (!use_whole_blk && h == block_height / 2) { + weight = bottom_weight; + } + // Shift the rows up + sum_row_1_first = sum_row_2_first; + sum_row_1_second = sum_row_2_second; + sum_row_2_first = sum_row_3_first; + sum_row_2_second = sum_row_3_second; + + // Add luma values to the modifier + sum_row_first = _mm_add_epi32(sum_row_1_first, sum_row_2_first); + sum_row_second = _mm_add_epi32(sum_row_1_second, sum_row_2_second); + + highbd_get_sum_8(y_dist + DIST_STRIDE, &sum_row_3_first, &sum_row_3_second); + + sum_row_first = _mm_add_epi32(sum_row_first, sum_row_3_first); + sum_row_second = _mm_add_epi32(sum_row_second, sum_row_3_second); + + // Add chroma values to the modifier + if (ss_y == 0 || h % 2 == 0) { + // Only calculate the new chroma distortion if we are at a pixel that + // corresponds to a new chroma row + highbd_read_chroma_dist_row_8(ss_x, u_dist, v_dist, &u_first, &u_second, + &v_first, &v_second); + + u_src += uv_src_stride; + u_pre += uv_pre_stride; + u_dist += DIST_STRIDE; + v_src += uv_src_stride; + v_pre += uv_pre_stride; + v_dist += DIST_STRIDE; + } + + sum_row_first = _mm_add_epi32(sum_row_first, u_first); + sum_row_second = _mm_add_epi32(sum_row_second, u_second); + sum_row_first = _mm_add_epi32(sum_row_first, v_first); + sum_row_second = _mm_add_epi32(sum_row_second, v_second); + + // Get modifier and store result + highbd_average_8(&sum_row_first, &sum_row_second, &sum_row_first, + &sum_row_second, &mul_first, &mul_second, strength, + rounding, weight); + highbd_accumulate_and_store_8(sum_row_first, sum_row_second, y_pre, y_count, + y_accum); + + y_src += y_src_stride; + y_pre += y_pre_stride; + y_count += y_pre_stride; + y_accum += y_pre_stride; + y_dist += DIST_STRIDE; + } + + // The last row + mul_first = _mm_loadu_si128((const __m128i *)neighbors_first[0]); + mul_second = _mm_loadu_si128((const __m128i *)neighbors_second[0]); + + // Shift the rows up + sum_row_1_first = sum_row_2_first; + sum_row_1_second = sum_row_2_second; + sum_row_2_first = sum_row_3_first; + sum_row_2_second = sum_row_3_second; + + // Add luma values to the modifier + sum_row_first = _mm_add_epi32(sum_row_1_first, sum_row_2_first); + sum_row_second = _mm_add_epi32(sum_row_1_second, sum_row_2_second); + + // Add chroma values to the modifier + if (ss_y == 0) { + // Only calculate the new chroma distortion if we are at a pixel that + // corresponds to a new chroma row + highbd_read_chroma_dist_row_8(ss_x, u_dist, v_dist, &u_first, &u_second, + &v_first, &v_second); + } + + sum_row_first = _mm_add_epi32(sum_row_first, u_first); + sum_row_second = _mm_add_epi32(sum_row_second, u_second); + sum_row_first = _mm_add_epi32(sum_row_first, v_first); + sum_row_second = _mm_add_epi32(sum_row_second, v_second); + + // Get modifier and store result + highbd_average_8(&sum_row_first, &sum_row_second, &sum_row_first, + &sum_row_second, &mul_first, &mul_second, strength, rounding, + weight); + highbd_accumulate_and_store_8(sum_row_first, sum_row_second, y_pre, y_count, + y_accum); +} + +// Perform temporal filter for the luma component. +static void highbd_apply_temporal_filter_luma( + const uint16_t *y_src, int y_src_stride, const uint16_t *y_pre, + int y_pre_stride, const uint16_t *u_src, const uint16_t *v_src, + int uv_src_stride, const uint16_t *u_pre, const uint16_t *v_pre, + int uv_pre_stride, unsigned int block_width, unsigned int block_height, + int ss_x, int ss_y, int strength, const int *blk_fw, int use_whole_blk, + uint32_t *y_accum, uint16_t *y_count, const uint32_t *y_dist, + const uint32_t *u_dist, const uint32_t *v_dist) { + unsigned int blk_col = 0, uv_blk_col = 0; + const unsigned int blk_col_step = 8, uv_blk_col_step = 8 >> ss_x; + const unsigned int mid_width = block_width >> 1, + last_width = block_width - blk_col_step; + int top_weight = blk_fw[0], + bottom_weight = use_whole_blk ? blk_fw[0] : blk_fw[2]; + const uint32_t *const *neighbors_first; + const uint32_t *const *neighbors_second; + + // Left + neighbors_first = HIGHBD_LUMA_LEFT_COLUMN_NEIGHBORS; + neighbors_second = HIGHBD_LUMA_MIDDLE_COLUMN_NEIGHBORS; + highbd_apply_temporal_filter_luma_8( + y_src + blk_col, y_src_stride, y_pre + blk_col, y_pre_stride, + u_src + uv_blk_col, v_src + uv_blk_col, uv_src_stride, u_pre + uv_blk_col, + v_pre + uv_blk_col, uv_pre_stride, blk_col_step, block_height, ss_x, ss_y, + strength, use_whole_blk, y_accum + blk_col, y_count + blk_col, + y_dist + blk_col, u_dist + uv_blk_col, v_dist + uv_blk_col, + neighbors_first, neighbors_second, top_weight, bottom_weight); + + blk_col += blk_col_step; + uv_blk_col += uv_blk_col_step; + + // Middle First + neighbors_first = HIGHBD_LUMA_MIDDLE_COLUMN_NEIGHBORS; + for (; blk_col < mid_width; + blk_col += blk_col_step, uv_blk_col += uv_blk_col_step) { + highbd_apply_temporal_filter_luma_8( + y_src + blk_col, y_src_stride, y_pre + blk_col, y_pre_stride, + u_src + uv_blk_col, v_src + uv_blk_col, uv_src_stride, + u_pre + uv_blk_col, v_pre + uv_blk_col, uv_pre_stride, blk_col_step, + block_height, ss_x, ss_y, strength, use_whole_blk, y_accum + blk_col, + y_count + blk_col, y_dist + blk_col, u_dist + uv_blk_col, + v_dist + uv_blk_col, neighbors_first, neighbors_second, top_weight, + bottom_weight); + } + + if (!use_whole_blk) { + top_weight = blk_fw[1]; + bottom_weight = blk_fw[3]; + } + + // Middle Second + for (; blk_col < last_width; + blk_col += blk_col_step, uv_blk_col += uv_blk_col_step) { + highbd_apply_temporal_filter_luma_8( + y_src + blk_col, y_src_stride, y_pre + blk_col, y_pre_stride, + u_src + uv_blk_col, v_src + uv_blk_col, uv_src_stride, + u_pre + uv_blk_col, v_pre + uv_blk_col, uv_pre_stride, blk_col_step, + block_height, ss_x, ss_y, strength, use_whole_blk, y_accum + blk_col, + y_count + blk_col, y_dist + blk_col, u_dist + uv_blk_col, + v_dist + uv_blk_col, neighbors_first, neighbors_second, top_weight, + bottom_weight); + } + + // Right + neighbors_second = HIGHBD_LUMA_RIGHT_COLUMN_NEIGHBORS; + highbd_apply_temporal_filter_luma_8( + y_src + blk_col, y_src_stride, y_pre + blk_col, y_pre_stride, + u_src + uv_blk_col, v_src + uv_blk_col, uv_src_stride, u_pre + uv_blk_col, + v_pre + uv_blk_col, uv_pre_stride, blk_col_step, block_height, ss_x, ss_y, + strength, use_whole_blk, y_accum + blk_col, y_count + blk_col, + y_dist + blk_col, u_dist + uv_blk_col, v_dist + uv_blk_col, + neighbors_first, neighbors_second, top_weight, bottom_weight); +} + +// Add a row of luma distortion that corresponds to 8 chroma mods. If we are +// subsampling in x direction, then we have 16 lumas, else we have 8. +static INLINE void highbd_add_luma_dist_to_8_chroma_mod( + const uint32_t *y_dist, int ss_x, int ss_y, __m128i *u_mod_fst, + __m128i *u_mod_snd, __m128i *v_mod_fst, __m128i *v_mod_snd) { + __m128i y_reg_fst, y_reg_snd; + if (!ss_x) { + highbd_read_dist_8(y_dist, &y_reg_fst, &y_reg_snd); + if (ss_y == 1) { + __m128i y_tmp_fst, y_tmp_snd; + highbd_read_dist_8(y_dist + DIST_STRIDE, &y_tmp_fst, &y_tmp_snd); + y_reg_fst = _mm_add_epi32(y_reg_fst, y_tmp_fst); + y_reg_snd = _mm_add_epi32(y_reg_snd, y_tmp_snd); + } + } else { + // Temporary + __m128i y_fst, y_snd; + + // First 8 + highbd_read_dist_8(y_dist, &y_fst, &y_snd); + if (ss_y == 1) { + __m128i y_tmp_fst, y_tmp_snd; + highbd_read_dist_8(y_dist + DIST_STRIDE, &y_tmp_fst, &y_tmp_snd); + + y_fst = _mm_add_epi32(y_fst, y_tmp_fst); + y_snd = _mm_add_epi32(y_snd, y_tmp_snd); + } + + y_reg_fst = _mm_hadd_epi32(y_fst, y_snd); + + // Second 8 + highbd_read_dist_8(y_dist + 8, &y_fst, &y_snd); + if (ss_y == 1) { + __m128i y_tmp_fst, y_tmp_snd; + highbd_read_dist_8(y_dist + 8 + DIST_STRIDE, &y_tmp_fst, &y_tmp_snd); + + y_fst = _mm_add_epi32(y_fst, y_tmp_fst); + y_snd = _mm_add_epi32(y_snd, y_tmp_snd); + } + + y_reg_snd = _mm_hadd_epi32(y_fst, y_snd); + } + + *u_mod_fst = _mm_add_epi32(*u_mod_fst, y_reg_fst); + *u_mod_snd = _mm_add_epi32(*u_mod_snd, y_reg_snd); + *v_mod_fst = _mm_add_epi32(*v_mod_fst, y_reg_fst); + *v_mod_snd = _mm_add_epi32(*v_mod_snd, y_reg_snd); +} + +// Apply temporal filter to the chroma components. This performs temporal +// filtering on a chroma block of 8 X uv_height. If blk_fw is not NULL, use +// blk_fw as an array of size 4 for the weights for each of the 4 subblocks, +// else use top_weight for top half, and bottom weight for bottom half. +static void highbd_apply_temporal_filter_chroma_8( + const uint16_t *y_src, int y_src_stride, const uint16_t *y_pre, + int y_pre_stride, const uint16_t *u_src, const uint16_t *v_src, + int uv_src_stride, const uint16_t *u_pre, const uint16_t *v_pre, + int uv_pre_stride, unsigned int uv_block_width, + unsigned int uv_block_height, int ss_x, int ss_y, int strength, + uint32_t *u_accum, uint16_t *u_count, uint32_t *v_accum, uint16_t *v_count, + const uint32_t *y_dist, const uint32_t *u_dist, const uint32_t *v_dist, + const uint32_t *const *neighbors_fst, const uint32_t *const *neighbors_snd, + int top_weight, int bottom_weight, const int *blk_fw) { + const int rounding = (1 << strength) >> 1; + int weight = top_weight; + + __m128i mul_fst, mul_snd; + + __m128i u_sum_row_1_fst, u_sum_row_2_fst, u_sum_row_3_fst; + __m128i v_sum_row_1_fst, v_sum_row_2_fst, v_sum_row_3_fst; + __m128i u_sum_row_1_snd, u_sum_row_2_snd, u_sum_row_3_snd; + __m128i v_sum_row_1_snd, v_sum_row_2_snd, v_sum_row_3_snd; + + __m128i u_sum_row_fst, v_sum_row_fst; + __m128i u_sum_row_snd, v_sum_row_snd; + + // Loop variable + unsigned int h; + + (void)uv_block_width; + + // First row + mul_fst = _mm_loadu_si128((const __m128i *)neighbors_fst[0]); + mul_snd = _mm_loadu_si128((const __m128i *)neighbors_snd[0]); + + // Add chroma values + highbd_get_sum_8(u_dist, &u_sum_row_2_fst, &u_sum_row_2_snd); + highbd_get_sum_8(u_dist + DIST_STRIDE, &u_sum_row_3_fst, &u_sum_row_3_snd); + + u_sum_row_fst = _mm_add_epi32(u_sum_row_2_fst, u_sum_row_3_fst); + u_sum_row_snd = _mm_add_epi32(u_sum_row_2_snd, u_sum_row_3_snd); + + highbd_get_sum_8(v_dist, &v_sum_row_2_fst, &v_sum_row_2_snd); + highbd_get_sum_8(v_dist + DIST_STRIDE, &v_sum_row_3_fst, &v_sum_row_3_snd); + + v_sum_row_fst = _mm_add_epi32(v_sum_row_2_fst, v_sum_row_3_fst); + v_sum_row_snd = _mm_add_epi32(v_sum_row_2_snd, v_sum_row_3_snd); + + // Add luma values + highbd_add_luma_dist_to_8_chroma_mod(y_dist, ss_x, ss_y, &u_sum_row_fst, + &u_sum_row_snd, &v_sum_row_fst, + &v_sum_row_snd); + + // Get modifier and store result + if (blk_fw) { + highbd_average_4(&u_sum_row_fst, &u_sum_row_fst, &mul_fst, strength, + rounding, blk_fw[0]); + highbd_average_4(&u_sum_row_snd, &u_sum_row_snd, &mul_snd, strength, + rounding, blk_fw[1]); + + highbd_average_4(&v_sum_row_fst, &v_sum_row_fst, &mul_fst, strength, + rounding, blk_fw[0]); + highbd_average_4(&v_sum_row_snd, &v_sum_row_snd, &mul_snd, strength, + rounding, blk_fw[1]); + + } else { + highbd_average_8(&u_sum_row_fst, &u_sum_row_snd, &u_sum_row_fst, + &u_sum_row_snd, &mul_fst, &mul_snd, strength, rounding, + weight); + highbd_average_8(&v_sum_row_fst, &v_sum_row_snd, &v_sum_row_fst, + &v_sum_row_snd, &mul_fst, &mul_snd, strength, rounding, + weight); + } + highbd_accumulate_and_store_8(u_sum_row_fst, u_sum_row_snd, u_pre, u_count, + u_accum); + highbd_accumulate_and_store_8(v_sum_row_fst, v_sum_row_snd, v_pre, v_count, + v_accum); + + u_src += uv_src_stride; + u_pre += uv_pre_stride; + u_dist += DIST_STRIDE; + v_src += uv_src_stride; + v_pre += uv_pre_stride; + v_dist += DIST_STRIDE; + u_count += uv_pre_stride; + u_accum += uv_pre_stride; + v_count += uv_pre_stride; + v_accum += uv_pre_stride; + + y_src += y_src_stride * (1 + ss_y); + y_pre += y_pre_stride * (1 + ss_y); + y_dist += DIST_STRIDE * (1 + ss_y); + + // Then all the rows except the last one + mul_fst = _mm_loadu_si128((const __m128i *)neighbors_fst[1]); + mul_snd = _mm_loadu_si128((const __m128i *)neighbors_snd[1]); + + for (h = 1; h < uv_block_height - 1; ++h) { + // Move the weight pointer to the bottom half of the blocks + if (h == uv_block_height / 2) { + if (blk_fw) { + blk_fw += 2; + } else { + weight = bottom_weight; + } + } + + // Shift the rows up + u_sum_row_1_fst = u_sum_row_2_fst; + u_sum_row_2_fst = u_sum_row_3_fst; + u_sum_row_1_snd = u_sum_row_2_snd; + u_sum_row_2_snd = u_sum_row_3_snd; + + v_sum_row_1_fst = v_sum_row_2_fst; + v_sum_row_2_fst = v_sum_row_3_fst; + v_sum_row_1_snd = v_sum_row_2_snd; + v_sum_row_2_snd = v_sum_row_3_snd; + + // Add chroma values + u_sum_row_fst = _mm_add_epi32(u_sum_row_1_fst, u_sum_row_2_fst); + u_sum_row_snd = _mm_add_epi32(u_sum_row_1_snd, u_sum_row_2_snd); + highbd_get_sum_8(u_dist + DIST_STRIDE, &u_sum_row_3_fst, &u_sum_row_3_snd); + u_sum_row_fst = _mm_add_epi32(u_sum_row_fst, u_sum_row_3_fst); + u_sum_row_snd = _mm_add_epi32(u_sum_row_snd, u_sum_row_3_snd); + + v_sum_row_fst = _mm_add_epi32(v_sum_row_1_fst, v_sum_row_2_fst); + v_sum_row_snd = _mm_add_epi32(v_sum_row_1_snd, v_sum_row_2_snd); + highbd_get_sum_8(v_dist + DIST_STRIDE, &v_sum_row_3_fst, &v_sum_row_3_snd); + v_sum_row_fst = _mm_add_epi32(v_sum_row_fst, v_sum_row_3_fst); + v_sum_row_snd = _mm_add_epi32(v_sum_row_snd, v_sum_row_3_snd); + + // Add luma values + highbd_add_luma_dist_to_8_chroma_mod(y_dist, ss_x, ss_y, &u_sum_row_fst, + &u_sum_row_snd, &v_sum_row_fst, + &v_sum_row_snd); + + // Get modifier and store result + if (blk_fw) { + highbd_average_4(&u_sum_row_fst, &u_sum_row_fst, &mul_fst, strength, + rounding, blk_fw[0]); + highbd_average_4(&u_sum_row_snd, &u_sum_row_snd, &mul_snd, strength, + rounding, blk_fw[1]); + + highbd_average_4(&v_sum_row_fst, &v_sum_row_fst, &mul_fst, strength, + rounding, blk_fw[0]); + highbd_average_4(&v_sum_row_snd, &v_sum_row_snd, &mul_snd, strength, + rounding, blk_fw[1]); + + } else { + highbd_average_8(&u_sum_row_fst, &u_sum_row_snd, &u_sum_row_fst, + &u_sum_row_snd, &mul_fst, &mul_snd, strength, rounding, + weight); + highbd_average_8(&v_sum_row_fst, &v_sum_row_snd, &v_sum_row_fst, + &v_sum_row_snd, &mul_fst, &mul_snd, strength, rounding, + weight); + } + + highbd_accumulate_and_store_8(u_sum_row_fst, u_sum_row_snd, u_pre, u_count, + u_accum); + highbd_accumulate_and_store_8(v_sum_row_fst, v_sum_row_snd, v_pre, v_count, + v_accum); + + u_src += uv_src_stride; + u_pre += uv_pre_stride; + u_dist += DIST_STRIDE; + v_src += uv_src_stride; + v_pre += uv_pre_stride; + v_dist += DIST_STRIDE; + u_count += uv_pre_stride; + u_accum += uv_pre_stride; + v_count += uv_pre_stride; + v_accum += uv_pre_stride; + + y_src += y_src_stride * (1 + ss_y); + y_pre += y_pre_stride * (1 + ss_y); + y_dist += DIST_STRIDE * (1 + ss_y); + } + + // The last row + mul_fst = _mm_loadu_si128((const __m128i *)neighbors_fst[0]); + mul_snd = _mm_loadu_si128((const __m128i *)neighbors_snd[0]); + + // Shift the rows up + u_sum_row_1_fst = u_sum_row_2_fst; + u_sum_row_2_fst = u_sum_row_3_fst; + u_sum_row_1_snd = u_sum_row_2_snd; + u_sum_row_2_snd = u_sum_row_3_snd; + + v_sum_row_1_fst = v_sum_row_2_fst; + v_sum_row_2_fst = v_sum_row_3_fst; + v_sum_row_1_snd = v_sum_row_2_snd; + v_sum_row_2_snd = v_sum_row_3_snd; + + // Add chroma values + u_sum_row_fst = _mm_add_epi32(u_sum_row_1_fst, u_sum_row_2_fst); + v_sum_row_fst = _mm_add_epi32(v_sum_row_1_fst, v_sum_row_2_fst); + u_sum_row_snd = _mm_add_epi32(u_sum_row_1_snd, u_sum_row_2_snd); + v_sum_row_snd = _mm_add_epi32(v_sum_row_1_snd, v_sum_row_2_snd); + + // Add luma values + highbd_add_luma_dist_to_8_chroma_mod(y_dist, ss_x, ss_y, &u_sum_row_fst, + &u_sum_row_snd, &v_sum_row_fst, + &v_sum_row_snd); + + // Get modifier and store result + if (blk_fw) { + highbd_average_4(&u_sum_row_fst, &u_sum_row_fst, &mul_fst, strength, + rounding, blk_fw[0]); + highbd_average_4(&u_sum_row_snd, &u_sum_row_snd, &mul_snd, strength, + rounding, blk_fw[1]); + + highbd_average_4(&v_sum_row_fst, &v_sum_row_fst, &mul_fst, strength, + rounding, blk_fw[0]); + highbd_average_4(&v_sum_row_snd, &v_sum_row_snd, &mul_snd, strength, + rounding, blk_fw[1]); + + } else { + highbd_average_8(&u_sum_row_fst, &u_sum_row_snd, &u_sum_row_fst, + &u_sum_row_snd, &mul_fst, &mul_snd, strength, rounding, + weight); + highbd_average_8(&v_sum_row_fst, &v_sum_row_snd, &v_sum_row_fst, + &v_sum_row_snd, &mul_fst, &mul_snd, strength, rounding, + weight); + } + + highbd_accumulate_and_store_8(u_sum_row_fst, u_sum_row_snd, u_pre, u_count, + u_accum); + highbd_accumulate_and_store_8(v_sum_row_fst, v_sum_row_snd, v_pre, v_count, + v_accum); +} + +// Perform temporal filter for the chroma components. +static void highbd_apply_temporal_filter_chroma( + const uint16_t *y_src, int y_src_stride, const uint16_t *y_pre, + int y_pre_stride, const uint16_t *u_src, const uint16_t *v_src, + int uv_src_stride, const uint16_t *u_pre, const uint16_t *v_pre, + int uv_pre_stride, unsigned int block_width, unsigned int block_height, + int ss_x, int ss_y, int strength, const int *blk_fw, int use_whole_blk, + uint32_t *u_accum, uint16_t *u_count, uint32_t *v_accum, uint16_t *v_count, + const uint32_t *y_dist, const uint32_t *u_dist, const uint32_t *v_dist) { + const unsigned int uv_width = block_width >> ss_x, + uv_height = block_height >> ss_y; + + unsigned int blk_col = 0, uv_blk_col = 0; + const unsigned int uv_blk_col_step = 8, blk_col_step = 8 << ss_x; + const unsigned int uv_mid_width = uv_width >> 1, + uv_last_width = uv_width - uv_blk_col_step; + int top_weight = blk_fw[0], + bottom_weight = use_whole_blk ? blk_fw[0] : blk_fw[2]; + const uint32_t *const *neighbors_fst; + const uint32_t *const *neighbors_snd; + + if (uv_width == 8) { + // Special Case: We are subsampling in x direction on a 16x16 block. Since + // we are operating on a row of 8 chroma pixels, we can't use the usual + // left-middle-right pattern. + assert(ss_x); + + if (ss_y) { + neighbors_fst = HIGHBD_CHROMA_DOUBLE_SS_LEFT_COLUMN_NEIGHBORS; + neighbors_snd = HIGHBD_CHROMA_DOUBLE_SS_RIGHT_COLUMN_NEIGHBORS; + } else { + neighbors_fst = HIGHBD_CHROMA_SINGLE_SS_LEFT_COLUMN_NEIGHBORS; + neighbors_snd = HIGHBD_CHROMA_SINGLE_SS_RIGHT_COLUMN_NEIGHBORS; + } + + if (use_whole_blk) { + highbd_apply_temporal_filter_chroma_8( + y_src + blk_col, y_src_stride, y_pre + blk_col, y_pre_stride, + u_src + uv_blk_col, v_src + uv_blk_col, uv_src_stride, + u_pre + uv_blk_col, v_pre + uv_blk_col, uv_pre_stride, uv_width, + uv_height, ss_x, ss_y, strength, u_accum + uv_blk_col, + u_count + uv_blk_col, v_accum + uv_blk_col, v_count + uv_blk_col, + y_dist + blk_col, u_dist + uv_blk_col, v_dist + uv_blk_col, + neighbors_fst, neighbors_snd, top_weight, bottom_weight, NULL); + } else { + highbd_apply_temporal_filter_chroma_8( + y_src + blk_col, y_src_stride, y_pre + blk_col, y_pre_stride, + u_src + uv_blk_col, v_src + uv_blk_col, uv_src_stride, + u_pre + uv_blk_col, v_pre + uv_blk_col, uv_pre_stride, uv_width, + uv_height, ss_x, ss_y, strength, u_accum + uv_blk_col, + u_count + uv_blk_col, v_accum + uv_blk_col, v_count + uv_blk_col, + y_dist + blk_col, u_dist + uv_blk_col, v_dist + uv_blk_col, + neighbors_fst, neighbors_snd, 0, 0, blk_fw); + } + + return; + } + + // Left + if (ss_x && ss_y) { + neighbors_fst = HIGHBD_CHROMA_DOUBLE_SS_LEFT_COLUMN_NEIGHBORS; + neighbors_snd = HIGHBD_CHROMA_DOUBLE_SS_MIDDLE_COLUMN_NEIGHBORS; + } else if (ss_x || ss_y) { + neighbors_fst = HIGHBD_CHROMA_SINGLE_SS_LEFT_COLUMN_NEIGHBORS; + neighbors_snd = HIGHBD_CHROMA_SINGLE_SS_MIDDLE_COLUMN_NEIGHBORS; + } else { + neighbors_fst = HIGHBD_CHROMA_NO_SS_LEFT_COLUMN_NEIGHBORS; + neighbors_snd = HIGHBD_CHROMA_NO_SS_MIDDLE_COLUMN_NEIGHBORS; + } + + highbd_apply_temporal_filter_chroma_8( + y_src + blk_col, y_src_stride, y_pre + blk_col, y_pre_stride, + u_src + uv_blk_col, v_src + uv_blk_col, uv_src_stride, u_pre + uv_blk_col, + v_pre + uv_blk_col, uv_pre_stride, uv_width, uv_height, ss_x, ss_y, + strength, u_accum + uv_blk_col, u_count + uv_blk_col, + v_accum + uv_blk_col, v_count + uv_blk_col, y_dist + blk_col, + u_dist + uv_blk_col, v_dist + uv_blk_col, neighbors_fst, neighbors_snd, + top_weight, bottom_weight, NULL); + + blk_col += blk_col_step; + uv_blk_col += uv_blk_col_step; + + // Middle First + if (ss_x && ss_y) { + neighbors_fst = HIGHBD_CHROMA_DOUBLE_SS_MIDDLE_COLUMN_NEIGHBORS; + } else if (ss_x || ss_y) { + neighbors_fst = HIGHBD_CHROMA_SINGLE_SS_MIDDLE_COLUMN_NEIGHBORS; + } else { + neighbors_fst = HIGHBD_CHROMA_NO_SS_MIDDLE_COLUMN_NEIGHBORS; + } + + for (; uv_blk_col < uv_mid_width; + blk_col += blk_col_step, uv_blk_col += uv_blk_col_step) { + highbd_apply_temporal_filter_chroma_8( + y_src + blk_col, y_src_stride, y_pre + blk_col, y_pre_stride, + u_src + uv_blk_col, v_src + uv_blk_col, uv_src_stride, + u_pre + uv_blk_col, v_pre + uv_blk_col, uv_pre_stride, uv_width, + uv_height, ss_x, ss_y, strength, u_accum + uv_blk_col, + u_count + uv_blk_col, v_accum + uv_blk_col, v_count + uv_blk_col, + y_dist + blk_col, u_dist + uv_blk_col, v_dist + uv_blk_col, + neighbors_fst, neighbors_snd, top_weight, bottom_weight, NULL); + } + + if (!use_whole_blk) { + top_weight = blk_fw[1]; + bottom_weight = blk_fw[3]; + } + + // Middle Second + for (; uv_blk_col < uv_last_width; + blk_col += blk_col_step, uv_blk_col += uv_blk_col_step) { + highbd_apply_temporal_filter_chroma_8( + y_src + blk_col, y_src_stride, y_pre + blk_col, y_pre_stride, + u_src + uv_blk_col, v_src + uv_blk_col, uv_src_stride, + u_pre + uv_blk_col, v_pre + uv_blk_col, uv_pre_stride, uv_width, + uv_height, ss_x, ss_y, strength, u_accum + uv_blk_col, + u_count + uv_blk_col, v_accum + uv_blk_col, v_count + uv_blk_col, + y_dist + blk_col, u_dist + uv_blk_col, v_dist + uv_blk_col, + neighbors_fst, neighbors_snd, top_weight, bottom_weight, NULL); + } + + // Right + if (ss_x && ss_y) { + neighbors_snd = HIGHBD_CHROMA_DOUBLE_SS_RIGHT_COLUMN_NEIGHBORS; + } else if (ss_x || ss_y) { + neighbors_snd = HIGHBD_CHROMA_SINGLE_SS_RIGHT_COLUMN_NEIGHBORS; + } else { + neighbors_snd = HIGHBD_CHROMA_NO_SS_RIGHT_COLUMN_NEIGHBORS; + } + + highbd_apply_temporal_filter_chroma_8( + y_src + blk_col, y_src_stride, y_pre + blk_col, y_pre_stride, + u_src + uv_blk_col, v_src + uv_blk_col, uv_src_stride, u_pre + uv_blk_col, + v_pre + uv_blk_col, uv_pre_stride, uv_width, uv_height, ss_x, ss_y, + strength, u_accum + uv_blk_col, u_count + uv_blk_col, + v_accum + uv_blk_col, v_count + uv_blk_col, y_dist + blk_col, + u_dist + uv_blk_col, v_dist + uv_blk_col, neighbors_fst, neighbors_snd, + top_weight, bottom_weight, NULL); +} + +static void highbd_apply_temporal_filter_yuv( + const YV12_BUFFER_CONFIG *ref_frame, const MACROBLOCKD *mbd, + const BLOCK_SIZE block_size, const int mb_row, const int mb_col, + const int strength, const int use_subblock, + const int *subblock_filter_weights, const uint8_t *pred, uint32_t *accum, + uint16_t *count) { + const int use_whole_blk = !use_subblock; + const int *blk_fw = subblock_filter_weights; + + // Block information (Y-plane). + const unsigned int block_height = block_size_high[block_size]; + const unsigned int block_width = block_size_wide[block_size]; + const int mb_pels = block_height * block_width; + const int y_src_stride = ref_frame->y_stride; + const int y_pre_stride = block_width; + const int mb_y_src_offset = + mb_row * block_height * ref_frame->y_stride + mb_col * block_width; + + // Block information (UV-plane). + const int ss_y = mbd->plane[1].subsampling_y; + const int ss_x = mbd->plane[1].subsampling_x; + const unsigned int uv_height = block_height >> ss_y; + const unsigned int uv_width = block_width >> ss_x; + const int uv_src_stride = ref_frame->uv_stride; + const int uv_pre_stride = block_width >> ss_x; + const int mb_uv_src_offset = + mb_row * uv_height * ref_frame->uv_stride + mb_col * uv_width; + + const uint8_t *y_src = ref_frame->y_buffer + mb_y_src_offset; + const uint8_t *u_src = ref_frame->u_buffer + mb_uv_src_offset; + const uint8_t *v_src = ref_frame->v_buffer + mb_uv_src_offset; + const uint8_t *y_pre = pred; + const uint8_t *u_pre = pred + mb_pels; + const uint8_t *v_pre = pred + mb_pels * 2; + uint32_t *y_accum = accum; + uint32_t *u_accum = accum + mb_pels; + uint32_t *v_accum = accum + mb_pels * 2; + uint16_t *y_count = count; + uint16_t *u_count = count + mb_pels; + uint16_t *v_count = count + mb_pels * 2; + + const unsigned int chroma_height = block_height >> ss_y, + chroma_width = block_width >> ss_x; + + DECLARE_ALIGNED(16, uint32_t, y_dist[BH * DIST_STRIDE]) = { 0 }; + DECLARE_ALIGNED(16, uint32_t, u_dist[BH * DIST_STRIDE]) = { 0 }; + DECLARE_ALIGNED(16, uint32_t, v_dist[BH * DIST_STRIDE]) = { 0 }; + + uint32_t *y_dist_ptr = y_dist + 1, *u_dist_ptr = u_dist + 1, + *v_dist_ptr = v_dist + 1; + const uint16_t *y_src_ptr = CONVERT_TO_SHORTPTR(y_src), + *u_src_ptr = CONVERT_TO_SHORTPTR(u_src), + *v_src_ptr = CONVERT_TO_SHORTPTR(v_src); + const uint16_t *y_pre_ptr = CONVERT_TO_SHORTPTR(y_pre), + *u_pre_ptr = CONVERT_TO_SHORTPTR(u_pre), + *v_pre_ptr = CONVERT_TO_SHORTPTR(v_pre); + + // Loop variables + unsigned int row, blk_col; + + assert(block_width <= BW && "block width too large"); + assert(block_height <= BH && "block height too large"); + assert(block_width % 16 == 0 && "block width must be multiple of 16"); + assert(block_height % 2 == 0 && "block height must be even"); + assert((ss_x == 0 || ss_x == 1) && (ss_y == 0 || ss_y == 1) && + "invalid chroma subsampling"); + assert(strength >= 0 && strength <= 14 && + "invalid adjusted temporal filter strength"); + assert(blk_fw[0] >= 0 && "filter weight must be positive"); + assert( + (use_whole_blk || (blk_fw[1] >= 0 && blk_fw[2] >= 0 && blk_fw[3] >= 0)) && + "subblock filter weight must be positive"); + assert(blk_fw[0] <= 2 && "sublock filter weight must be less than 2"); + assert( + (use_whole_blk || (blk_fw[1] <= 2 && blk_fw[2] <= 2 && blk_fw[3] <= 2)) && + "subblock filter weight must be less than 2"); + + // Precompute the difference squared + for (row = 0; row < block_height; row++) { + for (blk_col = 0; blk_col < block_width; blk_col += 8) { + highbd_store_dist_8(y_src_ptr + blk_col, y_pre_ptr + blk_col, + y_dist_ptr + blk_col); + } + y_src_ptr += y_src_stride; + y_pre_ptr += y_pre_stride; + y_dist_ptr += DIST_STRIDE; + } + + for (row = 0; row < chroma_height; row++) { + for (blk_col = 0; blk_col < chroma_width; blk_col += 8) { + highbd_store_dist_8(u_src_ptr + blk_col, u_pre_ptr + blk_col, + u_dist_ptr + blk_col); + highbd_store_dist_8(v_src_ptr + blk_col, v_pre_ptr + blk_col, + v_dist_ptr + blk_col); + } + + u_src_ptr += uv_src_stride; + u_pre_ptr += uv_pre_stride; + u_dist_ptr += DIST_STRIDE; + v_src_ptr += uv_src_stride; + v_pre_ptr += uv_pre_stride; + v_dist_ptr += DIST_STRIDE; + } + + y_src_ptr = CONVERT_TO_SHORTPTR(y_src), + u_src_ptr = CONVERT_TO_SHORTPTR(u_src), + v_src_ptr = CONVERT_TO_SHORTPTR(v_src); + y_pre_ptr = CONVERT_TO_SHORTPTR(y_pre), + u_pre_ptr = CONVERT_TO_SHORTPTR(u_pre), + v_pre_ptr = CONVERT_TO_SHORTPTR(v_pre); + + y_dist_ptr = y_dist + 1; + u_dist_ptr = u_dist + 1; + v_dist_ptr = v_dist + 1; + + highbd_apply_temporal_filter_luma( + y_src_ptr, y_src_stride, y_pre_ptr, y_pre_stride, u_src_ptr, v_src_ptr, + uv_src_stride, u_pre_ptr, v_pre_ptr, uv_pre_stride, block_width, + block_height, ss_x, ss_y, strength, blk_fw, use_whole_blk, y_accum, + y_count, y_dist_ptr, u_dist_ptr, v_dist_ptr); + + highbd_apply_temporal_filter_chroma( + y_src_ptr, y_src_stride, y_pre_ptr, y_pre_stride, u_src_ptr, v_src_ptr, + uv_src_stride, u_pre_ptr, v_pre_ptr, uv_pre_stride, block_width, + block_height, ss_x, ss_y, strength, blk_fw, use_whole_blk, u_accum, + u_count, v_accum, v_count, y_dist_ptr, u_dist_ptr, v_dist_ptr); +} + +///////////////////////// +// High bit-depth Ends // +///////////////////////// + +void av1_apply_temporal_filter_yuv_sse4_1( + const YV12_BUFFER_CONFIG *ref_frame, const MACROBLOCKD *mbd, + const BLOCK_SIZE block_size, const int mb_row, const int mb_col, + const int num_planes, const int strength, const int use_subblock, + const int *subblock_filter_weights, const uint8_t *pred, uint32_t *accum, + uint16_t *count) { + const int is_high_bitdepth = ref_frame->flags & YV12_FLAG_HIGHBITDEPTH; + // TODO(any): Need to support when `num_planes != 3`, like C implementation. + assert(num_planes == 3); + (void)num_planes; + if (is_high_bitdepth) { + highbd_apply_temporal_filter_yuv( + ref_frame, mbd, block_size, mb_row, mb_col, strength, use_subblock, + subblock_filter_weights, pred, accum, count); + } else { + apply_temporal_filter_yuv(ref_frame, mbd, block_size, mb_row, mb_col, + strength, use_subblock, subblock_filter_weights, + pred, accum, count); + } +}
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/temporal_filter_sse4.c
985
986
987
988
989
990
991
992
993
994
u_dist_ptr += DIST_STRIDE; v_src_ptr += uv_src_stride; v_pre_ptr += uv_pre_stride; v_dist_ptr += DIST_STRIDE; } y_dist_ptr = y_dist + 1; u_dist_ptr = u_dist + 1; v_dist_ptr = v_dist + 1;
+ show +
995
996
997
998
999
1000
1001
av1_apply_temporal_filter_luma( y_src, y_src_stride, y_pre, y_pre_stride, u_src, v_src, uv_src_stride, u_pre, v_pre, uv_pre_stride, block_width, block_height, ss_x, ss_y, strength, blk_fw_ptr, use_whole_blk, y_accum, y_count, y_dist_ptr, u_dist_ptr, v_dist_ptr); av1_apply_temporal_filter_chroma(
+ show +
1002
1003
1004
1005
1006
y_src, y_src_stride, y_pre, y_pre_stride, u_src, v_src, uv_src_stride, u_pre, v_pre, uv_pre_stride, block_width, block_height, ss_x, ss_y, strength, blk_fw_ptr, use_whole_blk, u_accum, u_count, v_accum, v_count, y_dist_ptr, u_dist_ptr, v_dist_ptr); }

[CVE-2020-0478_1.diff] highbd_fwd_txfm_sse4.c #4
- av1_fdct32_new_sse4_1, // DCT_DCT - NULL, // ADST_DCT - NULL, // DCT_ADST - NULL, // ADST_ADST - NULL, // FLIPADST_DCT - NULL, // DCT_FLIPADST - NULL, // FLIPADST_FLIPADST - NULL, // ADST_FLIPADST - NULL, // FLIPADST_ADST - av1_idtx32_new_sse4_1, // IDTX - NULL, // V_DCT - NULL, // H_DCT - NULL, // V_ADST - NULL, // H_ADST - NULL, // V_FLIPADST - NULL // H_FLIPADST + av1_fdct32_sse4_1, // DCT_DCT + NULL, // ADST_DCT + NULL, // DCT_ADST + NULL, // ADST_ADST + NULL, // FLIPADST_DCT + NULL, // DCT_FLIPADST + NULL, // FLIPADST_FLIPADST + NULL, // ADST_FLIPADST + NULL, // FLIPADST_ADST + av1_idtx32_sse4_1, // IDTX + NULL, // V_DCT + NULL, // H_DCT + NULL, // V_ADST + NULL, // H_ADST + NULL, // V_FLIPADST + NULL // H_FLIPADST
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/highbd_fwd_txfm_sse4.c
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
idtx4x4_sse4_1, // IDTX fdct4x4_sse4_1, // V_DCT idtx4x4_sse4_1, // H_DCT fadst4x4_sse4_1, // V_ADST idtx4x4_sse4_1, // H_ADST fadst4x4_sse4_1, // V_FLIPADST idtx4x4_sse4_1 // H_FLIPADST }; static const fwd_transform_1d_sse4_1 col_highbd_txfm8x32_arr[TX_TYPES] = {
+ show +
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
av1_fdct32_new_sse4_1, // DCT_DCT NULL, // ADST_DCT NULL, // DCT_ADST NULL, // ADST_ADST NULL, // FLIPADST_DCT NULL, // DCT_FLIPADST NULL, // FLIPADST_FLIPADST NULL, // ADST_FLIPADST NULL, // FLIPADST_ADST av1_idtx32_new_sse4_1, // IDTX NULL, // V_DCT NULL, // H_DCT NULL, // V_ADST NULL, // H_ADST NULL, // V_FLIPADST NULL // H_FLIPADST
+ show +
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
}; static const fwd_transform_1d_sse4_1 row_highbd_txfm8x32_arr[TX_TYPES] = { fdct16x16_sse4_1, // DCT_DCT NULL, // ADST_DCT NULL, // DCT_ADST NULL, // ADST_ADST NULL, // FLIPADST_DCT NULL, // DCT_FLIPADST NULL, // FLIPADST_FLIPADST

[CVE-2020-0470_1.diff] highbd_fwd_txfm_sse4.c #4
- av1_fdct32_new_sse4_1, // DCT_DCT - NULL, // ADST_DCT - NULL, // DCT_ADST - NULL, // ADST_ADST - NULL, // FLIPADST_DCT - NULL, // DCT_FLIPADST - NULL, // FLIPADST_FLIPADST - NULL, // ADST_FLIPADST - NULL, // FLIPADST_ADST - av1_idtx32_new_sse4_1, // IDTX - NULL, // V_DCT - NULL, // H_DCT - NULL, // V_ADST - NULL, // H_ADST - NULL, // V_FLIPADST - NULL // H_FLIPADST + av1_fdct32_sse4_1, // DCT_DCT + NULL, // ADST_DCT + NULL, // DCT_ADST + NULL, // ADST_ADST + NULL, // FLIPADST_DCT + NULL, // DCT_FLIPADST + NULL, // FLIPADST_FLIPADST + NULL, // ADST_FLIPADST + NULL, // FLIPADST_ADST + av1_idtx32_sse4_1, // IDTX + NULL, // V_DCT + NULL, // H_DCT + NULL, // V_ADST + NULL, // H_ADST + NULL, // V_FLIPADST + NULL // H_FLIPADST
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/highbd_fwd_txfm_sse4.c
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
idtx4x4_sse4_1, // IDTX fdct4x4_sse4_1, // V_DCT idtx4x4_sse4_1, // H_DCT fadst4x4_sse4_1, // V_ADST idtx4x4_sse4_1, // H_ADST fadst4x4_sse4_1, // V_FLIPADST idtx4x4_sse4_1 // H_FLIPADST }; static const fwd_transform_1d_sse4_1 col_highbd_txfm8x32_arr[TX_TYPES] = {
+ show +
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
av1_fdct32_new_sse4_1, // DCT_DCT NULL, // ADST_DCT NULL, // DCT_ADST NULL, // ADST_ADST NULL, // FLIPADST_DCT NULL, // DCT_FLIPADST NULL, // FLIPADST_FLIPADST NULL, // ADST_FLIPADST NULL, // FLIPADST_ADST av1_idtx32_new_sse4_1, // IDTX NULL, // V_DCT NULL, // H_DCT NULL, // V_ADST NULL, // H_ADST NULL, // V_FLIPADST NULL // H_FLIPADST
+ show +
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
}; static const fwd_transform_1d_sse4_1 row_highbd_txfm8x32_arr[TX_TYPES] = { fdct16x16_sse4_1, // DCT_DCT NULL, // ADST_DCT NULL, // DCT_ADST NULL, // ADST_ADST NULL, // FLIPADST_DCT NULL, // DCT_FLIPADST NULL, // FLIPADST_FLIPADST

[CVE-2020-0478_1.diff] highbd_fwd_txfm_avx2.c #3
- av1_load_buffer_8x8_avx2(topL, out, stride, flipud, fliplr, shift); - av1_load_buffer_8x8_avx2(botL, out + 8, stride, flipud, fliplr, shift); + load_buffer_8x8_avx2(topL, out, stride, flipud, fliplr, shift); + load_buffer_8x8_avx2(botL, out + 8, stride, flipud, fliplr, shift); -static INLINE void av1_load_buffer_16xn_avx2(const int16_t *input, __m256i *out, - int stride, int height, - int outstride, int flipud, - int fliplr) { +static INLINE void load_buffer_16xn_avx2(const int16_t *input, __m256i *out, + int stride, int height, int outstride, + int flipud, int fliplr) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/highbd_fwd_txfm_avx2.c
100
101
102
103
104
105
106
107
108
109
const int16_t *topL = input; const int16_t *botL = input + 8 * stride; const int16_t *tmp; if (flipud) { tmp = topL; topL = botL; botL = tmp; }
+ show +
110
111
112
113
114
115
116
av1_load_buffer_8x8_avx2(topL, out, stride, flipud, fliplr, shift); av1_load_buffer_8x8_avx2(botL, out + 8, stride, flipud, fliplr, shift); } static INLINE void av1_load_buffer_16xn_avx2(const int16_t *input, __m256i *out, int stride, int height, int outstride, int flipud, int fliplr) {
+ show +
117
118
119
120
121
122
123
124
125
126
__m256i out1[64]; if (!flipud) { for (int i = 0; i < height; i++) { out1[i] = _mm256_loadu_si256((const __m256i *)(input + i * stride)); } } else { for (int i = 0; i < height; i++) { out1[(height - 1) - i] = _mm256_loadu_si256((const __m256i *)(input + i * stride)); }

[CVE-2020-0478_1.diff] highbd_fwd_txfm_avx2.c #20
-static INLINE void av1_fdct64_stage3_avx2(__m256i *x2, __m256i *x3, - __m256i *cospi_m32, - __m256i *cospi_p32, - const __m256i *__rounding, - int8_t cos_bit) { +static INLINE void fdct64_stage3_avx2(__m256i *x2, __m256i *x3, + __m256i *cospi_m32, __m256i *cospi_p32, + const __m256i *__rounding, + int8_t cos_bit) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/highbd_fwd_txfm_avx2.c
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
*__rounding, cos_bit); x2[56] = x1[56]; x2[57] = x1[57]; x2[58] = x1[58]; x2[59] = x1[59]; x2[60] = x1[60]; x2[61] = x1[61]; x2[62] = x1[62]; x2[63] = x1[63]; }
+ show +
2178
2179
2180
2181
2182
static INLINE void av1_fdct64_stage3_avx2(__m256i *x2, __m256i *x3, __m256i *cospi_m32, __m256i *cospi_p32, const __m256i *__rounding, int8_t cos_bit) {
+ show +
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
x3[0] = _mm256_add_epi32(x2[0], x2[15]); x3[15] = _mm256_sub_epi32(x2[0], x2[15]); x3[1] = _mm256_add_epi32(x2[1], x2[14]); x3[14] = _mm256_sub_epi32(x2[1], x2[14]); x3[2] = _mm256_add_epi32(x2[2], x2[13]); x3[13] = _mm256_sub_epi32(x2[2], x2[13]); x3[3] = _mm256_add_epi32(x2[3], x2[12]); x3[12] = _mm256_sub_epi32(x2[3], x2[12]); x3[4] = _mm256_add_epi32(x2[4], x2[11]); x3[11] = _mm256_sub_epi32(x2[4], x2[11]);

[CVE-2020-0478_1.diff] highbd_fwd_txfm_avx2.c #21
-static INLINE void av1_fdct64_stage4_avx2( - __m256i *x3, __m256i *x4, __m256i *cospi_m32, __m256i *cospi_p32, - __m256i *cospi_m16, __m256i *cospi_p48, __m256i *cospi_m48, - const __m256i *__rounding, int8_t cos_bit) { +static INLINE void fdct64_stage4_avx2(__m256i *x3, __m256i *x4, + __m256i *cospi_m32, __m256i *cospi_p32, + __m256i *cospi_m16, __m256i *cospi_p48, + __m256i *cospi_m48, + const __m256i *__rounding, + int8_t cos_bit) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/highbd_fwd_txfm_avx2.c
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
x3[60] = _mm256_add_epi32(x2[60], x2[51]); x3[52] = _mm256_sub_epi32(x2[59], x2[52]); x3[59] = _mm256_add_epi32(x2[59], x2[52]); x3[53] = _mm256_sub_epi32(x2[58], x2[53]); x3[58] = _mm256_add_epi32(x2[58], x2[53]); x3[54] = _mm256_sub_epi32(x2[57], x2[54]); x3[57] = _mm256_add_epi32(x2[57], x2[54]); x3[55] = _mm256_sub_epi32(x2[56], x2[55]); x3[56] = _mm256_add_epi32(x2[56], x2[55]); }
+ show +
2248
2249
2250
2251
static INLINE void av1_fdct64_stage4_avx2( __m256i *x3, __m256i *x4, __m256i *cospi_m32, __m256i *cospi_p32, __m256i *cospi_m16, __m256i *cospi_p48, __m256i *cospi_m48, const __m256i *__rounding, int8_t cos_bit) {
+ show +
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
x4[0] = _mm256_add_epi32(x3[0], x3[7]); x4[7] = _mm256_sub_epi32(x3[0], x3[7]); x4[1] = _mm256_add_epi32(x3[1], x3[6]); x4[6] = _mm256_sub_epi32(x3[1], x3[6]); x4[2] = _mm256_add_epi32(x3[2], x3[5]); x4[5] = _mm256_sub_epi32(x3[2], x3[5]); x4[3] = _mm256_add_epi32(x3[3], x3[4]); x4[4] = _mm256_sub_epi32(x3[3], x3[4]); x4[8] = x3[8]; x4[9] = x3[9];

[CVE-2020-0478_1.diff] highbd_fwd_txfm_avx2.c #22
-static INLINE void av1_fdct64_stage5_avx2( - __m256i *x4, __m256i *x5, __m256i *cospi_m32, __m256i *cospi_p32, - __m256i *cospi_m16, __m256i *cospi_p48, __m256i *cospi_m48, - const __m256i *__rounding, int8_t cos_bit) { +static INLINE void fdct64_stage5_avx2(__m256i *x4, __m256i *x5, + __m256i *cospi_m32, __m256i *cospi_p32, + __m256i *cospi_m16, __m256i *cospi_p48, + __m256i *cospi_m48, + const __m256i *__rounding, + int8_t cos_bit) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/highbd_fwd_txfm_avx2.c
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
x4[47] = x3[47]; x4[48] = x3[48]; x4[49] = x3[49]; x4[50] = x3[50]; x4[51] = x3[51]; x4[60] = x3[60]; x4[61] = x3[61]; x4[62] = x3[62]; x4[63] = x3[63]; }
+ show +
2317
2318
2319
2320
static INLINE void av1_fdct64_stage5_avx2( __m256i *x4, __m256i *x5, __m256i *cospi_m32, __m256i *cospi_p32, __m256i *cospi_m16, __m256i *cospi_p48, __m256i *cospi_m48, const __m256i *__rounding, int8_t cos_bit) {
+ show +
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
x5[0] = _mm256_add_epi32(x4[0], x4[3]); x5[3] = _mm256_sub_epi32(x4[0], x4[3]); x5[1] = _mm256_add_epi32(x4[1], x4[2]); x5[2] = _mm256_sub_epi32(x4[1], x4[2]); x5[4] = x4[4]; btf_32_type0_avx2_new(*cospi_m32, *cospi_p32, x4[5], x4[6], x5[5], x5[6], *__rounding, cos_bit); x5[7] = x4[7]; x5[8] = _mm256_add_epi32(x4[8], x4[11]); x5[11] = _mm256_sub_epi32(x4[8], x4[11]);

[CVE-2020-0478_1.diff] highbd_fwd_txfm_avx2.c #24
-static INLINE void av1_fdct64_stage7_avx2( - __m256i *x6, __m256i *x7, __m256i *cospi_p08, __m256i *cospi_p56, - __m256i *cospi_p40, __m256i *cospi_p24, __m256i *cospi_m08, - __m256i *cospi_m56, __m256i *cospi_m40, __m256i *cospi_m24, - const __m256i *__rounding, int8_t cos_bit) { +static INLINE void fdct64_stage7_avx2(__m256i *x6, __m256i *x7, + __m256i *cospi_p08, __m256i *cospi_p56, + __m256i *cospi_p40, __m256i *cospi_p24, + __m256i *cospi_m08, __m256i *cospi_m56, + __m256i *cospi_m40, __m256i *cospi_m24, + const __m256i *__rounding, + int8_t cos_bit) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/highbd_fwd_txfm_avx2.c
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
x6[47] = x5[47]; x6[48] = x5[48]; x6[49] = x5[49]; x6[54] = x5[54]; x6[55] = x5[55]; x6[56] = x5[56]; x6[57] = x5[57]; x6[62] = x5[62]; x6[63] = x5[63]; }
+ show +
2457
2458
2459
2460
2461
static INLINE void av1_fdct64_stage7_avx2( __m256i *x6, __m256i *x7, __m256i *cospi_p08, __m256i *cospi_p56, __m256i *cospi_p40, __m256i *cospi_p24, __m256i *cospi_m08, __m256i *cospi_m56, __m256i *cospi_m40, __m256i *cospi_m24, const __m256i *__rounding, int8_t cos_bit) {
+ show +
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
x7[0] = x6[0]; x7[1] = x6[1]; x7[2] = x6[2]; x7[3] = x6[3]; btf_32_type0_avx2_new(*cospi_p08, *cospi_p56, x6[7], x6[4], x7[4], x7[7], *__rounding, cos_bit); btf_32_type0_avx2_new(*cospi_p40, *cospi_p24, x6[6], x6[5], x7[5], x7[6], *__rounding, cos_bit); x7[8] = _mm256_add_epi32(x6[8], x6[9]); x7[9] = _mm256_sub_epi32(x6[8], x6[9]);

[CVE-2020-0478_1.diff] highbd_fwd_txfm_avx2.c #25
-static INLINE void av1_fdct64_stage8_avx2(__m256i *x7, __m256i *x8, - const int32_t *cospi, - const __m256i *__rounding, - int8_t cos_bit) { +static INLINE void fdct64_stage8_avx2(__m256i *x7, __m256i *x8, + const int32_t *cospi, + const __m256i *__rounding, + int8_t cos_bit) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/highbd_fwd_txfm_avx2.c
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
x7[54] = _mm256_add_epi32(x6[54], x6[53]); x7[56] = _mm256_add_epi32(x6[56], x6[59]); x7[59] = _mm256_sub_epi32(x6[56], x6[59]); x7[57] = _mm256_add_epi32(x6[57], x6[58]); x7[58] = _mm256_sub_epi32(x6[57], x6[58]); x7[60] = _mm256_sub_epi32(x6[63], x6[60]); x7[63] = _mm256_add_epi32(x6[63], x6[60]); x7[61] = _mm256_sub_epi32(x6[62], x6[61]); x7[62] = _mm256_add_epi32(x6[62], x6[61]); }
+ show +
2527
2528
2529
2530
static INLINE void av1_fdct64_stage8_avx2(__m256i *x7, __m256i *x8, const int32_t *cospi, const __m256i *__rounding, int8_t cos_bit) {
+ show +
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
__m256i cospi_p60 = _mm256_set1_epi32(cospi[60]); __m256i cospi_p04 = _mm256_set1_epi32(cospi[4]); __m256i cospi_p28 = _mm256_set1_epi32(cospi[28]); __m256i cospi_p36 = _mm256_set1_epi32(cospi[36]); __m256i cospi_p44 = _mm256_set1_epi32(cospi[44]); __m256i cospi_p20 = _mm256_set1_epi32(cospi[20]); __m256i cospi_p12 = _mm256_set1_epi32(cospi[12]); __m256i cospi_p52 = _mm256_set1_epi32(cospi[52]); __m256i cospi_m04 = _mm256_set1_epi32(-cospi[4]); __m256i cospi_m60 = _mm256_set1_epi32(-cospi[60]);

[CVE-2020-0478_1.diff] highbd_fwd_txfm_avx2.c #26
-static INLINE void av1_fdct64_stage9_avx2(__m256i *x8, __m256i *x9, - const int32_t *cospi, - const __m256i *__rounding, - int8_t cos_bit) { +static INLINE void fdct64_stage9_avx2(__m256i *x8, __m256i *x9, + const int32_t *cospi, + const __m256i *__rounding, + int8_t cos_bit) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/highbd_fwd_txfm_avx2.c
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
x8[47] = x7[47]; x8[48] = x7[48]; x8[51] = x7[51]; x8[52] = x7[52]; x8[55] = x7[55]; x8[56] = x7[56]; x8[59] = x7[59]; x8[60] = x7[60]; x8[63] = x7[63]; }
+ show +
2614
2615
2616
2617
static INLINE void av1_fdct64_stage9_avx2(__m256i *x8, __m256i *x9, const int32_t *cospi, const __m256i *__rounding, int8_t cos_bit) {
+ show +
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
__m256i cospi_p62 = _mm256_set1_epi32(cospi[62]); __m256i cospi_p02 = _mm256_set1_epi32(cospi[2]); __m256i cospi_p30 = _mm256_set1_epi32(cospi[30]); __m256i cospi_p34 = _mm256_set1_epi32(cospi[34]); __m256i cospi_p46 = _mm256_set1_epi32(cospi[46]); __m256i cospi_p18 = _mm256_set1_epi32(cospi[18]); __m256i cospi_p14 = _mm256_set1_epi32(cospi[14]); __m256i cospi_p50 = _mm256_set1_epi32(cospi[50]); __m256i cospi_p54 = _mm256_set1_epi32(cospi[54]); __m256i cospi_p10 = _mm256_set1_epi32(cospi[10]);

[CVE-2020-0478_1.diff] highbd_fwd_txfm_avx2.c #27
-static INLINE void av1_fdct64_stage10_avx2(__m256i *x9, __m256i *x10, - const int32_t *cospi, - const __m256i *__rounding, - int8_t cos_bit) { +static INLINE void fdct64_stage10_avx2(__m256i *x9, __m256i *x10, + const int32_t *cospi, + const __m256i *__rounding, + int8_t cos_bit) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/highbd_fwd_txfm_avx2.c
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
x9[55] = _mm256_add_epi32(x8[55], x8[54]); x9[56] = _mm256_add_epi32(x8[56], x8[57]); x9[57] = _mm256_sub_epi32(x8[56], x8[57]); x9[58] = _mm256_sub_epi32(x8[59], x8[58]); x9[59] = _mm256_add_epi32(x8[59], x8[58]); x9[60] = _mm256_add_epi32(x8[60], x8[61]); x9[61] = _mm256_sub_epi32(x8[60], x8[61]); x9[62] = _mm256_sub_epi32(x8[63], x8[62]); x9[63] = _mm256_add_epi32(x8[63], x8[62]); }
+ show +
2700
2701
2702
2703
static INLINE void av1_fdct64_stage10_avx2(__m256i *x9, __m256i *x10, const int32_t *cospi, const __m256i *__rounding, int8_t cos_bit) {
+ show +
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
__m256i cospi_p63 = _mm256_set1_epi32(cospi[63]); __m256i cospi_p01 = _mm256_set1_epi32(cospi[1]); __m256i cospi_p31 = _mm256_set1_epi32(cospi[31]); __m256i cospi_p33 = _mm256_set1_epi32(cospi[33]); __m256i cospi_p47 = _mm256_set1_epi32(cospi[47]); __m256i cospi_p17 = _mm256_set1_epi32(cospi[17]); __m256i cospi_p15 = _mm256_set1_epi32(cospi[15]); __m256i cospi_p49 = _mm256_set1_epi32(cospi[49]); __m256i cospi_p55 = _mm256_set1_epi32(cospi[55]); __m256i cospi_p09 = _mm256_set1_epi32(cospi[9]);

[CVE-2020-0478_1.diff] highbd_fwd_txfm_avx2.c #29
- av1_fdct64_stage2_avx2(x1, x2, &cospi_m32, &cospi_p32, &__rounding, cos_bit); + fdct64_stage2_avx2(x1, x2, &cospi_m32, &cospi_p32, &__rounding, cos_bit); - av1_fdct64_stage3_avx2(x2, x1, &cospi_m32, &cospi_p32, &__rounding, cos_bit); + fdct64_stage3_avx2(x2, x1, &cospi_m32, &cospi_p32, &__rounding, cos_bit); - av1_fdct64_stage4_avx2(x1, x2, &cospi_m32, &cospi_p32, &cospi_m16, &cospi_p48, - &cospi_m48, &__rounding, cos_bit); + fdct64_stage4_avx2(x1, x2, &cospi_m32, &cospi_p32, &cospi_m16, &cospi_p48, + &cospi_m48, &__rounding, cos_bit); - av1_fdct64_stage5_avx2(x2, x1, &cospi_m32, &cospi_p32, &cospi_m16, &cospi_p48, - &cospi_m48, &__rounding, cos_bit); + fdct64_stage5_avx2(x2, x1, &cospi_m32, &cospi_p32, &cospi_m16, &cospi_p48, + &cospi_m48, &__rounding, cos_bit); - av1_fdct64_stage6_avx2(x1, x2, &cospi_p16, &cospi_p32, &cospi_m16, &cospi_p48, - &cospi_m48, &cospi_m08, &cospi_p56, &cospi_m56, - &cospi_m40, &cospi_p24, &cospi_m24, &__rounding, - cos_bit); + fdct64_stage6_avx2(x1, x2, &cospi_p16, &cospi_p32, &cospi_m16, &cospi_p48, + &cospi_m48, &cospi_m08, &cospi_p56, &cospi_m56, &cospi_m40, + &cospi_p24, &cospi_m24, &__rounding, cos_bit); - av1_fdct64_stage7_avx2(x2, x1, &cospi_p08, &cospi_p56, &cospi_p40, &cospi_p24, - &cospi_m08, &cospi_m56, &cospi_m40, &cospi_m24, - &__rounding, cos_bit); + fdct64_stage7_avx2(x2, x1, &cospi_p08, &cospi_p56, &cospi_p40, &cospi_p24, + &cospi_m08, &cospi_m56, &cospi_m40, &cospi_m24, + &__rounding, cos_bit); - av1_fdct64_stage8_avx2(x1, x2, cospi, &__rounding, cos_bit); + fdct64_stage8_avx2(x1, x2, cospi, &__rounding, cos_bit); - av1_fdct64_stage9_avx2(x2, x1, cospi, &__rounding, cos_bit); + fdct64_stage9_avx2(x2, x1, cospi, &__rounding, cos_bit); - av1_fdct64_stage10_avx2(x1, x2, cospi, &__rounding, cos_bit); + fdct64_stage10_avx2(x1, x2, cospi, &__rounding, cos_bit);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/highbd_fwd_txfm_avx2.c
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
endidx -= instride; x1[30] = _mm256_add_epi32(input[startidx], input[endidx]); x1[33] = _mm256_sub_epi32(input[startidx], input[endidx]); startidx += instride; endidx -= instride; x1[31] = _mm256_add_epi32(input[startidx], input[endidx]); x1[32] = _mm256_sub_epi32(input[startidx], input[endidx]); // stage 2 __m256i x2[64];
+ show +
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
av1_fdct64_stage2_avx2(x1, x2, &cospi_m32, &cospi_p32, &__rounding, cos_bit); // stage 3 av1_fdct64_stage3_avx2(x2, x1, &cospi_m32, &cospi_p32, &__rounding, cos_bit); // stage 4 av1_fdct64_stage4_avx2(x1, x2, &cospi_m32, &cospi_p32, &cospi_m16, &cospi_p48, &cospi_m48, &__rounding, cos_bit); // stage 5 av1_fdct64_stage5_avx2(x2, x1, &cospi_m32, &cospi_p32, &cospi_m16, &cospi_p48, &cospi_m48, &__rounding, cos_bit); // stage 6 av1_fdct64_stage6_avx2(x1, x2, &cospi_p16, &cospi_p32, &cospi_m16, &cospi_p48, &cospi_m48, &cospi_m08, &cospi_p56, &cospi_m56, &cospi_m40, &cospi_p24, &cospi_m24, &__rounding, cos_bit); // stage 7 av1_fdct64_stage7_avx2(x2, x1, &cospi_p08, &cospi_p56, &cospi_p40, &cospi_p24, &cospi_m08, &cospi_m56, &cospi_m40, &cospi_m24, &__rounding, cos_bit); // stage 8 av1_fdct64_stage8_avx2(x1, x2, cospi, &__rounding, cos_bit); // stage 9 av1_fdct64_stage9_avx2(x2, x1, cospi, &__rounding, cos_bit); // stage 10 av1_fdct64_stage10_avx2(x1, x2, cospi, &__rounding, cos_bit);
+ show +
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
startidx = 0 * outstride; endidx = 63 * outstride; // stage 11 output[startidx] = x2[0]; output[endidx] = x2[63]; startidx += outstride; endidx -= outstride; output[startidx] = x2[32];

[CVE-2020-0470_1.diff] highbd_fwd_txfm_avx2.c #3
- av1_load_buffer_8x8_avx2(topL, out, stride, flipud, fliplr, shift); - av1_load_buffer_8x8_avx2(botL, out + 8, stride, flipud, fliplr, shift); + load_buffer_8x8_avx2(topL, out, stride, flipud, fliplr, shift); + load_buffer_8x8_avx2(botL, out + 8, stride, flipud, fliplr, shift); -static INLINE void av1_load_buffer_16xn_avx2(const int16_t *input, __m256i *out, - int stride, int height, - int outstride, int flipud, - int fliplr) { +static INLINE void load_buffer_16xn_avx2(const int16_t *input, __m256i *out, + int stride, int height, int outstride, + int flipud, int fliplr) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/highbd_fwd_txfm_avx2.c
100
101
102
103
104
105
106
107
108
109
const int16_t *topL = input; const int16_t *botL = input + 8 * stride; const int16_t *tmp; if (flipud) { tmp = topL; topL = botL; botL = tmp; }
+ show +
110
111
112
113
114
115
116
av1_load_buffer_8x8_avx2(topL, out, stride, flipud, fliplr, shift); av1_load_buffer_8x8_avx2(botL, out + 8, stride, flipud, fliplr, shift); } static INLINE void av1_load_buffer_16xn_avx2(const int16_t *input, __m256i *out, int stride, int height, int outstride, int flipud, int fliplr) {
+ show +
117
118
119
120
121
122
123
124
125
126
__m256i out1[64]; if (!flipud) { for (int i = 0; i < height; i++) { out1[i] = _mm256_loadu_si256((const __m256i *)(input + i * stride)); } } else { for (int i = 0; i < height; i++) { out1[(height - 1) - i] = _mm256_loadu_si256((const __m256i *)(input + i * stride)); }

[CVE-2020-0470_1.diff] highbd_fwd_txfm_avx2.c #20
-static INLINE void av1_fdct64_stage3_avx2(__m256i *x2, __m256i *x3, - __m256i *cospi_m32, - __m256i *cospi_p32, - const __m256i *__rounding, - int8_t cos_bit) { +static INLINE void fdct64_stage3_avx2(__m256i *x2, __m256i *x3, + __m256i *cospi_m32, __m256i *cospi_p32, + const __m256i *__rounding, + int8_t cos_bit) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/highbd_fwd_txfm_avx2.c
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
*__rounding, cos_bit); x2[56] = x1[56]; x2[57] = x1[57]; x2[58] = x1[58]; x2[59] = x1[59]; x2[60] = x1[60]; x2[61] = x1[61]; x2[62] = x1[62]; x2[63] = x1[63]; }
+ show +
2178
2179
2180
2181
2182
static INLINE void av1_fdct64_stage3_avx2(__m256i *x2, __m256i *x3, __m256i *cospi_m32, __m256i *cospi_p32, const __m256i *__rounding, int8_t cos_bit) {
+ show +
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
x3[0] = _mm256_add_epi32(x2[0], x2[15]); x3[15] = _mm256_sub_epi32(x2[0], x2[15]); x3[1] = _mm256_add_epi32(x2[1], x2[14]); x3[14] = _mm256_sub_epi32(x2[1], x2[14]); x3[2] = _mm256_add_epi32(x2[2], x2[13]); x3[13] = _mm256_sub_epi32(x2[2], x2[13]); x3[3] = _mm256_add_epi32(x2[3], x2[12]); x3[12] = _mm256_sub_epi32(x2[3], x2[12]); x3[4] = _mm256_add_epi32(x2[4], x2[11]); x3[11] = _mm256_sub_epi32(x2[4], x2[11]);

[CVE-2020-0470_1.diff] highbd_fwd_txfm_avx2.c #21
-static INLINE void av1_fdct64_stage4_avx2( - __m256i *x3, __m256i *x4, __m256i *cospi_m32, __m256i *cospi_p32, - __m256i *cospi_m16, __m256i *cospi_p48, __m256i *cospi_m48, - const __m256i *__rounding, int8_t cos_bit) { +static INLINE void fdct64_stage4_avx2(__m256i *x3, __m256i *x4, + __m256i *cospi_m32, __m256i *cospi_p32, + __m256i *cospi_m16, __m256i *cospi_p48, + __m256i *cospi_m48, + const __m256i *__rounding, + int8_t cos_bit) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/highbd_fwd_txfm_avx2.c
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
x3[60] = _mm256_add_epi32(x2[60], x2[51]); x3[52] = _mm256_sub_epi32(x2[59], x2[52]); x3[59] = _mm256_add_epi32(x2[59], x2[52]); x3[53] = _mm256_sub_epi32(x2[58], x2[53]); x3[58] = _mm256_add_epi32(x2[58], x2[53]); x3[54] = _mm256_sub_epi32(x2[57], x2[54]); x3[57] = _mm256_add_epi32(x2[57], x2[54]); x3[55] = _mm256_sub_epi32(x2[56], x2[55]); x3[56] = _mm256_add_epi32(x2[56], x2[55]); }
+ show +
2248
2249
2250
2251
static INLINE void av1_fdct64_stage4_avx2( __m256i *x3, __m256i *x4, __m256i *cospi_m32, __m256i *cospi_p32, __m256i *cospi_m16, __m256i *cospi_p48, __m256i *cospi_m48, const __m256i *__rounding, int8_t cos_bit) {
+ show +
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
x4[0] = _mm256_add_epi32(x3[0], x3[7]); x4[7] = _mm256_sub_epi32(x3[0], x3[7]); x4[1] = _mm256_add_epi32(x3[1], x3[6]); x4[6] = _mm256_sub_epi32(x3[1], x3[6]); x4[2] = _mm256_add_epi32(x3[2], x3[5]); x4[5] = _mm256_sub_epi32(x3[2], x3[5]); x4[3] = _mm256_add_epi32(x3[3], x3[4]); x4[4] = _mm256_sub_epi32(x3[3], x3[4]); x4[8] = x3[8]; x4[9] = x3[9];

[CVE-2020-0470_1.diff] highbd_fwd_txfm_avx2.c #22
-static INLINE void av1_fdct64_stage5_avx2( - __m256i *x4, __m256i *x5, __m256i *cospi_m32, __m256i *cospi_p32, - __m256i *cospi_m16, __m256i *cospi_p48, __m256i *cospi_m48, - const __m256i *__rounding, int8_t cos_bit) { +static INLINE void fdct64_stage5_avx2(__m256i *x4, __m256i *x5, + __m256i *cospi_m32, __m256i *cospi_p32, + __m256i *cospi_m16, __m256i *cospi_p48, + __m256i *cospi_m48, + const __m256i *__rounding, + int8_t cos_bit) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/highbd_fwd_txfm_avx2.c
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
x4[47] = x3[47]; x4[48] = x3[48]; x4[49] = x3[49]; x4[50] = x3[50]; x4[51] = x3[51]; x4[60] = x3[60]; x4[61] = x3[61]; x4[62] = x3[62]; x4[63] = x3[63]; }
+ show +
2317
2318
2319
2320
static INLINE void av1_fdct64_stage5_avx2( __m256i *x4, __m256i *x5, __m256i *cospi_m32, __m256i *cospi_p32, __m256i *cospi_m16, __m256i *cospi_p48, __m256i *cospi_m48, const __m256i *__rounding, int8_t cos_bit) {
+ show +
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
x5[0] = _mm256_add_epi32(x4[0], x4[3]); x5[3] = _mm256_sub_epi32(x4[0], x4[3]); x5[1] = _mm256_add_epi32(x4[1], x4[2]); x5[2] = _mm256_sub_epi32(x4[1], x4[2]); x5[4] = x4[4]; btf_32_type0_avx2_new(*cospi_m32, *cospi_p32, x4[5], x4[6], x5[5], x5[6], *__rounding, cos_bit); x5[7] = x4[7]; x5[8] = _mm256_add_epi32(x4[8], x4[11]); x5[11] = _mm256_sub_epi32(x4[8], x4[11]);

[CVE-2020-0470_1.diff] highbd_fwd_txfm_avx2.c #24
-static INLINE void av1_fdct64_stage7_avx2( - __m256i *x6, __m256i *x7, __m256i *cospi_p08, __m256i *cospi_p56, - __m256i *cospi_p40, __m256i *cospi_p24, __m256i *cospi_m08, - __m256i *cospi_m56, __m256i *cospi_m40, __m256i *cospi_m24, - const __m256i *__rounding, int8_t cos_bit) { +static INLINE void fdct64_stage7_avx2(__m256i *x6, __m256i *x7, + __m256i *cospi_p08, __m256i *cospi_p56, + __m256i *cospi_p40, __m256i *cospi_p24, + __m256i *cospi_m08, __m256i *cospi_m56, + __m256i *cospi_m40, __m256i *cospi_m24, + const __m256i *__rounding, + int8_t cos_bit) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/highbd_fwd_txfm_avx2.c
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
x6[47] = x5[47]; x6[48] = x5[48]; x6[49] = x5[49]; x6[54] = x5[54]; x6[55] = x5[55]; x6[56] = x5[56]; x6[57] = x5[57]; x6[62] = x5[62]; x6[63] = x5[63]; }
+ show +
2457
2458
2459
2460
2461
static INLINE void av1_fdct64_stage7_avx2( __m256i *x6, __m256i *x7, __m256i *cospi_p08, __m256i *cospi_p56, __m256i *cospi_p40, __m256i *cospi_p24, __m256i *cospi_m08, __m256i *cospi_m56, __m256i *cospi_m40, __m256i *cospi_m24, const __m256i *__rounding, int8_t cos_bit) {
+ show +
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
x7[0] = x6[0]; x7[1] = x6[1]; x7[2] = x6[2]; x7[3] = x6[3]; btf_32_type0_avx2_new(*cospi_p08, *cospi_p56, x6[7], x6[4], x7[4], x7[7], *__rounding, cos_bit); btf_32_type0_avx2_new(*cospi_p40, *cospi_p24, x6[6], x6[5], x7[5], x7[6], *__rounding, cos_bit); x7[8] = _mm256_add_epi32(x6[8], x6[9]); x7[9] = _mm256_sub_epi32(x6[8], x6[9]);

[CVE-2020-0470_1.diff] highbd_fwd_txfm_avx2.c #25
-static INLINE void av1_fdct64_stage8_avx2(__m256i *x7, __m256i *x8, - const int32_t *cospi, - const __m256i *__rounding, - int8_t cos_bit) { +static INLINE void fdct64_stage8_avx2(__m256i *x7, __m256i *x8, + const int32_t *cospi, + const __m256i *__rounding, + int8_t cos_bit) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/highbd_fwd_txfm_avx2.c
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
x7[54] = _mm256_add_epi32(x6[54], x6[53]); x7[56] = _mm256_add_epi32(x6[56], x6[59]); x7[59] = _mm256_sub_epi32(x6[56], x6[59]); x7[57] = _mm256_add_epi32(x6[57], x6[58]); x7[58] = _mm256_sub_epi32(x6[57], x6[58]); x7[60] = _mm256_sub_epi32(x6[63], x6[60]); x7[63] = _mm256_add_epi32(x6[63], x6[60]); x7[61] = _mm256_sub_epi32(x6[62], x6[61]); x7[62] = _mm256_add_epi32(x6[62], x6[61]); }
+ show +
2527
2528
2529
2530
static INLINE void av1_fdct64_stage8_avx2(__m256i *x7, __m256i *x8, const int32_t *cospi, const __m256i *__rounding, int8_t cos_bit) {
+ show +
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
__m256i cospi_p60 = _mm256_set1_epi32(cospi[60]); __m256i cospi_p04 = _mm256_set1_epi32(cospi[4]); __m256i cospi_p28 = _mm256_set1_epi32(cospi[28]); __m256i cospi_p36 = _mm256_set1_epi32(cospi[36]); __m256i cospi_p44 = _mm256_set1_epi32(cospi[44]); __m256i cospi_p20 = _mm256_set1_epi32(cospi[20]); __m256i cospi_p12 = _mm256_set1_epi32(cospi[12]); __m256i cospi_p52 = _mm256_set1_epi32(cospi[52]); __m256i cospi_m04 = _mm256_set1_epi32(-cospi[4]); __m256i cospi_m60 = _mm256_set1_epi32(-cospi[60]);

[CVE-2020-0470_1.diff] highbd_fwd_txfm_avx2.c #26
-static INLINE void av1_fdct64_stage9_avx2(__m256i *x8, __m256i *x9, - const int32_t *cospi, - const __m256i *__rounding, - int8_t cos_bit) { +static INLINE void fdct64_stage9_avx2(__m256i *x8, __m256i *x9, + const int32_t *cospi, + const __m256i *__rounding, + int8_t cos_bit) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/highbd_fwd_txfm_avx2.c
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
x8[47] = x7[47]; x8[48] = x7[48]; x8[51] = x7[51]; x8[52] = x7[52]; x8[55] = x7[55]; x8[56] = x7[56]; x8[59] = x7[59]; x8[60] = x7[60]; x8[63] = x7[63]; }
+ show +
2614
2615
2616
2617
static INLINE void av1_fdct64_stage9_avx2(__m256i *x8, __m256i *x9, const int32_t *cospi, const __m256i *__rounding, int8_t cos_bit) {
+ show +
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
__m256i cospi_p62 = _mm256_set1_epi32(cospi[62]); __m256i cospi_p02 = _mm256_set1_epi32(cospi[2]); __m256i cospi_p30 = _mm256_set1_epi32(cospi[30]); __m256i cospi_p34 = _mm256_set1_epi32(cospi[34]); __m256i cospi_p46 = _mm256_set1_epi32(cospi[46]); __m256i cospi_p18 = _mm256_set1_epi32(cospi[18]); __m256i cospi_p14 = _mm256_set1_epi32(cospi[14]); __m256i cospi_p50 = _mm256_set1_epi32(cospi[50]); __m256i cospi_p54 = _mm256_set1_epi32(cospi[54]); __m256i cospi_p10 = _mm256_set1_epi32(cospi[10]);

[CVE-2020-0470_1.diff] highbd_fwd_txfm_avx2.c #27
-static INLINE void av1_fdct64_stage10_avx2(__m256i *x9, __m256i *x10, - const int32_t *cospi, - const __m256i *__rounding, - int8_t cos_bit) { +static INLINE void fdct64_stage10_avx2(__m256i *x9, __m256i *x10, + const int32_t *cospi, + const __m256i *__rounding, + int8_t cos_bit) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/highbd_fwd_txfm_avx2.c
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
x9[55] = _mm256_add_epi32(x8[55], x8[54]); x9[56] = _mm256_add_epi32(x8[56], x8[57]); x9[57] = _mm256_sub_epi32(x8[56], x8[57]); x9[58] = _mm256_sub_epi32(x8[59], x8[58]); x9[59] = _mm256_add_epi32(x8[59], x8[58]); x9[60] = _mm256_add_epi32(x8[60], x8[61]); x9[61] = _mm256_sub_epi32(x8[60], x8[61]); x9[62] = _mm256_sub_epi32(x8[63], x8[62]); x9[63] = _mm256_add_epi32(x8[63], x8[62]); }
+ show +
2700
2701
2702
2703
static INLINE void av1_fdct64_stage10_avx2(__m256i *x9, __m256i *x10, const int32_t *cospi, const __m256i *__rounding, int8_t cos_bit) {
+ show +
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
__m256i cospi_p63 = _mm256_set1_epi32(cospi[63]); __m256i cospi_p01 = _mm256_set1_epi32(cospi[1]); __m256i cospi_p31 = _mm256_set1_epi32(cospi[31]); __m256i cospi_p33 = _mm256_set1_epi32(cospi[33]); __m256i cospi_p47 = _mm256_set1_epi32(cospi[47]); __m256i cospi_p17 = _mm256_set1_epi32(cospi[17]); __m256i cospi_p15 = _mm256_set1_epi32(cospi[15]); __m256i cospi_p49 = _mm256_set1_epi32(cospi[49]); __m256i cospi_p55 = _mm256_set1_epi32(cospi[55]); __m256i cospi_p09 = _mm256_set1_epi32(cospi[9]);

[CVE-2020-0470_1.diff] highbd_fwd_txfm_avx2.c #29
- av1_fdct64_stage2_avx2(x1, x2, &cospi_m32, &cospi_p32, &__rounding, cos_bit); + fdct64_stage2_avx2(x1, x2, &cospi_m32, &cospi_p32, &__rounding, cos_bit); - av1_fdct64_stage3_avx2(x2, x1, &cospi_m32, &cospi_p32, &__rounding, cos_bit); + fdct64_stage3_avx2(x2, x1, &cospi_m32, &cospi_p32, &__rounding, cos_bit); - av1_fdct64_stage4_avx2(x1, x2, &cospi_m32, &cospi_p32, &cospi_m16, &cospi_p48, - &cospi_m48, &__rounding, cos_bit); + fdct64_stage4_avx2(x1, x2, &cospi_m32, &cospi_p32, &cospi_m16, &cospi_p48, + &cospi_m48, &__rounding, cos_bit); - av1_fdct64_stage5_avx2(x2, x1, &cospi_m32, &cospi_p32, &cospi_m16, &cospi_p48, - &cospi_m48, &__rounding, cos_bit); + fdct64_stage5_avx2(x2, x1, &cospi_m32, &cospi_p32, &cospi_m16, &cospi_p48, + &cospi_m48, &__rounding, cos_bit); - av1_fdct64_stage6_avx2(x1, x2, &cospi_p16, &cospi_p32, &cospi_m16, &cospi_p48, - &cospi_m48, &cospi_m08, &cospi_p56, &cospi_m56, - &cospi_m40, &cospi_p24, &cospi_m24, &__rounding, - cos_bit); + fdct64_stage6_avx2(x1, x2, &cospi_p16, &cospi_p32, &cospi_m16, &cospi_p48, + &cospi_m48, &cospi_m08, &cospi_p56, &cospi_m56, &cospi_m40, + &cospi_p24, &cospi_m24, &__rounding, cos_bit); - av1_fdct64_stage7_avx2(x2, x1, &cospi_p08, &cospi_p56, &cospi_p40, &cospi_p24, - &cospi_m08, &cospi_m56, &cospi_m40, &cospi_m24, - &__rounding, cos_bit); + fdct64_stage7_avx2(x2, x1, &cospi_p08, &cospi_p56, &cospi_p40, &cospi_p24, + &cospi_m08, &cospi_m56, &cospi_m40, &cospi_m24, + &__rounding, cos_bit); - av1_fdct64_stage8_avx2(x1, x2, cospi, &__rounding, cos_bit); + fdct64_stage8_avx2(x1, x2, cospi, &__rounding, cos_bit); - av1_fdct64_stage9_avx2(x2, x1, cospi, &__rounding, cos_bit); + fdct64_stage9_avx2(x2, x1, cospi, &__rounding, cos_bit); - av1_fdct64_stage10_avx2(x1, x2, cospi, &__rounding, cos_bit); + fdct64_stage10_avx2(x1, x2, cospi, &__rounding, cos_bit);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/encoder/x86/highbd_fwd_txfm_avx2.c
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
endidx -= instride; x1[30] = _mm256_add_epi32(input[startidx], input[endidx]); x1[33] = _mm256_sub_epi32(input[startidx], input[endidx]); startidx += instride; endidx -= instride; x1[31] = _mm256_add_epi32(input[startidx], input[endidx]); x1[32] = _mm256_sub_epi32(input[startidx], input[endidx]); // stage 2 __m256i x2[64];
+ show +
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
av1_fdct64_stage2_avx2(x1, x2, &cospi_m32, &cospi_p32, &__rounding, cos_bit); // stage 3 av1_fdct64_stage3_avx2(x2, x1, &cospi_m32, &cospi_p32, &__rounding, cos_bit); // stage 4 av1_fdct64_stage4_avx2(x1, x2, &cospi_m32, &cospi_p32, &cospi_m16, &cospi_p48, &cospi_m48, &__rounding, cos_bit); // stage 5 av1_fdct64_stage5_avx2(x2, x1, &cospi_m32, &cospi_p32, &cospi_m16, &cospi_p48, &cospi_m48, &__rounding, cos_bit); // stage 6 av1_fdct64_stage6_avx2(x1, x2, &cospi_p16, &cospi_p32, &cospi_m16, &cospi_p48, &cospi_m48, &cospi_m08, &cospi_p56, &cospi_m56, &cospi_m40, &cospi_p24, &cospi_m24, &__rounding, cos_bit); // stage 7 av1_fdct64_stage7_avx2(x2, x1, &cospi_p08, &cospi_p56, &cospi_p40, &cospi_p24, &cospi_m08, &cospi_m56, &cospi_m40, &cospi_m24, &__rounding, cos_bit); // stage 8 av1_fdct64_stage8_avx2(x1, x2, cospi, &__rounding, cos_bit); // stage 9 av1_fdct64_stage9_avx2(x2, x1, cospi, &__rounding, cos_bit); // stage 10 av1_fdct64_stage10_avx2(x1, x2, cospi, &__rounding, cos_bit);
+ show +
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
startidx = 0 * outstride; endidx = 63 * outstride; // stage 11 output[startidx] = x2[0]; output[endidx] = x2[63]; startidx += outstride; endidx -= outstride; output[startidx] = x2[32];

[CVE-2020-0478_1.diff] decodemv.c #22
- if (!cm->seq_params.monochrome && - is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x, - xd->plane[1].subsampling_y)) { - xd->cfl.is_chroma_reference = 1; + if (!cm->seq_params.monochrome && xd->is_chroma_ref) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodemv.c
786
787
788
789
790
791
792
793
794
795
} mbmi->mode = read_intra_mode(r, get_y_mode_cdf(ec_ctx, above_mi, left_mi)); const int use_angle_delta = av1_use_angle_delta(bsize); mbmi->angle_delta[PLANE_TYPE_Y] = (use_angle_delta && av1_is_directional_mode(mbmi->mode)) ? read_angle_delta(r, ec_ctx->angle_delta_cdf[mbmi->mode - V_PRED]) : 0;
+ show +
796
797
798
799
if (!cm->seq_params.monochrome && is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x, xd->plane[1].subsampling_y)) { xd->cfl.is_chroma_reference = 1;
+ show +
800
801
802
803
804
805
806
807
808
809
mbmi->uv_mode = read_intra_mode_uv(ec_ctx, r, is_cfl_allowed(xd), mbmi->mode); if (mbmi->uv_mode == UV_CFL_PRED) { mbmi->cfl_alpha_idx = read_cfl_alphas(ec_ctx, r, &mbmi->cfl_alpha_signs); } mbmi->angle_delta[PLANE_TYPE_UV] = (use_angle_delta && av1_is_directional_mode(get_uv_mode(mbmi->uv_mode))) ? read_angle_delta(r, ec_ctx->angle_delta_cdf[mbmi->uv_mode - V_PRED]) : 0;

[CVE-2020-0478_1.diff] decodemv.c #26
- const int has_chroma = - is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x, - xd->plane[1].subsampling_y); - xd->cfl.is_chroma_reference = has_chroma; - if (!cm->seq_params.monochrome && has_chroma) { + if (!cm->seq_params.monochrome && xd->is_chroma_ref) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodemv.c
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
mbmi->ref_frame[1] = NONE_FRAME; FRAME_CONTEXT *ec_ctx = xd->tile_ctx; mbmi->mode = read_intra_mode(r, ec_ctx->y_mode_cdf[size_group_lookup[bsize]]); mbmi->angle_delta[PLANE_TYPE_Y] = use_angle_delta && av1_is_directional_mode(mbmi->mode) ? read_angle_delta(r, ec_ctx->angle_delta_cdf[mbmi->mode - V_PRED]) : 0;
+ show +
1059
1060
1061
1062
1063
const int has_chroma = is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x, xd->plane[1].subsampling_y); xd->cfl.is_chroma_reference = has_chroma; if (!cm->seq_params.monochrome && has_chroma) {
+ show +
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
mbmi->uv_mode = read_intra_mode_uv(ec_ctx, r, is_cfl_allowed(xd), mbmi->mode); if (mbmi->uv_mode == UV_CFL_PRED) { mbmi->cfl_alpha_idx = read_cfl_alphas(xd->tile_ctx, r, &mbmi->cfl_alpha_signs); } mbmi->angle_delta[PLANE_TYPE_UV] = use_angle_delta && av1_is_directional_mode(get_uv_mode(mbmi->uv_mode)) ? read_angle_delta(r, ec_ctx->angle_delta_cdf[mbmi->uv_mode - V_PRED])

[CVE-2020-0478_1.diff] decodemv.c #29
- mv[0].as_int = - gm_get_motion_vector(&cm->global_motion[ref_frame[0]], - cm->allow_high_precision_mv, bsize, mi_col, - mi_row, cm->cur_frame_force_integer_mv) - .as_int; + mv[0].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[0]], + features->allow_high_precision_mv, + bsize, xd->mi_col, xd->mi_row, + features->cur_frame_force_integer_mv) + .as_int;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodemv.c
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
} case NEARESTMV: { mv[0].as_int = nearest_mv[0].as_int; break; } case NEARMV: { mv[0].as_int = near_mv[0].as_int; break; } case GLOBALMV: {
+ show +
1121
1122
1123
1124
1125
mv[0].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[0]], cm->allow_high_precision_mv, bsize, mi_col, mi_row, cm->cur_frame_force_integer_mv) .as_int;
+ show +
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
break; } case NEW_NEWMV: { assert(is_compound); for (int i = 0; i < 2; ++i) { nmv_context *const nmvc = &ec_ctx->nmvc; read_mv(r, &mv[i].as_mv, &ref_mv[i].as_mv, nmvc, allow_hp); } break; }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodemv.c
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
} case NEW_NEARMV: { nmv_context *const nmvc = &ec_ctx->nmvc; read_mv(r, &mv[0].as_mv, &ref_mv[0].as_mv, nmvc, allow_hp); assert(is_compound); mv[1].as_int = near_mv[1].as_int; break; } case GLOBAL_GLOBALMV: { assert(is_compound);
+ show +
1178
1179
1180
1181
1182
mv[0].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[0]], cm->allow_high_precision_mv, bsize, mi_col, mi_row, cm->cur_frame_force_integer_mv) .as_int;
+ show +
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
mv[1].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[1]], cm->allow_high_precision_mv, bsize, mi_col, mi_row, cm->cur_frame_force_integer_mv) .as_int; break; } default: { return 0; } }

[CVE-2020-0478_1.diff] decodemv.c #30
- mv[0].as_int = - gm_get_motion_vector(&cm->global_motion[ref_frame[0]], - cm->allow_high_precision_mv, bsize, mi_col, - mi_row, cm->cur_frame_force_integer_mv) - .as_int; - mv[1].as_int = - gm_get_motion_vector(&cm->global_motion[ref_frame[1]], - cm->allow_high_precision_mv, bsize, mi_col, - mi_row, cm->cur_frame_force_integer_mv) - .as_int; + mv[0].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[0]], + features->allow_high_precision_mv, + bsize, xd->mi_col, xd->mi_row, + features->cur_frame_force_integer_mv) + .as_int; + mv[1].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[1]], + features->allow_high_precision_mv, + bsize, xd->mi_col, xd->mi_row, + features->cur_frame_force_integer_mv) + .as_int;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodemv.c
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
} case NEW_NEARMV: { nmv_context *const nmvc = &ec_ctx->nmvc; read_mv(r, &mv[0].as_mv, &ref_mv[0].as_mv, nmvc, allow_hp); assert(is_compound); mv[1].as_int = near_mv[1].as_int; break; } case GLOBAL_GLOBALMV: { assert(is_compound);
+ show +
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
mv[0].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[0]], cm->allow_high_precision_mv, bsize, mi_col, mi_row, cm->cur_frame_force_integer_mv) .as_int; mv[1].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[1]], cm->allow_high_precision_mv, bsize, mi_col, mi_row, cm->cur_frame_force_integer_mv) .as_int;
+ show +
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
break; } default: { return 0; } } int ret = is_mv_valid(&mv[0].as_mv); if (is_compound) { ret = ret && is_mv_valid(&mv[1].as_mv); } return ret;

[CVE-2020-0470_1.diff] decodemv.c #22
- if (!cm->seq_params.monochrome && - is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x, - xd->plane[1].subsampling_y)) { - xd->cfl.is_chroma_reference = 1; + if (!cm->seq_params.monochrome && xd->is_chroma_ref) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodemv.c
786
787
788
789
790
791
792
793
794
795
} mbmi->mode = read_intra_mode(r, get_y_mode_cdf(ec_ctx, above_mi, left_mi)); const int use_angle_delta = av1_use_angle_delta(bsize); mbmi->angle_delta[PLANE_TYPE_Y] = (use_angle_delta && av1_is_directional_mode(mbmi->mode)) ? read_angle_delta(r, ec_ctx->angle_delta_cdf[mbmi->mode - V_PRED]) : 0;
+ show +
796
797
798
799
if (!cm->seq_params.monochrome && is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x, xd->plane[1].subsampling_y)) { xd->cfl.is_chroma_reference = 1;
+ show +
800
801
802
803
804
805
806
807
808
809
mbmi->uv_mode = read_intra_mode_uv(ec_ctx, r, is_cfl_allowed(xd), mbmi->mode); if (mbmi->uv_mode == UV_CFL_PRED) { mbmi->cfl_alpha_idx = read_cfl_alphas(ec_ctx, r, &mbmi->cfl_alpha_signs); } mbmi->angle_delta[PLANE_TYPE_UV] = (use_angle_delta && av1_is_directional_mode(get_uv_mode(mbmi->uv_mode))) ? read_angle_delta(r, ec_ctx->angle_delta_cdf[mbmi->uv_mode - V_PRED]) : 0;

[CVE-2020-0470_1.diff] decodemv.c #26
- const int has_chroma = - is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x, - xd->plane[1].subsampling_y); - xd->cfl.is_chroma_reference = has_chroma; - if (!cm->seq_params.monochrome && has_chroma) { + if (!cm->seq_params.monochrome && xd->is_chroma_ref) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodemv.c
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
mbmi->ref_frame[1] = NONE_FRAME; FRAME_CONTEXT *ec_ctx = xd->tile_ctx; mbmi->mode = read_intra_mode(r, ec_ctx->y_mode_cdf[size_group_lookup[bsize]]); mbmi->angle_delta[PLANE_TYPE_Y] = use_angle_delta && av1_is_directional_mode(mbmi->mode) ? read_angle_delta(r, ec_ctx->angle_delta_cdf[mbmi->mode - V_PRED]) : 0;
+ show +
1059
1060
1061
1062
1063
const int has_chroma = is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x, xd->plane[1].subsampling_y); xd->cfl.is_chroma_reference = has_chroma; if (!cm->seq_params.monochrome && has_chroma) {
+ show +
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
mbmi->uv_mode = read_intra_mode_uv(ec_ctx, r, is_cfl_allowed(xd), mbmi->mode); if (mbmi->uv_mode == UV_CFL_PRED) { mbmi->cfl_alpha_idx = read_cfl_alphas(xd->tile_ctx, r, &mbmi->cfl_alpha_signs); } mbmi->angle_delta[PLANE_TYPE_UV] = use_angle_delta && av1_is_directional_mode(get_uv_mode(mbmi->uv_mode)) ? read_angle_delta(r, ec_ctx->angle_delta_cdf[mbmi->uv_mode - V_PRED])

[CVE-2020-0470_1.diff] decodemv.c #29
- mv[0].as_int = - gm_get_motion_vector(&cm->global_motion[ref_frame[0]], - cm->allow_high_precision_mv, bsize, mi_col, - mi_row, cm->cur_frame_force_integer_mv) - .as_int; + mv[0].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[0]], + features->allow_high_precision_mv, + bsize, xd->mi_col, xd->mi_row, + features->cur_frame_force_integer_mv) + .as_int;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodemv.c
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
} case NEARESTMV: { mv[0].as_int = nearest_mv[0].as_int; break; } case NEARMV: { mv[0].as_int = near_mv[0].as_int; break; } case GLOBALMV: {
+ show +
1121
1122
1123
1124
1125
mv[0].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[0]], cm->allow_high_precision_mv, bsize, mi_col, mi_row, cm->cur_frame_force_integer_mv) .as_int;
+ show +
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
break; } case NEW_NEWMV: { assert(is_compound); for (int i = 0; i < 2; ++i) { nmv_context *const nmvc = &ec_ctx->nmvc; read_mv(r, &mv[i].as_mv, &ref_mv[i].as_mv, nmvc, allow_hp); } break; }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodemv.c
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
} case NEW_NEARMV: { nmv_context *const nmvc = &ec_ctx->nmvc; read_mv(r, &mv[0].as_mv, &ref_mv[0].as_mv, nmvc, allow_hp); assert(is_compound); mv[1].as_int = near_mv[1].as_int; break; } case GLOBAL_GLOBALMV: { assert(is_compound);
+ show +
1178
1179
1180
1181
1182
mv[0].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[0]], cm->allow_high_precision_mv, bsize, mi_col, mi_row, cm->cur_frame_force_integer_mv) .as_int;
+ show +
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
mv[1].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[1]], cm->allow_high_precision_mv, bsize, mi_col, mi_row, cm->cur_frame_force_integer_mv) .as_int; break; } default: { return 0; } }

[CVE-2020-0470_1.diff] decodemv.c #30
- mv[0].as_int = - gm_get_motion_vector(&cm->global_motion[ref_frame[0]], - cm->allow_high_precision_mv, bsize, mi_col, - mi_row, cm->cur_frame_force_integer_mv) - .as_int; - mv[1].as_int = - gm_get_motion_vector(&cm->global_motion[ref_frame[1]], - cm->allow_high_precision_mv, bsize, mi_col, - mi_row, cm->cur_frame_force_integer_mv) - .as_int; + mv[0].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[0]], + features->allow_high_precision_mv, + bsize, xd->mi_col, xd->mi_row, + features->cur_frame_force_integer_mv) + .as_int; + mv[1].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[1]], + features->allow_high_precision_mv, + bsize, xd->mi_col, xd->mi_row, + features->cur_frame_force_integer_mv) + .as_int;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodemv.c
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
} case NEW_NEARMV: { nmv_context *const nmvc = &ec_ctx->nmvc; read_mv(r, &mv[0].as_mv, &ref_mv[0].as_mv, nmvc, allow_hp); assert(is_compound); mv[1].as_int = near_mv[1].as_int; break; } case GLOBAL_GLOBALMV: { assert(is_compound);
+ show +
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
mv[0].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[0]], cm->allow_high_precision_mv, bsize, mi_col, mi_row, cm->cur_frame_force_integer_mv) .as_int; mv[1].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[1]], cm->allow_high_precision_mv, bsize, mi_col, mi_row, cm->cur_frame_force_integer_mv) .as_int;
+ show +
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
break; } default: { return 0; } } int ret = is_mv_valid(&mv[0].as_mv); if (is_compound) { ret = ret && is_mv_valid(&mv[1].as_mv); } return ret;

[CVE-2020-0478_1.diff] inspection.c #2
- fd->y_dequant[i][j] = cm->y_dequant_QTX[i][j]; - fd->u_dequant[i][j] = cm->u_dequant_QTX[i][j]; - fd->v_dequant[i][j] = cm->v_dequant_QTX[i][j]; + fd->y_dequant[i][j] = quant_params->y_dequant_QTX[i][j]; + fd->u_dequant[i][j] = quant_params->u_dequant_QTX[i][j]; + fd->v_dequant[i][j] = quant_params->v_dequant_QTX[i][j]; - for (j = 0; j < cm->mi_rows; j++) { - for (i = 0; i < cm->mi_cols; i++) { - const MB_MODE_INFO *mbmi = cm->mi_grid_visible[j * cm->mi_stride + i]; - insp_mi_data *mi = &fd->mi_grid[j * cm->mi_cols + i]; + for (j = 0; j < mi_params->mi_rows; j++) { + for (i = 0; i < mi_params->mi_cols; i++) { + const MB_MODE_INFO *mbmi = + mi_params->mi_grid_base[j * mi_params->mi_stride + i]; + insp_mi_data *mi = &fd->mi_grid[j * mi_params->mi_cols + i];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/inspection.c
54
55
56
57
58
59
60
61
62
63
fd->tile_mi_rows = tile_info.mi_row_end - tile_info.mi_row_start; fd->delta_q_present_flag = cm->delta_q_info.delta_q_present_flag; fd->delta_q_res = cm->delta_q_info.delta_q_res; #if CONFIG_ACCOUNTING fd->accounting = &pbi->accounting; #endif // TODO(negge): copy per frame CDEF data int i, j; for (i = 0; i < MAX_SEGMENTS; i++) { for (j = 0; j < 2; j++) {
+ show +
64
65
66
67
68
69
70
71
72
fd->y_dequant[i][j] = cm->y_dequant_QTX[i][j]; fd->u_dequant[i][j] = cm->u_dequant_QTX[i][j]; fd->v_dequant[i][j] = cm->v_dequant_QTX[i][j]; } } for (j = 0; j < cm->mi_rows; j++) { for (i = 0; i < cm->mi_cols; i++) { const MB_MODE_INFO *mbmi = cm->mi_grid_visible[j * cm->mi_stride + i]; insp_mi_data *mi = &fd->mi_grid[j * cm->mi_cols + i];
+ show +
73
74
75
76
77
78
79
80
81
82
// Segment mi->segment_id = mbmi->segment_id; // Motion Vectors mi->mv[0].row = mbmi->mv[0].as_mv.row; mi->mv[0].col = mbmi->mv[0].as_mv.col; mi->mv[1].row = mbmi->mv[1].as_mv.row; mi->mv[1].col = mbmi->mv[1].as_mv.col; // Reference Frames mi->ref_frame[0] = mbmi->ref_frame[0]; mi->ref_frame[1] = mbmi->ref_frame[1];

[CVE-2020-0470_1.diff] inspection.c #2
- fd->y_dequant[i][j] = cm->y_dequant_QTX[i][j]; - fd->u_dequant[i][j] = cm->u_dequant_QTX[i][j]; - fd->v_dequant[i][j] = cm->v_dequant_QTX[i][j]; + fd->y_dequant[i][j] = quant_params->y_dequant_QTX[i][j]; + fd->u_dequant[i][j] = quant_params->u_dequant_QTX[i][j]; + fd->v_dequant[i][j] = quant_params->v_dequant_QTX[i][j]; - for (j = 0; j < cm->mi_rows; j++) { - for (i = 0; i < cm->mi_cols; i++) { - const MB_MODE_INFO *mbmi = cm->mi_grid_visible[j * cm->mi_stride + i]; - insp_mi_data *mi = &fd->mi_grid[j * cm->mi_cols + i]; + for (j = 0; j < mi_params->mi_rows; j++) { + for (i = 0; i < mi_params->mi_cols; i++) { + const MB_MODE_INFO *mbmi = + mi_params->mi_grid_base[j * mi_params->mi_stride + i]; + insp_mi_data *mi = &fd->mi_grid[j * mi_params->mi_cols + i];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/inspection.c
54
55
56
57
58
59
60
61
62
63
fd->tile_mi_rows = tile_info.mi_row_end - tile_info.mi_row_start; fd->delta_q_present_flag = cm->delta_q_info.delta_q_present_flag; fd->delta_q_res = cm->delta_q_info.delta_q_res; #if CONFIG_ACCOUNTING fd->accounting = &pbi->accounting; #endif // TODO(negge): copy per frame CDEF data int i, j; for (i = 0; i < MAX_SEGMENTS; i++) { for (j = 0; j < 2; j++) {
+ show +
64
65
66
67
68
69
70
71
72
fd->y_dequant[i][j] = cm->y_dequant_QTX[i][j]; fd->u_dequant[i][j] = cm->u_dequant_QTX[i][j]; fd->v_dequant[i][j] = cm->v_dequant_QTX[i][j]; } } for (j = 0; j < cm->mi_rows; j++) { for (i = 0; i < cm->mi_cols; i++) { const MB_MODE_INFO *mbmi = cm->mi_grid_visible[j * cm->mi_stride + i]; insp_mi_data *mi = &fd->mi_grid[j * cm->mi_cols + i];
+ show +
73
74
75
76
77
78
79
80
81
82
// Segment mi->segment_id = mbmi->segment_id; // Motion Vectors mi->mv[0].row = mbmi->mv[0].as_mv.row; mi->mv[0].col = mbmi->mv[0].as_mv.col; mi->mv[1].row = mbmi->mv[1].as_mv.row; mi->mv[1].col = mbmi->mv[1].as_mv.col; // Reference Frames mi->ref_frame[0] = mbmi->ref_frame[0]; mi->ref_frame[1] = mbmi->ref_frame[1];

[CVE-2020-0478_1.diff] decodeframe.c #3
-static void inverse_transform_block(MACROBLOCKD *xd, int plane, - const TX_TYPE tx_type, - const TX_SIZE tx_size, uint8_t *dst, - int stride, int reduced_tx_set) { +static AOM_INLINE void inverse_transform_block(MACROBLOCKD *xd, int plane, + const TX_TYPE tx_type, + const TX_SIZE tx_size, + uint8_t *dst, int stride, + int reduced_tx_set) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
144
145
146
147
148
149
150
151
152
153
static REFERENCE_MODE read_frame_reference_mode( const AV1_COMMON *cm, struct aom_read_bit_buffer *rb) { if (frame_is_intra_only(cm)) { return SINGLE_REFERENCE; } else { return aom_rb_read_bit(rb) ? REFERENCE_MODE_SELECT : SINGLE_REFERENCE; } }
+ show +
154
155
156
157
static void inverse_transform_block(MACROBLOCKD *xd, int plane, const TX_TYPE tx_type, const TX_SIZE tx_size, uint8_t *dst, int stride, int reduced_tx_set) {
+ show +
158
159
160
161
162
163
164
165
166
167
struct macroblockd_plane *const pd = &xd->plane[plane]; tran_low_t *const dqcoeff = pd->dqcoeff_block + xd->cb_offset[plane]; eob_info *eob_data = pd->eob_data + xd->txb_offset[plane]; uint16_t scan_line = eob_data->max_scan_line; uint16_t eob = eob_data->eob; av1_inverse_transform_block(xd, dqcoeff, plane, tx_type, tx_size, dst, stride, eob, reduced_tx_set); memset(dqcoeff, 0, (scan_line + 1) * sizeof(dqcoeff[0])); }

[CVE-2020-0478_1.diff] decodeframe.c #4
-static void read_coeffs_tx_intra_block(const AV1_COMMON *const cm, - MACROBLOCKD *const xd, - aom_reader *const r, const int plane, - const int row, const int col, - const TX_SIZE tx_size) { +static AOM_INLINE void read_coeffs_tx_intra_block( + const AV1_COMMON *const cm, MACROBLOCKD *const xd, aom_reader *const r, + const int plane, const int row, const int col, const TX_SIZE tx_size) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
158
159
160
161
162
163
164
165
166
167
struct macroblockd_plane *const pd = &xd->plane[plane]; tran_low_t *const dqcoeff = pd->dqcoeff_block + xd->cb_offset[plane]; eob_info *eob_data = pd->eob_data + xd->txb_offset[plane]; uint16_t scan_line = eob_data->max_scan_line; uint16_t eob = eob_data->eob; av1_inverse_transform_block(xd, dqcoeff, plane, tx_type, tx_size, dst, stride, eob, reduced_tx_set); memset(dqcoeff, 0, (scan_line + 1) * sizeof(dqcoeff[0])); }
+ show +
168
169
170
171
172
static void read_coeffs_tx_intra_block(const AV1_COMMON *const cm, MACROBLOCKD *const xd, aom_reader *const r, const int plane, const int row, const int col, const TX_SIZE tx_size) {
+ show +
173
174
175
176
177
178
179
180
181
182
MB_MODE_INFO *mbmi = xd->mi[0]; if (!mbmi->skip) { #if TXCOEFF_TIMER struct aom_usec_timer timer; aom_usec_timer_start(&timer); #endif av1_read_coeffs_txb_facade(cm, xd, r, plane, row, col, tx_size); #if TXCOEFF_TIMER aom_usec_timer_mark(&timer); const int64_t elapsed_time = aom_usec_timer_elapsed(&timer);

[CVE-2020-0478_1.diff] decodeframe.c #5
-static void decode_block_void(const AV1_COMMON *const cm, MACROBLOCKD *const xd, - aom_reader *const r, const int plane, - const int row, const int col, - const TX_SIZE tx_size) { +static AOM_INLINE void decode_block_void(const AV1_COMMON *const cm, + MACROBLOCKD *const xd, + aom_reader *const r, const int plane, + const int row, const int col, + const TX_SIZE tx_size) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
179
180
181
182
183
184
185
186
187
188
av1_read_coeffs_txb_facade(cm, xd, r, plane, row, col, tx_size); #if TXCOEFF_TIMER aom_usec_timer_mark(&timer); const int64_t elapsed_time = aom_usec_timer_elapsed(&timer); cm->txcoeff_timer += elapsed_time; ++cm->txb_count; #endif } }
+ show +
189
190
191
192
static void decode_block_void(const AV1_COMMON *const cm, MACROBLOCKD *const xd, aom_reader *const r, const int plane, const int row, const int col, const TX_SIZE tx_size) {
+ show +
193
194
195
196
197
198
199
200
201
202
(void)cm; (void)xd; (void)r; (void)plane; (void)row; (void)col; (void)tx_size; } static void predict_inter_block_void(AV1_COMMON *const cm,

[CVE-2020-0478_1.diff] decodeframe.c #28
+ if (plane && !xd->is_chroma_ref) break; - if (!is_chroma_reference(mi_row, mi_col, bsize, pd->subsampling_x, - pd->subsampling_y)) - continue; - const BLOCK_SIZE bsizec = - scale_chroma_bsize(bsize, pd->subsampling_x, pd->subsampling_y); - const BLOCK_SIZE plane_bsize = get_plane_block_size( - bsizec, pd->subsampling_x, pd->subsampling_y); - + const int ss_x = pd->subsampling_x; + const int ss_y = pd->subsampling_y; + const BLOCK_SIZE plane_bsize = + get_plane_block_size(bsize, ss_x, ss_y);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
int mu_blocks_high = block_size_high[max_unit_bsize] >> tx_size_high_log2[0]; mu_blocks_wide = AOMMIN(max_blocks_wide, mu_blocks_wide); mu_blocks_high = AOMMIN(max_blocks_high, mu_blocks_high); for (row = 0; row < max_blocks_high; row += mu_blocks_high) { for (col = 0; col < max_blocks_wide; col += mu_blocks_wide) { for (int plane = 0; plane < num_planes; ++plane) { const struct macroblockd_plane *const pd = &xd->plane[plane];
+ show +
1192
1193
1194
1195
1196
1197
1198
if (!is_chroma_reference(mi_row, mi_col, bsize, pd->subsampling_x, pd->subsampling_y)) continue; const BLOCK_SIZE bsizec = scale_chroma_bsize(bsize, pd->subsampling_x, pd->subsampling_y); const BLOCK_SIZE plane_bsize = get_plane_block_size( bsizec, pd->subsampling_x, pd->subsampling_y);
+ show +
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
const TX_SIZE max_tx_size = get_vartx_max_txsize(xd, plane_bsize, plane); const int bh_var_tx = tx_size_high_unit[max_tx_size]; const int bw_var_tx = tx_size_wide_unit[max_tx_size]; int block = 0; int step = tx_size_wide_unit[max_tx_size] * tx_size_high_unit[max_tx_size]; int blk_row, blk_col; const int unit_height = ROUND_POWER_OF_TWO(

[CVE-2020-0478_1.diff] decodeframe.c #30
- av1_visit_palette(pbi, xd, mi_row, mi_col, r, bsize, - set_color_index_map_offset); + av1_visit_palette(pbi, xd, r, set_color_index_map_offset); -#if LOOP_FILTER_BITMASK -static void store_bitmask_vartx(AV1_COMMON *cm, int mi_row, int mi_col, - BLOCK_SIZE bsize, TX_SIZE tx_size, - MB_MODE_INFO *mbmi); -#endif - -static void set_inter_tx_size(MB_MODE_INFO *mbmi, int stride_log2, - int tx_w_log2, int tx_h_log2, int min_txs, - int split_size, int txs, int blk_row, - int blk_col) { +static AOM_INLINE void set_inter_tx_size(MB_MODE_INFO *mbmi, int stride_log2, + int tx_w_log2, int tx_h_log2, + int min_txs, int split_size, int txs, + int blk_row, int blk_col) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
block += step; } } } } } } td->cfl_store_inter_block_visit(cm, xd); }
+ show +
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
av1_visit_palette(pbi, xd, mi_row, mi_col, r, bsize, set_color_index_map_offset); } #if LOOP_FILTER_BITMASK static void store_bitmask_vartx(AV1_COMMON *cm, int mi_row, int mi_col, BLOCK_SIZE bsize, TX_SIZE tx_size, MB_MODE_INFO *mbmi); #endif static void set_inter_tx_size(MB_MODE_INFO *mbmi, int stride_log2, int tx_w_log2, int tx_h_log2, int min_txs, int split_size, int txs, int blk_row, int blk_col) {
+ show +
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
for (int idy = 0; idy < tx_size_high_unit[split_size]; idy += tx_size_high_unit[min_txs]) { for (int idx = 0; idx < tx_size_wide_unit[split_size]; idx += tx_size_wide_unit[min_txs]) { const int index = (((blk_row + idy) >> tx_h_log2) << stride_log2) + ((blk_col + idx) >> tx_w_log2); mbmi->inter_tx_size[index] = txs; } } }

[CVE-2020-0478_1.diff] decodeframe.c #37
+ const CommonQuantParams *const quant_params = &cm->quant_params; - const int dc_delta_q = - j == 0 ? cm->y_dc_delta_q - : (j == 1 ? cm->u_dc_delta_q : cm->v_dc_delta_q); - const int ac_delta_q = - j == 0 ? 0 : (j == 1 ? cm->u_ac_delta_q : cm->v_ac_delta_q); + const int dc_delta_q = j == 0 ? quant_params->y_dc_delta_q + : (j == 1 ? quant_params->u_dc_delta_q + : quant_params->v_dc_delta_q); + const int ac_delta_q = j == 0 ? 0 + : (j == 1 ? quant_params->u_ac_delta_q + : quant_params->v_ac_delta_q);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
} } } #endif if (cm->delta_q_info.delta_q_present_flag) { for (int i = 0; i < MAX_SEGMENTS; i++) { const int current_qindex = av1_get_qindex(&cm->seg, i, xd->current_qindex); for (int j = 0; j < num_planes; ++j) {
+ show +
1653
1654
1655
1656
1657
const int dc_delta_q = j == 0 ? cm->y_dc_delta_q : (j == 1 ? cm->u_dc_delta_q : cm->v_dc_delta_q); const int ac_delta_q = j == 0 ? 0 : (j == 1 ? cm->u_ac_delta_q : cm->v_ac_delta_q);
+ show +
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
xd->plane[j].seg_dequant_QTX[i][0] = av1_dc_quant_QTX( current_qindex, dc_delta_q, cm->seq_params.bit_depth); xd->plane[j].seg_dequant_QTX[i][1] = av1_ac_quant_QTX( current_qindex, ac_delta_q, cm->seq_params.bit_depth); } } } if (mbmi->skip) av1_reset_skip_context(xd, mi_row, mi_col, bsize, num_planes); decode_token_recon_block(pbi, td, mi_row, mi_col, r, bsize);

[CVE-2020-0478_1.diff] decodeframe.c #40
- const int has_rows = (mi_row + hbs) < cm->mi_rows; - const int has_cols = (mi_col + hbs) < cm->mi_cols; + const int has_rows = (mi_row + hbs) < cm->mi_params.mi_rows; + const int has_cols = (mi_col + hbs) < cm->mi_params.mi_cols; - if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) return; + if (mi_row >= cm->mi_params.mi_rows || mi_col >= cm->mi_params.mi_cols) + return; - static const block_visitor_fn_t block_visit[4] = { - NULL, parse_decode_block, decode_block, parse_decode_block - }; + static const block_visitor_fn_t block_visit[4] = { NULL, parse_decode_block, + decode_block, + parse_decode_block };
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
int mi_row, int mi_col, aom_reader *reader, BLOCK_SIZE bsize, int parse_decode_flag) { AV1_COMMON *const cm = &pbi->common; MACROBLOCKD *const xd = &td->xd; const int bw = mi_size_wide[bsize]; const int hbs = bw >> 1; PARTITION_TYPE partition; BLOCK_SIZE subsize; const int quarter_step = bw / 4; BLOCK_SIZE bsize2 = get_partition_subsize(bsize, PARTITION_SPLIT);
+ show +
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
const int has_rows = (mi_row + hbs) < cm->mi_rows; const int has_cols = (mi_col + hbs) < cm->mi_cols; if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) return; // parse_decode_flag takes the following values : // 01 - do parse only // 10 - do decode only // 11 - do parse and decode static const block_visitor_fn_t block_visit[4] = { NULL, parse_decode_block, decode_block, parse_decode_block };
+ show +
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
if (parse_decode_flag & 1) { const int num_planes = av1_num_planes(cm); for (int plane = 0; plane < num_planes; ++plane) { int rcol0, rcol1, rrow0, rrow1; if (av1_loop_restoration_corners_in_sb(cm, plane, mi_row, mi_col, bsize, &rcol0, &rcol1, &rrow0, &rrow1)) { const int rstride = cm->rst_info[plane].horz_units_per_tile; for (int rrow = rrow0; rrow < rrow1; ++rrow) { for (int rcol = rcol0; rcol < rcol1; ++rcol) {

[CVE-2020-0478_1.diff] decodeframe.c #43
-static void setup_bool_decoder(const uint8_t *data, const uint8_t *data_end, - const size_t read_size, - struct aom_internal_error_info *error_info, - aom_reader *r, uint8_t allow_update_cdf) { +static AOM_INLINE void setup_bool_decoder( + const uint8_t *data, const uint8_t *data_end, const size_t read_size, + struct aom_internal_error_info *error_info, aom_reader *r, + uint8_t allow_update_cdf) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
#undef DEC_PARTITION #undef DEC_BLOCK #undef DEC_BLOCK_EPT_ARG #undef DEC_BLOCK_STX_ARG if (parse_decode_flag & 1) update_ext_partition_context(xd, mi_row, mi_col, subsize, bsize, partition); }
+ show +
1863
1864
1865
1866
static void setup_bool_decoder(const uint8_t *data, const uint8_t *data_end, const size_t read_size, struct aom_internal_error_info *error_info, aom_reader *r, uint8_t allow_update_cdf) {
+ show +
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
// Validate the calculated partition length. If the buffer // described by the partition can't be fully read, then restrict // it to the portion that can be (for EC mode) or throw an error. if (!read_is_valid(data, read_size, data_end)) aom_internal_error(error_info, AOM_CODEC_CORRUPT_FRAME, "Truncated packet or corrupt tile length"); if (aom_reader_init(r, data, read_size)) aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, "Failed to allocate bool decoder %d", 1);

[CVE-2020-0478_1.diff] decodeframe.c #84
-static void tile_worker_hook_init(AV1Decoder *const pbi, - DecWorkerData *const thread_data, - const TileBufferDec *const tile_buffer, - TileDataDec *const tile_data, - uint8_t allow_update_cdf) { +static AOM_INLINE void tile_worker_hook_init( + AV1Decoder *const pbi, DecWorkerData *const thread_data, + const TileBufferDec *const tile_buffer, TileDataDec *const tile_data, + uint8_t allow_update_cdf) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
tile_mt_info->jobs_dequeued++; } pthread_mutex_unlock(tile_mt_info->job_mutex); #else (void)tile_mt_info; #endif return cur_job_info; }
+ show +
3283
3284
3285
3286
3287
static void tile_worker_hook_init(AV1Decoder *const pbi, DecWorkerData *const thread_data, const TileBufferDec *const tile_buffer, TileDataDec *const tile_data, uint8_t allow_update_cdf) {
+ show +
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
AV1_COMMON *cm = &pbi->common; ThreadData *const td = thread_data->td; int tile_row = tile_data->tile_info.tile_row; int tile_col = tile_data->tile_info.tile_col; td->bit_reader = &tile_data->bit_reader; av1_zero(td->cb_buffer_base.dqcoeff); av1_tile_init(&td->xd.tile, cm, tile_row, tile_col); td->xd.current_qindex = cm->base_qindex; setup_bool_decoder(tile_buffer->data, thread_data->data_end,

[CVE-2020-0478_1.diff] decodeframe.c #93
-static void enqueue_tile_jobs(AV1Decoder *pbi, AV1_COMMON *cm, - int tile_rows_start, int tile_rows_end, - int tile_cols_start, int tile_cols_end, - int start_tile, int end_tile) { +static AOM_INLINE void enqueue_tile_jobs(AV1Decoder *pbi, AV1_COMMON *cm, + int tile_rows_start, int tile_rows_end, + int tile_cols_start, int tile_cols_end, + int start_tile, int end_tile) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
return !td->xd.corrupted; } // sorts in descending order static int compare_tile_buffers(const void *a, const void *b) { const TileJobsDec *const buf1 = (const TileJobsDec *)a; const TileJobsDec *const buf2 = (const TileJobsDec *)b; return (((int)buf2->tile_buffer->size) - ((int)buf1->tile_buffer->size)); }
+ show +
3688
3689
3690
3691
static void enqueue_tile_jobs(AV1Decoder *pbi, AV1_COMMON *cm, int tile_rows_start, int tile_rows_end, int tile_cols_start, int tile_cols_end, int start_tile, int end_tile) {
+ show +
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
AV1DecTileMT *tile_mt_info = &pbi->tile_mt_info; TileJobsDec *tile_job_queue = tile_mt_info->job_queue; tile_mt_info->jobs_enqueued = 0; tile_mt_info->jobs_dequeued = 0; for (int row = tile_rows_start; row < tile_rows_end; row++) { for (int col = tile_cols_start; col < tile_cols_end; col++) { if (row * cm->tile_cols + col < start_tile || row * cm->tile_cols + col > end_tile) continue;

[CVE-2020-0478_1.diff] decodeframe.c #100
-static void tile_mt_queue(AV1Decoder *pbi, int tile_cols, int tile_rows, - int tile_rows_start, int tile_rows_end, - int tile_cols_start, int tile_cols_end, - int start_tile, int end_tile) { +static AOM_INLINE void tile_mt_queue(AV1Decoder *pbi, int tile_cols, + int tile_rows, int tile_rows_start, + int tile_rows_end, int tile_cols_start, + int tile_cols_end, int start_tile, + int end_tile) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
const int buf_size = MC_TEMP_BUF_PELS << use_highbd; for (worker_idx = 0; worker_idx < pbi->max_threads - 1; ++worker_idx) { DecWorkerData *const thread_data = pbi->thread_data + worker_idx; if (thread_data->td->mc_buf_size != buf_size) { av1_free_mc_tmp_buf(thread_data->td); allocate_mc_tmp_buf(cm, thread_data->td, buf_size, use_highbd); } } }
+ show +
3884
3885
3886
3887
static void tile_mt_queue(AV1Decoder *pbi, int tile_cols, int tile_rows, int tile_rows_start, int tile_rows_end, int tile_cols_start, int tile_cols_end, int start_tile, int end_tile) {
+ show +
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
AV1_COMMON *const cm = &pbi->common; if (pbi->tile_mt_info.alloc_tile_cols != tile_cols || pbi->tile_mt_info.alloc_tile_rows != tile_rows) { av1_dealloc_dec_jobs(&pbi->tile_mt_info); alloc_dec_jobs(&pbi->tile_mt_info, cm, tile_rows, tile_cols); } enqueue_tile_jobs(pbi, cm, tile_rows_start, tile_rows_end, tile_cols_start, tile_cols_end, start_tile, end_tile); qsort(pbi->tile_mt_info.job_queue, pbi->tile_mt_info.jobs_enqueued, sizeof(pbi->tile_mt_info.job_queue[0]), compare_tile_buffers);

[CVE-2020-0478_1.diff] decodeframe.c #107
-static void row_mt_frame_init(AV1Decoder *pbi, int tile_rows_start, - int tile_rows_end, int tile_cols_start, - int tile_cols_end, int start_tile, int end_tile, - int max_sb_rows) { +static AOM_INLINE void row_mt_frame_init(AV1Decoder *pbi, int tile_rows_start, + int tile_rows_end, int tile_cols_start, + int tile_cols_end, int start_tile, + int end_tile, int max_sb_rows) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
if (pbi->cb_buffer_alloc_size < size) { av1_dec_free_cb_buf(pbi); CHECK_MEM_ERROR(cm, pbi->cb_buffer_base, aom_memalign(32, sizeof(*pbi->cb_buffer_base) * size)); memset(pbi->cb_buffer_base, 0, sizeof(*pbi->cb_buffer_base) * size); pbi->cb_buffer_alloc_size = size; } }
+ show +
4009
4010
4011
4012
static void row_mt_frame_init(AV1Decoder *pbi, int tile_rows_start, int tile_rows_end, int tile_cols_start, int tile_cols_end, int start_tile, int end_tile, int max_sb_rows) {
+ show +
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
AV1_COMMON *const cm = &pbi->common; AV1DecRowMTInfo *frame_row_mt_info = &pbi->frame_row_mt_info; frame_row_mt_info->tile_rows_start = tile_rows_start; frame_row_mt_info->tile_rows_end = tile_rows_end; frame_row_mt_info->tile_cols_start = tile_cols_start; frame_row_mt_info->tile_cols_end = tile_cols_end; frame_row_mt_info->start_tile = start_tile; frame_row_mt_info->end_tile = end_tile; frame_row_mt_info->mi_rows_to_decode = 0;

[CVE-2020-0470_1.diff] decodeframe.c #3
-static void inverse_transform_block(MACROBLOCKD *xd, int plane, - const TX_TYPE tx_type, - const TX_SIZE tx_size, uint8_t *dst, - int stride, int reduced_tx_set) { +static AOM_INLINE void inverse_transform_block(MACROBLOCKD *xd, int plane, + const TX_TYPE tx_type, + const TX_SIZE tx_size, + uint8_t *dst, int stride, + int reduced_tx_set) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
144
145
146
147
148
149
150
151
152
153
static REFERENCE_MODE read_frame_reference_mode( const AV1_COMMON *cm, struct aom_read_bit_buffer *rb) { if (frame_is_intra_only(cm)) { return SINGLE_REFERENCE; } else { return aom_rb_read_bit(rb) ? REFERENCE_MODE_SELECT : SINGLE_REFERENCE; } }
+ show +
154
155
156
157
static void inverse_transform_block(MACROBLOCKD *xd, int plane, const TX_TYPE tx_type, const TX_SIZE tx_size, uint8_t *dst, int stride, int reduced_tx_set) {
+ show +
158
159
160
161
162
163
164
165
166
167
struct macroblockd_plane *const pd = &xd->plane[plane]; tran_low_t *const dqcoeff = pd->dqcoeff_block + xd->cb_offset[plane]; eob_info *eob_data = pd->eob_data + xd->txb_offset[plane]; uint16_t scan_line = eob_data->max_scan_line; uint16_t eob = eob_data->eob; av1_inverse_transform_block(xd, dqcoeff, plane, tx_type, tx_size, dst, stride, eob, reduced_tx_set); memset(dqcoeff, 0, (scan_line + 1) * sizeof(dqcoeff[0])); }

[CVE-2020-0470_1.diff] decodeframe.c #4
-static void read_coeffs_tx_intra_block(const AV1_COMMON *const cm, - MACROBLOCKD *const xd, - aom_reader *const r, const int plane, - const int row, const int col, - const TX_SIZE tx_size) { +static AOM_INLINE void read_coeffs_tx_intra_block( + const AV1_COMMON *const cm, MACROBLOCKD *const xd, aom_reader *const r, + const int plane, const int row, const int col, const TX_SIZE tx_size) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
158
159
160
161
162
163
164
165
166
167
struct macroblockd_plane *const pd = &xd->plane[plane]; tran_low_t *const dqcoeff = pd->dqcoeff_block + xd->cb_offset[plane]; eob_info *eob_data = pd->eob_data + xd->txb_offset[plane]; uint16_t scan_line = eob_data->max_scan_line; uint16_t eob = eob_data->eob; av1_inverse_transform_block(xd, dqcoeff, plane, tx_type, tx_size, dst, stride, eob, reduced_tx_set); memset(dqcoeff, 0, (scan_line + 1) * sizeof(dqcoeff[0])); }
+ show +
168
169
170
171
172
static void read_coeffs_tx_intra_block(const AV1_COMMON *const cm, MACROBLOCKD *const xd, aom_reader *const r, const int plane, const int row, const int col, const TX_SIZE tx_size) {
+ show +
173
174
175
176
177
178
179
180
181
182
MB_MODE_INFO *mbmi = xd->mi[0]; if (!mbmi->skip) { #if TXCOEFF_TIMER struct aom_usec_timer timer; aom_usec_timer_start(&timer); #endif av1_read_coeffs_txb_facade(cm, xd, r, plane, row, col, tx_size); #if TXCOEFF_TIMER aom_usec_timer_mark(&timer); const int64_t elapsed_time = aom_usec_timer_elapsed(&timer);

[CVE-2020-0470_1.diff] decodeframe.c #5
-static void decode_block_void(const AV1_COMMON *const cm, MACROBLOCKD *const xd, - aom_reader *const r, const int plane, - const int row, const int col, - const TX_SIZE tx_size) { +static AOM_INLINE void decode_block_void(const AV1_COMMON *const cm, + MACROBLOCKD *const xd, + aom_reader *const r, const int plane, + const int row, const int col, + const TX_SIZE tx_size) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
179
180
181
182
183
184
185
186
187
188
av1_read_coeffs_txb_facade(cm, xd, r, plane, row, col, tx_size); #if TXCOEFF_TIMER aom_usec_timer_mark(&timer); const int64_t elapsed_time = aom_usec_timer_elapsed(&timer); cm->txcoeff_timer += elapsed_time; ++cm->txb_count; #endif } }
+ show +
189
190
191
192
static void decode_block_void(const AV1_COMMON *const cm, MACROBLOCKD *const xd, aom_reader *const r, const int plane, const int row, const int col, const TX_SIZE tx_size) {
+ show +
193
194
195
196
197
198
199
200
201
202
(void)cm; (void)xd; (void)r; (void)plane; (void)row; (void)col; (void)tx_size; } static void predict_inter_block_void(AV1_COMMON *const cm,

[CVE-2020-0470_1.diff] decodeframe.c #28
+ if (plane && !xd->is_chroma_ref) break; - if (!is_chroma_reference(mi_row, mi_col, bsize, pd->subsampling_x, - pd->subsampling_y)) - continue; - const BLOCK_SIZE bsizec = - scale_chroma_bsize(bsize, pd->subsampling_x, pd->subsampling_y); - const BLOCK_SIZE plane_bsize = get_plane_block_size( - bsizec, pd->subsampling_x, pd->subsampling_y); - + const int ss_x = pd->subsampling_x; + const int ss_y = pd->subsampling_y; + const BLOCK_SIZE plane_bsize = + get_plane_block_size(bsize, ss_x, ss_y);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
int mu_blocks_high = block_size_high[max_unit_bsize] >> tx_size_high_log2[0]; mu_blocks_wide = AOMMIN(max_blocks_wide, mu_blocks_wide); mu_blocks_high = AOMMIN(max_blocks_high, mu_blocks_high); for (row = 0; row < max_blocks_high; row += mu_blocks_high) { for (col = 0; col < max_blocks_wide; col += mu_blocks_wide) { for (int plane = 0; plane < num_planes; ++plane) { const struct macroblockd_plane *const pd = &xd->plane[plane];
+ show +
1192
1193
1194
1195
1196
1197
1198
if (!is_chroma_reference(mi_row, mi_col, bsize, pd->subsampling_x, pd->subsampling_y)) continue; const BLOCK_SIZE bsizec = scale_chroma_bsize(bsize, pd->subsampling_x, pd->subsampling_y); const BLOCK_SIZE plane_bsize = get_plane_block_size( bsizec, pd->subsampling_x, pd->subsampling_y);
+ show +
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
const TX_SIZE max_tx_size = get_vartx_max_txsize(xd, plane_bsize, plane); const int bh_var_tx = tx_size_high_unit[max_tx_size]; const int bw_var_tx = tx_size_wide_unit[max_tx_size]; int block = 0; int step = tx_size_wide_unit[max_tx_size] * tx_size_high_unit[max_tx_size]; int blk_row, blk_col; const int unit_height = ROUND_POWER_OF_TWO(

[CVE-2020-0470_1.diff] decodeframe.c #30
- av1_visit_palette(pbi, xd, mi_row, mi_col, r, bsize, - set_color_index_map_offset); + av1_visit_palette(pbi, xd, r, set_color_index_map_offset); -#if LOOP_FILTER_BITMASK -static void store_bitmask_vartx(AV1_COMMON *cm, int mi_row, int mi_col, - BLOCK_SIZE bsize, TX_SIZE tx_size, - MB_MODE_INFO *mbmi); -#endif - -static void set_inter_tx_size(MB_MODE_INFO *mbmi, int stride_log2, - int tx_w_log2, int tx_h_log2, int min_txs, - int split_size, int txs, int blk_row, - int blk_col) { +static AOM_INLINE void set_inter_tx_size(MB_MODE_INFO *mbmi, int stride_log2, + int tx_w_log2, int tx_h_log2, + int min_txs, int split_size, int txs, + int blk_row, int blk_col) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
block += step; } } } } } } td->cfl_store_inter_block_visit(cm, xd); }
+ show +
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
av1_visit_palette(pbi, xd, mi_row, mi_col, r, bsize, set_color_index_map_offset); } #if LOOP_FILTER_BITMASK static void store_bitmask_vartx(AV1_COMMON *cm, int mi_row, int mi_col, BLOCK_SIZE bsize, TX_SIZE tx_size, MB_MODE_INFO *mbmi); #endif static void set_inter_tx_size(MB_MODE_INFO *mbmi, int stride_log2, int tx_w_log2, int tx_h_log2, int min_txs, int split_size, int txs, int blk_row, int blk_col) {
+ show +
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
for (int idy = 0; idy < tx_size_high_unit[split_size]; idy += tx_size_high_unit[min_txs]) { for (int idx = 0; idx < tx_size_wide_unit[split_size]; idx += tx_size_wide_unit[min_txs]) { const int index = (((blk_row + idy) >> tx_h_log2) << stride_log2) + ((blk_col + idx) >> tx_w_log2); mbmi->inter_tx_size[index] = txs; } } }

[CVE-2020-0470_1.diff] decodeframe.c #37
+ const CommonQuantParams *const quant_params = &cm->quant_params; - const int dc_delta_q = - j == 0 ? cm->y_dc_delta_q - : (j == 1 ? cm->u_dc_delta_q : cm->v_dc_delta_q); - const int ac_delta_q = - j == 0 ? 0 : (j == 1 ? cm->u_ac_delta_q : cm->v_ac_delta_q); + const int dc_delta_q = j == 0 ? quant_params->y_dc_delta_q + : (j == 1 ? quant_params->u_dc_delta_q + : quant_params->v_dc_delta_q); + const int ac_delta_q = j == 0 ? 0 + : (j == 1 ? quant_params->u_ac_delta_q + : quant_params->v_ac_delta_q);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
} } } #endif if (cm->delta_q_info.delta_q_present_flag) { for (int i = 0; i < MAX_SEGMENTS; i++) { const int current_qindex = av1_get_qindex(&cm->seg, i, xd->current_qindex); for (int j = 0; j < num_planes; ++j) {
+ show +
1653
1654
1655
1656
1657
const int dc_delta_q = j == 0 ? cm->y_dc_delta_q : (j == 1 ? cm->u_dc_delta_q : cm->v_dc_delta_q); const int ac_delta_q = j == 0 ? 0 : (j == 1 ? cm->u_ac_delta_q : cm->v_ac_delta_q);
+ show +
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
xd->plane[j].seg_dequant_QTX[i][0] = av1_dc_quant_QTX( current_qindex, dc_delta_q, cm->seq_params.bit_depth); xd->plane[j].seg_dequant_QTX[i][1] = av1_ac_quant_QTX( current_qindex, ac_delta_q, cm->seq_params.bit_depth); } } } if (mbmi->skip) av1_reset_skip_context(xd, mi_row, mi_col, bsize, num_planes); decode_token_recon_block(pbi, td, mi_row, mi_col, r, bsize);

[CVE-2020-0470_1.diff] decodeframe.c #40
- const int has_rows = (mi_row + hbs) < cm->mi_rows; - const int has_cols = (mi_col + hbs) < cm->mi_cols; + const int has_rows = (mi_row + hbs) < cm->mi_params.mi_rows; + const int has_cols = (mi_col + hbs) < cm->mi_params.mi_cols; - if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) return; + if (mi_row >= cm->mi_params.mi_rows || mi_col >= cm->mi_params.mi_cols) + return; - static const block_visitor_fn_t block_visit[4] = { - NULL, parse_decode_block, decode_block, parse_decode_block - }; + static const block_visitor_fn_t block_visit[4] = { NULL, parse_decode_block, + decode_block, + parse_decode_block };
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
int mi_row, int mi_col, aom_reader *reader, BLOCK_SIZE bsize, int parse_decode_flag) { AV1_COMMON *const cm = &pbi->common; MACROBLOCKD *const xd = &td->xd; const int bw = mi_size_wide[bsize]; const int hbs = bw >> 1; PARTITION_TYPE partition; BLOCK_SIZE subsize; const int quarter_step = bw / 4; BLOCK_SIZE bsize2 = get_partition_subsize(bsize, PARTITION_SPLIT);
+ show +
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
const int has_rows = (mi_row + hbs) < cm->mi_rows; const int has_cols = (mi_col + hbs) < cm->mi_cols; if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) return; // parse_decode_flag takes the following values : // 01 - do parse only // 10 - do decode only // 11 - do parse and decode static const block_visitor_fn_t block_visit[4] = { NULL, parse_decode_block, decode_block, parse_decode_block };
+ show +
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
if (parse_decode_flag & 1) { const int num_planes = av1_num_planes(cm); for (int plane = 0; plane < num_planes; ++plane) { int rcol0, rcol1, rrow0, rrow1; if (av1_loop_restoration_corners_in_sb(cm, plane, mi_row, mi_col, bsize, &rcol0, &rcol1, &rrow0, &rrow1)) { const int rstride = cm->rst_info[plane].horz_units_per_tile; for (int rrow = rrow0; rrow < rrow1; ++rrow) { for (int rcol = rcol0; rcol < rcol1; ++rcol) {

[CVE-2020-0470_1.diff] decodeframe.c #43
-static void setup_bool_decoder(const uint8_t *data, const uint8_t *data_end, - const size_t read_size, - struct aom_internal_error_info *error_info, - aom_reader *r, uint8_t allow_update_cdf) { +static AOM_INLINE void setup_bool_decoder( + const uint8_t *data, const uint8_t *data_end, const size_t read_size, + struct aom_internal_error_info *error_info, aom_reader *r, + uint8_t allow_update_cdf) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
#undef DEC_PARTITION #undef DEC_BLOCK #undef DEC_BLOCK_EPT_ARG #undef DEC_BLOCK_STX_ARG if (parse_decode_flag & 1) update_ext_partition_context(xd, mi_row, mi_col, subsize, bsize, partition); }
+ show +
1863
1864
1865
1866
static void setup_bool_decoder(const uint8_t *data, const uint8_t *data_end, const size_t read_size, struct aom_internal_error_info *error_info, aom_reader *r, uint8_t allow_update_cdf) {
+ show +
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
// Validate the calculated partition length. If the buffer // described by the partition can't be fully read, then restrict // it to the portion that can be (for EC mode) or throw an error. if (!read_is_valid(data, read_size, data_end)) aom_internal_error(error_info, AOM_CODEC_CORRUPT_FRAME, "Truncated packet or corrupt tile length"); if (aom_reader_init(r, data, read_size)) aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, "Failed to allocate bool decoder %d", 1);

[CVE-2020-0470_1.diff] decodeframe.c #84
-static void tile_worker_hook_init(AV1Decoder *const pbi, - DecWorkerData *const thread_data, - const TileBufferDec *const tile_buffer, - TileDataDec *const tile_data, - uint8_t allow_update_cdf) { +static AOM_INLINE void tile_worker_hook_init( + AV1Decoder *const pbi, DecWorkerData *const thread_data, + const TileBufferDec *const tile_buffer, TileDataDec *const tile_data, + uint8_t allow_update_cdf) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
tile_mt_info->jobs_dequeued++; } pthread_mutex_unlock(tile_mt_info->job_mutex); #else (void)tile_mt_info; #endif return cur_job_info; }
+ show +
3283
3284
3285
3286
3287
static void tile_worker_hook_init(AV1Decoder *const pbi, DecWorkerData *const thread_data, const TileBufferDec *const tile_buffer, TileDataDec *const tile_data, uint8_t allow_update_cdf) {
+ show +
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
AV1_COMMON *cm = &pbi->common; ThreadData *const td = thread_data->td; int tile_row = tile_data->tile_info.tile_row; int tile_col = tile_data->tile_info.tile_col; td->bit_reader = &tile_data->bit_reader; av1_zero(td->cb_buffer_base.dqcoeff); av1_tile_init(&td->xd.tile, cm, tile_row, tile_col); td->xd.current_qindex = cm->base_qindex; setup_bool_decoder(tile_buffer->data, thread_data->data_end,

[CVE-2020-0470_1.diff] decodeframe.c #93
-static void enqueue_tile_jobs(AV1Decoder *pbi, AV1_COMMON *cm, - int tile_rows_start, int tile_rows_end, - int tile_cols_start, int tile_cols_end, - int start_tile, int end_tile) { +static AOM_INLINE void enqueue_tile_jobs(AV1Decoder *pbi, AV1_COMMON *cm, + int tile_rows_start, int tile_rows_end, + int tile_cols_start, int tile_cols_end, + int start_tile, int end_tile) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
return !td->xd.corrupted; } // sorts in descending order static int compare_tile_buffers(const void *a, const void *b) { const TileJobsDec *const buf1 = (const TileJobsDec *)a; const TileJobsDec *const buf2 = (const TileJobsDec *)b; return (((int)buf2->tile_buffer->size) - ((int)buf1->tile_buffer->size)); }
+ show +
3688
3689
3690
3691
static void enqueue_tile_jobs(AV1Decoder *pbi, AV1_COMMON *cm, int tile_rows_start, int tile_rows_end, int tile_cols_start, int tile_cols_end, int start_tile, int end_tile) {
+ show +
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
AV1DecTileMT *tile_mt_info = &pbi->tile_mt_info; TileJobsDec *tile_job_queue = tile_mt_info->job_queue; tile_mt_info->jobs_enqueued = 0; tile_mt_info->jobs_dequeued = 0; for (int row = tile_rows_start; row < tile_rows_end; row++) { for (int col = tile_cols_start; col < tile_cols_end; col++) { if (row * cm->tile_cols + col < start_tile || row * cm->tile_cols + col > end_tile) continue;

[CVE-2020-0470_1.diff] decodeframe.c #100
-static void tile_mt_queue(AV1Decoder *pbi, int tile_cols, int tile_rows, - int tile_rows_start, int tile_rows_end, - int tile_cols_start, int tile_cols_end, - int start_tile, int end_tile) { +static AOM_INLINE void tile_mt_queue(AV1Decoder *pbi, int tile_cols, + int tile_rows, int tile_rows_start, + int tile_rows_end, int tile_cols_start, + int tile_cols_end, int start_tile, + int end_tile) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
const int buf_size = MC_TEMP_BUF_PELS << use_highbd; for (worker_idx = 0; worker_idx < pbi->max_threads - 1; ++worker_idx) { DecWorkerData *const thread_data = pbi->thread_data + worker_idx; if (thread_data->td->mc_buf_size != buf_size) { av1_free_mc_tmp_buf(thread_data->td); allocate_mc_tmp_buf(cm, thread_data->td, buf_size, use_highbd); } } }
+ show +
3884
3885
3886
3887
static void tile_mt_queue(AV1Decoder *pbi, int tile_cols, int tile_rows, int tile_rows_start, int tile_rows_end, int tile_cols_start, int tile_cols_end, int start_tile, int end_tile) {
+ show +
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
AV1_COMMON *const cm = &pbi->common; if (pbi->tile_mt_info.alloc_tile_cols != tile_cols || pbi->tile_mt_info.alloc_tile_rows != tile_rows) { av1_dealloc_dec_jobs(&pbi->tile_mt_info); alloc_dec_jobs(&pbi->tile_mt_info, cm, tile_rows, tile_cols); } enqueue_tile_jobs(pbi, cm, tile_rows_start, tile_rows_end, tile_cols_start, tile_cols_end, start_tile, end_tile); qsort(pbi->tile_mt_info.job_queue, pbi->tile_mt_info.jobs_enqueued, sizeof(pbi->tile_mt_info.job_queue[0]), compare_tile_buffers);

[CVE-2020-0470_1.diff] decodeframe.c #107
-static void row_mt_frame_init(AV1Decoder *pbi, int tile_rows_start, - int tile_rows_end, int tile_cols_start, - int tile_cols_end, int start_tile, int end_tile, - int max_sb_rows) { +static AOM_INLINE void row_mt_frame_init(AV1Decoder *pbi, int tile_rows_start, + int tile_rows_end, int tile_cols_start, + int tile_cols_end, int start_tile, + int end_tile, int max_sb_rows) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decodeframe.c
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
if (pbi->cb_buffer_alloc_size < size) { av1_dec_free_cb_buf(pbi); CHECK_MEM_ERROR(cm, pbi->cb_buffer_base, aom_memalign(32, sizeof(*pbi->cb_buffer_base) * size)); memset(pbi->cb_buffer_base, 0, sizeof(*pbi->cb_buffer_base) * size); pbi->cb_buffer_alloc_size = size; } }
+ show +
4009
4010
4011
4012
static void row_mt_frame_init(AV1Decoder *pbi, int tile_rows_start, int tile_rows_end, int tile_cols_start, int tile_cols_end, int start_tile, int end_tile, int max_sb_rows) {
+ show +
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
AV1_COMMON *const cm = &pbi->common; AV1DecRowMTInfo *frame_row_mt_info = &pbi->frame_row_mt_info; frame_row_mt_info->tile_rows_start = tile_rows_start; frame_row_mt_info->tile_rows_end = tile_rows_end; frame_row_mt_info->tile_cols_start = tile_cols_start; frame_row_mt_info->tile_cols_end = tile_cols_end; frame_row_mt_info->start_tile = start_tile; frame_row_mt_info->end_tile = end_tile; frame_row_mt_info->mi_rows_to_decode = 0;

[CVE-2020-0478_1.diff] obu.c #1
-// Picture prediction structures (0-12 are predefined) in scalability metadata. -enum { - SCALABILITY_L1T2 = 0, - SCALABILITY_L1T3 = 1, - SCALABILITY_L2T1 = 2, - SCALABILITY_L2T2 = 3, - SCALABILITY_L2T3 = 4, - SCALABILITY_S2T1 = 5, - SCALABILITY_S2T2 = 6, - SCALABILITY_S2T3 = 7, - SCALABILITY_L2T1h = 8, - SCALABILITY_L2T2h = 9, - SCALABILITY_L2T3h = 10, - SCALABILITY_S2T1h = 11, - SCALABILITY_S2T2h = 12, - SCALABILITY_S2T3h = 13, - SCALABILITY_SS = 14 -} UENUM1BYTE(SCALABILITY_STRUCTURES); -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/obu.c
19
20
21
22
23
24
25
26
27
28
#include "aom_ports/mem_ops.h" #include "av1/common/common.h" #include "av1/common/obu_util.h" #include "av1/common/timing.h" #include "av1/decoder/decoder.h" #include "av1/decoder/decodeframe.h" #include "av1/decoder/obu.h" // Picture prediction structures (0-12 are predefined) in scalability metadata.
+ show +
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
enum { SCALABILITY_L1T2 = 0, SCALABILITY_L1T3 = 1, SCALABILITY_L2T1 = 2, SCALABILITY_L2T2 = 3, SCALABILITY_L2T3 = 4, SCALABILITY_S2T1 = 5, SCALABILITY_S2T2 = 6, SCALABILITY_S2T3 = 7, SCALABILITY_L2T1h = 8, SCALABILITY_L2T2h = 9, SCALABILITY_L2T3h = 10, SCALABILITY_S2T1h = 11, SCALABILITY_S2T2h = 12, SCALABILITY_S2T3h = 13, SCALABILITY_SS = 14 } UENUM1BYTE(SCALABILITY_STRUCTURES);
+ show +
46
47
48
49
50
51
52
53
54
55
aom_codec_err_t aom_get_num_layers_from_operating_point_idc( int operating_point_idc, unsigned int *number_spatial_layers, unsigned int *number_temporal_layers) { // derive number of spatial/temporal layers from operating_point_idc if (!number_spatial_layers || !number_temporal_layers) return AOM_CODEC_INVALID_PARAM; if (operating_point_idc == 0) {

[CVE-2020-0470_1.diff] obu.c #1
-// Picture prediction structures (0-12 are predefined) in scalability metadata. -enum { - SCALABILITY_L1T2 = 0, - SCALABILITY_L1T3 = 1, - SCALABILITY_L2T1 = 2, - SCALABILITY_L2T2 = 3, - SCALABILITY_L2T3 = 4, - SCALABILITY_S2T1 = 5, - SCALABILITY_S2T2 = 6, - SCALABILITY_S2T3 = 7, - SCALABILITY_L2T1h = 8, - SCALABILITY_L2T2h = 9, - SCALABILITY_L2T3h = 10, - SCALABILITY_S2T1h = 11, - SCALABILITY_S2T2h = 12, - SCALABILITY_S2T3h = 13, - SCALABILITY_SS = 14 -} UENUM1BYTE(SCALABILITY_STRUCTURES); -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/obu.c
19
20
21
22
23
24
25
26
27
28
#include "aom_ports/mem_ops.h" #include "av1/common/common.h" #include "av1/common/obu_util.h" #include "av1/common/timing.h" #include "av1/decoder/decoder.h" #include "av1/decoder/decodeframe.h" #include "av1/decoder/obu.h" // Picture prediction structures (0-12 are predefined) in scalability metadata.
+ show +
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
enum { SCALABILITY_L1T2 = 0, SCALABILITY_L1T3 = 1, SCALABILITY_L2T1 = 2, SCALABILITY_L2T2 = 3, SCALABILITY_L2T3 = 4, SCALABILITY_S2T1 = 5, SCALABILITY_S2T2 = 6, SCALABILITY_S2T3 = 7, SCALABILITY_L2T1h = 8, SCALABILITY_L2T2h = 9, SCALABILITY_L2T3h = 10, SCALABILITY_S2T1h = 11, SCALABILITY_S2T2h = 12, SCALABILITY_S2T3h = 13, SCALABILITY_SS = 14 } UENUM1BYTE(SCALABILITY_STRUCTURES);
+ show +
46
47
48
49
50
51
52
53
54
55
aom_codec_err_t aom_get_num_layers_from_operating_point_idc( int operating_point_idc, unsigned int *number_spatial_layers, unsigned int *number_temporal_layers) { // derive number of spatial/temporal layers from operating_point_idc if (!number_spatial_layers || !number_temporal_layers) return AOM_CODEC_INVALID_PARAM; if (operating_point_idc == 0) {

[CVE-2020-0478_1.diff] decoder.c #2
-static void dec_setup_mi(AV1_COMMON *cm) { - cm->mi = cm->mip; - cm->mi_grid_visible = cm->mi_grid_base; - memset(cm->mi_grid_base, 0, - cm->mi_stride * cm->mi_rows * sizeof(*cm->mi_grid_base)); +static void dec_set_mb_mi(CommonModeInfoParams *mi_params, int width, + int height) { + // Ensure that the decoded width and height are both multiples of + // 8 luma pixels (note: this may only be a multiple of 4 chroma pixels if + // subsampling is used). + // This simplifies the implementation of various experiments, + // eg. cdef, which operates on units of 8x8 luma pixels. + const int aligned_width = ALIGN_POWER_OF_TWO(width, 3); + const int aligned_height = ALIGN_POWER_OF_TWO(height, 3); + + mi_params->mi_cols = aligned_width >> MI_SIZE_LOG2; + mi_params->mi_rows = aligned_height >> MI_SIZE_LOG2; + mi_params->mi_stride = calc_mi_size(mi_params->mi_cols); + + mi_params->mb_cols = (mi_params->mi_cols + 2) >> 2; + mi_params->mb_rows = (mi_params->mi_rows + 2) >> 2; + mi_params->MBs = mi_params->mb_rows * mi_params->mb_cols; + + mi_params->mi_alloc_bsize = BLOCK_4X4; + mi_params->mi_alloc_stride = mi_params->mi_stride; + + assert(mi_size_wide[mi_params->mi_alloc_bsize] == + mi_size_high[mi_params->mi_alloc_bsize]); + +#if CONFIG_LPF_MASK + av1_alloc_loop_filter_mask(mi_params); +#endif -static int av1_dec_alloc_mi(AV1_COMMON *cm, int mi_size) { - cm->mip = aom_calloc(mi_size, sizeof(*cm->mip)); - if (!cm->mip) return 1; - cm->mi_alloc_size = mi_size; - cm->mi_grid_base = - (MB_MODE_INFO **)aom_calloc(mi_size, sizeof(MB_MODE_INFO *)); - if (!cm->mi_grid_base) return 1; - return 0; +static void dec_setup_mi(CommonModeInfoParams *mi_params) { + const int mi_grid_size = + mi_params->mi_stride * calc_mi_size(mi_params->mi_rows); + memset(mi_params->mi_grid_base, 0, + mi_grid_size * sizeof(*mi_params->mi_grid_base)); -static void dec_free_mi(AV1_COMMON *cm) { - aom_free(cm->mip); - cm->mip = NULL; - aom_free(cm->mi_grid_base); - cm->mi_grid_base = NULL; - cm->mi_alloc_size = 0; +static void dec_free_mi(CommonModeInfoParams *mi_params) { + aom_free(mi_params->mi_alloc); + mi_params->mi_alloc = NULL; + aom_free(mi_params->mi_grid_base); + mi_params->mi_grid_base = NULL; + mi_params->mi_alloc_size = 0; + aom_free(mi_params->tx_type_map); + mi_params->tx_type_map = NULL;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decoder.c
38
39
40
41
42
43
44
45
46
47
#include "av1/decoder/obu.h" static void initialize_dec(void) { av1_rtcd(); aom_dsp_rtcd(); aom_scale_rtcd(); av1_init_intra_predictors(); av1_init_wedge_masks(); }
+ show +
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
static void dec_setup_mi(AV1_COMMON *cm) { cm->mi = cm->mip; cm->mi_grid_visible = cm->mi_grid_base; memset(cm->mi_grid_base, 0, cm->mi_stride * cm->mi_rows * sizeof(*cm->mi_grid_base)); } static int av1_dec_alloc_mi(AV1_COMMON *cm, int mi_size) { cm->mip = aom_calloc(mi_size, sizeof(*cm->mip)); if (!cm->mip) return 1; cm->mi_alloc_size = mi_size; cm->mi_grid_base = (MB_MODE_INFO **)aom_calloc(mi_size, sizeof(MB_MODE_INFO *)); if (!cm->mi_grid_base) return 1; return 0; } static void dec_free_mi(AV1_COMMON *cm) { aom_free(cm->mip); cm->mip = NULL; aom_free(cm->mi_grid_base); cm->mi_grid_base = NULL; cm->mi_alloc_size = 0;
+ show +
71
72
73
74
75
76
77
78
79
80
} AV1Decoder *av1_decoder_create(BufferPool *const pool) { AV1Decoder *volatile const pbi = aom_memalign(32, sizeof(*pbi)); if (!pbi) return NULL; av1_zero(*pbi); AV1_COMMON *volatile const cm = &pbi->common; // The jmp_buf is valid only for the duration of the function that calls

[CVE-2020-0470_1.diff] decoder.c #2
-static void dec_setup_mi(AV1_COMMON *cm) { - cm->mi = cm->mip; - cm->mi_grid_visible = cm->mi_grid_base; - memset(cm->mi_grid_base, 0, - cm->mi_stride * cm->mi_rows * sizeof(*cm->mi_grid_base)); +static void dec_set_mb_mi(CommonModeInfoParams *mi_params, int width, + int height) { + // Ensure that the decoded width and height are both multiples of + // 8 luma pixels (note: this may only be a multiple of 4 chroma pixels if + // subsampling is used). + // This simplifies the implementation of various experiments, + // eg. cdef, which operates on units of 8x8 luma pixels. + const int aligned_width = ALIGN_POWER_OF_TWO(width, 3); + const int aligned_height = ALIGN_POWER_OF_TWO(height, 3); + + mi_params->mi_cols = aligned_width >> MI_SIZE_LOG2; + mi_params->mi_rows = aligned_height >> MI_SIZE_LOG2; + mi_params->mi_stride = calc_mi_size(mi_params->mi_cols); + + mi_params->mb_cols = (mi_params->mi_cols + 2) >> 2; + mi_params->mb_rows = (mi_params->mi_rows + 2) >> 2; + mi_params->MBs = mi_params->mb_rows * mi_params->mb_cols; + + mi_params->mi_alloc_bsize = BLOCK_4X4; + mi_params->mi_alloc_stride = mi_params->mi_stride; + + assert(mi_size_wide[mi_params->mi_alloc_bsize] == + mi_size_high[mi_params->mi_alloc_bsize]); + +#if CONFIG_LPF_MASK + av1_alloc_loop_filter_mask(mi_params); +#endif -static int av1_dec_alloc_mi(AV1_COMMON *cm, int mi_size) { - cm->mip = aom_calloc(mi_size, sizeof(*cm->mip)); - if (!cm->mip) return 1; - cm->mi_alloc_size = mi_size; - cm->mi_grid_base = - (MB_MODE_INFO **)aom_calloc(mi_size, sizeof(MB_MODE_INFO *)); - if (!cm->mi_grid_base) return 1; - return 0; +static void dec_setup_mi(CommonModeInfoParams *mi_params) { + const int mi_grid_size = + mi_params->mi_stride * calc_mi_size(mi_params->mi_rows); + memset(mi_params->mi_grid_base, 0, + mi_grid_size * sizeof(*mi_params->mi_grid_base)); -static void dec_free_mi(AV1_COMMON *cm) { - aom_free(cm->mip); - cm->mip = NULL; - aom_free(cm->mi_grid_base); - cm->mi_grid_base = NULL; - cm->mi_alloc_size = 0; +static void dec_free_mi(CommonModeInfoParams *mi_params) { + aom_free(mi_params->mi_alloc); + mi_params->mi_alloc = NULL; + aom_free(mi_params->mi_grid_base); + mi_params->mi_grid_base = NULL; + mi_params->mi_alloc_size = 0; + aom_free(mi_params->tx_type_map); + mi_params->tx_type_map = NULL;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/decoder/decoder.c
38
39
40
41
42
43
44
45
46
47
#include "av1/decoder/obu.h" static void initialize_dec(void) { av1_rtcd(); aom_dsp_rtcd(); aom_scale_rtcd(); av1_init_intra_predictors(); av1_init_wedge_masks(); }
+ show +
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
static void dec_setup_mi(AV1_COMMON *cm) { cm->mi = cm->mip; cm->mi_grid_visible = cm->mi_grid_base; memset(cm->mi_grid_base, 0, cm->mi_stride * cm->mi_rows * sizeof(*cm->mi_grid_base)); } static int av1_dec_alloc_mi(AV1_COMMON *cm, int mi_size) { cm->mip = aom_calloc(mi_size, sizeof(*cm->mip)); if (!cm->mip) return 1; cm->mi_alloc_size = mi_size; cm->mi_grid_base = (MB_MODE_INFO **)aom_calloc(mi_size, sizeof(MB_MODE_INFO *)); if (!cm->mi_grid_base) return 1; return 0; } static void dec_free_mi(AV1_COMMON *cm) { aom_free(cm->mip); cm->mip = NULL; aom_free(cm->mi_grid_base); cm->mi_grid_base = NULL; cm->mi_alloc_size = 0;
+ show +
71
72
73
74
75
76
77
78
79
80
} AV1Decoder *av1_decoder_create(BufferPool *const pool) { AV1Decoder *volatile const pbi = aom_memalign(32, sizeof(*pbi)); if (!pbi) return NULL; av1_zero(*pbi); AV1_COMMON *volatile const cm = &pbi->common; // The jmp_buf is valid only for the duration of the function that calls

[CVE-2020-0478_1.diff] mvref_common.c #30
- for (i = 0; i < AOMMIN(xd->n4_w, cm->mi_cols - mi_col); i += mi_step) { - int mi_col_offset = i; - mbmi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride]; - n4_w = mi_size_wide[mbmi->sb_type]; - mi_step = AOMMIN(xd->n4_w, n4_w); + for (i = 0; i < AOMMIN(xd->width, cm->mi_params.mi_cols - mi_col); + i += mi_step) { + mbmi = xd->mi[i + mi_row_offset * mi_stride]; + superblock_width = mi_size_wide[mbmi->sb_type]; + mi_step = AOMMIN(xd->width, superblock_width);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/mvref_common.c
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
if (mbmi->ref_frame[0] == ref_frame && mbmi->ref_frame[1] == NONE_FRAME) { record_samples(mbmi, pts, pts_inref, 0, -1, col_offset, 1); pts += 2; pts_inref += 2; np++; if (np >= LEAST_SQUARES_SAMPLES_MAX) return LEAST_SQUARES_SAMPLES_MAX; } } else { // Handle "current block width > above block width" case.
+ show +
1171
1172
1173
1174
1175
for (i = 0; i < AOMMIN(xd->n4_w, cm->mi_cols - mi_col); i += mi_step) { int mi_col_offset = i; mbmi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride]; n4_w = mi_size_wide[mbmi->sb_type]; mi_step = AOMMIN(xd->n4_w, n4_w);
+ show +
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
if (mbmi->ref_frame[0] == ref_frame && mbmi->ref_frame[1] == NONE_FRAME) { record_samples(mbmi, pts, pts_inref, 0, -1, i, 1); pts += 2; pts_inref += 2; np++; if (np >= LEAST_SQUARES_SAMPLES_MAX) return LEAST_SQUARES_SAMPLES_MAX; } }

[CVE-2020-0478_1.diff] mvref_common.c #31
- int mi_col_offset = -1; + const int mi_col_offset = -1; + const MB_MODE_INFO *mbmi = xd->mi[mi_col_offset]; + uint8_t superblock_height = mi_size_high[mbmi->sb_type]; - MB_MODE_INFO *mbmi = xd->mi[mi_col_offset]; - uint8_t n4_h = mi_size_high[mbmi->sb_type]; - - if (xd->n4_h <= n4_h) { + if (xd->height <= superblock_height) { - int row_offset = -mi_row % n4_h; + const int row_offset = -mi_row % superblock_height;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/mvref_common.c
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
np++; if (np >= LEAST_SQUARES_SAMPLES_MAX) return LEAST_SQUARES_SAMPLES_MAX; } } } } assert(np <= LEAST_SQUARES_SAMPLES_MAX); // scan the nearest left columns if (left_available) {
+ show +
1192
1193
1194
1195
1196
1197
1198
1199
int mi_col_offset = -1; MB_MODE_INFO *mbmi = xd->mi[mi_col_offset]; uint8_t n4_h = mi_size_high[mbmi->sb_type]; if (xd->n4_h <= n4_h) { // Handle "current block height <= above block height" case. int row_offset = -mi_row % n4_h;
+ show +
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
if (row_offset < 0) do_tl = 0; if (mbmi->ref_frame[0] == ref_frame && mbmi->ref_frame[1] == NONE_FRAME) { record_samples(mbmi, pts, pts_inref, row_offset, 1, 0, -1); pts += 2; pts_inref += 2; np++; if (np >= LEAST_SQUARES_SAMPLES_MAX) return LEAST_SQUARES_SAMPLES_MAX; }

[CVE-2020-0478_1.diff] mvref_common.c #32
- for (i = 0; i < AOMMIN(xd->n4_h, cm->mi_rows - mi_row); i += mi_step) { - int mi_row_offset = i; - mbmi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride]; - n4_h = mi_size_high[mbmi->sb_type]; - mi_step = AOMMIN(xd->n4_h, n4_h); + for (i = 0; i < AOMMIN(xd->height, cm->mi_params.mi_rows - mi_row); + i += mi_step) { + mbmi = xd->mi[mi_col_offset + i * mi_stride]; + superblock_height = mi_size_high[mbmi->sb_type]; + mi_step = AOMMIN(xd->height, superblock_height);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/mvref_common.c
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
if (mbmi->ref_frame[0] == ref_frame && mbmi->ref_frame[1] == NONE_FRAME) { record_samples(mbmi, pts, pts_inref, row_offset, 1, 0, -1); pts += 2; pts_inref += 2; np++; if (np >= LEAST_SQUARES_SAMPLES_MAX) return LEAST_SQUARES_SAMPLES_MAX; } } else { // Handle "current block height > above block height" case.
+ show +
1212
1213
1214
1215
1216
for (i = 0; i < AOMMIN(xd->n4_h, cm->mi_rows - mi_row); i += mi_step) { int mi_row_offset = i; mbmi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride]; n4_h = mi_size_high[mbmi->sb_type]; mi_step = AOMMIN(xd->n4_h, n4_h);
+ show +
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
if (mbmi->ref_frame[0] == ref_frame && mbmi->ref_frame[1] == NONE_FRAME) { record_samples(mbmi, pts, pts_inref, i, 1, 0, -1); pts += 2; pts_inref += 2; np++; if (np >= LEAST_SQUARES_SAMPLES_MAX) return LEAST_SQUARES_SAMPLES_MAX; } }

[CVE-2020-0470_1.diff] mvref_common.c #30
- for (i = 0; i < AOMMIN(xd->n4_w, cm->mi_cols - mi_col); i += mi_step) { - int mi_col_offset = i; - mbmi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride]; - n4_w = mi_size_wide[mbmi->sb_type]; - mi_step = AOMMIN(xd->n4_w, n4_w); + for (i = 0; i < AOMMIN(xd->width, cm->mi_params.mi_cols - mi_col); + i += mi_step) { + mbmi = xd->mi[i + mi_row_offset * mi_stride]; + superblock_width = mi_size_wide[mbmi->sb_type]; + mi_step = AOMMIN(xd->width, superblock_width);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/mvref_common.c
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
if (mbmi->ref_frame[0] == ref_frame && mbmi->ref_frame[1] == NONE_FRAME) { record_samples(mbmi, pts, pts_inref, 0, -1, col_offset, 1); pts += 2; pts_inref += 2; np++; if (np >= LEAST_SQUARES_SAMPLES_MAX) return LEAST_SQUARES_SAMPLES_MAX; } } else { // Handle "current block width > above block width" case.
+ show +
1171
1172
1173
1174
1175
for (i = 0; i < AOMMIN(xd->n4_w, cm->mi_cols - mi_col); i += mi_step) { int mi_col_offset = i; mbmi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride]; n4_w = mi_size_wide[mbmi->sb_type]; mi_step = AOMMIN(xd->n4_w, n4_w);
+ show +
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
if (mbmi->ref_frame[0] == ref_frame && mbmi->ref_frame[1] == NONE_FRAME) { record_samples(mbmi, pts, pts_inref, 0, -1, i, 1); pts += 2; pts_inref += 2; np++; if (np >= LEAST_SQUARES_SAMPLES_MAX) return LEAST_SQUARES_SAMPLES_MAX; } }

[CVE-2020-0470_1.diff] mvref_common.c #31
- int mi_col_offset = -1; + const int mi_col_offset = -1; + const MB_MODE_INFO *mbmi = xd->mi[mi_col_offset]; + uint8_t superblock_height = mi_size_high[mbmi->sb_type]; - MB_MODE_INFO *mbmi = xd->mi[mi_col_offset]; - uint8_t n4_h = mi_size_high[mbmi->sb_type]; - - if (xd->n4_h <= n4_h) { + if (xd->height <= superblock_height) { - int row_offset = -mi_row % n4_h; + const int row_offset = -mi_row % superblock_height;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/mvref_common.c
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
np++; if (np >= LEAST_SQUARES_SAMPLES_MAX) return LEAST_SQUARES_SAMPLES_MAX; } } } } assert(np <= LEAST_SQUARES_SAMPLES_MAX); // scan the nearest left columns if (left_available) {
+ show +
1192
1193
1194
1195
1196
1197
1198
1199
int mi_col_offset = -1; MB_MODE_INFO *mbmi = xd->mi[mi_col_offset]; uint8_t n4_h = mi_size_high[mbmi->sb_type]; if (xd->n4_h <= n4_h) { // Handle "current block height <= above block height" case. int row_offset = -mi_row % n4_h;
+ show +
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
if (row_offset < 0) do_tl = 0; if (mbmi->ref_frame[0] == ref_frame && mbmi->ref_frame[1] == NONE_FRAME) { record_samples(mbmi, pts, pts_inref, row_offset, 1, 0, -1); pts += 2; pts_inref += 2; np++; if (np >= LEAST_SQUARES_SAMPLES_MAX) return LEAST_SQUARES_SAMPLES_MAX; }

[CVE-2020-0470_1.diff] mvref_common.c #32
- for (i = 0; i < AOMMIN(xd->n4_h, cm->mi_rows - mi_row); i += mi_step) { - int mi_row_offset = i; - mbmi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride]; - n4_h = mi_size_high[mbmi->sb_type]; - mi_step = AOMMIN(xd->n4_h, n4_h); + for (i = 0; i < AOMMIN(xd->height, cm->mi_params.mi_rows - mi_row); + i += mi_step) { + mbmi = xd->mi[mi_col_offset + i * mi_stride]; + superblock_height = mi_size_high[mbmi->sb_type]; + mi_step = AOMMIN(xd->height, superblock_height);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/mvref_common.c
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
if (mbmi->ref_frame[0] == ref_frame && mbmi->ref_frame[1] == NONE_FRAME) { record_samples(mbmi, pts, pts_inref, row_offset, 1, 0, -1); pts += 2; pts_inref += 2; np++; if (np >= LEAST_SQUARES_SAMPLES_MAX) return LEAST_SQUARES_SAMPLES_MAX; } } else { // Handle "current block height > above block height" case.
+ show +
1212
1213
1214
1215
1216
for (i = 0; i < AOMMIN(xd->n4_h, cm->mi_rows - mi_row); i += mi_step) { int mi_row_offset = i; mbmi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride]; n4_h = mi_size_high[mbmi->sb_type]; mi_step = AOMMIN(xd->n4_h, n4_h);
+ show +
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
if (mbmi->ref_frame[0] == ref_frame && mbmi->ref_frame[1] == NONE_FRAME) { record_samples(mbmi, pts, pts_inref, i, 1, 0, -1); pts += 2; pts_inref += 2; np++; if (np >= LEAST_SQUARES_SAMPLES_MAX) return LEAST_SQUARES_SAMPLES_MAX; } }

[CVE-2020-0478_1.diff] reconintra.c #4
- const int blk_start_row_off = blk_row_in_sb - << (bh_in_mi_log2 + MI_SIZE_LOG2 - - tx_size_wide_log2[0]) >> - ss_y; + const int blk_start_row_off = + blk_row_in_sb << (bh_in_mi_log2 + MI_SIZE_LOG2 - MI_SIZE_LOG2) >> + ss_y;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/reconintra.c
415
416
417
418
419
420
421
422
423
424
const int bw_in_mi_log2 = mi_size_wide_log2[bsize]; const int bh_in_mi_log2 = mi_size_high_log2[bsize]; const int sb_mi_size = mi_size_high[cm->seq_params.sb_size]; const int blk_row_in_sb = (mi_row & (sb_mi_size - 1)) >> bh_in_mi_log2; const int blk_col_in_sb = (mi_col & (sb_mi_size - 1)) >> bw_in_mi_log2; // Leftmost column of superblock: so bottom-left pixels maybe in the left // and/or bottom-left superblocks. But only the left superblock is // available, so check if all required pixels fall in that superblock. if (blk_col_in_sb == 0) {
+ show +
425
426
427
428
const int blk_start_row_off = blk_row_in_sb << (bh_in_mi_log2 + MI_SIZE_LOG2 - tx_size_wide_log2[0]) >> ss_y;
+ show +
429
430
431
432
433
434
435
436
437
438
const int row_off_in_sb = blk_start_row_off + row_off; const int sb_height_unit = sb_mi_size >> ss_y; return row_off_in_sb + bottom_left_count_unit < sb_height_unit; } // Bottom row of superblock (and not the leftmost column): so bottom-left // pixels fall in the bottom superblock, which is not available yet. if (((blk_row_in_sb + 1) << bh_in_mi_log2) >= sb_mi_size) return 0; // General case (neither leftmost column nor bottom row): check if the

[CVE-2020-0470_1.diff] reconintra.c #4
- const int blk_start_row_off = blk_row_in_sb - << (bh_in_mi_log2 + MI_SIZE_LOG2 - - tx_size_wide_log2[0]) >> - ss_y; + const int blk_start_row_off = + blk_row_in_sb << (bh_in_mi_log2 + MI_SIZE_LOG2 - MI_SIZE_LOG2) >> + ss_y;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/reconintra.c
415
416
417
418
419
420
421
422
423
424
const int bw_in_mi_log2 = mi_size_wide_log2[bsize]; const int bh_in_mi_log2 = mi_size_high_log2[bsize]; const int sb_mi_size = mi_size_high[cm->seq_params.sb_size]; const int blk_row_in_sb = (mi_row & (sb_mi_size - 1)) >> bh_in_mi_log2; const int blk_col_in_sb = (mi_col & (sb_mi_size - 1)) >> bw_in_mi_log2; // Leftmost column of superblock: so bottom-left pixels maybe in the left // and/or bottom-left superblocks. But only the left superblock is // available, so check if all required pixels fall in that superblock. if (blk_col_in_sb == 0) {
+ show +
425
426
427
428
const int blk_start_row_off = blk_row_in_sb << (bh_in_mi_log2 + MI_SIZE_LOG2 - tx_size_wide_log2[0]) >> ss_y;
+ show +
429
430
431
432
433
434
435
436
437
438
const int row_off_in_sb = blk_start_row_off + row_off; const int sb_height_unit = sb_mi_size >> ss_y; return row_off_in_sb + bottom_left_count_unit < sb_height_unit; } // Bottom row of superblock (and not the leftmost column): so bottom-left // pixels fall in the bottom superblock, which is not available yet. if (((blk_row_in_sb + 1) << bh_in_mi_log2) >= sb_mi_size) return 0; // General case (neither leftmost column nor bottom row): check if the

[CVE-2020-0478_1.diff] entropymode.c #3
- default_interintra_mode_cdf[BLOCK_SIZE_GROUPS][CDF_SIZE(INTERINTRA_MODES)] = - { { AOM_CDF4(8192, 16384, 24576) }, - { AOM_CDF4(1875, 11082, 27332) }, - { AOM_CDF4(2473, 9996, 26388) }, - { AOM_CDF4(4238, 11537, 25926) } }; + default_interintra_mode_cdf[BLOCK_SIZE_GROUPS][CDF_SIZE( + INTERINTRA_MODES)] = { { AOM_CDF4(8192, 16384, 24576) }, + { AOM_CDF4(1875, 11082, 27332) }, + { AOM_CDF4(2473, 9996, 26388) }, + { AOM_CDF4(4238, 11537, 25926) } };
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/entropymode.c
463
464
465
466
467
468
469
470
471
472
{ AOM_CDF8(13046, 23214, 24505, 25942, 27435, 28442, 29330) } }; static const aom_cdf_prob default_interintra_cdf[BLOCK_SIZE_GROUPS][CDF_SIZE( 2)] = { { AOM_CDF2(16384) }, { AOM_CDF2(26887) }, { AOM_CDF2(27597) }, { AOM_CDF2(30237) } }; static const aom_cdf_prob
+ show +
473
474
475
476
477
default_interintra_mode_cdf[BLOCK_SIZE_GROUPS][CDF_SIZE(INTERINTRA_MODES)] = { { AOM_CDF4(8192, 16384, 24576) }, { AOM_CDF4(1875, 11082, 27332) }, { AOM_CDF4(2473, 9996, 26388) }, { AOM_CDF4(4238, 11537, 25926) } };
+ show +
478
479
480
481
482
483
484
485
486
487
static const aom_cdf_prob default_wedge_interintra_cdf[BLOCK_SIZES_ALL][CDF_SIZE(2)] = { { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(20036) }, { AOM_CDF2(24957) }, { AOM_CDF2(26704) }, { AOM_CDF2(27530) }, { AOM_CDF2(29564) }, { AOM_CDF2(29444) }, { AOM_CDF2(26872) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) },

[CVE-2020-0478_1.diff] entropymode.c #4
-static const aom_cdf_prob default_wedge_idx_cdf[BLOCK_SIZES_ALL][CDF_SIZE(16)] = - { { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(2438, 4440, 6599, 8663, 11005, 12874, 15751, 18094, 20359, - 22362, 24127, 25702, 27752, 29450, 31171) }, - { AOM_CDF16(806, 3266, 6005, 6738, 7218, 7367, 7771, 14588, 16323, 17367, - 18452, 19422, 22839, 26127, 29629) }, - { AOM_CDF16(2779, 3738, 4683, 7213, 7775, 8017, 8655, 14357, 17939, 21332, - 24520, 27470, 29456, 30529, 31656) }, - { AOM_CDF16(1684, 3625, 5675, 7108, 9302, 11274, 14429, 17144, 19163, - 20961, 22884, 24471, 26719, 28714, 30877) }, - { AOM_CDF16(1142, 3491, 6277, 7314, 8089, 8355, 9023, 13624, 15369, 16730, - 18114, 19313, 22521, 26012, 29550) }, - { AOM_CDF16(2742, 4195, 5727, 8035, 8980, 9336, 10146, 14124, 17270, - 20533, 23434, 25972, 27944, 29570, 31416) }, - { AOM_CDF16(1727, 3948, 6101, 7796, 9841, 12344, 15766, 18944, 20638, - 22038, 23963, 25311, 26988, 28766, 31012) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(154, 987, 1925, 2051, 2088, 2111, 2151, 23033, 23703, 24284, - 24985, 25684, 27259, 28883, 30911) }, - { AOM_CDF16(1135, 1322, 1493, 2635, 2696, 2737, 2770, 21016, 22935, 25057, - 27251, 29173, 30089, 30960, 31933) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) } }; +static const aom_cdf_prob default_wedge_idx_cdf[BLOCK_SIZES_ALL][CDF_SIZE( + 16)] = { { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(2438, 4440, 6599, 8663, 11005, 12874, 15751, 18094, + 20359, 22362, 24127, 25702, 27752, 29450, 31171) }, + { AOM_CDF16(806, 3266, 6005, 6738, 7218, 7367, 7771, 14588, 16323, + 17367, 18452, 19422, 22839, 26127, 29629) }, + { AOM_CDF16(2779, 3738, 4683, 7213, 7775, 8017, 8655, 14357, 17939, + 21332, 24520, 27470, 29456, 30529, 31656) }, + { AOM_CDF16(1684, 3625, 5675, 7108, 9302, 11274, 14429, 17144, + 19163, 20961, 22884, 24471, 26719, 28714, 30877) }, + { AOM_CDF16(1142, 3491, 6277, 7314, 8089, 8355, 9023, 13624, 15369, + 16730, 18114, 19313, 22521, 26012, 29550) }, + { AOM_CDF16(2742, 4195, 5727, 8035, 8980, 9336, 10146, 14124, + 17270, 20533, 23434, 25972, 27944, 29570, 31416) }, + { AOM_CDF16(1727, 3948, 6101, 7796, 9841, 12344, 15766, 18944, + 20638, 22038, 23963, 25311, 26988, 28766, 31012) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(154, 987, 1925, 2051, 2088, 2111, 2151, 23033, 23703, + 24284, 24985, 25684, 27259, 28883, 30911) }, + { AOM_CDF16(1135, 1322, 1493, 2635, 2696, 2737, 2770, 21016, 22935, + 25057, 27251, 29173, 30089, 30960, 31933) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) } };
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/entropymode.c
493
494
495
496
497
498
499
500
501
502
{ AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(23431) }, { AOM_CDF2(13171) }, { AOM_CDF2(11470) }, { AOM_CDF2(9770) }, { AOM_CDF2(9100) }, { AOM_CDF2(8233) }, { AOM_CDF2(6172) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(11820) }, { AOM_CDF2(7701) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) } };
+ show +
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
static const aom_cdf_prob default_wedge_idx_cdf[BLOCK_SIZES_ALL][CDF_SIZE(16)] = { { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(2438, 4440, 6599, 8663, 11005, 12874, 15751, 18094, 20359, 22362, 24127, 25702, 27752, 29450, 31171) }, { AOM_CDF16(806, 3266, 6005, 6738, 7218, 7367, 7771, 14588, 16323, 17367, 18452, 19422, 22839, 26127, 29629) }, { AOM_CDF16(2779, 3738, 4683, 7213, 7775, 8017, 8655, 14357, 17939, 21332, 24520, 27470, 29456, 30529, 31656) }, { AOM_CDF16(1684, 3625, 5675, 7108, 9302, 11274, 14429, 17144, 19163, 20961, 22884, 24471, 26719, 28714, 30877) }, { AOM_CDF16(1142, 3491, 6277, 7314, 8089, 8355, 9023, 13624, 15369, 16730, 18114, 19313, 22521, 26012, 29550) }, { AOM_CDF16(2742, 4195, 5727, 8035, 8980, 9336, 10146, 14124, 17270, 20533, 23434, 25972, 27944, 29570, 31416) }, { AOM_CDF16(1727, 3948, 6101, 7796, 9841, 12344, 15766, 18944, 20638, 22038, 23963, 25311, 26988, 28766, 31012) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(154, 987, 1925, 2051, 2088, 2111, 2151, 23033, 23703, 24284, 24985, 25684, 27259, 28883, 30911) }, { AOM_CDF16(1135, 1322, 1493, 2635, 2696, 2737, 2770, 21016, 22935, 25057, 27251, 29173, 30089, 30960, 31933) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) } };
+ show +
548
549
550
551
552
553
554
555
556
557
static const aom_cdf_prob default_motion_mode_cdf[BLOCK_SIZES_ALL][CDF_SIZE( MOTION_MODES)] = { { AOM_CDF3(10923, 21845) }, { AOM_CDF3(10923, 21845) }, { AOM_CDF3(10923, 21845) }, { AOM_CDF3(7651, 24760) }, { AOM_CDF3(4738, 24765) }, { AOM_CDF3(5391, 25528) }, { AOM_CDF3(19419, 26810) }, { AOM_CDF3(5123, 23606) }, { AOM_CDF3(11606, 24308) }, { AOM_CDF3(26260, 29116) }, { AOM_CDF3(20360, 28062) }, { AOM_CDF3(21679, 26830) }, { AOM_CDF3(29516, 30701) }, { AOM_CDF3(28898, 30397) }, { AOM_CDF3(30878, 31335) }, { AOM_CDF3(32507, 32558) },

[CVE-2020-0470_1.diff] entropymode.c #3
- default_interintra_mode_cdf[BLOCK_SIZE_GROUPS][CDF_SIZE(INTERINTRA_MODES)] = - { { AOM_CDF4(8192, 16384, 24576) }, - { AOM_CDF4(1875, 11082, 27332) }, - { AOM_CDF4(2473, 9996, 26388) }, - { AOM_CDF4(4238, 11537, 25926) } }; + default_interintra_mode_cdf[BLOCK_SIZE_GROUPS][CDF_SIZE( + INTERINTRA_MODES)] = { { AOM_CDF4(8192, 16384, 24576) }, + { AOM_CDF4(1875, 11082, 27332) }, + { AOM_CDF4(2473, 9996, 26388) }, + { AOM_CDF4(4238, 11537, 25926) } };
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/entropymode.c
463
464
465
466
467
468
469
470
471
472
{ AOM_CDF8(13046, 23214, 24505, 25942, 27435, 28442, 29330) } }; static const aom_cdf_prob default_interintra_cdf[BLOCK_SIZE_GROUPS][CDF_SIZE( 2)] = { { AOM_CDF2(16384) }, { AOM_CDF2(26887) }, { AOM_CDF2(27597) }, { AOM_CDF2(30237) } }; static const aom_cdf_prob
+ show +
473
474
475
476
477
default_interintra_mode_cdf[BLOCK_SIZE_GROUPS][CDF_SIZE(INTERINTRA_MODES)] = { { AOM_CDF4(8192, 16384, 24576) }, { AOM_CDF4(1875, 11082, 27332) }, { AOM_CDF4(2473, 9996, 26388) }, { AOM_CDF4(4238, 11537, 25926) } };
+ show +
478
479
480
481
482
483
484
485
486
487
static const aom_cdf_prob default_wedge_interintra_cdf[BLOCK_SIZES_ALL][CDF_SIZE(2)] = { { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(20036) }, { AOM_CDF2(24957) }, { AOM_CDF2(26704) }, { AOM_CDF2(27530) }, { AOM_CDF2(29564) }, { AOM_CDF2(29444) }, { AOM_CDF2(26872) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) },

[CVE-2020-0470_1.diff] entropymode.c #4
-static const aom_cdf_prob default_wedge_idx_cdf[BLOCK_SIZES_ALL][CDF_SIZE(16)] = - { { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(2438, 4440, 6599, 8663, 11005, 12874, 15751, 18094, 20359, - 22362, 24127, 25702, 27752, 29450, 31171) }, - { AOM_CDF16(806, 3266, 6005, 6738, 7218, 7367, 7771, 14588, 16323, 17367, - 18452, 19422, 22839, 26127, 29629) }, - { AOM_CDF16(2779, 3738, 4683, 7213, 7775, 8017, 8655, 14357, 17939, 21332, - 24520, 27470, 29456, 30529, 31656) }, - { AOM_CDF16(1684, 3625, 5675, 7108, 9302, 11274, 14429, 17144, 19163, - 20961, 22884, 24471, 26719, 28714, 30877) }, - { AOM_CDF16(1142, 3491, 6277, 7314, 8089, 8355, 9023, 13624, 15369, 16730, - 18114, 19313, 22521, 26012, 29550) }, - { AOM_CDF16(2742, 4195, 5727, 8035, 8980, 9336, 10146, 14124, 17270, - 20533, 23434, 25972, 27944, 29570, 31416) }, - { AOM_CDF16(1727, 3948, 6101, 7796, 9841, 12344, 15766, 18944, 20638, - 22038, 23963, 25311, 26988, 28766, 31012) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(154, 987, 1925, 2051, 2088, 2111, 2151, 23033, 23703, 24284, - 24985, 25684, 27259, 28883, 30911) }, - { AOM_CDF16(1135, 1322, 1493, 2635, 2696, 2737, 2770, 21016, 22935, 25057, - 27251, 29173, 30089, 30960, 31933) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) }, - { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, - 20480, 22528, 24576, 26624, 28672, 30720) } }; +static const aom_cdf_prob default_wedge_idx_cdf[BLOCK_SIZES_ALL][CDF_SIZE( + 16)] = { { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(2438, 4440, 6599, 8663, 11005, 12874, 15751, 18094, + 20359, 22362, 24127, 25702, 27752, 29450, 31171) }, + { AOM_CDF16(806, 3266, 6005, 6738, 7218, 7367, 7771, 14588, 16323, + 17367, 18452, 19422, 22839, 26127, 29629) }, + { AOM_CDF16(2779, 3738, 4683, 7213, 7775, 8017, 8655, 14357, 17939, + 21332, 24520, 27470, 29456, 30529, 31656) }, + { AOM_CDF16(1684, 3625, 5675, 7108, 9302, 11274, 14429, 17144, + 19163, 20961, 22884, 24471, 26719, 28714, 30877) }, + { AOM_CDF16(1142, 3491, 6277, 7314, 8089, 8355, 9023, 13624, 15369, + 16730, 18114, 19313, 22521, 26012, 29550) }, + { AOM_CDF16(2742, 4195, 5727, 8035, 8980, 9336, 10146, 14124, + 17270, 20533, 23434, 25972, 27944, 29570, 31416) }, + { AOM_CDF16(1727, 3948, 6101, 7796, 9841, 12344, 15766, 18944, + 20638, 22038, 23963, 25311, 26988, 28766, 31012) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(154, 987, 1925, 2051, 2088, 2111, 2151, 23033, 23703, + 24284, 24985, 25684, 27259, 28883, 30911) }, + { AOM_CDF16(1135, 1322, 1493, 2635, 2696, 2737, 2770, 21016, 22935, + 25057, 27251, 29173, 30089, 30960, 31933) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, + { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, + 18432, 20480, 22528, 24576, 26624, 28672, 30720) } };
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/entropymode.c
493
494
495
496
497
498
499
500
501
502
{ AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(23431) }, { AOM_CDF2(13171) }, { AOM_CDF2(11470) }, { AOM_CDF2(9770) }, { AOM_CDF2(9100) }, { AOM_CDF2(8233) }, { AOM_CDF2(6172) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(11820) }, { AOM_CDF2(7701) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) } };
+ show +
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
static const aom_cdf_prob default_wedge_idx_cdf[BLOCK_SIZES_ALL][CDF_SIZE(16)] = { { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(2438, 4440, 6599, 8663, 11005, 12874, 15751, 18094, 20359, 22362, 24127, 25702, 27752, 29450, 31171) }, { AOM_CDF16(806, 3266, 6005, 6738, 7218, 7367, 7771, 14588, 16323, 17367, 18452, 19422, 22839, 26127, 29629) }, { AOM_CDF16(2779, 3738, 4683, 7213, 7775, 8017, 8655, 14357, 17939, 21332, 24520, 27470, 29456, 30529, 31656) }, { AOM_CDF16(1684, 3625, 5675, 7108, 9302, 11274, 14429, 17144, 19163, 20961, 22884, 24471, 26719, 28714, 30877) }, { AOM_CDF16(1142, 3491, 6277, 7314, 8089, 8355, 9023, 13624, 15369, 16730, 18114, 19313, 22521, 26012, 29550) }, { AOM_CDF16(2742, 4195, 5727, 8035, 8980, 9336, 10146, 14124, 17270, 20533, 23434, 25972, 27944, 29570, 31416) }, { AOM_CDF16(1727, 3948, 6101, 7796, 9841, 12344, 15766, 18944, 20638, 22038, 23963, 25311, 26988, 28766, 31012) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(154, 987, 1925, 2051, 2088, 2111, 2151, 23033, 23703, 24284, 24985, 25684, 27259, 28883, 30911) }, { AOM_CDF16(1135, 1322, 1493, 2635, 2696, 2737, 2770, 21016, 22935, 25057, 27251, 29173, 30089, 30960, 31933) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) }, { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720) } };
+ show +
548
549
550
551
552
553
554
555
556
557
static const aom_cdf_prob default_motion_mode_cdf[BLOCK_SIZES_ALL][CDF_SIZE( MOTION_MODES)] = { { AOM_CDF3(10923, 21845) }, { AOM_CDF3(10923, 21845) }, { AOM_CDF3(10923, 21845) }, { AOM_CDF3(7651, 24760) }, { AOM_CDF3(4738, 24765) }, { AOM_CDF3(5391, 25528) }, { AOM_CDF3(19419, 26810) }, { AOM_CDF3(5123, 23606) }, { AOM_CDF3(11606, 24308) }, { AOM_CDF3(26260, 29116) }, { AOM_CDF3(20360, 28062) }, { AOM_CDF3(21679, 26830) }, { AOM_CDF3(29516, 30701) }, { AOM_CDF3(28898, 30397) }, { AOM_CDF3(30878, 31335) }, { AOM_CDF3(32507, 32558) },

[CVE-2020-0478_1.diff] blockd.c #2
-void av1_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd, - int plane, BLOCK_SIZE plane_bsize, TX_SIZE tx_size, - int has_eob, int aoff, int loff) { - ENTROPY_CONTEXT *const a = pd->above_context + aoff; - ENTROPY_CONTEXT *const l = pd->left_context + loff; +void av1_set_entropy_contexts(const MACROBLOCKD *xd, + struct macroblockd_plane *pd, int plane, + BLOCK_SIZE plane_bsize, TX_SIZE tx_size, + int has_eob, int aoff, int loff) { + ENTROPY_CONTEXT *const a = pd->above_entropy_context + aoff; + ENTROPY_CONTEXT *const l = pd->left_entropy_context + loff;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/blockd.c
21
22
23
24
25
26
27
28
29
30
assert(!is_inter_block(left_mi) || is_intrabc_block(left_mi)); return left_mi->mode; } PREDICTION_MODE av1_above_block_mode(const MB_MODE_INFO *above_mi) { if (!above_mi) return DC_PRED; assert(!is_inter_block(above_mi) || is_intrabc_block(above_mi)); return above_mi->mode; }
+ show +
31
32
33
34
35
void av1_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd, int plane, BLOCK_SIZE plane_bsize, TX_SIZE tx_size, int has_eob, int aoff, int loff) { ENTROPY_CONTEXT *const a = pd->above_context + aoff; ENTROPY_CONTEXT *const l = pd->left_context + loff;
+ show +
36
37
38
39
40
41
42
43
44
45
const int txs_wide = tx_size_wide_unit[tx_size]; const int txs_high = tx_size_high_unit[tx_size]; // above if (has_eob && xd->mb_to_right_edge < 0) { const int blocks_wide = max_block_wide(xd, plane_bsize, plane); const int above_contexts = AOMMIN(txs_wide, blocks_wide - aoff); memset(a, has_eob, sizeof(*a) * above_contexts); memset(a + above_contexts, 0, sizeof(*a) * (txs_wide - above_contexts)); } else {

[CVE-2020-0470_1.diff] blockd.c #2
-void av1_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd, - int plane, BLOCK_SIZE plane_bsize, TX_SIZE tx_size, - int has_eob, int aoff, int loff) { - ENTROPY_CONTEXT *const a = pd->above_context + aoff; - ENTROPY_CONTEXT *const l = pd->left_context + loff; +void av1_set_entropy_contexts(const MACROBLOCKD *xd, + struct macroblockd_plane *pd, int plane, + BLOCK_SIZE plane_bsize, TX_SIZE tx_size, + int has_eob, int aoff, int loff) { + ENTROPY_CONTEXT *const a = pd->above_entropy_context + aoff; + ENTROPY_CONTEXT *const l = pd->left_entropy_context + loff;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/blockd.c
21
22
23
24
25
26
27
28
29
30
assert(!is_inter_block(left_mi) || is_intrabc_block(left_mi)); return left_mi->mode; } PREDICTION_MODE av1_above_block_mode(const MB_MODE_INFO *above_mi) { if (!above_mi) return DC_PRED; assert(!is_inter_block(above_mi) || is_intrabc_block(above_mi)); return above_mi->mode; }
+ show +
31
32
33
34
35
void av1_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd, int plane, BLOCK_SIZE plane_bsize, TX_SIZE tx_size, int has_eob, int aoff, int loff) { ENTROPY_CONTEXT *const a = pd->above_context + aoff; ENTROPY_CONTEXT *const l = pd->left_context + loff;
+ show +
36
37
38
39
40
41
42
43
44
45
const int txs_wide = tx_size_wide_unit[tx_size]; const int txs_high = tx_size_high_unit[tx_size]; // above if (has_eob && xd->mb_to_right_edge < 0) { const int blocks_wide = max_block_wide(xd, plane_bsize, plane); const int above_contexts = AOMMIN(txs_wide, blocks_wide - aoff); memset(a, has_eob, sizeof(*a) * above_contexts); memset(a + above_contexts, 0, sizeof(*a) * (txs_wide - above_contexts)); } else {

[CVE-2020-0478_1.diff] alloccommon.c #2
-#if LOOP_FILTER_BITMASK -static int alloc_loop_filter_mask(AV1_COMMON *cm) { - aom_free(cm->lf.lfm); - cm->lf.lfm = NULL; - - // Each lfm holds bit masks for all the 4x4 blocks in a max - // 64x64 (128x128 for ext_partitions) region. The stride - // and rows are rounded up / truncated to a multiple of 16 - // (32 for ext_partition). - cm->lf.lfm_stride = (cm->mi_cols + (MI_SIZE_64X64 - 1)) >> MIN_MIB_SIZE_LOG2; - cm->lf.lfm_num = ((cm->mi_rows + (MI_SIZE_64X64 - 1)) >> MIN_MIB_SIZE_LOG2) * - cm->lf.lfm_stride; - cm->lf.lfm = - (LoopFilterMask *)aom_calloc(cm->lf.lfm_num, sizeof(*cm->lf.lfm)); - if (!cm->lf.lfm) return 1; - - unsigned int i; - for (i = 0; i < cm->lf.lfm_num; ++i) av1_zero(cm->lf.lfm[i]); - - return 0; -} - -static void free_loop_filter_mask(AV1_COMMON *cm) { - if (cm->lf.lfm == NULL) return; - - aom_free(cm->lf.lfm); - cm->lf.lfm = NULL; - cm->lf.lfm_num = 0; - cm->lf.lfm_stride = 0; -} -#endif - -void av1_set_mb_mi(AV1_COMMON *cm, int width, int height) { - // Ensure that the decoded width and height are both multiples of - // 8 luma pixels (note: this may only be a multiple of 4 chroma pixels if - // subsampling is used). - // This simplifies the implementation of various experiments, - // eg. cdef, which operates on units of 8x8 luma pixels. - const int aligned_width = ALIGN_POWER_OF_TWO(width, 3); - const int aligned_height = ALIGN_POWER_OF_TWO(height, 3); - - cm->mi_cols = aligned_width >> MI_SIZE_LOG2; - cm->mi_rows = aligned_height >> MI_SIZE_LOG2; - cm->mi_stride = calc_mi_size(cm->mi_cols); - - cm->mb_cols = (cm->mi_cols + 2) >> 2; - cm->mb_rows = (cm->mi_rows + 2) >> 2; - cm->MBs = cm->mb_rows * cm->mb_cols; - -#if LOOP_FILTER_BITMASK - alloc_loop_filter_mask(cm); -#endif -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/alloccommon.c
24
25
26
27
28
29
30
31
32
33
const int aligned_width = ALIGN_POWER_OF_TWO(width, 3); const int aligned_height = ALIGN_POWER_OF_TWO(height, 3); const int mi_cols = aligned_width >> MI_SIZE_LOG2; const int mi_rows = aligned_height >> MI_SIZE_LOG2; const int mb_cols = (mi_cols + 2) >> 2; const int mb_rows = (mi_rows + 2) >> 2; return mb_rows * mb_cols; }
+ show +
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#if LOOP_FILTER_BITMASK static int alloc_loop_filter_mask(AV1_COMMON *cm) { aom_free(cm->lf.lfm); cm->lf.lfm = NULL; // Each lfm holds bit masks for all the 4x4 blocks in a max // 64x64 (128x128 for ext_partitions) region. The stride // and rows are rounded up / truncated to a multiple of 16 // (32 for ext_partition). cm->lf.lfm_stride = (cm->mi_cols + (MI_SIZE_64X64 - 1)) >> MIN_MIB_SIZE_LOG2; cm->lf.lfm_num = ((cm->mi_rows + (MI_SIZE_64X64 - 1)) >> MIN_MIB_SIZE_LOG2) * cm->lf.lfm_stride; cm->lf.lfm = (LoopFilterMask *)aom_calloc(cm->lf.lfm_num, sizeof(*cm->lf.lfm)); if (!cm->lf.lfm) return 1; unsigned int i; for (i = 0; i < cm->lf.lfm_num; ++i) av1_zero(cm->lf.lfm[i]); return 0; } static void free_loop_filter_mask(AV1_COMMON *cm) { if (cm->lf.lfm == NULL) return; aom_free(cm->lf.lfm); cm->lf.lfm = NULL; cm->lf.lfm_num = 0; cm->lf.lfm_stride = 0; } #endif void av1_set_mb_mi(AV1_COMMON *cm, int width, int height) { // Ensure that the decoded width and height are both multiples of // 8 luma pixels (note: this may only be a multiple of 4 chroma pixels if // subsampling is used). // This simplifies the implementation of various experiments, // eg. cdef, which operates on units of 8x8 luma pixels. const int aligned_width = ALIGN_POWER_OF_TWO(width, 3); const int aligned_height = ALIGN_POWER_OF_TWO(height, 3); cm->mi_cols = aligned_width >> MI_SIZE_LOG2; cm->mi_rows = aligned_height >> MI_SIZE_LOG2; cm->mi_stride = calc_mi_size(cm->mi_cols); cm->mb_cols = (cm->mi_cols + 2) >> 2; cm->mb_rows = (cm->mi_rows + 2) >> 2; cm->MBs = cm->mb_rows * cm->mb_cols; #if LOOP_FILTER_BITMASK alloc_loop_filter_mask(cm); #endif
+ show +
86
87
88
89
90
91
92
93
94
95
} void av1_free_ref_frame_buffers(BufferPool *pool) { int i; for (i = 0; i < FRAME_BUFFERS; ++i) { if (pool->frame_bufs[i].ref_count > 0 && pool->frame_bufs[i].raw_frame_buffer.data != NULL) { pool->release_fb_cb(pool->cb_priv, &pool->frame_bufs[i].raw_frame_buffer); pool->frame_bufs[i].raw_frame_buffer.data = NULL;

[CVE-2020-0470_1.diff] alloccommon.c #2
-#if LOOP_FILTER_BITMASK -static int alloc_loop_filter_mask(AV1_COMMON *cm) { - aom_free(cm->lf.lfm); - cm->lf.lfm = NULL; - - // Each lfm holds bit masks for all the 4x4 blocks in a max - // 64x64 (128x128 for ext_partitions) region. The stride - // and rows are rounded up / truncated to a multiple of 16 - // (32 for ext_partition). - cm->lf.lfm_stride = (cm->mi_cols + (MI_SIZE_64X64 - 1)) >> MIN_MIB_SIZE_LOG2; - cm->lf.lfm_num = ((cm->mi_rows + (MI_SIZE_64X64 - 1)) >> MIN_MIB_SIZE_LOG2) * - cm->lf.lfm_stride; - cm->lf.lfm = - (LoopFilterMask *)aom_calloc(cm->lf.lfm_num, sizeof(*cm->lf.lfm)); - if (!cm->lf.lfm) return 1; - - unsigned int i; - for (i = 0; i < cm->lf.lfm_num; ++i) av1_zero(cm->lf.lfm[i]); - - return 0; -} - -static void free_loop_filter_mask(AV1_COMMON *cm) { - if (cm->lf.lfm == NULL) return; - - aom_free(cm->lf.lfm); - cm->lf.lfm = NULL; - cm->lf.lfm_num = 0; - cm->lf.lfm_stride = 0; -} -#endif - -void av1_set_mb_mi(AV1_COMMON *cm, int width, int height) { - // Ensure that the decoded width and height are both multiples of - // 8 luma pixels (note: this may only be a multiple of 4 chroma pixels if - // subsampling is used). - // This simplifies the implementation of various experiments, - // eg. cdef, which operates on units of 8x8 luma pixels. - const int aligned_width = ALIGN_POWER_OF_TWO(width, 3); - const int aligned_height = ALIGN_POWER_OF_TWO(height, 3); - - cm->mi_cols = aligned_width >> MI_SIZE_LOG2; - cm->mi_rows = aligned_height >> MI_SIZE_LOG2; - cm->mi_stride = calc_mi_size(cm->mi_cols); - - cm->mb_cols = (cm->mi_cols + 2) >> 2; - cm->mb_rows = (cm->mi_rows + 2) >> 2; - cm->MBs = cm->mb_rows * cm->mb_cols; - -#if LOOP_FILTER_BITMASK - alloc_loop_filter_mask(cm); -#endif -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/alloccommon.c
24
25
26
27
28
29
30
31
32
33
const int aligned_width = ALIGN_POWER_OF_TWO(width, 3); const int aligned_height = ALIGN_POWER_OF_TWO(height, 3); const int mi_cols = aligned_width >> MI_SIZE_LOG2; const int mi_rows = aligned_height >> MI_SIZE_LOG2; const int mb_cols = (mi_cols + 2) >> 2; const int mb_rows = (mi_rows + 2) >> 2; return mb_rows * mb_cols; }
+ show +
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#if LOOP_FILTER_BITMASK static int alloc_loop_filter_mask(AV1_COMMON *cm) { aom_free(cm->lf.lfm); cm->lf.lfm = NULL; // Each lfm holds bit masks for all the 4x4 blocks in a max // 64x64 (128x128 for ext_partitions) region. The stride // and rows are rounded up / truncated to a multiple of 16 // (32 for ext_partition). cm->lf.lfm_stride = (cm->mi_cols + (MI_SIZE_64X64 - 1)) >> MIN_MIB_SIZE_LOG2; cm->lf.lfm_num = ((cm->mi_rows + (MI_SIZE_64X64 - 1)) >> MIN_MIB_SIZE_LOG2) * cm->lf.lfm_stride; cm->lf.lfm = (LoopFilterMask *)aom_calloc(cm->lf.lfm_num, sizeof(*cm->lf.lfm)); if (!cm->lf.lfm) return 1; unsigned int i; for (i = 0; i < cm->lf.lfm_num; ++i) av1_zero(cm->lf.lfm[i]); return 0; } static void free_loop_filter_mask(AV1_COMMON *cm) { if (cm->lf.lfm == NULL) return; aom_free(cm->lf.lfm); cm->lf.lfm = NULL; cm->lf.lfm_num = 0; cm->lf.lfm_stride = 0; } #endif void av1_set_mb_mi(AV1_COMMON *cm, int width, int height) { // Ensure that the decoded width and height are both multiples of // 8 luma pixels (note: this may only be a multiple of 4 chroma pixels if // subsampling is used). // This simplifies the implementation of various experiments, // eg. cdef, which operates on units of 8x8 luma pixels. const int aligned_width = ALIGN_POWER_OF_TWO(width, 3); const int aligned_height = ALIGN_POWER_OF_TWO(height, 3); cm->mi_cols = aligned_width >> MI_SIZE_LOG2; cm->mi_rows = aligned_height >> MI_SIZE_LOG2; cm->mi_stride = calc_mi_size(cm->mi_cols); cm->mb_cols = (cm->mi_cols + 2) >> 2; cm->mb_rows = (cm->mi_rows + 2) >> 2; cm->MBs = cm->mb_rows * cm->mb_cols; #if LOOP_FILTER_BITMASK alloc_loop_filter_mask(cm); #endif
+ show +
86
87
88
89
90
91
92
93
94
95
} void av1_free_ref_frame_buffers(BufferPool *pool) { int i; for (i = 0; i < FRAME_BUFFERS; ++i) { if (pool->frame_bufs[i].ref_count > 0 && pool->frame_bufs[i].raw_frame_buffer.data != NULL) { pool->release_fb_cb(pool->cb_priv, &pool->frame_bufs[i].raw_frame_buffer); pool->frame_bufs[i].raw_frame_buffer.data = NULL;

[CVE-2020-0478_1.diff] reconintra.h #2
-void av1_predict_intra_block(const AV1_COMMON *cm, const MACROBLOCKD *xd, - int bw, int bh, TX_SIZE tx_size, - PREDICTION_MODE mode, int angle_delta, - int use_palette, - FILTER_INTRA_MODE filter_intra_mode, - const uint8_t *ref, int ref_stride, uint8_t *dst, - int dst_stride, int aoff, int loff, int plane); +void av1_predict_intra_block( + const AV1_COMMON *cm, const MACROBLOCKD *xd, int wpx, int hpx, + TX_SIZE tx_size, PREDICTION_MODE mode, int angle_delta, int use_palette, + FILTER_INTRA_MODE filter_intra_mode, const uint8_t *ref, int ref_stride, + uint8_t *dst, int dst_stride, int col_off, int row_off, int plane);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/reconintra.h
19
20
21
22
23
24
25
26
27
28
#include "av1/common/onyxc_int.h" #ifdef __cplusplus extern "C" { #endif void av1_init_intra_predictors(void); void av1_predict_intra_block_facade(const AV1_COMMON *cm, MACROBLOCKD *xd, int plane, int blk_col, int blk_row, TX_SIZE tx_size);
+ show +
29
30
31
32
33
34
35
void av1_predict_intra_block(const AV1_COMMON *cm, const MACROBLOCKD *xd, int bw, int bh, TX_SIZE tx_size, PREDICTION_MODE mode, int angle_delta, int use_palette, FILTER_INTRA_MODE filter_intra_mode, const uint8_t *ref, int ref_stride, uint8_t *dst, int dst_stride, int aoff, int loff, int plane);
+ show +
36
37
38
39
40
41
42
43
44
45
// Mapping of interintra to intra mode for use in the intra component static const PREDICTION_MODE interintra_to_intra_mode[INTERINTRA_MODES] = { DC_PRED, V_PRED, H_PRED, SMOOTH_PRED }; // Mapping of intra mode to the interintra mode static const INTERINTRA_MODE intra_to_interintra_mode[INTRA_MODES] = { II_DC_PRED, II_V_PRED, II_H_PRED, II_V_PRED, II_SMOOTH_PRED, II_V_PRED, II_H_PRED, II_H_PRED, II_V_PRED, II_SMOOTH_PRED, II_SMOOTH_PRED

[CVE-2020-0470_1.diff] reconintra.h #2
-void av1_predict_intra_block(const AV1_COMMON *cm, const MACROBLOCKD *xd, - int bw, int bh, TX_SIZE tx_size, - PREDICTION_MODE mode, int angle_delta, - int use_palette, - FILTER_INTRA_MODE filter_intra_mode, - const uint8_t *ref, int ref_stride, uint8_t *dst, - int dst_stride, int aoff, int loff, int plane); +void av1_predict_intra_block( + const AV1_COMMON *cm, const MACROBLOCKD *xd, int wpx, int hpx, + TX_SIZE tx_size, PREDICTION_MODE mode, int angle_delta, int use_palette, + FILTER_INTRA_MODE filter_intra_mode, const uint8_t *ref, int ref_stride, + uint8_t *dst, int dst_stride, int col_off, int row_off, int plane);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/reconintra.h
19
20
21
22
23
24
25
26
27
28
#include "av1/common/onyxc_int.h" #ifdef __cplusplus extern "C" { #endif void av1_init_intra_predictors(void); void av1_predict_intra_block_facade(const AV1_COMMON *cm, MACROBLOCKD *xd, int plane, int blk_col, int blk_row, TX_SIZE tx_size);
+ show +
29
30
31
32
33
34
35
void av1_predict_intra_block(const AV1_COMMON *cm, const MACROBLOCKD *xd, int bw, int bh, TX_SIZE tx_size, PREDICTION_MODE mode, int angle_delta, int use_palette, FILTER_INTRA_MODE filter_intra_mode, const uint8_t *ref, int ref_stride, uint8_t *dst, int dst_stride, int aoff, int loff, int plane);
+ show +
36
37
38
39
40
41
42
43
44
45
// Mapping of interintra to intra mode for use in the intra component static const PREDICTION_MODE interintra_to_intra_mode[INTERINTRA_MODES] = { DC_PRED, V_PRED, H_PRED, SMOOTH_PRED }; // Mapping of intra mode to the interintra mode static const INTERINTRA_MODE intra_to_interintra_mode[INTRA_MODES] = { II_DC_PRED, II_V_PRED, II_H_PRED, II_V_PRED, II_SMOOTH_PRED, II_V_PRED, II_H_PRED, II_H_PRED, II_V_PRED, II_SMOOTH_PRED, II_SMOOTH_PRED

[CVE-2020-0478_1.diff] cfl.h #4
-#define CFL_SUBSAMPLE_FUNCTION_ARRAY(arch, sub, bd) \ - static const cfl_subsample_##bd##_fn subfn_##sub[TX_SIZES_ALL] = { \ - subsample_##bd##_##sub##_4x4_##arch, /* 4x4 */ \ - subsample_##bd##_##sub##_8x8_##arch, /* 8x8 */ \ - subsample_##bd##_##sub##_16x16_##arch, /* 16x16 */ \ - subsample_##bd##_##sub##_32x32_##arch, /* 32x32 */ \ - NULL, /* 64x64 (invalid CFL size) */ \ - subsample_##bd##_##sub##_4x8_##arch, /* 4x8 */ \ - subsample_##bd##_##sub##_8x4_##arch, /* 8x4 */ \ - subsample_##bd##_##sub##_8x16_##arch, /* 8x16 */ \ - subsample_##bd##_##sub##_16x8_##arch, /* 16x8 */ \ - subsample_##bd##_##sub##_16x32_##arch, /* 16x32 */ \ - subsample_##bd##_##sub##_32x16_##arch, /* 32x16 */ \ - NULL, /* 32x64 (invalid CFL size) */ \ - NULL, /* 64x32 (invalid CFL size) */ \ - subsample_##bd##_##sub##_4x16_##arch, /* 4x16 */ \ - subsample_##bd##_##sub##_16x4_##arch, /* 16x4 */ \ - subsample_##bd##_##sub##_8x32_##arch, /* 8x32 */ \ - subsample_##bd##_##sub##_32x8_##arch, /* 32x8 */ \ - NULL, /* 16x64 (invalid CFL size) */ \ - NULL, /* 64x16 (invalid CFL size) */ \ +#define CFL_SUBSAMPLE_FUNCTION_ARRAY(arch, sub, bd) \ + static const cfl_subsample_##bd##_fn subfn_##sub[TX_SIZES_ALL] = { \ + cfl_subsample_##bd##_##sub##_4x4_##arch, /* 4x4 */ \ + cfl_subsample_##bd##_##sub##_8x8_##arch, /* 8x8 */ \ + cfl_subsample_##bd##_##sub##_16x16_##arch, /* 16x16 */ \ + cfl_subsample_##bd##_##sub##_32x32_##arch, /* 32x32 */ \ + NULL, /* 64x64 (invalid CFL size) */ \ + cfl_subsample_##bd##_##sub##_4x8_##arch, /* 4x8 */ \ + cfl_subsample_##bd##_##sub##_8x4_##arch, /* 8x4 */ \ + cfl_subsample_##bd##_##sub##_8x16_##arch, /* 8x16 */ \ + cfl_subsample_##bd##_##sub##_16x8_##arch, /* 16x8 */ \ + cfl_subsample_##bd##_##sub##_16x32_##arch, /* 16x32 */ \ + cfl_subsample_##bd##_##sub##_32x16_##arch, /* 32x16 */ \ + NULL, /* 32x64 (invalid CFL size) */ \ + NULL, /* 64x32 (invalid CFL size) */ \ + cfl_subsample_##bd##_##sub##_4x16_##arch, /* 4x16 */ \ + cfl_subsample_##bd##_##sub##_16x4_##arch, /* 16x4 */ \ + cfl_subsample_##bd##_##sub##_8x32_##arch, /* 8x32 */ \ + cfl_subsample_##bd##_##sub##_32x8_##arch, /* 32x8 */ \ + NULL, /* 16x64 (invalid CFL size) */ \ + NULL, /* 64x16 (invalid CFL size) */ \ +#if CONFIG_AV1_HIGHBITDEPTH
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/cfl.h
112
113
114
115
116
117
118
119
120
121
CFL_SUBSAMPLE(arch, sub, bd, 8, 32) \ CFL_SUBSAMPLE(arch, sub, bd, 32, 8) \ cfl_subsample_##bd##_fn cfl_get_luma_subsampling_##sub##_##bd##_##arch( \ TX_SIZE tx_size) { \ CFL_SUBSAMPLE_FUNCTION_ARRAY(arch, sub, bd) \ return subfn_##sub[tx_size]; \ } // Declare an architecture-specific array of function pointers for size-specific // wrappers.
+ show +
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#define CFL_SUBSAMPLE_FUNCTION_ARRAY(arch, sub, bd) \ static const cfl_subsample_##bd##_fn subfn_##sub[TX_SIZES_ALL] = { \ subsample_##bd##_##sub##_4x4_##arch, /* 4x4 */ \ subsample_##bd##_##sub##_8x8_##arch, /* 8x8 */ \ subsample_##bd##_##sub##_16x16_##arch, /* 16x16 */ \ subsample_##bd##_##sub##_32x32_##arch, /* 32x32 */ \ NULL, /* 64x64 (invalid CFL size) */ \ subsample_##bd##_##sub##_4x8_##arch, /* 4x8 */ \ subsample_##bd##_##sub##_8x4_##arch, /* 8x4 */ \ subsample_##bd##_##sub##_8x16_##arch, /* 8x16 */ \ subsample_##bd##_##sub##_16x8_##arch, /* 16x8 */ \ subsample_##bd##_##sub##_16x32_##arch, /* 16x32 */ \ subsample_##bd##_##sub##_32x16_##arch, /* 32x16 */ \ NULL, /* 32x64 (invalid CFL size) */ \ NULL, /* 64x32 (invalid CFL size) */ \ subsample_##bd##_##sub##_4x16_##arch, /* 4x16 */ \ subsample_##bd##_##sub##_16x4_##arch, /* 16x4 */ \ subsample_##bd##_##sub##_8x32_##arch, /* 8x32 */ \ subsample_##bd##_##sub##_32x8_##arch, /* 32x8 */ \ NULL, /* 16x64 (invalid CFL size) */ \ NULL, /* 64x16 (invalid CFL size) */ \
+ show +
143
144
145
146
147
148
149
150
151
152
}; // The RTCD script does not support passing in an array, so we wrap it in this // function. #define CFL_GET_SUBSAMPLE_FUNCTION(arch) \ CFL_SUBSAMPLE_FUNCTIONS(arch, 420, lbd) \ CFL_SUBSAMPLE_FUNCTIONS(arch, 422, lbd) \ CFL_SUBSAMPLE_FUNCTIONS(arch, 444, lbd) \ CFL_SUBSAMPLE_FUNCTIONS(arch, 420, hbd) \ CFL_SUBSAMPLE_FUNCTIONS(arch, 422, hbd) \

[CVE-2020-0470_1.diff] cfl.h #4
-#define CFL_SUBSAMPLE_FUNCTION_ARRAY(arch, sub, bd) \ - static const cfl_subsample_##bd##_fn subfn_##sub[TX_SIZES_ALL] = { \ - subsample_##bd##_##sub##_4x4_##arch, /* 4x4 */ \ - subsample_##bd##_##sub##_8x8_##arch, /* 8x8 */ \ - subsample_##bd##_##sub##_16x16_##arch, /* 16x16 */ \ - subsample_##bd##_##sub##_32x32_##arch, /* 32x32 */ \ - NULL, /* 64x64 (invalid CFL size) */ \ - subsample_##bd##_##sub##_4x8_##arch, /* 4x8 */ \ - subsample_##bd##_##sub##_8x4_##arch, /* 8x4 */ \ - subsample_##bd##_##sub##_8x16_##arch, /* 8x16 */ \ - subsample_##bd##_##sub##_16x8_##arch, /* 16x8 */ \ - subsample_##bd##_##sub##_16x32_##arch, /* 16x32 */ \ - subsample_##bd##_##sub##_32x16_##arch, /* 32x16 */ \ - NULL, /* 32x64 (invalid CFL size) */ \ - NULL, /* 64x32 (invalid CFL size) */ \ - subsample_##bd##_##sub##_4x16_##arch, /* 4x16 */ \ - subsample_##bd##_##sub##_16x4_##arch, /* 16x4 */ \ - subsample_##bd##_##sub##_8x32_##arch, /* 8x32 */ \ - subsample_##bd##_##sub##_32x8_##arch, /* 32x8 */ \ - NULL, /* 16x64 (invalid CFL size) */ \ - NULL, /* 64x16 (invalid CFL size) */ \ +#define CFL_SUBSAMPLE_FUNCTION_ARRAY(arch, sub, bd) \ + static const cfl_subsample_##bd##_fn subfn_##sub[TX_SIZES_ALL] = { \ + cfl_subsample_##bd##_##sub##_4x4_##arch, /* 4x4 */ \ + cfl_subsample_##bd##_##sub##_8x8_##arch, /* 8x8 */ \ + cfl_subsample_##bd##_##sub##_16x16_##arch, /* 16x16 */ \ + cfl_subsample_##bd##_##sub##_32x32_##arch, /* 32x32 */ \ + NULL, /* 64x64 (invalid CFL size) */ \ + cfl_subsample_##bd##_##sub##_4x8_##arch, /* 4x8 */ \ + cfl_subsample_##bd##_##sub##_8x4_##arch, /* 8x4 */ \ + cfl_subsample_##bd##_##sub##_8x16_##arch, /* 8x16 */ \ + cfl_subsample_##bd##_##sub##_16x8_##arch, /* 16x8 */ \ + cfl_subsample_##bd##_##sub##_16x32_##arch, /* 16x32 */ \ + cfl_subsample_##bd##_##sub##_32x16_##arch, /* 32x16 */ \ + NULL, /* 32x64 (invalid CFL size) */ \ + NULL, /* 64x32 (invalid CFL size) */ \ + cfl_subsample_##bd##_##sub##_4x16_##arch, /* 4x16 */ \ + cfl_subsample_##bd##_##sub##_16x4_##arch, /* 16x4 */ \ + cfl_subsample_##bd##_##sub##_8x32_##arch, /* 8x32 */ \ + cfl_subsample_##bd##_##sub##_32x8_##arch, /* 32x8 */ \ + NULL, /* 16x64 (invalid CFL size) */ \ + NULL, /* 64x16 (invalid CFL size) */ \ +#if CONFIG_AV1_HIGHBITDEPTH
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/cfl.h
112
113
114
115
116
117
118
119
120
121
CFL_SUBSAMPLE(arch, sub, bd, 8, 32) \ CFL_SUBSAMPLE(arch, sub, bd, 32, 8) \ cfl_subsample_##bd##_fn cfl_get_luma_subsampling_##sub##_##bd##_##arch( \ TX_SIZE tx_size) { \ CFL_SUBSAMPLE_FUNCTION_ARRAY(arch, sub, bd) \ return subfn_##sub[tx_size]; \ } // Declare an architecture-specific array of function pointers for size-specific // wrappers.
+ show +
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#define CFL_SUBSAMPLE_FUNCTION_ARRAY(arch, sub, bd) \ static const cfl_subsample_##bd##_fn subfn_##sub[TX_SIZES_ALL] = { \ subsample_##bd##_##sub##_4x4_##arch, /* 4x4 */ \ subsample_##bd##_##sub##_8x8_##arch, /* 8x8 */ \ subsample_##bd##_##sub##_16x16_##arch, /* 16x16 */ \ subsample_##bd##_##sub##_32x32_##arch, /* 32x32 */ \ NULL, /* 64x64 (invalid CFL size) */ \ subsample_##bd##_##sub##_4x8_##arch, /* 4x8 */ \ subsample_##bd##_##sub##_8x4_##arch, /* 8x4 */ \ subsample_##bd##_##sub##_8x16_##arch, /* 8x16 */ \ subsample_##bd##_##sub##_16x8_##arch, /* 16x8 */ \ subsample_##bd##_##sub##_16x32_##arch, /* 16x32 */ \ subsample_##bd##_##sub##_32x16_##arch, /* 32x16 */ \ NULL, /* 32x64 (invalid CFL size) */ \ NULL, /* 64x32 (invalid CFL size) */ \ subsample_##bd##_##sub##_4x16_##arch, /* 4x16 */ \ subsample_##bd##_##sub##_16x4_##arch, /* 16x4 */ \ subsample_##bd##_##sub##_8x32_##arch, /* 8x32 */ \ subsample_##bd##_##sub##_32x8_##arch, /* 32x8 */ \ NULL, /* 16x64 (invalid CFL size) */ \ NULL, /* 64x16 (invalid CFL size) */ \
+ show +
143
144
145
146
147
148
149
150
151
152
}; // The RTCD script does not support passing in an array, so we wrap it in this // function. #define CFL_GET_SUBSAMPLE_FUNCTION(arch) \ CFL_SUBSAMPLE_FUNCTIONS(arch, 420, lbd) \ CFL_SUBSAMPLE_FUNCTIONS(arch, 422, lbd) \ CFL_SUBSAMPLE_FUNCTIONS(arch, 444, lbd) \ CFL_SUBSAMPLE_FUNCTIONS(arch, 420, hbd) \ CFL_SUBSAMPLE_FUNCTIONS(arch, 422, hbd) \

[CVE-2020-0478_1.diff] warped_motion.c #1
-#define WARP_ERROR_BLOCK 32 - -/* clang-format off */ -static const int error_measure_lut[512] = { - // pow 0.7 - 16384, 16339, 16294, 16249, 16204, 16158, 16113, 16068, - 16022, 15977, 15932, 15886, 15840, 15795, 15749, 15703, - 15657, 15612, 15566, 15520, 15474, 15427, 15381, 15335, - 15289, 15242, 15196, 15149, 15103, 15056, 15010, 14963, - 14916, 14869, 14822, 14775, 14728, 14681, 14634, 14587, - 14539, 14492, 14445, 14397, 14350, 14302, 14254, 14206, - 14159, 14111, 14063, 14015, 13967, 13918, 13870, 13822, - 13773, 13725, 13676, 13628, 13579, 13530, 13481, 13432, - 13383, 13334, 13285, 13236, 13187, 13137, 13088, 13038, - 12988, 12939, 12889, 12839, 12789, 12739, 12689, 12639, - 12588, 12538, 12487, 12437, 12386, 12335, 12285, 12234, - 12183, 12132, 12080, 12029, 11978, 11926, 11875, 11823, - 11771, 11719, 11667, 11615, 11563, 11511, 11458, 11406, - 11353, 11301, 11248, 11195, 11142, 11089, 11036, 10982, - 10929, 10875, 10822, 10768, 10714, 10660, 10606, 10552, - 10497, 10443, 10388, 10333, 10279, 10224, 10168, 10113, - 10058, 10002, 9947, 9891, 9835, 9779, 9723, 9666, - 9610, 9553, 9497, 9440, 9383, 9326, 9268, 9211, - 9153, 9095, 9037, 8979, 8921, 8862, 8804, 8745, - 8686, 8627, 8568, 8508, 8449, 8389, 8329, 8269, - 8208, 8148, 8087, 8026, 7965, 7903, 7842, 7780, - 7718, 7656, 7593, 7531, 7468, 7405, 7341, 7278, - 7214, 7150, 7086, 7021, 6956, 6891, 6826, 6760, - 6695, 6628, 6562, 6495, 6428, 6361, 6293, 6225, - 6157, 6089, 6020, 5950, 5881, 5811, 5741, 5670, - 5599, 5527, 5456, 5383, 5311, 5237, 5164, 5090, - 5015, 4941, 4865, 4789, 4713, 4636, 4558, 4480, - 4401, 4322, 4242, 4162, 4080, 3998, 3916, 3832, - 3748, 3663, 3577, 3490, 3402, 3314, 3224, 3133, - 3041, 2948, 2854, 2758, 2661, 2562, 2461, 2359, - 2255, 2148, 2040, 1929, 1815, 1698, 1577, 1452, - 1323, 1187, 1045, 894, 731, 550, 339, 0, - 339, 550, 731, 894, 1045, 1187, 1323, 1452, - 1577, 1698, 1815, 1929, 2040, 2148, 2255, 2359, - 2461, 2562, 2661, 2758, 2854, 2948, 3041, 3133, - 3224, 3314, 3402, 3490, 3577, 3663, 3748, 3832, - 3916, 3998, 4080, 4162, 4242, 4322, 4401, 4480, - 4558, 4636, 4713, 4789, 4865, 4941, 5015, 5090, - 5164, 5237, 5311, 5383, 5456, 5527, 5599, 5670, - 5741, 5811, 5881, 5950, 6020, 6089, 6157, 6225, - 6293, 6361, 6428, 6495, 6562, 6628, 6695, 6760, - 6826, 6891, 6956, 7021, 7086, 7150, 7214, 7278, - 7341, 7405, 7468, 7531, 7593, 7656, 7718, 7780, - 7842, 7903, 7965, 8026, 8087, 8148, 8208, 8269, - 8329, 8389, 8449, 8508, 8568, 8627, 8686, 8745, - 8804, 8862, 8921, 8979, 9037, 9095, 9153, 9211, - 9268, 9326, 9383, 9440, 9497, 9553, 9610, 9666, - 9723, 9779, 9835, 9891, 9947, 10002, 10058, 10113, - 10168, 10224, 10279, 10333, 10388, 10443, 10497, 10552, - 10606, 10660, 10714, 10768, 10822, 10875, 10929, 10982, - 11036, 11089, 11142, 11195, 11248, 11301, 11353, 11406, - 11458, 11511, 11563, 11615, 11667, 11719, 11771, 11823, - 11875, 11926, 11978, 12029, 12080, 12132, 12183, 12234, - 12285, 12335, 12386, 12437, 12487, 12538, 12588, 12639, - 12689, 12739, 12789, 12839, 12889, 12939, 12988, 13038, - 13088, 13137, 13187, 13236, 13285, 13334, 13383, 13432, - 13481, 13530, 13579, 13628, 13676, 13725, 13773, 13822, - 13870, 13918, 13967, 14015, 14063, 14111, 14159, 14206, - 14254, 14302, 14350, 14397, 14445, 14492, 14539, 14587, - 14634, 14681, 14728, 14775, 14822, 14869, 14916, 14963, - 15010, 15056, 15103, 15149, 15196, 15242, 15289, 15335, - 15381, 15427, 15474, 15520, 15566, 15612, 15657, 15703, - 15749, 15795, 15840, 15886, 15932, 15977, 16022, 16068, - 16113, 16158, 16204, 16249, 16294, 16339, 16384, 16384, -}; -/* clang-format on */ - -const int16_t warped_filter[WARPEDPIXEL_PREC_SHIFTS * 3 + 1][8] = { +const int16_t av1_warped_filter[WARPEDPIXEL_PREC_SHIFTS * 3 + 1][8] = {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/warped_motion.c
13
14
15
16
17
18
19
20
21
22
#include <stdlib.h> #include <memory.h> #include <math.h> #include <assert.h> #include "config/av1_rtcd.h" #include "av1/common/warped_motion.h" #include "av1/common/scale.h"
+ show +
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#define WARP_ERROR_BLOCK 32 /* clang-format off */ static const int error_measure_lut[512] = { // pow 0.7 16384, 16339, 16294, 16249, 16204, 16158, 16113, 16068, 16022, 15977, 15932, 15886, 15840, 15795, 15749, 15703, 15657, 15612, 15566, 15520, 15474, 15427, 15381, 15335, 15289, 15242, 15196, 15149, 15103, 15056, 15010, 14963, 14916, 14869, 14822, 14775, 14728, 14681, 14634, 14587, 14539, 14492, 14445, 14397, 14350, 14302, 14254, 14206, 14159, 14111, 14063, 14015, 13967, 13918, 13870, 13822, 13773, 13725, 13676, 13628, 13579, 13530, 13481, 13432, 13383, 13334, 13285, 13236, 13187, 13137, 13088, 13038, 12988, 12939, 12889, 12839, 12789, 12739, 12689, 12639, 12588, 12538, 12487, 12437, 12386, 12335, 12285, 12234, 12183, 12132, 12080, 12029, 11978, 11926, 11875, 11823, 11771, 11719, 11667, 11615, 11563, 11511, 11458, 11406, 11353, 11301, 11248, 11195, 11142, 11089, 11036, 10982, 10929, 10875, 10822, 10768, 10714, 10660, 10606, 10552, 10497, 10443, 10388, 10333, 10279, 10224, 10168, 10113, 10058, 10002, 9947, 9891, 9835, 9779, 9723, 9666, 9610, 9553, 9497, 9440, 9383, 9326, 9268, 9211, 9153, 9095, 9037, 8979, 8921, 8862, 8804, 8745, 8686, 8627, 8568, 8508, 8449, 8389, 8329, 8269, 8208, 8148, 8087, 8026, 7965, 7903, 7842, 7780, 7718, 7656, 7593, 7531, 7468, 7405, 7341, 7278, 7214, 7150, 7086, 7021, 6956, 6891, 6826, 6760, 6695, 6628, 6562, 6495, 6428, 6361, 6293, 6225, 6157, 6089, 6020, 5950, 5881, 5811, 5741, 5670, 5599, 5527, 5456, 5383, 5311, 5237, 5164, 5090, 5015, 4941, 4865, 4789, 4713, 4636, 4558, 4480, 4401, 4322, 4242, 4162, 4080, 3998, 3916, 3832, 3748, 3663, 3577, 3490, 3402, 3314, 3224, 3133, 3041, 2948, 2854, 2758, 2661, 2562, 2461, 2359, 2255, 2148, 2040, 1929, 1815, 1698, 1577, 1452, 1323, 1187, 1045, 894, 731, 550, 339, 0, 339, 550, 731, 894, 1045, 1187, 1323, 1452, 1577, 1698, 1815, 1929, 2040, 2148, 2255, 2359, 2461, 2562, 2661, 2758, 2854, 2948, 3041, 3133, 3224, 3314, 3402, 3490, 3577, 3663, 3748, 3832, 3916, 3998, 4080, 4162, 4242, 4322, 4401, 4480, 4558, 4636, 4713, 4789, 4865, 4941, 5015, 5090, 5164, 5237, 5311, 5383, 5456, 5527, 5599, 5670, 5741, 5811, 5881, 5950, 6020, 6089, 6157, 6225, 6293, 6361, 6428, 6495, 6562, 6628, 6695, 6760, 6826, 6891, 6956, 7021, 7086, 7150, 7214, 7278, 7341, 7405, 7468, 7531, 7593, 7656, 7718, 7780, 7842, 7903, 7965, 8026, 8087, 8148, 8208, 8269, 8329, 8389, 8449, 8508, 8568, 8627, 8686, 8745, 8804, 8862, 8921, 8979, 9037, 9095, 9153, 9211, 9268, 9326, 9383, 9440, 9497, 9553, 9610, 9666, 9723, 9779, 9835, 9891, 9947, 10002, 10058, 10113, 10168, 10224, 10279, 10333, 10388, 10443, 10497, 10552, 10606, 10660, 10714, 10768, 10822, 10875, 10929, 10982, 11036, 11089, 11142, 11195, 11248, 11301, 11353, 11406, 11458, 11511, 11563, 11615, 11667, 11719, 11771, 11823, 11875, 11926, 11978, 12029, 12080, 12132, 12183, 12234, 12285, 12335, 12386, 12437, 12487, 12538, 12588, 12639, 12689, 12739, 12789, 12839, 12889, 12939, 12988, 13038, 13088, 13137, 13187, 13236, 13285, 13334, 13383, 13432, 13481, 13530, 13579, 13628, 13676, 13725, 13773, 13822, 13870, 13918, 13967, 14015, 14063, 14111, 14159, 14206, 14254, 14302, 14350, 14397, 14445, 14492, 14539, 14587, 14634, 14681, 14728, 14775, 14822, 14869, 14916, 14963, 15010, 15056, 15103, 15149, 15196, 15242, 15289, 15335, 15381, 15427, 15474, 15520, 15566, 15612, 15657, 15703, 15749, 15795, 15840, 15886, 15932, 15977, 16022, 16068, 16113, 16158, 16204, 16249, 16294, 16339, 16384, 16384, }; /* clang-format on */ // For warping, we really use a 6-tap filter, but we do blocks of 8 pixels // at a time. The zoom/rotation/shear in the model are applied to the // "fractional" position of each pixel, which therefore varies within // [-1, 2) * WARPEDPIXEL_PREC_SHIFTS. // We need an extra 2 taps to fit this in, for a total of 8 taps. /* clang-format off */ const int16_t warped_filter[WARPEDPIXEL_PREC_SHIFTS * 3 + 1][8] = {
+ show +
102
103
104
105
106
107
108
109
110
111
#if WARPEDPIXEL_PREC_BITS == 6 // [-1, 0) { 0, 0, 127, 1, 0, 0, 0, 0 }, { 0, - 1, 127, 2, 0, 0, 0, 0 }, { 1, - 3, 127, 4, - 1, 0, 0, 0 }, { 1, - 4, 126, 6, - 2, 1, 0, 0 }, { 1, - 5, 126, 8, - 3, 1, 0, 0 }, { 1, - 6, 125, 11, - 4, 1, 0, 0 }, { 1, - 7, 124, 13, - 4, 1, 0, 0 }, { 2, - 8, 123, 15, - 5, 1, 0, 0 }, { 2, - 9, 122, 18, - 6, 1, 0, 0 }, { 2, -10, 121, 20, - 6, 1, 0, 0 }, { 2, -11, 120, 22, - 7, 2, 0, 0 }, { 2, -12, 119, 25, - 8, 2, 0, 0 }, { 3, -13, 117, 27, - 8, 2, 0, 0 }, { 3, -13, 116, 29, - 9, 2, 0, 0 }, { 3, -14, 114, 32, -10, 3, 0, 0 }, { 3, -15, 113, 35, -10, 2, 0, 0 },

[CVE-2020-0478_1.diff] warped_motion.c #6
-static void highbd_warp_plane(WarpedMotionParams *wm, const uint8_t *const ref8, - int width, int height, int stride, - const uint8_t *const pred8, int p_col, int p_row, - int p_width, int p_height, int p_stride, - int subsampling_x, int subsampling_y, int bd, - ConvolveParams *conv_params) { +void highbd_warp_plane(WarpedMotionParams *wm, const uint16_t *const ref, + int width, int height, int stride, uint16_t *const pred, + int p_col, int p_row, int p_width, int p_height, + int p_stride, int subsampling_x, int subsampling_y, + int bd, ConvolveParams *conv_params) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/warped_motion.c
507
508
509
510
511
512
513
514
515
516
assert(0 <= sum && sum < (1 << (bd + 2))); *p = clip_pixel_highbd(sum - (1 << (bd - 1)) - (1 << bd), bd); } sy += gamma; } } } } }
+ show +
517
518
519
520
521
522
static void highbd_warp_plane(WarpedMotionParams *wm, const uint8_t *const ref8, int width, int height, int stride, const uint8_t *const pred8, int p_col, int p_row, int p_width, int p_height, int p_stride, int subsampling_x, int subsampling_y, int bd, ConvolveParams *conv_params) {
+ show +
523
524
525
526
527
528
529
530
531
532
assert(wm->wmtype <= AFFINE); if (wm->wmtype == ROTZOOM) { wm->wmmat[5] = wm->wmmat[2]; wm->wmmat[4] = -wm->wmmat[3]; } const int32_t *const mat = wm->wmmat; const int16_t alpha = wm->alpha; const int16_t beta = wm->beta; const int16_t gamma = wm->gamma; const int16_t delta = wm->delta;

[CVE-2020-0478_1.diff] warped_motion.c #11
-static void warp_plane(WarpedMotionParams *wm, const uint8_t *const ref, - int width, int height, int stride, uint8_t *pred, - int p_col, int p_row, int p_width, int p_height, - int p_stride, int subsampling_x, int subsampling_y, - ConvolveParams *conv_params) { +void warp_plane(WarpedMotionParams *wm, const uint8_t *const ref, int width, + int height, int stride, uint8_t *pred, int p_col, int p_row, + int p_width, int p_height, int p_stride, int subsampling_x, + int subsampling_y, ConvolveParams *conv_params) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/warped_motion.c
794
795
796
797
798
799
800
801
802
803
assert(0 <= sum && sum < (1 << (bd + 2))); *p = clip_pixel(sum - (1 << (bd - 1)) - (1 << bd)); } sy += gamma; } } } } }
+ show +
804
805
806
807
808
static void warp_plane(WarpedMotionParams *wm, const uint8_t *const ref, int width, int height, int stride, uint8_t *pred, int p_col, int p_row, int p_width, int p_height, int p_stride, int subsampling_x, int subsampling_y, ConvolveParams *conv_params) {
+ show +
809
810
811
812
813
814
815
816
817
818
assert(wm->wmtype <= AFFINE); if (wm->wmtype == ROTZOOM) { wm->wmmat[5] = wm->wmmat[2]; wm->wmmat[4] = -wm->wmmat[3]; } const int32_t *const mat = wm->wmmat; const int16_t alpha = wm->alpha; const int16_t beta = wm->beta; const int16_t gamma = wm->gamma; const int16_t delta = wm->delta;

[CVE-2020-0478_1.diff] warped_motion.c #19
+ const int isuy = (mi_row * MI_SIZE + rsuy); + const int isux = (mi_col * MI_SIZE + rsux); - int32_t vx = mvx * (1 << (WARPEDMODEL_PREC_BITS - 3)) - - (isux * (wm->wmmat[2] - (1 << WARPEDMODEL_PREC_BITS)) + - isuy * wm->wmmat[3]); - int32_t vy = mvy * (1 << (WARPEDMODEL_PREC_BITS - 3)) - - (isux * wm->wmmat[4] + - isuy * (wm->wmmat[5] - (1 << WARPEDMODEL_PREC_BITS))); + const int32_t vx = mvx * (1 << (WARPEDMODEL_PREC_BITS - 3)) - + (isux * (wm->wmmat[2] - (1 << WARPEDMODEL_PREC_BITS)) + + isuy * wm->wmmat[3]); + const int32_t vy = mvy * (1 << (WARPEDMODEL_PREC_BITS - 3)) - + (isux * wm->wmmat[4] + + isuy * (wm->wmmat[5] - (1 << WARPEDMODEL_PREC_BITS)));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/warped_motion.c
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
wm->wmmat[2] = get_mult_shift_diag(Px[0], iDet, shift); wm->wmmat[3] = get_mult_shift_ndiag(Px[1], iDet, shift); wm->wmmat[4] = get_mult_shift_ndiag(Py[0], iDet, shift); wm->wmmat[5] = get_mult_shift_diag(Py[1], iDet, shift); // Note: In the vx, vy expressions below, the max value of each of the // 2nd and 3rd terms are (2^16 - 1) * (2^13 - 1). That leaves enough room // for the first term so that the overall sum in the worst case fits // within 32 bits overall.
+ show +
1120
1121
1122
1123
1124
1125
int32_t vx = mvx * (1 << (WARPEDMODEL_PREC_BITS - 3)) - (isux * (wm->wmmat[2] - (1 << WARPEDMODEL_PREC_BITS)) + isuy * wm->wmmat[3]); int32_t vy = mvy * (1 << (WARPEDMODEL_PREC_BITS - 3)) - (isux * wm->wmmat[4] + isuy * (wm->wmmat[5] - (1 << WARPEDMODEL_PREC_BITS)));
+ show +
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
wm->wmmat[0] = clamp(vx, -WARPEDMODEL_TRANS_CLAMP, WARPEDMODEL_TRANS_CLAMP - 1); wm->wmmat[1] = clamp(vy, -WARPEDMODEL_TRANS_CLAMP, WARPEDMODEL_TRANS_CLAMP - 1); wm->wmmat[6] = wm->wmmat[7] = 0; return 0; } int find_projection(int np, int *pts1, int *pts2, BLOCK_SIZE bsize, int mvy,

[CVE-2020-0470_1.diff] warped_motion.c #1
-#define WARP_ERROR_BLOCK 32 - -/* clang-format off */ -static const int error_measure_lut[512] = { - // pow 0.7 - 16384, 16339, 16294, 16249, 16204, 16158, 16113, 16068, - 16022, 15977, 15932, 15886, 15840, 15795, 15749, 15703, - 15657, 15612, 15566, 15520, 15474, 15427, 15381, 15335, - 15289, 15242, 15196, 15149, 15103, 15056, 15010, 14963, - 14916, 14869, 14822, 14775, 14728, 14681, 14634, 14587, - 14539, 14492, 14445, 14397, 14350, 14302, 14254, 14206, - 14159, 14111, 14063, 14015, 13967, 13918, 13870, 13822, - 13773, 13725, 13676, 13628, 13579, 13530, 13481, 13432, - 13383, 13334, 13285, 13236, 13187, 13137, 13088, 13038, - 12988, 12939, 12889, 12839, 12789, 12739, 12689, 12639, - 12588, 12538, 12487, 12437, 12386, 12335, 12285, 12234, - 12183, 12132, 12080, 12029, 11978, 11926, 11875, 11823, - 11771, 11719, 11667, 11615, 11563, 11511, 11458, 11406, - 11353, 11301, 11248, 11195, 11142, 11089, 11036, 10982, - 10929, 10875, 10822, 10768, 10714, 10660, 10606, 10552, - 10497, 10443, 10388, 10333, 10279, 10224, 10168, 10113, - 10058, 10002, 9947, 9891, 9835, 9779, 9723, 9666, - 9610, 9553, 9497, 9440, 9383, 9326, 9268, 9211, - 9153, 9095, 9037, 8979, 8921, 8862, 8804, 8745, - 8686, 8627, 8568, 8508, 8449, 8389, 8329, 8269, - 8208, 8148, 8087, 8026, 7965, 7903, 7842, 7780, - 7718, 7656, 7593, 7531, 7468, 7405, 7341, 7278, - 7214, 7150, 7086, 7021, 6956, 6891, 6826, 6760, - 6695, 6628, 6562, 6495, 6428, 6361, 6293, 6225, - 6157, 6089, 6020, 5950, 5881, 5811, 5741, 5670, - 5599, 5527, 5456, 5383, 5311, 5237, 5164, 5090, - 5015, 4941, 4865, 4789, 4713, 4636, 4558, 4480, - 4401, 4322, 4242, 4162, 4080, 3998, 3916, 3832, - 3748, 3663, 3577, 3490, 3402, 3314, 3224, 3133, - 3041, 2948, 2854, 2758, 2661, 2562, 2461, 2359, - 2255, 2148, 2040, 1929, 1815, 1698, 1577, 1452, - 1323, 1187, 1045, 894, 731, 550, 339, 0, - 339, 550, 731, 894, 1045, 1187, 1323, 1452, - 1577, 1698, 1815, 1929, 2040, 2148, 2255, 2359, - 2461, 2562, 2661, 2758, 2854, 2948, 3041, 3133, - 3224, 3314, 3402, 3490, 3577, 3663, 3748, 3832, - 3916, 3998, 4080, 4162, 4242, 4322, 4401, 4480, - 4558, 4636, 4713, 4789, 4865, 4941, 5015, 5090, - 5164, 5237, 5311, 5383, 5456, 5527, 5599, 5670, - 5741, 5811, 5881, 5950, 6020, 6089, 6157, 6225, - 6293, 6361, 6428, 6495, 6562, 6628, 6695, 6760, - 6826, 6891, 6956, 7021, 7086, 7150, 7214, 7278, - 7341, 7405, 7468, 7531, 7593, 7656, 7718, 7780, - 7842, 7903, 7965, 8026, 8087, 8148, 8208, 8269, - 8329, 8389, 8449, 8508, 8568, 8627, 8686, 8745, - 8804, 8862, 8921, 8979, 9037, 9095, 9153, 9211, - 9268, 9326, 9383, 9440, 9497, 9553, 9610, 9666, - 9723, 9779, 9835, 9891, 9947, 10002, 10058, 10113, - 10168, 10224, 10279, 10333, 10388, 10443, 10497, 10552, - 10606, 10660, 10714, 10768, 10822, 10875, 10929, 10982, - 11036, 11089, 11142, 11195, 11248, 11301, 11353, 11406, - 11458, 11511, 11563, 11615, 11667, 11719, 11771, 11823, - 11875, 11926, 11978, 12029, 12080, 12132, 12183, 12234, - 12285, 12335, 12386, 12437, 12487, 12538, 12588, 12639, - 12689, 12739, 12789, 12839, 12889, 12939, 12988, 13038, - 13088, 13137, 13187, 13236, 13285, 13334, 13383, 13432, - 13481, 13530, 13579, 13628, 13676, 13725, 13773, 13822, - 13870, 13918, 13967, 14015, 14063, 14111, 14159, 14206, - 14254, 14302, 14350, 14397, 14445, 14492, 14539, 14587, - 14634, 14681, 14728, 14775, 14822, 14869, 14916, 14963, - 15010, 15056, 15103, 15149, 15196, 15242, 15289, 15335, - 15381, 15427, 15474, 15520, 15566, 15612, 15657, 15703, - 15749, 15795, 15840, 15886, 15932, 15977, 16022, 16068, - 16113, 16158, 16204, 16249, 16294, 16339, 16384, 16384, -}; -/* clang-format on */ - -const int16_t warped_filter[WARPEDPIXEL_PREC_SHIFTS * 3 + 1][8] = { +const int16_t av1_warped_filter[WARPEDPIXEL_PREC_SHIFTS * 3 + 1][8] = {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/warped_motion.c
13
14
15
16
17
18
19
20
21
22
#include <stdlib.h> #include <memory.h> #include <math.h> #include <assert.h> #include "config/av1_rtcd.h" #include "av1/common/warped_motion.h" #include "av1/common/scale.h"
+ show +
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#define WARP_ERROR_BLOCK 32 /* clang-format off */ static const int error_measure_lut[512] = { // pow 0.7 16384, 16339, 16294, 16249, 16204, 16158, 16113, 16068, 16022, 15977, 15932, 15886, 15840, 15795, 15749, 15703, 15657, 15612, 15566, 15520, 15474, 15427, 15381, 15335, 15289, 15242, 15196, 15149, 15103, 15056, 15010, 14963, 14916, 14869, 14822, 14775, 14728, 14681, 14634, 14587, 14539, 14492, 14445, 14397, 14350, 14302, 14254, 14206, 14159, 14111, 14063, 14015, 13967, 13918, 13870, 13822, 13773, 13725, 13676, 13628, 13579, 13530, 13481, 13432, 13383, 13334, 13285, 13236, 13187, 13137, 13088, 13038, 12988, 12939, 12889, 12839, 12789, 12739, 12689, 12639, 12588, 12538, 12487, 12437, 12386, 12335, 12285, 12234, 12183, 12132, 12080, 12029, 11978, 11926, 11875, 11823, 11771, 11719, 11667, 11615, 11563, 11511, 11458, 11406, 11353, 11301, 11248, 11195, 11142, 11089, 11036, 10982, 10929, 10875, 10822, 10768, 10714, 10660, 10606, 10552, 10497, 10443, 10388, 10333, 10279, 10224, 10168, 10113, 10058, 10002, 9947, 9891, 9835, 9779, 9723, 9666, 9610, 9553, 9497, 9440, 9383, 9326, 9268, 9211, 9153, 9095, 9037, 8979, 8921, 8862, 8804, 8745, 8686, 8627, 8568, 8508, 8449, 8389, 8329, 8269, 8208, 8148, 8087, 8026, 7965, 7903, 7842, 7780, 7718, 7656, 7593, 7531, 7468, 7405, 7341, 7278, 7214, 7150, 7086, 7021, 6956, 6891, 6826, 6760, 6695, 6628, 6562, 6495, 6428, 6361, 6293, 6225, 6157, 6089, 6020, 5950, 5881, 5811, 5741, 5670, 5599, 5527, 5456, 5383, 5311, 5237, 5164, 5090, 5015, 4941, 4865, 4789, 4713, 4636, 4558, 4480, 4401, 4322, 4242, 4162, 4080, 3998, 3916, 3832, 3748, 3663, 3577, 3490, 3402, 3314, 3224, 3133, 3041, 2948, 2854, 2758, 2661, 2562, 2461, 2359, 2255, 2148, 2040, 1929, 1815, 1698, 1577, 1452, 1323, 1187, 1045, 894, 731, 550, 339, 0, 339, 550, 731, 894, 1045, 1187, 1323, 1452, 1577, 1698, 1815, 1929, 2040, 2148, 2255, 2359, 2461, 2562, 2661, 2758, 2854, 2948, 3041, 3133, 3224, 3314, 3402, 3490, 3577, 3663, 3748, 3832, 3916, 3998, 4080, 4162, 4242, 4322, 4401, 4480, 4558, 4636, 4713, 4789, 4865, 4941, 5015, 5090, 5164, 5237, 5311, 5383, 5456, 5527, 5599, 5670, 5741, 5811, 5881, 5950, 6020, 6089, 6157, 6225, 6293, 6361, 6428, 6495, 6562, 6628, 6695, 6760, 6826, 6891, 6956, 7021, 7086, 7150, 7214, 7278, 7341, 7405, 7468, 7531, 7593, 7656, 7718, 7780, 7842, 7903, 7965, 8026, 8087, 8148, 8208, 8269, 8329, 8389, 8449, 8508, 8568, 8627, 8686, 8745, 8804, 8862, 8921, 8979, 9037, 9095, 9153, 9211, 9268, 9326, 9383, 9440, 9497, 9553, 9610, 9666, 9723, 9779, 9835, 9891, 9947, 10002, 10058, 10113, 10168, 10224, 10279, 10333, 10388, 10443, 10497, 10552, 10606, 10660, 10714, 10768, 10822, 10875, 10929, 10982, 11036, 11089, 11142, 11195, 11248, 11301, 11353, 11406, 11458, 11511, 11563, 11615, 11667, 11719, 11771, 11823, 11875, 11926, 11978, 12029, 12080, 12132, 12183, 12234, 12285, 12335, 12386, 12437, 12487, 12538, 12588, 12639, 12689, 12739, 12789, 12839, 12889, 12939, 12988, 13038, 13088, 13137, 13187, 13236, 13285, 13334, 13383, 13432, 13481, 13530, 13579, 13628, 13676, 13725, 13773, 13822, 13870, 13918, 13967, 14015, 14063, 14111, 14159, 14206, 14254, 14302, 14350, 14397, 14445, 14492, 14539, 14587, 14634, 14681, 14728, 14775, 14822, 14869, 14916, 14963, 15010, 15056, 15103, 15149, 15196, 15242, 15289, 15335, 15381, 15427, 15474, 15520, 15566, 15612, 15657, 15703, 15749, 15795, 15840, 15886, 15932, 15977, 16022, 16068, 16113, 16158, 16204, 16249, 16294, 16339, 16384, 16384, }; /* clang-format on */ // For warping, we really use a 6-tap filter, but we do blocks of 8 pixels // at a time. The zoom/rotation/shear in the model are applied to the // "fractional" position of each pixel, which therefore varies within // [-1, 2) * WARPEDPIXEL_PREC_SHIFTS. // We need an extra 2 taps to fit this in, for a total of 8 taps. /* clang-format off */ const int16_t warped_filter[WARPEDPIXEL_PREC_SHIFTS * 3 + 1][8] = {
+ show +
102
103
104
105
106
107
108
109
110
111
#if WARPEDPIXEL_PREC_BITS == 6 // [-1, 0) { 0, 0, 127, 1, 0, 0, 0, 0 }, { 0, - 1, 127, 2, 0, 0, 0, 0 }, { 1, - 3, 127, 4, - 1, 0, 0, 0 }, { 1, - 4, 126, 6, - 2, 1, 0, 0 }, { 1, - 5, 126, 8, - 3, 1, 0, 0 }, { 1, - 6, 125, 11, - 4, 1, 0, 0 }, { 1, - 7, 124, 13, - 4, 1, 0, 0 }, { 2, - 8, 123, 15, - 5, 1, 0, 0 }, { 2, - 9, 122, 18, - 6, 1, 0, 0 }, { 2, -10, 121, 20, - 6, 1, 0, 0 }, { 2, -11, 120, 22, - 7, 2, 0, 0 }, { 2, -12, 119, 25, - 8, 2, 0, 0 }, { 3, -13, 117, 27, - 8, 2, 0, 0 }, { 3, -13, 116, 29, - 9, 2, 0, 0 }, { 3, -14, 114, 32, -10, 3, 0, 0 }, { 3, -15, 113, 35, -10, 2, 0, 0 },

[CVE-2020-0470_1.diff] warped_motion.c #6
-static void highbd_warp_plane(WarpedMotionParams *wm, const uint8_t *const ref8, - int width, int height, int stride, - const uint8_t *const pred8, int p_col, int p_row, - int p_width, int p_height, int p_stride, - int subsampling_x, int subsampling_y, int bd, - ConvolveParams *conv_params) { +void highbd_warp_plane(WarpedMotionParams *wm, const uint16_t *const ref, + int width, int height, int stride, uint16_t *const pred, + int p_col, int p_row, int p_width, int p_height, + int p_stride, int subsampling_x, int subsampling_y, + int bd, ConvolveParams *conv_params) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/warped_motion.c
507
508
509
510
511
512
513
514
515
516
assert(0 <= sum && sum < (1 << (bd + 2))); *p = clip_pixel_highbd(sum - (1 << (bd - 1)) - (1 << bd), bd); } sy += gamma; } } } } }
+ show +
517
518
519
520
521
522
static void highbd_warp_plane(WarpedMotionParams *wm, const uint8_t *const ref8, int width, int height, int stride, const uint8_t *const pred8, int p_col, int p_row, int p_width, int p_height, int p_stride, int subsampling_x, int subsampling_y, int bd, ConvolveParams *conv_params) {
+ show +
523
524
525
526
527
528
529
530
531
532
assert(wm->wmtype <= AFFINE); if (wm->wmtype == ROTZOOM) { wm->wmmat[5] = wm->wmmat[2]; wm->wmmat[4] = -wm->wmmat[3]; } const int32_t *const mat = wm->wmmat; const int16_t alpha = wm->alpha; const int16_t beta = wm->beta; const int16_t gamma = wm->gamma; const int16_t delta = wm->delta;

[CVE-2020-0470_1.diff] warped_motion.c #11
-static void warp_plane(WarpedMotionParams *wm, const uint8_t *const ref, - int width, int height, int stride, uint8_t *pred, - int p_col, int p_row, int p_width, int p_height, - int p_stride, int subsampling_x, int subsampling_y, - ConvolveParams *conv_params) { +void warp_plane(WarpedMotionParams *wm, const uint8_t *const ref, int width, + int height, int stride, uint8_t *pred, int p_col, int p_row, + int p_width, int p_height, int p_stride, int subsampling_x, + int subsampling_y, ConvolveParams *conv_params) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/warped_motion.c
794
795
796
797
798
799
800
801
802
803
assert(0 <= sum && sum < (1 << (bd + 2))); *p = clip_pixel(sum - (1 << (bd - 1)) - (1 << bd)); } sy += gamma; } } } } }
+ show +
804
805
806
807
808
static void warp_plane(WarpedMotionParams *wm, const uint8_t *const ref, int width, int height, int stride, uint8_t *pred, int p_col, int p_row, int p_width, int p_height, int p_stride, int subsampling_x, int subsampling_y, ConvolveParams *conv_params) {
+ show +
809
810
811
812
813
814
815
816
817
818
assert(wm->wmtype <= AFFINE); if (wm->wmtype == ROTZOOM) { wm->wmmat[5] = wm->wmmat[2]; wm->wmmat[4] = -wm->wmmat[3]; } const int32_t *const mat = wm->wmmat; const int16_t alpha = wm->alpha; const int16_t beta = wm->beta; const int16_t gamma = wm->gamma; const int16_t delta = wm->delta;

[CVE-2020-0470_1.diff] warped_motion.c #19
+ const int isuy = (mi_row * MI_SIZE + rsuy); + const int isux = (mi_col * MI_SIZE + rsux); - int32_t vx = mvx * (1 << (WARPEDMODEL_PREC_BITS - 3)) - - (isux * (wm->wmmat[2] - (1 << WARPEDMODEL_PREC_BITS)) + - isuy * wm->wmmat[3]); - int32_t vy = mvy * (1 << (WARPEDMODEL_PREC_BITS - 3)) - - (isux * wm->wmmat[4] + - isuy * (wm->wmmat[5] - (1 << WARPEDMODEL_PREC_BITS))); + const int32_t vx = mvx * (1 << (WARPEDMODEL_PREC_BITS - 3)) - + (isux * (wm->wmmat[2] - (1 << WARPEDMODEL_PREC_BITS)) + + isuy * wm->wmmat[3]); + const int32_t vy = mvy * (1 << (WARPEDMODEL_PREC_BITS - 3)) - + (isux * wm->wmmat[4] + + isuy * (wm->wmmat[5] - (1 << WARPEDMODEL_PREC_BITS)));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/warped_motion.c
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
wm->wmmat[2] = get_mult_shift_diag(Px[0], iDet, shift); wm->wmmat[3] = get_mult_shift_ndiag(Px[1], iDet, shift); wm->wmmat[4] = get_mult_shift_ndiag(Py[0], iDet, shift); wm->wmmat[5] = get_mult_shift_diag(Py[1], iDet, shift); // Note: In the vx, vy expressions below, the max value of each of the // 2nd and 3rd terms are (2^16 - 1) * (2^13 - 1). That leaves enough room // for the first term so that the overall sum in the worst case fits // within 32 bits overall.
+ show +
1120
1121
1122
1123
1124
1125
int32_t vx = mvx * (1 << (WARPEDMODEL_PREC_BITS - 3)) - (isux * (wm->wmmat[2] - (1 << WARPEDMODEL_PREC_BITS)) + isuy * wm->wmmat[3]); int32_t vy = mvy * (1 << (WARPEDMODEL_PREC_BITS - 3)) - (isux * wm->wmmat[4] + isuy * (wm->wmmat[5] - (1 << WARPEDMODEL_PREC_BITS)));
+ show +
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
wm->wmmat[0] = clamp(vx, -WARPEDMODEL_TRANS_CLAMP, WARPEDMODEL_TRANS_CLAMP - 1); wm->wmmat[1] = clamp(vy, -WARPEDMODEL_TRANS_CLAMP, WARPEDMODEL_TRANS_CLAMP - 1); wm->wmmat[6] = wm->wmmat[7] = 0; return 0; } int find_projection(int np, int *pts1, int *pts2, BLOCK_SIZE bsize, int mvy,

[CVE-2020-0478_1.diff] restoration.c #16
-void apply_selfguided_restoration_c(const uint8_t *dat8, int width, int height, - int stride, int eps, const int *xqd, - uint8_t *dst8, int dst_stride, - int32_t *tmpbuf, int bit_depth, - int highbd) { +void av1_apply_selfguided_restoration_c(const uint8_t *dat8, int width, + int height, int stride, int eps, + const int *xqd, uint8_t *dst8, + int dst_stride, int32_t *tmpbuf, + int bit_depth, int highbd) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/restoration.c
892
893
894
895
896
897
898
899
900
901
if (params->r[0] > 0) selfguided_restoration_fast_internal(dgd32, width, height, dgd32_stride, flt0, flt_stride, bit_depth, sgr_params_idx, 0); if (params->r[1] > 0) selfguided_restoration_internal(dgd32, width, height, dgd32_stride, flt1, flt_stride, bit_depth, sgr_params_idx, 1); return 0; }
+ show +
902
903
904
905
906
void apply_selfguided_restoration_c(const uint8_t *dat8, int width, int height, int stride, int eps, const int *xqd, uint8_t *dst8, int dst_stride, int32_t *tmpbuf, int bit_depth, int highbd) {
+ show +
907
908
909
910
911
912
913
914
915
916
int32_t *flt0 = tmpbuf; int32_t *flt1 = flt0 + RESTORATION_UNITPELS_MAX; assert(width * height <= RESTORATION_UNITPELS_MAX); const int ret = av1_selfguided_restoration_c( dat8, width, height, stride, flt0, flt1, width, eps, bit_depth, highbd); (void)ret; assert(!ret); const sgr_params_type *const params = &sgr_params[eps]; int xq[2];

[CVE-2020-0470_1.diff] restoration.c #16
-void apply_selfguided_restoration_c(const uint8_t *dat8, int width, int height, - int stride, int eps, const int *xqd, - uint8_t *dst8, int dst_stride, - int32_t *tmpbuf, int bit_depth, - int highbd) { +void av1_apply_selfguided_restoration_c(const uint8_t *dat8, int width, + int height, int stride, int eps, + const int *xqd, uint8_t *dst8, + int dst_stride, int32_t *tmpbuf, + int bit_depth, int highbd) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/restoration.c
892
893
894
895
896
897
898
899
900
901
if (params->r[0] > 0) selfguided_restoration_fast_internal(dgd32, width, height, dgd32_stride, flt0, flt_stride, bit_depth, sgr_params_idx, 0); if (params->r[1] > 0) selfguided_restoration_internal(dgd32, width, height, dgd32_stride, flt1, flt_stride, bit_depth, sgr_params_idx, 1); return 0; }
+ show +
902
903
904
905
906
void apply_selfguided_restoration_c(const uint8_t *dat8, int width, int height, int stride, int eps, const int *xqd, uint8_t *dst8, int dst_stride, int32_t *tmpbuf, int bit_depth, int highbd) {
+ show +
907
908
909
910
911
912
913
914
915
916
int32_t *flt0 = tmpbuf; int32_t *flt1 = flt0 + RESTORATION_UNITPELS_MAX; assert(width * height <= RESTORATION_UNITPELS_MAX); const int ret = av1_selfguided_restoration_c( dat8, width, height, stride, flt0, flt1, width, eps, bit_depth, highbd); (void)ret; assert(!ret); const sgr_params_type *const params = &sgr_params[eps]; int xq[2];

[CVE-2020-0478_1.diff] av1_loopfilter.h #5
-uint8_t get_filter_level(const struct AV1Common *cm, - const loop_filter_info_n *lfi_n, const int dir_idx, - int plane, const MB_MODE_INFO *mbmi); -#if LOOP_FILTER_BITMASK -void av1_setup_bitmask(struct AV1Common *const cm, int mi_row, int mi_col, - int plane, int subsampling_x, int subsampling_y, - int row_end, int col_end); - +uint8_t av1_get_filter_level(const struct AV1Common *cm, + const loop_filter_info_n *lfi_n, const int dir_idx, + int plane, const MB_MODE_INFO *mbmi); +#if CONFIG_LPF_MASK
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/av1_loopfilter.h
149
150
151
152
153
154
155
156
157
158
typedef struct LoopFilterWorkerData { YV12_BUFFER_CONFIG *frame_buffer; struct AV1Common *cm; struct macroblockd_plane planes[MAX_MB_PLANE]; // TODO(Ranjit): When the filter functions are modified to use xd->lossless // add lossless as a member here. MACROBLOCKD *xd; } LFWorkerData;
+ show +
159
160
161
162
163
164
165
uint8_t get_filter_level(const struct AV1Common *cm, const loop_filter_info_n *lfi_n, const int dir_idx, int plane, const MB_MODE_INFO *mbmi); #if LOOP_FILTER_BITMASK void av1_setup_bitmask(struct AV1Common *const cm, int mi_row, int mi_col, int plane, int subsampling_x, int subsampling_y, int row_end, int col_end);
+ show +
166
167
168
169
170
171
172
173
174
175
void av1_filter_block_plane_ver(struct AV1Common *const cm, struct macroblockd_plane *const plane_ptr, int pl, int mi_row, int mi_col); void av1_filter_block_plane_hor(struct AV1Common *const cm, struct macroblockd_plane *const plane, int pl, int mi_row, int mi_col); LoopFilterMask *get_loop_filter_mask(const struct AV1Common *const cm, int mi_row, int mi_col);

[CVE-2020-0470_1.diff] av1_loopfilter.h #5
-uint8_t get_filter_level(const struct AV1Common *cm, - const loop_filter_info_n *lfi_n, const int dir_idx, - int plane, const MB_MODE_INFO *mbmi); -#if LOOP_FILTER_BITMASK -void av1_setup_bitmask(struct AV1Common *const cm, int mi_row, int mi_col, - int plane, int subsampling_x, int subsampling_y, - int row_end, int col_end); - +uint8_t av1_get_filter_level(const struct AV1Common *cm, + const loop_filter_info_n *lfi_n, const int dir_idx, + int plane, const MB_MODE_INFO *mbmi); +#if CONFIG_LPF_MASK
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/av1_loopfilter.h
149
150
151
152
153
154
155
156
157
158
typedef struct LoopFilterWorkerData { YV12_BUFFER_CONFIG *frame_buffer; struct AV1Common *cm; struct macroblockd_plane planes[MAX_MB_PLANE]; // TODO(Ranjit): When the filter functions are modified to use xd->lossless // add lossless as a member here. MACROBLOCKD *xd; } LFWorkerData;
+ show +
159
160
161
162
163
164
165
uint8_t get_filter_level(const struct AV1Common *cm, const loop_filter_info_n *lfi_n, const int dir_idx, int plane, const MB_MODE_INFO *mbmi); #if LOOP_FILTER_BITMASK void av1_setup_bitmask(struct AV1Common *const cm, int mi_row, int mi_col, int plane, int subsampling_x, int subsampling_y, int row_end, int col_end);
+ show +
166
167
168
169
170
171
172
173
174
175
void av1_filter_block_plane_ver(struct AV1Common *const cm, struct macroblockd_plane *const plane_ptr, int pl, int mi_row, int mi_col); void av1_filter_block_plane_hor(struct AV1Common *const cm, struct macroblockd_plane *const plane, int pl, int mi_row, int mi_col); LoopFilterMask *get_loop_filter_mask(const struct AV1Common *const cm, int mi_row, int mi_col);

[CVE-2020-0478_1.diff] blockd.h #2
+#define INTERINTRA_WEDGE_SIGN 0 + - static PREDICTION_MODE lut[] = { - MB_MODE_COUNT, // DC_PRED - MB_MODE_COUNT, // V_PRED - MB_MODE_COUNT, // H_PRED - MB_MODE_COUNT, // D45_PRED - MB_MODE_COUNT, // D135_PRED - MB_MODE_COUNT, // D113_PRED - MB_MODE_COUNT, // D157_PRED - MB_MODE_COUNT, // D203_PRED - MB_MODE_COUNT, // D67_PRED - MB_MODE_COUNT, // SMOOTH_PRED - MB_MODE_COUNT, // SMOOTH_V_PRED - MB_MODE_COUNT, // SMOOTH_H_PRED - MB_MODE_COUNT, // PAETH_PRED - MB_MODE_COUNT, // NEARESTMV - MB_MODE_COUNT, // NEARMV - MB_MODE_COUNT, // GLOBALMV - MB_MODE_COUNT, // NEWMV + static const PREDICTION_MODE lut[] = { + DC_PRED, // DC_PRED + V_PRED, // V_PRED + H_PRED, // H_PRED + D45_PRED, // D45_PRED + D135_PRED, // D135_PRED + D113_PRED, // D113_PRED + D157_PRED, // D157_PRED + D203_PRED, // D203_PRED + D67_PRED, // D67_PRED + SMOOTH_PRED, // SMOOTH_PRED + SMOOTH_V_PRED, // SMOOTH_V_PRED + SMOOTH_H_PRED, // SMOOTH_H_PRED + PAETH_PRED, // PAETH_PRED + NEARESTMV, // NEARESTMV + NEARMV, // NEARMV + GLOBALMV, // GLOBALMV + NEWMV, // NEWMV
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/blockd.h
66
67
68
69
70
71
72
73
74
75
} BUFFER_SET; static INLINE int is_inter_singleref_mode(PREDICTION_MODE mode) { return mode >= SINGLE_INTER_MODE_START && mode < SINGLE_INTER_MODE_END; } static INLINE int is_inter_compound_mode(PREDICTION_MODE mode) { return mode >= COMP_INTER_MODE_START && mode < COMP_INTER_MODE_END; } static INLINE PREDICTION_MODE compound_ref0_mode(PREDICTION_MODE mode) {
+ show +
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
static PREDICTION_MODE lut[] = { MB_MODE_COUNT, // DC_PRED MB_MODE_COUNT, // V_PRED MB_MODE_COUNT, // H_PRED MB_MODE_COUNT, // D45_PRED MB_MODE_COUNT, // D135_PRED MB_MODE_COUNT, // D113_PRED MB_MODE_COUNT, // D157_PRED MB_MODE_COUNT, // D203_PRED MB_MODE_COUNT, // D67_PRED MB_MODE_COUNT, // SMOOTH_PRED MB_MODE_COUNT, // SMOOTH_V_PRED MB_MODE_COUNT, // SMOOTH_H_PRED MB_MODE_COUNT, // PAETH_PRED MB_MODE_COUNT, // NEARESTMV MB_MODE_COUNT, // NEARMV MB_MODE_COUNT, // GLOBALMV MB_MODE_COUNT, // NEWMV
+ show +
94
95
96
97
98
99
100
101
102
103
NEARESTMV, // NEAREST_NEARESTMV NEARMV, // NEAR_NEARMV NEARESTMV, // NEAREST_NEWMV NEWMV, // NEW_NEARESTMV NEARMV, // NEAR_NEWMV NEWMV, // NEW_NEARMV GLOBALMV, // GLOBAL_GLOBALMV NEWMV, // NEW_NEWMV }; assert(NELEMENTS(lut) == MB_MODE_COUNT);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/blockd.h
99
100
101
102
103
104
105
106
107
108
NEWMV, // NEW_NEARMV GLOBALMV, // GLOBAL_GLOBALMV NEWMV, // NEW_NEWMV }; assert(NELEMENTS(lut) == MB_MODE_COUNT); assert(is_inter_compound_mode(mode)); return lut[mode]; } static INLINE PREDICTION_MODE compound_ref1_mode(PREDICTION_MODE mode) {
+ show +
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
static PREDICTION_MODE lut[] = { MB_MODE_COUNT, // DC_PRED MB_MODE_COUNT, // V_PRED MB_MODE_COUNT, // H_PRED MB_MODE_COUNT, // D45_PRED MB_MODE_COUNT, // D135_PRED MB_MODE_COUNT, // D113_PRED MB_MODE_COUNT, // D157_PRED MB_MODE_COUNT, // D203_PRED MB_MODE_COUNT, // D67_PRED MB_MODE_COUNT, // SMOOTH_PRED MB_MODE_COUNT, // SMOOTH_V_PRED MB_MODE_COUNT, // SMOOTH_H_PRED MB_MODE_COUNT, // PAETH_PRED MB_MODE_COUNT, // NEARESTMV MB_MODE_COUNT, // NEARMV MB_MODE_COUNT, // GLOBALMV MB_MODE_COUNT, // NEWMV
+ show +
127
128
129
130
131
132
133
134
135
136
NEARESTMV, // NEAREST_NEARESTMV NEARMV, // NEAR_NEARMV NEWMV, // NEAREST_NEWMV NEARESTMV, // NEW_NEARESTMV NEWMV, // NEAR_NEWMV NEARMV, // NEW_NEARMV GLOBALMV, // GLOBAL_GLOBALMV NEWMV, // NEW_NEWMV }; assert(NELEMENTS(lut) == MB_MODE_COUNT);

[CVE-2020-0478_1.diff] blockd.h #18
+static const uint16_t av1_reduced_intra_tx_used_flag[INTRA_MODES] = { + 0x080F, // DC_PRED: 0000 1000 0000 1111 + 0x040F, // V_PRED: 0000 0100 0000 1111 + 0x080F, // H_PRED: 0000 1000 0000 1111 + 0x020F, // D45_PRED: 0000 0010 0000 1111 + 0x080F, // D135_PRED: 0000 1000 0000 1111 + 0x040F, // D113_PRED: 0000 0100 0000 1111 + 0x080F, // D157_PRED: 0000 1000 0000 1111 + 0x080F, // D203_PRED: 0000 1000 0000 1111 + 0x040F, // D67_PRED: 0000 0100 0000 1111 + 0x080F, // SMOOTH_PRED: 0000 1000 0000 1111 + 0x040F, // SMOOTH_V_PRED: 0000 0100 0000 1111 + 0x080F, // SMOOTH_H_PRED: 0000 1000 0000 1111 + 0x0C0E, // PAETH_PRED: 0000 1100 0000 1110 +}; + +static const TxSetType av1_ext_tx_set_lookup[2][2] = { + { EXT_TX_SET_DTT4_IDTX_1DDCT, EXT_TX_SET_DTT4_IDTX }, + { EXT_TX_SET_ALL16, EXT_TX_SET_DTT9_IDTX_1DDCT }, +}; + - if (is_inter) { - return (tx_size_sqr == TX_16X16 ? EXT_TX_SET_DTT9_IDTX_1DDCT - : EXT_TX_SET_ALL16); - } else { - return (tx_size_sqr == TX_16X16 ? EXT_TX_SET_DTT4_IDTX - : EXT_TX_SET_DTT4_IDTX_1DDCT); - } + return av1_ext_tx_set_lookup[is_inter][tx_size_sqr == TX_16X16];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/blockd.h
688
689
690
691
692
693
694
695
696
697
static INLINE TxSetType av1_get_ext_tx_set_type(TX_SIZE tx_size, int is_inter, int use_reduced_set) { const TX_SIZE tx_size_sqr_up = txsize_sqr_up_map[tx_size]; if (tx_size_sqr_up > TX_32X32) return EXT_TX_SET_DCTONLY; if (tx_size_sqr_up == TX_32X32) return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DCTONLY; if (use_reduced_set) return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DTT4_IDTX; const TX_SIZE tx_size_sqr = txsize_sqr_map[tx_size];
+ show +
698
699
700
701
702
703
if (is_inter) { return (tx_size_sqr == TX_16X16 ? EXT_TX_SET_DTT9_IDTX_1DDCT : EXT_TX_SET_ALL16); } else { return (tx_size_sqr == TX_16X16 ? EXT_TX_SET_DTT4_IDTX : EXT_TX_SET_DTT4_IDTX_1DDCT);
+ show +
704
705
706
707
708
709
710
711
712
713
} } // Maps tx set types to the indices. static const int ext_tx_set_index[2][EXT_TX_SET_TYPES] = { { // Intra 0, -1, 2, 1, -1, -1 }, { // Inter 0, 3, -1, -1, 2, 1 }, };

[CVE-2020-0478_1.diff] blockd.h #24
+ assert(bsize < BLOCK_SIZES_ALL); - if (!has_second_ref(mbmi)) - return 1; - else - return 0; + return !has_second_ref(mbmi);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/blockd.h
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
if (plane == 0) return max_txsize; // luma return av1_get_adjusted_tx_size(max_txsize); // chroma } static INLINE int is_motion_variation_allowed_bsize(BLOCK_SIZE bsize) { return AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8; } static INLINE int is_motion_variation_allowed_compound( const MB_MODE_INFO *mbmi) {
+ show +
1014
1015
1016
1017
if (!has_second_ref(mbmi)) return 1; else return 0;
+ show +
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
} // input: log2 of length, 0(4), 1(8), ... static const int max_neighbor_obmc[6] = { 0, 1, 2, 3, 4, 4 }; static INLINE int check_num_overlappable_neighbors(const MB_MODE_INFO *mbmi) { return !(mbmi->overlappable_neighbors[0] == 0 && mbmi->overlappable_neighbors[1] == 0); }

[CVE-2020-0478_1.diff] blockd.h #25
-static INLINE void assert_motion_mode_valid(MOTION_MODE mode, - const WarpedMotionParams *gm_params, - const MACROBLOCKD *xd, - const MB_MODE_INFO *mbmi, - int allow_warped_motion) { - const MOTION_MODE last_motion_mode_allowed = - motion_mode_allowed(gm_params, xd, mbmi, allow_warped_motion); - - // Check that the input mode is not illegal - if (last_motion_mode_allowed < mode) - assert(0 && "Illegal motion mode selected"); -} - + assert(sb_type < BLOCK_SIZES_ALL);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/blockd.h
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
return OBMC_CAUSAL; } return WARPED_CAUSAL; } return OBMC_CAUSAL; } else { return SIMPLE_TRANSLATION; } }
+ show +
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
static INLINE void assert_motion_mode_valid(MOTION_MODE mode, const WarpedMotionParams *gm_params, const MACROBLOCKD *xd, const MB_MODE_INFO *mbmi, int allow_warped_motion) { const MOTION_MODE last_motion_mode_allowed = motion_mode_allowed(gm_params, xd, mbmi, allow_warped_motion); // Check that the input mode is not illegal if (last_motion_mode_allowed < mode) assert(0 && "Illegal motion mode selected");
+ show +
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
} static INLINE int is_neighbor_overlappable(const MB_MODE_INFO *mbmi) { return (is_inter_block(mbmi)); } static INLINE int av1_allow_palette(int allow_screen_content_tools, BLOCK_SIZE sb_type) { return allow_screen_content_tools && block_size_wide[sb_type] <= 64 && block_size_high[sb_type] <= 64 && sb_type >= BLOCK_8X8;

[CVE-2020-0470_1.diff] blockd.h #2
+#define INTERINTRA_WEDGE_SIGN 0 + - static PREDICTION_MODE lut[] = { - MB_MODE_COUNT, // DC_PRED - MB_MODE_COUNT, // V_PRED - MB_MODE_COUNT, // H_PRED - MB_MODE_COUNT, // D45_PRED - MB_MODE_COUNT, // D135_PRED - MB_MODE_COUNT, // D113_PRED - MB_MODE_COUNT, // D157_PRED - MB_MODE_COUNT, // D203_PRED - MB_MODE_COUNT, // D67_PRED - MB_MODE_COUNT, // SMOOTH_PRED - MB_MODE_COUNT, // SMOOTH_V_PRED - MB_MODE_COUNT, // SMOOTH_H_PRED - MB_MODE_COUNT, // PAETH_PRED - MB_MODE_COUNT, // NEARESTMV - MB_MODE_COUNT, // NEARMV - MB_MODE_COUNT, // GLOBALMV - MB_MODE_COUNT, // NEWMV + static const PREDICTION_MODE lut[] = { + DC_PRED, // DC_PRED + V_PRED, // V_PRED + H_PRED, // H_PRED + D45_PRED, // D45_PRED + D135_PRED, // D135_PRED + D113_PRED, // D113_PRED + D157_PRED, // D157_PRED + D203_PRED, // D203_PRED + D67_PRED, // D67_PRED + SMOOTH_PRED, // SMOOTH_PRED + SMOOTH_V_PRED, // SMOOTH_V_PRED + SMOOTH_H_PRED, // SMOOTH_H_PRED + PAETH_PRED, // PAETH_PRED + NEARESTMV, // NEARESTMV + NEARMV, // NEARMV + GLOBALMV, // GLOBALMV + NEWMV, // NEWMV
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/blockd.h
66
67
68
69
70
71
72
73
74
75
} BUFFER_SET; static INLINE int is_inter_singleref_mode(PREDICTION_MODE mode) { return mode >= SINGLE_INTER_MODE_START && mode < SINGLE_INTER_MODE_END; } static INLINE int is_inter_compound_mode(PREDICTION_MODE mode) { return mode >= COMP_INTER_MODE_START && mode < COMP_INTER_MODE_END; } static INLINE PREDICTION_MODE compound_ref0_mode(PREDICTION_MODE mode) {
+ show +
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
static PREDICTION_MODE lut[] = { MB_MODE_COUNT, // DC_PRED MB_MODE_COUNT, // V_PRED MB_MODE_COUNT, // H_PRED MB_MODE_COUNT, // D45_PRED MB_MODE_COUNT, // D135_PRED MB_MODE_COUNT, // D113_PRED MB_MODE_COUNT, // D157_PRED MB_MODE_COUNT, // D203_PRED MB_MODE_COUNT, // D67_PRED MB_MODE_COUNT, // SMOOTH_PRED MB_MODE_COUNT, // SMOOTH_V_PRED MB_MODE_COUNT, // SMOOTH_H_PRED MB_MODE_COUNT, // PAETH_PRED MB_MODE_COUNT, // NEARESTMV MB_MODE_COUNT, // NEARMV MB_MODE_COUNT, // GLOBALMV MB_MODE_COUNT, // NEWMV
+ show +
94
95
96
97
98
99
100
101
102
103
NEARESTMV, // NEAREST_NEARESTMV NEARMV, // NEAR_NEARMV NEARESTMV, // NEAREST_NEWMV NEWMV, // NEW_NEARESTMV NEARMV, // NEAR_NEWMV NEWMV, // NEW_NEARMV GLOBALMV, // GLOBAL_GLOBALMV NEWMV, // NEW_NEWMV }; assert(NELEMENTS(lut) == MB_MODE_COUNT);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/blockd.h
99
100
101
102
103
104
105
106
107
108
NEWMV, // NEW_NEARMV GLOBALMV, // GLOBAL_GLOBALMV NEWMV, // NEW_NEWMV }; assert(NELEMENTS(lut) == MB_MODE_COUNT); assert(is_inter_compound_mode(mode)); return lut[mode]; } static INLINE PREDICTION_MODE compound_ref1_mode(PREDICTION_MODE mode) {
+ show +
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
static PREDICTION_MODE lut[] = { MB_MODE_COUNT, // DC_PRED MB_MODE_COUNT, // V_PRED MB_MODE_COUNT, // H_PRED MB_MODE_COUNT, // D45_PRED MB_MODE_COUNT, // D135_PRED MB_MODE_COUNT, // D113_PRED MB_MODE_COUNT, // D157_PRED MB_MODE_COUNT, // D203_PRED MB_MODE_COUNT, // D67_PRED MB_MODE_COUNT, // SMOOTH_PRED MB_MODE_COUNT, // SMOOTH_V_PRED MB_MODE_COUNT, // SMOOTH_H_PRED MB_MODE_COUNT, // PAETH_PRED MB_MODE_COUNT, // NEARESTMV MB_MODE_COUNT, // NEARMV MB_MODE_COUNT, // GLOBALMV MB_MODE_COUNT, // NEWMV
+ show +
127
128
129
130
131
132
133
134
135
136
NEARESTMV, // NEAREST_NEARESTMV NEARMV, // NEAR_NEARMV NEWMV, // NEAREST_NEWMV NEARESTMV, // NEW_NEARESTMV NEWMV, // NEAR_NEWMV NEARMV, // NEW_NEARMV GLOBALMV, // GLOBAL_GLOBALMV NEWMV, // NEW_NEWMV }; assert(NELEMENTS(lut) == MB_MODE_COUNT);

[CVE-2020-0470_1.diff] blockd.h #18
+static const uint16_t av1_reduced_intra_tx_used_flag[INTRA_MODES] = { + 0x080F, // DC_PRED: 0000 1000 0000 1111 + 0x040F, // V_PRED: 0000 0100 0000 1111 + 0x080F, // H_PRED: 0000 1000 0000 1111 + 0x020F, // D45_PRED: 0000 0010 0000 1111 + 0x080F, // D135_PRED: 0000 1000 0000 1111 + 0x040F, // D113_PRED: 0000 0100 0000 1111 + 0x080F, // D157_PRED: 0000 1000 0000 1111 + 0x080F, // D203_PRED: 0000 1000 0000 1111 + 0x040F, // D67_PRED: 0000 0100 0000 1111 + 0x080F, // SMOOTH_PRED: 0000 1000 0000 1111 + 0x040F, // SMOOTH_V_PRED: 0000 0100 0000 1111 + 0x080F, // SMOOTH_H_PRED: 0000 1000 0000 1111 + 0x0C0E, // PAETH_PRED: 0000 1100 0000 1110 +}; + +static const TxSetType av1_ext_tx_set_lookup[2][2] = { + { EXT_TX_SET_DTT4_IDTX_1DDCT, EXT_TX_SET_DTT4_IDTX }, + { EXT_TX_SET_ALL16, EXT_TX_SET_DTT9_IDTX_1DDCT }, +}; + - if (is_inter) { - return (tx_size_sqr == TX_16X16 ? EXT_TX_SET_DTT9_IDTX_1DDCT - : EXT_TX_SET_ALL16); - } else { - return (tx_size_sqr == TX_16X16 ? EXT_TX_SET_DTT4_IDTX - : EXT_TX_SET_DTT4_IDTX_1DDCT); - } + return av1_ext_tx_set_lookup[is_inter][tx_size_sqr == TX_16X16];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/blockd.h
688
689
690
691
692
693
694
695
696
697
static INLINE TxSetType av1_get_ext_tx_set_type(TX_SIZE tx_size, int is_inter, int use_reduced_set) { const TX_SIZE tx_size_sqr_up = txsize_sqr_up_map[tx_size]; if (tx_size_sqr_up > TX_32X32) return EXT_TX_SET_DCTONLY; if (tx_size_sqr_up == TX_32X32) return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DCTONLY; if (use_reduced_set) return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DTT4_IDTX; const TX_SIZE tx_size_sqr = txsize_sqr_map[tx_size];
+ show +
698
699
700
701
702
703
if (is_inter) { return (tx_size_sqr == TX_16X16 ? EXT_TX_SET_DTT9_IDTX_1DDCT : EXT_TX_SET_ALL16); } else { return (tx_size_sqr == TX_16X16 ? EXT_TX_SET_DTT4_IDTX : EXT_TX_SET_DTT4_IDTX_1DDCT);
+ show +
704
705
706
707
708
709
710
711
712
713
} } // Maps tx set types to the indices. static const int ext_tx_set_index[2][EXT_TX_SET_TYPES] = { { // Intra 0, -1, 2, 1, -1, -1 }, { // Inter 0, 3, -1, -1, 2, 1 }, };

[CVE-2020-0470_1.diff] blockd.h #24
+ assert(bsize < BLOCK_SIZES_ALL); - if (!has_second_ref(mbmi)) - return 1; - else - return 0; + return !has_second_ref(mbmi);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/blockd.h
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
if (plane == 0) return max_txsize; // luma return av1_get_adjusted_tx_size(max_txsize); // chroma } static INLINE int is_motion_variation_allowed_bsize(BLOCK_SIZE bsize) { return AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8; } static INLINE int is_motion_variation_allowed_compound( const MB_MODE_INFO *mbmi) {
+ show +
1014
1015
1016
1017
if (!has_second_ref(mbmi)) return 1; else return 0;
+ show +
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
} // input: log2 of length, 0(4), 1(8), ... static const int max_neighbor_obmc[6] = { 0, 1, 2, 3, 4, 4 }; static INLINE int check_num_overlappable_neighbors(const MB_MODE_INFO *mbmi) { return !(mbmi->overlappable_neighbors[0] == 0 && mbmi->overlappable_neighbors[1] == 0); }

[CVE-2020-0470_1.diff] blockd.h #25
-static INLINE void assert_motion_mode_valid(MOTION_MODE mode, - const WarpedMotionParams *gm_params, - const MACROBLOCKD *xd, - const MB_MODE_INFO *mbmi, - int allow_warped_motion) { - const MOTION_MODE last_motion_mode_allowed = - motion_mode_allowed(gm_params, xd, mbmi, allow_warped_motion); - - // Check that the input mode is not illegal - if (last_motion_mode_allowed < mode) - assert(0 && "Illegal motion mode selected"); -} - + assert(sb_type < BLOCK_SIZES_ALL);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/blockd.h
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
return OBMC_CAUSAL; } return WARPED_CAUSAL; } return OBMC_CAUSAL; } else { return SIMPLE_TRANSLATION; } }
+ show +
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
static INLINE void assert_motion_mode_valid(MOTION_MODE mode, const WarpedMotionParams *gm_params, const MACROBLOCKD *xd, const MB_MODE_INFO *mbmi, int allow_warped_motion) { const MOTION_MODE last_motion_mode_allowed = motion_mode_allowed(gm_params, xd, mbmi, allow_warped_motion); // Check that the input mode is not illegal if (last_motion_mode_allowed < mode) assert(0 && "Illegal motion mode selected");
+ show +
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
} static INLINE int is_neighbor_overlappable(const MB_MODE_INFO *mbmi) { return (is_inter_block(mbmi)); } static INLINE int av1_allow_palette(int allow_screen_content_tools, BLOCK_SIZE sb_type) { return allow_screen_content_tools && block_size_wide[sb_type] <= 64 && block_size_high[sb_type] <= 64 && sb_type >= BLOCK_8X8;

[CVE-2020-0478_1.diff] txb_common.h #3
- { 1, 4, 4, 4, 5 }, - { 1, 4, 4, 4, 5 }, - { 1, 4, 4, 4, 5 }, - { 1, 4, 4, 4, 6 } }; + { 2, 4, 4, 4, 5 }, + { 2, 4, 4, 4, 5 }, + { 2, 4, 4, 4, 5 }, + { 3, 5, 5, 5, 6 } }; + // For top and left, we only care about which of the following three + // categories they belong to: { 0 }, { 1, 2, 3 }, or { 4, 5, ... }. The + // spec calculates top and left with the Max() function. We can calculate + // an approximate max with bitwise OR because the real max and the + // approximate max belong to the same category.
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/txb_common.h
391
392
393
394
395
396
397
398
399
400
// txb_skip_ctx = 1; // else if (!min) // txb_skip_ctx = 2 + (max > 3); // else if (max <= 3) // txb_skip_ctx = 4; // else if (min <= 3) // txb_skip_ctx = 5; // else // txb_skip_ctx = 6; static const uint8_t skip_contexts[5][5] = { { 1, 2, 2, 2, 3 },
+ show +
401
402
403
404
{ 1, 4, 4, 4, 5 }, { 1, 4, 4, 4, 5 }, { 1, 4, 4, 4, 5 }, { 1, 4, 4, 4, 6 } };
+ show +
405
406
407
408
409
410
411
412
413
414
int top = 0; int left = 0; k = 0; do { top |= a[k]; } while (++k < txb_w_unit); top &= COEFF_CONTEXT_MASK; k = 0;

[CVE-2020-0470_1.diff] txb_common.h #3
- { 1, 4, 4, 4, 5 }, - { 1, 4, 4, 4, 5 }, - { 1, 4, 4, 4, 5 }, - { 1, 4, 4, 4, 6 } }; + { 2, 4, 4, 4, 5 }, + { 2, 4, 4, 4, 5 }, + { 2, 4, 4, 4, 5 }, + { 3, 5, 5, 5, 6 } }; + // For top and left, we only care about which of the following three + // categories they belong to: { 0 }, { 1, 2, 3 }, or { 4, 5, ... }. The + // spec calculates top and left with the Max() function. We can calculate + // an approximate max with bitwise OR because the real max and the + // approximate max belong to the same category.
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/txb_common.h
391
392
393
394
395
396
397
398
399
400
// txb_skip_ctx = 1; // else if (!min) // txb_skip_ctx = 2 + (max > 3); // else if (max <= 3) // txb_skip_ctx = 4; // else if (min <= 3) // txb_skip_ctx = 5; // else // txb_skip_ctx = 6; static const uint8_t skip_contexts[5][5] = { { 1, 2, 2, 2, 3 },
+ show +
401
402
403
404
{ 1, 4, 4, 4, 5 }, { 1, 4, 4, 4, 5 }, { 1, 4, 4, 4, 5 }, { 1, 4, 4, 4, 6 } };
+ show +
405
406
407
408
409
410
411
412
413
414
int top = 0; int left = 0; k = 0; do { top |= a[k]; } while (++k < txb_w_unit); top &= COEFF_CONTEXT_MASK; k = 0;

[CVE-2020-0478_1.diff] mvref_common.h #2
- clamp_mv(mv, xd->mb_to_left_edge - bw * 8 - MV_BORDER, - xd->mb_to_right_edge + bw * 8 + MV_BORDER, - xd->mb_to_top_edge - bh * 8 - MV_BORDER, - xd->mb_to_bottom_edge + bh * 8 + MV_BORDER); + const SubpelMvLimits mv_limits = { + xd->mb_to_left_edge - GET_MV_SUBPEL(bw) - MV_BORDER, + xd->mb_to_right_edge + GET_MV_SUBPEL(bw) + MV_BORDER, + xd->mb_to_top_edge - GET_MV_SUBPEL(bh) - MV_BORDER, + xd->mb_to_bottom_edge + GET_MV_SUBPEL(bh) + MV_BORDER + }; + clamp_mv(mv, &mv_limits); -// This function returns either the appropriate sub block or block's mv -// on whether the block_size < 8x8 and we have check_sub_blocks set. -static INLINE int_mv get_sub_block_mv(const MB_MODE_INFO *candidate, - int which_mv, int search_col) { - (void)search_col; - return candidate->mv[which_mv]; -} - -static INLINE int_mv get_sub_block_pred_mv(const MB_MODE_INFO *candidate, - int which_mv, int search_col) { - (void)search_col; +static INLINE int_mv get_block_mv(const MB_MODE_INFO *candidate, int which_mv) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/mvref_common.h
43
44
45
46
47
48
49
50
51
52
assert(a >= 0 && a < (1 << bits)); assert(b >= 0 && b < (1 << bits)); int diff = a - b; const int m = 1 << (bits - 1); diff = (diff & (m - 1)) - (diff & m); return diff; } static INLINE void clamp_mv_ref(MV *mv, int bw, int bh, const MACROBLOCKD *xd) {
+ show +
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
clamp_mv(mv, xd->mb_to_left_edge - bw * 8 - MV_BORDER, xd->mb_to_right_edge + bw * 8 + MV_BORDER, xd->mb_to_top_edge - bh * 8 - MV_BORDER, xd->mb_to_bottom_edge + bh * 8 + MV_BORDER); } // This function returns either the appropriate sub block or block's mv // on whether the block_size < 8x8 and we have check_sub_blocks set. static INLINE int_mv get_sub_block_mv(const MB_MODE_INFO *candidate, int which_mv, int search_col) { (void)search_col; return candidate->mv[which_mv]; } static INLINE int_mv get_sub_block_pred_mv(const MB_MODE_INFO *candidate, int which_mv, int search_col) { (void)search_col;
+ show +
70
71
72
73
74
75
76
77
78
79
return candidate->mv[which_mv]; } // Checks that the given mi_row, mi_col and search point // are inside the borders of the tile. static INLINE int is_inside(const TileInfo *const tile, int mi_col, int mi_row, const POSITION *mi_pos) { return !(mi_row + mi_pos->row < tile->mi_row_start || mi_col + mi_pos->col < tile->mi_col_start || mi_row + mi_pos->row >= tile->mi_row_end ||

[CVE-2020-0478_1.diff] mvref_common.h #6
- for (int plane = 1; plane < av1_num_planes(cm); ++plane) { - const struct macroblockd_plane *const pd = &xd->plane[plane]; - if (is_chroma_reference(mi_row, mi_col, bsize, pd->subsampling_x, - pd->subsampling_y)) { - if (bw < 8 && pd->subsampling_x) - if (src_left_edge < tile_left_edge + 4 * SCALE_PX_TO_MV) return 0; - if (bh < 8 && pd->subsampling_y) - if (src_top_edge < tile_top_edge + 4 * SCALE_PX_TO_MV) return 0; - } + if (xd->is_chroma_ref && av1_num_planes(cm) > 1) { + const struct macroblockd_plane *const pd = &xd->plane[1]; + if (bw < 8 && pd->subsampling_x) + if (src_left_edge < tile_left_edge + 4 * SCALE_PX_TO_MV) return 0; + if (bh < 8 && pd->subsampling_y) + if (src_top_edge < tile_top_edge + 4 * SCALE_PX_TO_MV) return 0;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/mvref_common.h
304
305
306
307
308
309
310
311
312
313
// Is the bottom right inside the current tile? const int src_bottom_edge = (mi_row * MI_SIZE + bh) * SCALE_PX_TO_MV + dv.row; const int tile_bottom_edge = tile->mi_row_end * MI_SIZE * SCALE_PX_TO_MV; if (src_bottom_edge > tile_bottom_edge) return 0; const int src_right_edge = (mi_col * MI_SIZE + bw) * SCALE_PX_TO_MV + dv.col; const int tile_right_edge = tile->mi_col_end * MI_SIZE * SCALE_PX_TO_MV; if (src_right_edge > tile_right_edge) return 0; // Special case for sub 8x8 chroma cases, to prevent referring to chroma // pixels outside current tile.
+ show +
314
315
316
317
318
319
320
321
for (int plane = 1; plane < av1_num_planes(cm); ++plane) { const struct macroblockd_plane *const pd = &xd->plane[plane]; if (is_chroma_reference(mi_row, mi_col, bsize, pd->subsampling_x, pd->subsampling_y)) { if (bw < 8 && pd->subsampling_x) if (src_left_edge < tile_left_edge + 4 * SCALE_PX_TO_MV) return 0; if (bh < 8 && pd->subsampling_y) if (src_top_edge < tile_top_edge + 4 * SCALE_PX_TO_MV) return 0;
+ show +
322
323
324
325
326
327
328
329
330
331
} } // Is the bottom right within an already coded SB? Also consider additional // constraints to facilitate HW decoder. const int max_mib_size = 1 << mib_size_log2; const int active_sb_row = mi_row >> mib_size_log2; const int active_sb64_col = (mi_col * MI_SIZE) >> 6; const int sb_size = max_mib_size * MI_SIZE; const int src_sb_row = ((src_bottom_edge >> 3) - 1) / sb_size;

[CVE-2020-0470_1.diff] mvref_common.h #2
- clamp_mv(mv, xd->mb_to_left_edge - bw * 8 - MV_BORDER, - xd->mb_to_right_edge + bw * 8 + MV_BORDER, - xd->mb_to_top_edge - bh * 8 - MV_BORDER, - xd->mb_to_bottom_edge + bh * 8 + MV_BORDER); + const SubpelMvLimits mv_limits = { + xd->mb_to_left_edge - GET_MV_SUBPEL(bw) - MV_BORDER, + xd->mb_to_right_edge + GET_MV_SUBPEL(bw) + MV_BORDER, + xd->mb_to_top_edge - GET_MV_SUBPEL(bh) - MV_BORDER, + xd->mb_to_bottom_edge + GET_MV_SUBPEL(bh) + MV_BORDER + }; + clamp_mv(mv, &mv_limits); -// This function returns either the appropriate sub block or block's mv -// on whether the block_size < 8x8 and we have check_sub_blocks set. -static INLINE int_mv get_sub_block_mv(const MB_MODE_INFO *candidate, - int which_mv, int search_col) { - (void)search_col; - return candidate->mv[which_mv]; -} - -static INLINE int_mv get_sub_block_pred_mv(const MB_MODE_INFO *candidate, - int which_mv, int search_col) { - (void)search_col; +static INLINE int_mv get_block_mv(const MB_MODE_INFO *candidate, int which_mv) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/mvref_common.h
43
44
45
46
47
48
49
50
51
52
assert(a >= 0 && a < (1 << bits)); assert(b >= 0 && b < (1 << bits)); int diff = a - b; const int m = 1 << (bits - 1); diff = (diff & (m - 1)) - (diff & m); return diff; } static INLINE void clamp_mv_ref(MV *mv, int bw, int bh, const MACROBLOCKD *xd) {
+ show +
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
clamp_mv(mv, xd->mb_to_left_edge - bw * 8 - MV_BORDER, xd->mb_to_right_edge + bw * 8 + MV_BORDER, xd->mb_to_top_edge - bh * 8 - MV_BORDER, xd->mb_to_bottom_edge + bh * 8 + MV_BORDER); } // This function returns either the appropriate sub block or block's mv // on whether the block_size < 8x8 and we have check_sub_blocks set. static INLINE int_mv get_sub_block_mv(const MB_MODE_INFO *candidate, int which_mv, int search_col) { (void)search_col; return candidate->mv[which_mv]; } static INLINE int_mv get_sub_block_pred_mv(const MB_MODE_INFO *candidate, int which_mv, int search_col) { (void)search_col;
+ show +
70
71
72
73
74
75
76
77
78
79
return candidate->mv[which_mv]; } // Checks that the given mi_row, mi_col and search point // are inside the borders of the tile. static INLINE int is_inside(const TileInfo *const tile, int mi_col, int mi_row, const POSITION *mi_pos) { return !(mi_row + mi_pos->row < tile->mi_row_start || mi_col + mi_pos->col < tile->mi_col_start || mi_row + mi_pos->row >= tile->mi_row_end ||

[CVE-2020-0470_1.diff] mvref_common.h #6
- for (int plane = 1; plane < av1_num_planes(cm); ++plane) { - const struct macroblockd_plane *const pd = &xd->plane[plane]; - if (is_chroma_reference(mi_row, mi_col, bsize, pd->subsampling_x, - pd->subsampling_y)) { - if (bw < 8 && pd->subsampling_x) - if (src_left_edge < tile_left_edge + 4 * SCALE_PX_TO_MV) return 0; - if (bh < 8 && pd->subsampling_y) - if (src_top_edge < tile_top_edge + 4 * SCALE_PX_TO_MV) return 0; - } + if (xd->is_chroma_ref && av1_num_planes(cm) > 1) { + const struct macroblockd_plane *const pd = &xd->plane[1]; + if (bw < 8 && pd->subsampling_x) + if (src_left_edge < tile_left_edge + 4 * SCALE_PX_TO_MV) return 0; + if (bh < 8 && pd->subsampling_y) + if (src_top_edge < tile_top_edge + 4 * SCALE_PX_TO_MV) return 0;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/mvref_common.h
304
305
306
307
308
309
310
311
312
313
// Is the bottom right inside the current tile? const int src_bottom_edge = (mi_row * MI_SIZE + bh) * SCALE_PX_TO_MV + dv.row; const int tile_bottom_edge = tile->mi_row_end * MI_SIZE * SCALE_PX_TO_MV; if (src_bottom_edge > tile_bottom_edge) return 0; const int src_right_edge = (mi_col * MI_SIZE + bw) * SCALE_PX_TO_MV + dv.col; const int tile_right_edge = tile->mi_col_end * MI_SIZE * SCALE_PX_TO_MV; if (src_right_edge > tile_right_edge) return 0; // Special case for sub 8x8 chroma cases, to prevent referring to chroma // pixels outside current tile.
+ show +
314
315
316
317
318
319
320
321
for (int plane = 1; plane < av1_num_planes(cm); ++plane) { const struct macroblockd_plane *const pd = &xd->plane[plane]; if (is_chroma_reference(mi_row, mi_col, bsize, pd->subsampling_x, pd->subsampling_y)) { if (bw < 8 && pd->subsampling_x) if (src_left_edge < tile_left_edge + 4 * SCALE_PX_TO_MV) return 0; if (bh < 8 && pd->subsampling_y) if (src_top_edge < tile_top_edge + 4 * SCALE_PX_TO_MV) return 0;
+ show +
322
323
324
325
326
327
328
329
330
331
} } // Is the bottom right within an already coded SB? Also consider additional // constraints to facilitate HW decoder. const int max_mib_size = 1 << mib_size_log2; const int active_sb_row = mi_row >> mib_size_log2; const int active_sb64_col = (mi_col * MI_SIZE) >> 6; const int sb_size = max_mib_size * MI_SIZE; const int src_sb_row = ((src_bottom_edge >> 3) - 1) / sb_size;

[CVE-2020-0478_1.diff] quant_common.c #8
-const qm_val_t *av1_iqmatrix(AV1_COMMON *cm, int qmlevel, int plane, - TX_SIZE tx_size) { - return &cm->giqmatrix[qmlevel][plane][tx_size][0]; +bool av1_use_qmatrix(const CommonQuantParams *quant_params, + const struct macroblockd *xd, int segment_id) { + // True if explicit Q matrix levels and this is not a lossless segment. + return quant_params->using_qmatrix && !xd->lossless[segment_id]; -const qm_val_t *av1_qmatrix(AV1_COMMON *cm, int qmlevel, int plane, - TX_SIZE tx_size) { - return &cm->gqmatrix[qmlevel][plane][tx_size][0]; + +const qm_val_t *av1_iqmatrix(const CommonQuantParams *quant_params, int qmlevel, + int plane, TX_SIZE tx_size) { + assert(quant_params->giqmatrix[qmlevel][plane][tx_size] != NULL || + qmlevel == NUM_QM_LEVELS - 1); + return quant_params->giqmatrix[qmlevel][plane][tx_size]; +} +const qm_val_t *av1_qmatrix(const CommonQuantParams *quant_params, int qmlevel, + int plane, TX_SIZE tx_size) { + assert(quant_params->gqmatrix[qmlevel][plane][tx_size] != NULL || + qmlevel == NUM_QM_LEVELS - 1); + return quant_params->gqmatrix[qmlevel][plane][tx_size]; +} + +// Returns true if the tx_type corresponds to non-identity transform in both +// horizontal and vertical directions. +static INLINE bool is_2d_transform(TX_TYPE tx_type) { return (tx_type < IDTX); } + +const qm_val_t *av1_get_iqmatrix(const CommonQuantParams *quant_params, + const MACROBLOCKD *xd, int plane, + TX_SIZE tx_size, TX_TYPE tx_type) { + const struct macroblockd_plane *const pd = &xd->plane[plane]; + const MB_MODE_INFO *const mbmi = xd->mi[0]; + const int seg_id = mbmi->segment_id; + const TX_SIZE qm_tx_size = av1_get_adjusted_tx_size(tx_size); + // Use a flat matrix (i.e. no weighting) for 1D and Identity transforms + return is_2d_transform(tx_type) + ? pd->seg_iqmatrix[seg_id][qm_tx_size] + : quant_params->giqmatrix[NUM_QM_LEVELS - 1][0][qm_tx_size]; +} + +const qm_val_t *av1_get_qmatrix(const CommonQuantParams *quant_params, + const MACROBLOCKD *xd, int plane, + TX_SIZE tx_size, TX_TYPE tx_type) { + const struct macroblockd_plane *const pd = &xd->plane[plane]; + const MB_MODE_INFO *const mbmi = xd->mi[0]; + const int seg_id = mbmi->segment_id; + const TX_SIZE qm_tx_size = av1_get_adjusted_tx_size(tx_size); + // Use a flat matrix (i.e. no weighting) for 1D and Identity transforms + return is_2d_transform(tx_type) + ? pd->seg_qmatrix[seg_id][qm_tx_size] + : quant_params->gqmatrix[NUM_QM_LEVELS - 1][0][qm_tx_size];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/quant_common.c
229
230
231
232
233
234
235
236
237
238
int base_qindex) { if (segfeature_active(seg, segment_id, SEG_LVL_ALT_Q)) { const int data = get_segdata(seg, segment_id, SEG_LVL_ALT_Q); const int seg_qindex = base_qindex + data; return clamp(seg_qindex, 0, MAXQ); } else { return base_qindex; } }
+ show +
239
240
241
242
243
244
245
const qm_val_t *av1_iqmatrix(AV1_COMMON *cm, int qmlevel, int plane, TX_SIZE tx_size) { return &cm->giqmatrix[qmlevel][plane][tx_size][0]; } const qm_val_t *av1_qmatrix(AV1_COMMON *cm, int qmlevel, int plane, TX_SIZE tx_size) { return &cm->gqmatrix[qmlevel][plane][tx_size][0];
+ show +
246
247
248
249
250
251
252
253
254
255
} #define QM_TOTAL_SIZE 3344 // We only use wt_matrix_ref[q] and iwt_matrix_ref[q] // for q = 0, ..., NUM_QM_LEVELS - 2. static const qm_val_t wt_matrix_ref[NUM_QM_LEVELS - 1][2][QM_TOTAL_SIZE]; static const qm_val_t iwt_matrix_ref[NUM_QM_LEVELS - 1][2][QM_TOTAL_SIZE]; void av1_qm_init(AV1_COMMON *cm) { const int num_planes = av1_num_planes(cm);

[CVE-2020-0470_1.diff] quant_common.c #8
-const qm_val_t *av1_iqmatrix(AV1_COMMON *cm, int qmlevel, int plane, - TX_SIZE tx_size) { - return &cm->giqmatrix[qmlevel][plane][tx_size][0]; +bool av1_use_qmatrix(const CommonQuantParams *quant_params, + const struct macroblockd *xd, int segment_id) { + // True if explicit Q matrix levels and this is not a lossless segment. + return quant_params->using_qmatrix && !xd->lossless[segment_id]; -const qm_val_t *av1_qmatrix(AV1_COMMON *cm, int qmlevel, int plane, - TX_SIZE tx_size) { - return &cm->gqmatrix[qmlevel][plane][tx_size][0]; + +const qm_val_t *av1_iqmatrix(const CommonQuantParams *quant_params, int qmlevel, + int plane, TX_SIZE tx_size) { + assert(quant_params->giqmatrix[qmlevel][plane][tx_size] != NULL || + qmlevel == NUM_QM_LEVELS - 1); + return quant_params->giqmatrix[qmlevel][plane][tx_size]; +} +const qm_val_t *av1_qmatrix(const CommonQuantParams *quant_params, int qmlevel, + int plane, TX_SIZE tx_size) { + assert(quant_params->gqmatrix[qmlevel][plane][tx_size] != NULL || + qmlevel == NUM_QM_LEVELS - 1); + return quant_params->gqmatrix[qmlevel][plane][tx_size]; +} + +// Returns true if the tx_type corresponds to non-identity transform in both +// horizontal and vertical directions. +static INLINE bool is_2d_transform(TX_TYPE tx_type) { return (tx_type < IDTX); } + +const qm_val_t *av1_get_iqmatrix(const CommonQuantParams *quant_params, + const MACROBLOCKD *xd, int plane, + TX_SIZE tx_size, TX_TYPE tx_type) { + const struct macroblockd_plane *const pd = &xd->plane[plane]; + const MB_MODE_INFO *const mbmi = xd->mi[0]; + const int seg_id = mbmi->segment_id; + const TX_SIZE qm_tx_size = av1_get_adjusted_tx_size(tx_size); + // Use a flat matrix (i.e. no weighting) for 1D and Identity transforms + return is_2d_transform(tx_type) + ? pd->seg_iqmatrix[seg_id][qm_tx_size] + : quant_params->giqmatrix[NUM_QM_LEVELS - 1][0][qm_tx_size]; +} + +const qm_val_t *av1_get_qmatrix(const CommonQuantParams *quant_params, + const MACROBLOCKD *xd, int plane, + TX_SIZE tx_size, TX_TYPE tx_type) { + const struct macroblockd_plane *const pd = &xd->plane[plane]; + const MB_MODE_INFO *const mbmi = xd->mi[0]; + const int seg_id = mbmi->segment_id; + const TX_SIZE qm_tx_size = av1_get_adjusted_tx_size(tx_size); + // Use a flat matrix (i.e. no weighting) for 1D and Identity transforms + return is_2d_transform(tx_type) + ? pd->seg_qmatrix[seg_id][qm_tx_size] + : quant_params->gqmatrix[NUM_QM_LEVELS - 1][0][qm_tx_size];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/quant_common.c
229
230
231
232
233
234
235
236
237
238
int base_qindex) { if (segfeature_active(seg, segment_id, SEG_LVL_ALT_Q)) { const int data = get_segdata(seg, segment_id, SEG_LVL_ALT_Q); const int seg_qindex = base_qindex + data; return clamp(seg_qindex, 0, MAXQ); } else { return base_qindex; } }
+ show +
239
240
241
242
243
244
245
const qm_val_t *av1_iqmatrix(AV1_COMMON *cm, int qmlevel, int plane, TX_SIZE tx_size) { return &cm->giqmatrix[qmlevel][plane][tx_size][0]; } const qm_val_t *av1_qmatrix(AV1_COMMON *cm, int qmlevel, int plane, TX_SIZE tx_size) { return &cm->gqmatrix[qmlevel][plane][tx_size][0];
+ show +
246
247
248
249
250
251
252
253
254
255
} #define QM_TOTAL_SIZE 3344 // We only use wt_matrix_ref[q] and iwt_matrix_ref[q] // for q = 0, ..., NUM_QM_LEVELS - 2. static const qm_val_t wt_matrix_ref[NUM_QM_LEVELS - 1][2][QM_TOTAL_SIZE]; static const qm_val_t iwt_matrix_ref[NUM_QM_LEVELS - 1][2][QM_TOTAL_SIZE]; void av1_qm_init(AV1_COMMON *cm) { const int num_planes = av1_num_planes(cm);

[CVE-2020-0478_1.diff] onyxc_int.h #7
- int enable_order_hint; // 0 - disable order hint, and related tools - int order_hint_bits_minus_1; // dist_wtd_comp, ref_frame_mvs, - // frame_sign_bias - // if 0, enable_dist_wtd_comp and - // enable_ref_frame_mvs must be set as 0. - int enable_dist_wtd_comp; // 0 - disable dist-wtd compound modes - // 1 - enable it - int enable_ref_frame_mvs; // 0 - disable ref frame mvs - // 1 - enable it + int enable_order_hint; // 0 - disable order hint, and related tools + int order_hint_bits_minus_1; // dist_wtd_comp, ref_frame_mvs, + // frame_sign_bias + // if 0, enable_dist_wtd_comp and + // enable_ref_frame_mvs must be set as 0. + int enable_dist_wtd_comp; // 0 - disable dist-wtd compound modes + // 1 - enable it + int enable_ref_frame_mvs; // 0 - disable ref frame mvs + // 1 - enable it +// One exception is the last member 'op_params' that is ignored by +// are_seq_headers_consistent() function.
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/onyxc_int.h
198
199
200
201
202
203
204
205
206
207
int delta_lf_present_flag; // Resolution of delta lf level int delta_lf_res; // This is a flag for number of deltas of loop filter level // 0: use 1 delta, for y_vertical, y_horizontal, u, and v // 1: use separate deltas for each filter level int delta_lf_multi; } DeltaQInfo; typedef struct {
+ show +
208
209
210
211
212
213
214
215
int enable_order_hint; // 0 - disable order hint, and related tools int order_hint_bits_minus_1; // dist_wtd_comp, ref_frame_mvs, // frame_sign_bias // if 0, enable_dist_wtd_comp and // enable_ref_frame_mvs must be set as 0. int enable_dist_wtd_comp; // 0 - disable dist-wtd compound modes // 1 - enable it int enable_ref_frame_mvs; // 0 - disable ref frame mvs
+ show +
216
217
218
219
220
221
222
223
224
225
// 1 - enable it } OrderHintInfo; // Sequence header structure. // Note: All syntax elements of sequence_header_obu that need to be // bit-identical across multiple sequence headers must be part of this struct, // so that consistency is checked by are_seq_headers_consistent() function. typedef struct SequenceHeader { int num_bits_width; int num_bits_height;

[CVE-2020-0478_1.diff] onyxc_int.h #8
- // Operating point info. - int operating_points_cnt_minus_1; - int operating_point_idc[MAX_NUM_OPERATING_POINTS]; - uint8_t display_model_info_present_flag; - uint8_t decoder_model_info_present_flag; - AV1_LEVEL seq_level_idx[MAX_NUM_OPERATING_POINTS]; - uint8_t tier[MAX_NUM_OPERATING_POINTS]; // seq_tier in the spec. One bit: 0 - // or 1. -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/onyxc_int.h
252
253
254
255
256
257
258
259
260
261
// 1 - enable warp for the sequence uint8_t enable_superres; // 0 - Disable superres for the sequence // and no frame level superres flag // 1 - Enable superres for the sequence // enable per-frame superres flag uint8_t enable_cdef; // To turn on/off CDEF uint8_t enable_restoration; // To turn on/off loop restoration BITSTREAM_PROFILE profile; // Operating point info.
+ show +
262
263
264
265
266
267
int operating_points_cnt_minus_1; int operating_point_idc[MAX_NUM_OPERATING_POINTS]; uint8_t display_model_info_present_flag; uint8_t decoder_model_info_present_flag; AV1_LEVEL seq_level_idx[MAX_NUM_OPERATING_POINTS]; uint8_t tier[MAX_NUM_OPERATING_POINTS]; // seq_tier in the spec. One bit: 0
+ show +
268
269
270
271
272
273
274
275
276
277
// or 1. // Color config. aom_bit_depth_t bit_depth; // AOM_BITS_8 in profile 0 or 1, // AOM_BITS_10 or AOM_BITS_12 in profile 2 or 3. uint8_t use_highbitdepth; // If true, we need to use 16bit frame buffers. uint8_t monochrome; // Monochorme video aom_color_primaries_t color_primaries; aom_transfer_characteristics_t transfer_characteristics; aom_matrix_coefficients_t matrix_coefficients;

[CVE-2020-0478_1.diff] onyxc_int.h #23
+ assert(bsize < BLOCK_SIZES_ALL); -static INLINE BLOCK_SIZE scale_chroma_bsize(BLOCK_SIZE bsize, int subsampling_x, - int subsampling_y) { - BLOCK_SIZE bs = bsize; - switch (bsize) { - case BLOCK_4X4: - if (subsampling_x == 1 && subsampling_y == 1) - bs = BLOCK_8X8; - else if (subsampling_x == 1) - bs = BLOCK_8X4; - else if (subsampling_y == 1) - bs = BLOCK_4X8; - break; - case BLOCK_4X8: - if (subsampling_x == 1 && subsampling_y == 1) - bs = BLOCK_8X8; - else if (subsampling_x == 1) - bs = BLOCK_8X8; - else if (subsampling_y == 1) - bs = BLOCK_4X8; - break; - case BLOCK_8X4: - if (subsampling_x == 1 && subsampling_y == 1) - bs = BLOCK_8X8; - else if (subsampling_x == 1) - bs = BLOCK_8X4; - else if (subsampling_y == 1) - bs = BLOCK_8X8; - break; - case BLOCK_4X16: - if (subsampling_x == 1 && subsampling_y == 1) - bs = BLOCK_8X16; - else if (subsampling_x == 1) - bs = BLOCK_8X16; - else if (subsampling_y == 1) - bs = BLOCK_4X16; - break; - case BLOCK_16X4: - if (subsampling_x == 1 && subsampling_y == 1) - bs = BLOCK_16X8; - else if (subsampling_x == 1) - bs = BLOCK_16X4; - else if (subsampling_y == 1) - bs = BLOCK_16X8; - break; - default: break; - } - return bs; -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/onyxc_int.h
917
918
919
920
921
922
923
924
925
926
static INLINE int is_chroma_reference(int mi_row, int mi_col, BLOCK_SIZE bsize, int subsampling_x, int subsampling_y) { const int bw = mi_size_wide[bsize]; const int bh = mi_size_high[bsize]; int ref_pos = ((mi_row & 0x01) || !(bh & 0x01) || !subsampling_y) && ((mi_col & 0x01) || !(bw & 0x01) || !subsampling_x); return ref_pos; }
+ show +
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
static INLINE BLOCK_SIZE scale_chroma_bsize(BLOCK_SIZE bsize, int subsampling_x, int subsampling_y) { BLOCK_SIZE bs = bsize; switch (bsize) { case BLOCK_4X4: if (subsampling_x == 1 && subsampling_y == 1) bs = BLOCK_8X8; else if (subsampling_x == 1) bs = BLOCK_8X4; else if (subsampling_y == 1) bs = BLOCK_4X8; break; case BLOCK_4X8: if (subsampling_x == 1 && subsampling_y == 1) bs = BLOCK_8X8; else if (subsampling_x == 1) bs = BLOCK_8X8; else if (subsampling_y == 1) bs = BLOCK_4X8; break; case BLOCK_8X4: if (subsampling_x == 1 && subsampling_y == 1) bs = BLOCK_8X8; else if (subsampling_x == 1) bs = BLOCK_8X4; else if (subsampling_y == 1) bs = BLOCK_8X8; break; case BLOCK_4X16: if (subsampling_x == 1 && subsampling_y == 1) bs = BLOCK_8X16; else if (subsampling_x == 1) bs = BLOCK_8X16; else if (subsampling_y == 1) bs = BLOCK_4X16; break; case BLOCK_16X4: if (subsampling_x == 1 && subsampling_y == 1) bs = BLOCK_16X8; else if (subsampling_x == 1) bs = BLOCK_16X4; else if (subsampling_y == 1) bs = BLOCK_16X8; break; default: break; } return bs;
+ show +
974
975
976
977
978
979
980
981
982
983
} static INLINE aom_cdf_prob cdf_element_prob(const aom_cdf_prob *cdf, size_t element) { assert(cdf != NULL); return (element > 0 ? cdf[element - 1] : CDF_PROB_TOP) - cdf[element]; } static INLINE void partition_gather_horz_alike(aom_cdf_prob *out, const aom_cdf_prob *const in,

[CVE-2020-0470_1.diff] onyxc_int.h #7
- int enable_order_hint; // 0 - disable order hint, and related tools - int order_hint_bits_minus_1; // dist_wtd_comp, ref_frame_mvs, - // frame_sign_bias - // if 0, enable_dist_wtd_comp and - // enable_ref_frame_mvs must be set as 0. - int enable_dist_wtd_comp; // 0 - disable dist-wtd compound modes - // 1 - enable it - int enable_ref_frame_mvs; // 0 - disable ref frame mvs - // 1 - enable it + int enable_order_hint; // 0 - disable order hint, and related tools + int order_hint_bits_minus_1; // dist_wtd_comp, ref_frame_mvs, + // frame_sign_bias + // if 0, enable_dist_wtd_comp and + // enable_ref_frame_mvs must be set as 0. + int enable_dist_wtd_comp; // 0 - disable dist-wtd compound modes + // 1 - enable it + int enable_ref_frame_mvs; // 0 - disable ref frame mvs + // 1 - enable it +// One exception is the last member 'op_params' that is ignored by +// are_seq_headers_consistent() function.
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/onyxc_int.h
198
199
200
201
202
203
204
205
206
207
int delta_lf_present_flag; // Resolution of delta lf level int delta_lf_res; // This is a flag for number of deltas of loop filter level // 0: use 1 delta, for y_vertical, y_horizontal, u, and v // 1: use separate deltas for each filter level int delta_lf_multi; } DeltaQInfo; typedef struct {
+ show +
208
209
210
211
212
213
214
215
int enable_order_hint; // 0 - disable order hint, and related tools int order_hint_bits_minus_1; // dist_wtd_comp, ref_frame_mvs, // frame_sign_bias // if 0, enable_dist_wtd_comp and // enable_ref_frame_mvs must be set as 0. int enable_dist_wtd_comp; // 0 - disable dist-wtd compound modes // 1 - enable it int enable_ref_frame_mvs; // 0 - disable ref frame mvs
+ show +
216
217
218
219
220
221
222
223
224
225
// 1 - enable it } OrderHintInfo; // Sequence header structure. // Note: All syntax elements of sequence_header_obu that need to be // bit-identical across multiple sequence headers must be part of this struct, // so that consistency is checked by are_seq_headers_consistent() function. typedef struct SequenceHeader { int num_bits_width; int num_bits_height;

[CVE-2020-0470_1.diff] onyxc_int.h #8
- // Operating point info. - int operating_points_cnt_minus_1; - int operating_point_idc[MAX_NUM_OPERATING_POINTS]; - uint8_t display_model_info_present_flag; - uint8_t decoder_model_info_present_flag; - AV1_LEVEL seq_level_idx[MAX_NUM_OPERATING_POINTS]; - uint8_t tier[MAX_NUM_OPERATING_POINTS]; // seq_tier in the spec. One bit: 0 - // or 1. -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/onyxc_int.h
252
253
254
255
256
257
258
259
260
261
// 1 - enable warp for the sequence uint8_t enable_superres; // 0 - Disable superres for the sequence // and no frame level superres flag // 1 - Enable superres for the sequence // enable per-frame superres flag uint8_t enable_cdef; // To turn on/off CDEF uint8_t enable_restoration; // To turn on/off loop restoration BITSTREAM_PROFILE profile; // Operating point info.
+ show +
262
263
264
265
266
267
int operating_points_cnt_minus_1; int operating_point_idc[MAX_NUM_OPERATING_POINTS]; uint8_t display_model_info_present_flag; uint8_t decoder_model_info_present_flag; AV1_LEVEL seq_level_idx[MAX_NUM_OPERATING_POINTS]; uint8_t tier[MAX_NUM_OPERATING_POINTS]; // seq_tier in the spec. One bit: 0
+ show +
268
269
270
271
272
273
274
275
276
277
// or 1. // Color config. aom_bit_depth_t bit_depth; // AOM_BITS_8 in profile 0 or 1, // AOM_BITS_10 or AOM_BITS_12 in profile 2 or 3. uint8_t use_highbitdepth; // If true, we need to use 16bit frame buffers. uint8_t monochrome; // Monochorme video aom_color_primaries_t color_primaries; aom_transfer_characteristics_t transfer_characteristics; aom_matrix_coefficients_t matrix_coefficients;

[CVE-2020-0470_1.diff] onyxc_int.h #23
+ assert(bsize < BLOCK_SIZES_ALL); -static INLINE BLOCK_SIZE scale_chroma_bsize(BLOCK_SIZE bsize, int subsampling_x, - int subsampling_y) { - BLOCK_SIZE bs = bsize; - switch (bsize) { - case BLOCK_4X4: - if (subsampling_x == 1 && subsampling_y == 1) - bs = BLOCK_8X8; - else if (subsampling_x == 1) - bs = BLOCK_8X4; - else if (subsampling_y == 1) - bs = BLOCK_4X8; - break; - case BLOCK_4X8: - if (subsampling_x == 1 && subsampling_y == 1) - bs = BLOCK_8X8; - else if (subsampling_x == 1) - bs = BLOCK_8X8; - else if (subsampling_y == 1) - bs = BLOCK_4X8; - break; - case BLOCK_8X4: - if (subsampling_x == 1 && subsampling_y == 1) - bs = BLOCK_8X8; - else if (subsampling_x == 1) - bs = BLOCK_8X4; - else if (subsampling_y == 1) - bs = BLOCK_8X8; - break; - case BLOCK_4X16: - if (subsampling_x == 1 && subsampling_y == 1) - bs = BLOCK_8X16; - else if (subsampling_x == 1) - bs = BLOCK_8X16; - else if (subsampling_y == 1) - bs = BLOCK_4X16; - break; - case BLOCK_16X4: - if (subsampling_x == 1 && subsampling_y == 1) - bs = BLOCK_16X8; - else if (subsampling_x == 1) - bs = BLOCK_16X4; - else if (subsampling_y == 1) - bs = BLOCK_16X8; - break; - default: break; - } - return bs; -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/onyxc_int.h
917
918
919
920
921
922
923
924
925
926
static INLINE int is_chroma_reference(int mi_row, int mi_col, BLOCK_SIZE bsize, int subsampling_x, int subsampling_y) { const int bw = mi_size_wide[bsize]; const int bh = mi_size_high[bsize]; int ref_pos = ((mi_row & 0x01) || !(bh & 0x01) || !subsampling_y) && ((mi_col & 0x01) || !(bw & 0x01) || !subsampling_x); return ref_pos; }
+ show +
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
static INLINE BLOCK_SIZE scale_chroma_bsize(BLOCK_SIZE bsize, int subsampling_x, int subsampling_y) { BLOCK_SIZE bs = bsize; switch (bsize) { case BLOCK_4X4: if (subsampling_x == 1 && subsampling_y == 1) bs = BLOCK_8X8; else if (subsampling_x == 1) bs = BLOCK_8X4; else if (subsampling_y == 1) bs = BLOCK_4X8; break; case BLOCK_4X8: if (subsampling_x == 1 && subsampling_y == 1) bs = BLOCK_8X8; else if (subsampling_x == 1) bs = BLOCK_8X8; else if (subsampling_y == 1) bs = BLOCK_4X8; break; case BLOCK_8X4: if (subsampling_x == 1 && subsampling_y == 1) bs = BLOCK_8X8; else if (subsampling_x == 1) bs = BLOCK_8X4; else if (subsampling_y == 1) bs = BLOCK_8X8; break; case BLOCK_4X16: if (subsampling_x == 1 && subsampling_y == 1) bs = BLOCK_8X16; else if (subsampling_x == 1) bs = BLOCK_8X16; else if (subsampling_y == 1) bs = BLOCK_4X16; break; case BLOCK_16X4: if (subsampling_x == 1 && subsampling_y == 1) bs = BLOCK_16X8; else if (subsampling_x == 1) bs = BLOCK_16X4; else if (subsampling_y == 1) bs = BLOCK_16X8; break; default: break; } return bs;
+ show +
974
975
976
977
978
979
980
981
982
983
} static INLINE aom_cdf_prob cdf_element_prob(const aom_cdf_prob *cdf, size_t element) { assert(cdf != NULL); return (element > 0 ? cdf[element - 1] : CDF_PROB_TOP) - cdf[element]; } static INLINE void partition_gather_horz_alike(aom_cdf_prob *out, const aom_cdf_prob *const in,

[CVE-2020-0478_1.diff] av1_loopfilter.c #2
-static const int delta_lf_id_lut[MAX_MB_PLANE][2] = { - { 0, 1 }, { 2, 2 }, { 3, 3 } -}; - -enum { VERT_EDGE = 0, HORZ_EDGE = 1, NUM_EDGE_DIRS } UENUM1BYTE(EDGE_DIR); +static const int delta_lf_id_lut[MAX_MB_PLANE][2] = { { 0, 1 }, + { 2, 2 }, + { 3, 3 } };
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/av1_loopfilter.c
21
22
23
24
25
26
27
28
29
30
#include "av1/common/onyxc_int.h" #include "av1/common/reconinter.h" #include "av1/common/seg_common.h" static const SEG_LVL_FEATURES seg_lvl_lf_lut[MAX_MB_PLANE][2] = { { SEG_LVL_ALT_LF_Y_V, SEG_LVL_ALT_LF_Y_H }, { SEG_LVL_ALT_LF_U, SEG_LVL_ALT_LF_U }, { SEG_LVL_ALT_LF_V, SEG_LVL_ALT_LF_V } };
+ show +
31
32
33
34
35
static const int delta_lf_id_lut[MAX_MB_PLANE][2] = { { 0, 1 }, { 2, 2 }, { 3, 3 } }; enum { VERT_EDGE = 0, HORZ_EDGE = 1, NUM_EDGE_DIRS } UENUM1BYTE(EDGE_DIR);
+ show +
36
37
38
39
40
41
42
43
44
45
static const int mode_lf_lut[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // INTRA_MODES 1, 1, 0, 1, // INTER_MODES (GLOBALMV == 0) 1, 1, 1, 1, 1, 1, 0, 1 // INTER_COMPOUND_MODES (GLOBAL_GLOBALMV == 0) }; // 256 bit masks (64x64 / 4x4) for left transform size for Y plane. // We use 4 uint64_t to represent the 256 bit. // Each 1 represents a position where we should apply a loop filter

[CVE-2020-0478_1.diff] av1_loopfilter.c #3
-// 256 bit masks (64x64 / 4x4) for left transform size for Y plane. -// We use 4 uint64_t to represent the 256 bit. -// Each 1 represents a position where we should apply a loop filter -// across the left border of an 4x4 block boundary. -// -// In the case of TX_8x8-> ( in low order byte first we end up with -// a mask that looks like this (-- and | are used for better view) -// -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// ----------------- -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// -// A loopfilter should be applied to every other 4x4 horizontally. - -// 256 bit masks (64x64 / 4x4) for above transform size for Y plane. -// We use 4 uint64_t to represent the 256 bit. -// Each 1 represents a position where we should apply a loop filter -// across the top border of an 4x4 block boundary. -// -// In the case of TX_8x8-> ( in low order byte first we end up with -// a mask that looks like this -// -// 11111111|11111111 -// 00000000|00000000 -// 11111111|11111111 -// 00000000|00000000 -// 11111111|11111111 -// 00000000|00000000 -// 11111111|11111111 -// 00000000|00000000 -// ----------------- -// 11111111|11111111 -// 00000000|00000000 -// 11111111|11111111 -// 00000000|00000000 -// 11111111|11111111 -// 00000000|00000000 -// 11111111|11111111 -// 00000000|00000000 -// -// A loopfilter should be applied to every other 4x4 horizontally. - -const int mask_id_table_tx_4x4[BLOCK_SIZES_ALL] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, -1, -1, -1, 13, 14, 15, 16, 17, 18 -}; - -const int mask_id_table_tx_8x8[BLOCK_SIZES_ALL] = { - -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, 10, 11, 12, 13 -}; - -const int mask_id_table_tx_16x16[BLOCK_SIZES_ALL] = { - -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, -1, -1, -1, -1, -1, -1, -1, 7, 8 -}; - -const int mask_id_table_tx_32x32[BLOCK_SIZES_ALL] = { -1, -1, -1, -1, -1, -1, - -1, -1, -1, 0, 1, 2, - 3, -1, -1, -1, -1, -1, - -1, -1, -1, -1 }; -const int mask_id_table_vert_border[BLOCK_SIZES_ALL] = { 0, 47, 49, 19, 51, 53, - 33, 55, 57, 42, 59, 60, - 46, -1, -1, -1, 61, 62, - 63, 64, 65, 66 }; - -const FilterMask left_mask_univariant_reordered[67] = { - // TX_4X4 - { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X4, TX_4X4 - { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X8, TX_4X4 - { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X4, TX_4X4 - { { 0x0000000000030003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X8, TX_4X4 - { { 0x0003000300030003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X16, TX_4X4 - { { 0x00000000000f000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X8, TX_4X4 - { { 0x000f000f000f000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X16, TX_4X4 - { { 0x000f000f000f000fULL, 0x000f000f000f000fULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X32, TX_4X4 - { { 0x00ff00ff00ff00ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X16, TX_4X4 - { { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X32, TX_4X4 - { { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, - 0x00ff00ff00ff00ffULL } }, // block size 32X64, TX_4X4 - { { 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X32, TX_4X4 - { { 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL, - 0xffffffffffffffffULL } }, // block size 64X64, TX_4X4 - { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X16, TX_4X4 - { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X4, TX_4X4 - { { 0x0003000300030003ULL, 0x0003000300030003ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X32, TX_4X4 - { { 0x0000000000ff00ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X8, TX_4X4 - { { 0x000f000f000f000fULL, 0x000f000f000f000fULL, 0x000f000f000f000fULL, - 0x000f000f000f000fULL } }, // block size 16X64, TX_4X4 - { { 0xffffffffffffffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X16, TX_4X4 - // TX_8X8 - { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X8, TX_8X8 - { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X16, TX_8X8 - { { 0x0000000000050005ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X8, TX_8X8 - { { 0x0005000500050005ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X16, TX_8X8 - { { 0x0005000500050005ULL, 0x0005000500050005ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X32, TX_8X8 - { { 0x0055005500550055ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X16, TX_8X8 - { { 0x0055005500550055ULL, 0x0055005500550055ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X32, TX_8X8 - { { 0x0055005500550055ULL, 0x0055005500550055ULL, 0x0055005500550055ULL, - 0x0055005500550055ULL } }, // block size 32X64, TX_8X8 - { { 0x5555555555555555ULL, 0x5555555555555555ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X32, TX_8X8 - { { 0x5555555555555555ULL, 0x5555555555555555ULL, 0x5555555555555555ULL, - 0x5555555555555555ULL } }, // block size 64X64, TX_8X8 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X32, TX_8X8 - { { 0x0000000000550055ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X8, TX_8X8 - { { 0x0005000500050005ULL, 0x0005000500050005ULL, 0x0005000500050005ULL, - 0x0005000500050005ULL } }, // block size 16X64, TX_8X8 - { { 0x5555555555555555ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X16, TX_8X8 - // TX_16X16 - { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X16, TX_16X16 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X32, TX_16X16 - { { 0x0011001100110011ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X16, TX_16X16 - { { 0x0011001100110011ULL, 0x0011001100110011ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X32, TX_16X16 - { { 0x0011001100110011ULL, 0x0011001100110011ULL, 0x0011001100110011ULL, - 0x0011001100110011ULL } }, // block size 32X64, TX_16X16 - { { 0x1111111111111111ULL, 0x1111111111111111ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X32, TX_16X16 - { { 0x1111111111111111ULL, 0x1111111111111111ULL, 0x1111111111111111ULL, - 0x1111111111111111ULL } }, // block size 64X64, TX_16X16 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL, - 0x0001000100010001ULL } }, // block size 16X64, TX_16X16 - { { 0x1111111111111111ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X16, TX_16X16 - // TX_32X32 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X32, TX_32X32 - { { 0x0101010101010101ULL, 0x0101010101010101ULL, 0x0101010101010101ULL, - 0x0101010101010101ULL } }, // block size 32X64, TX_32X32 - { { 0x0101010101010101ULL, 0x0101010101010101ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X32, TX_32X32 - { { 0x0101010101010101ULL, 0x0101010101010101ULL, 0x0101010101010101ULL, - 0x0101010101010101ULL } }, // block size 64X64, TX_32X32 - // TX_64X64 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL, - 0x0001000100010001ULL } }, // block size 64X64, TX_64X64 - // 2:1, 1:2 transform sizes. - { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X8, TX_4X8 - { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X16, TX_4X8 - { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X4, TX_8X4 - { { 0x0000000000000005ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X4, TX_8X4 - { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X16, TX_8X16 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X32, TX_8X16 - { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X8, TX_16X8 - { { 0x0000000000110011ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X8, TX_16X8 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X32, TX_16X32 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL, - 0x0001000100010001ULL } }, // block size 16X64, TX_16X32 - { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X16, TX_32X16 - { { 0x0101010101010101ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X16, TX_32X16 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL, - 0x0001000100010001ULL } }, // block size 32X64, TX_32X64 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X32, TX_64X32 - // 4:1, 1:4 transform sizes. - { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X16, TX_4X16 - { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X4, TX_16X4 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X32, TX_8X32 - { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X8, TX_32X8 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL, - 0x0001000100010001ULL } }, // block size 16X64, TX_16X64 - { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X16, TX_64X16 -}; - -const FilterMask above_mask_univariant_reordered[67] = { - // TX_4X4 - { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X4, TX_4X4 - { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X8, TX_4X4 - { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X4, TX_4X4 - { { 0x0000000000030003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X8, TX_4X4 - { { 0x0003000300030003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X16, TX_4X4 - { { 0x00000000000f000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X8, TX_4X4 - { { 0x000f000f000f000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X16, TX_4X4 - { { 0x000f000f000f000fULL, 0x000f000f000f000fULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X32, TX_4X4 - { { 0x00ff00ff00ff00ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X16, TX_4X4 - { { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X32, TX_4X4 - { { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, - 0x00ff00ff00ff00ffULL } }, // block size 32X64, TX_4X4 - { { 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X32, TX_4X4 - { { 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL, - 0xffffffffffffffffULL } }, // block size 64X64, TX_4x4 - { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X16, TX_4X4 - { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X4, TX_4X4 - { { 0x0003000300030003ULL, 0x0003000300030003ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X32, TX_4X4 - { { 0x0000000000ff00ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X8, TX_4X4 - { { 0x000f000f000f000fULL, 0x000f000f000f000fULL, 0x000f000f000f000fULL, - 0x000f000f000f000fULL } }, // block size 16X64, TX_4X4 - { { 0xffffffffffffffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X16, TX_4X4 - // TX_8X8 - { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X8, TX_8X8 - { { 0x0000000300000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X16, TX_8X8 - { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X8, TX_8X8 - { { 0x0000000f0000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X16, TX_8X8 - { { 0x0000000f0000000fULL, 0x0000000f0000000fULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X32, TX_8X8 - { { 0x000000ff000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X16, TX_8X8 - { { 0x000000ff000000ffULL, 0x000000ff000000ffULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X32, TX_8X8 - { { 0x000000ff000000ffULL, 0x000000ff000000ffULL, 0x000000ff000000ffULL, - 0x000000ff000000ffULL } }, // block size 32X64, TX_8X8 - { { 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X32, TX_8X8 - { { 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, - 0x0000ffff0000ffffULL } }, // block size 64X64, TX_8X8 - { { 0x0000000300000003ULL, 0x0000000300000003ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X32, TX_8X8 - { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X8, TX_8X8 - { { 0x0000000f0000000fULL, 0x0000000f0000000fULL, 0x0000000f0000000fULL, - 0x0000000f0000000fULL } }, // block size 16X64, TX_8X8 - { { 0x0000ffff0000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X16, TX_8X8 - // TX_16X16 - { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X16, TX_16X16 - { { 0x000000000000000fULL, 0x000000000000000fULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X32, TX_16X16 - { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X16, TX_16X16 - { { 0x00000000000000ffULL, 0x00000000000000ffULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X32, TX_16X16 - { { 0x00000000000000ffULL, 0x00000000000000ffULL, 0x00000000000000ffULL, - 0x00000000000000ffULL } }, // block size 32X64, TX_16X16 - { { 0x000000000000ffffULL, 0x000000000000ffffULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X32, TX_16X16 - { { 0x000000000000ffffULL, 0x000000000000ffffULL, 0x000000000000ffffULL, - 0x000000000000ffffULL } }, // block size 64X64, TX_16X16 - { { 0x000000000000000fULL, 0x000000000000000fULL, 0x000000000000000fULL, - 0x000000000000000fULL } }, // block size 16X64, TX_16X16 - { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X16, TX_16X16 - // TX_32X32 - { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X32, TX_32X32 - { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x00000000000000ffULL, - 0x0000000000000000ULL } }, // block size 32X64, TX_32X32 - { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X32, TX_32X32 - { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x000000000000ffffULL, - 0x0000000000000000ULL } }, // block size 64X64, TX_32X32 - // TX_64X64 - { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X64, TX_64X64 - // 2:1, 1:2 transform sizes. - { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X8, TX_4X8 - { { 0x0000000100000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X16, TX_4X8 - { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X4, TX_8X4 - { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X4, TX_8X4 - { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X16, TX_8X16 - { { 0x0000000000000003ULL, 0x0000000000000003ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X32, TX_8X16 - { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X8, TX_16X8 - { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X8, TX_16X8 - { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X32, TX_16X32 - { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x000000000000000fULL, - 0x0000000000000000ULL } }, // block size 16X64, TX_16X32 - { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X16, TX_32X16 - { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X16, TX_32X16 - { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X64, TX_32X64 - { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X32, TX_64X32 - // 4:1, 1:4 transform sizes. - { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X16, TX_4X16 - { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X4, TX_16X4 - { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X32, TX_8X32 - { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X8, TX_32X8 - { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X64, TX_16X64 - { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X16, TX_64X16 -}; - -#if LOOP_FILTER_BITMASK -LoopFilterMask *get_loop_filter_mask(const AV1_COMMON *const cm, int mi_row, - int mi_col) { - assert(cm->lf.lfm != NULL); - const int row = mi_row >> MIN_MIB_SIZE_LOG2; // 64x64 - const int col = mi_col >> MIN_MIB_SIZE_LOG2; - return &cm->lf.lfm[row * cm->lf.lfm_stride + col]; -} - -typedef void (*LpfFunc)(uint8_t *s, int p, const uint8_t *blimit, - const uint8_t *limit, const uint8_t *thresh); - -typedef void (*LpfDualFunc)(uint8_t *s, int p, const uint8_t *blimit0, - const uint8_t *limit0, const uint8_t *thresh0, - const uint8_t *blimit1, const uint8_t *limit1, - const uint8_t *thresh1); - -typedef void (*HbdLpfFunc)(uint16_t *s, int p, const uint8_t *blimit, - const uint8_t *limit, const uint8_t *thresh, int bd); - -typedef void (*HbdLpfDualFunc)(uint16_t *s, int p, const uint8_t *blimit0, - const uint8_t *limit0, const uint8_t *thresh0, - const uint8_t *blimit1, const uint8_t *limit1, - const uint8_t *thresh1, int bd); -#endif // LOOP_FILTER_BITMASK -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/av1_loopfilter.c
89
90
91
92
93
94
95
96
97
98
// 00000000|00000000 // 11111111|11111111 // 00000000|00000000 // 11111111|11111111 // 00000000|00000000 // 11111111|11111111 // 00000000|00000000 // // A loopfilter should be applied to every other 4x4 horizontally.
+ show +
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
const int mask_id_table_tx_4x4[BLOCK_SIZES_ALL] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, -1, -1, -1, 13, 14, 15, 16, 17, 18 }; const int mask_id_table_tx_8x8[BLOCK_SIZES_ALL] = { -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, 10, 11, 12, 13 }; const int mask_id_table_tx_16x16[BLOCK_SIZES_ALL] = { -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, -1, -1, -1, -1, -1, -1, -1, 7, 8 }; const int mask_id_table_tx_32x32[BLOCK_SIZES_ALL] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; const int mask_id_table_vert_border[BLOCK_SIZES_ALL] = { 0, 47, 49, 19, 51, 53, 33, 55, 57, 42, 59, 60, 46, -1, -1, -1, 61, 62, 63, 64, 65, 66 }; const FilterMask left_mask_univariant_reordered[67] = { // TX_4X4 { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X4, TX_4X4 { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X8, TX_4X4 { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X4, TX_4X4 { { 0x0000000000030003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X8, TX_4X4 { { 0x0003000300030003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X16, TX_4X4 { { 0x00000000000f000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X8, TX_4X4 { { 0x000f000f000f000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X16, TX_4X4 { { 0x000f000f000f000fULL, 0x000f000f000f000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X32, TX_4X4 { { 0x00ff00ff00ff00ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X16, TX_4X4 { { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X32, TX_4X4 { { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL } }, // block size 32X64, TX_4X4 { { 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X32, TX_4X4 { { 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL } }, // block size 64X64, TX_4X4 { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X16, TX_4X4 { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X4, TX_4X4 { { 0x0003000300030003ULL, 0x0003000300030003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X32, TX_4X4 { { 0x0000000000ff00ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X8, TX_4X4 { { 0x000f000f000f000fULL, 0x000f000f000f000fULL, 0x000f000f000f000fULL, 0x000f000f000f000fULL } }, // block size 16X64, TX_4X4 { { 0xffffffffffffffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X16, TX_4X4 // TX_8X8 { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X8, TX_8X8 { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X16, TX_8X8 { { 0x0000000000050005ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X8, TX_8X8 { { 0x0005000500050005ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X16, TX_8X8 { { 0x0005000500050005ULL, 0x0005000500050005ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X32, TX_8X8 { { 0x0055005500550055ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X16, TX_8X8 { { 0x0055005500550055ULL, 0x0055005500550055ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X32, TX_8X8 { { 0x0055005500550055ULL, 0x0055005500550055ULL, 0x0055005500550055ULL, 0x0055005500550055ULL } }, // block size 32X64, TX_8X8 { { 0x5555555555555555ULL, 0x5555555555555555ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X32, TX_8X8 { { 0x5555555555555555ULL, 0x5555555555555555ULL, 0x5555555555555555ULL, 0x5555555555555555ULL } }, // block size 64X64, TX_8X8 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X32, TX_8X8 { { 0x0000000000550055ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X8, TX_8X8 { { 0x0005000500050005ULL, 0x0005000500050005ULL, 0x0005000500050005ULL, 0x0005000500050005ULL } }, // block size 16X64, TX_8X8 { { 0x5555555555555555ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X16, TX_8X8 // TX_16X16 { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X16, TX_16X16 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X32, TX_16X16 { { 0x0011001100110011ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X16, TX_16X16 { { 0x0011001100110011ULL, 0x0011001100110011ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X32, TX_16X16 { { 0x0011001100110011ULL, 0x0011001100110011ULL, 0x0011001100110011ULL, 0x0011001100110011ULL } }, // block size 32X64, TX_16X16 { { 0x1111111111111111ULL, 0x1111111111111111ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X32, TX_16X16 { { 0x1111111111111111ULL, 0x1111111111111111ULL, 0x1111111111111111ULL, 0x1111111111111111ULL } }, // block size 64X64, TX_16X16 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL } }, // block size 16X64, TX_16X16 { { 0x1111111111111111ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X16, TX_16X16 // TX_32X32 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X32, TX_32X32 { { 0x0101010101010101ULL, 0x0101010101010101ULL, 0x0101010101010101ULL, 0x0101010101010101ULL } }, // block size 32X64, TX_32X32 { { 0x0101010101010101ULL, 0x0101010101010101ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X32, TX_32X32 { { 0x0101010101010101ULL, 0x0101010101010101ULL, 0x0101010101010101ULL, 0x0101010101010101ULL } }, // block size 64X64, TX_32X32 // TX_64X64 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL } }, // block size 64X64, TX_64X64 // 2:1, 1:2 transform sizes. { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X8, TX_4X8 { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X16, TX_4X8 { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X4, TX_8X4 { { 0x0000000000000005ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X4, TX_8X4 { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X16, TX_8X16 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X32, TX_8X16 { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X8, TX_16X8 { { 0x0000000000110011ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X8, TX_16X8 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X32, TX_16X32 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL } }, // block size 16X64, TX_16X32 { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X16, TX_32X16 { { 0x0101010101010101ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X16, TX_32X16 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL } }, // block size 32X64, TX_32X64 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X32, TX_64X32 // 4:1, 1:4 transform sizes. { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X16, TX_4X16 { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X4, TX_16X4 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X32, TX_8X32 { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X8, TX_32X8 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL } }, // block size 16X64, TX_16X64 { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X16, TX_64X16 }; const FilterMask above_mask_univariant_reordered[67] = { // TX_4X4 { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X4, TX_4X4 { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X8, TX_4X4 { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X4, TX_4X4 { { 0x0000000000030003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X8, TX_4X4 { { 0x0003000300030003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X16, TX_4X4 { { 0x00000000000f000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X8, TX_4X4 { { 0x000f000f000f000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X16, TX_4X4 { { 0x000f000f000f000fULL, 0x000f000f000f000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X32, TX_4X4 { { 0x00ff00ff00ff00ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X16, TX_4X4 { { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X32, TX_4X4 { { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL } }, // block size 32X64, TX_4X4 { { 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X32, TX_4X4 { { 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL } }, // block size 64X64, TX_4x4 { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X16, TX_4X4 { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X4, TX_4X4 { { 0x0003000300030003ULL, 0x0003000300030003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X32, TX_4X4 { { 0x0000000000ff00ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X8, TX_4X4 { { 0x000f000f000f000fULL, 0x000f000f000f000fULL, 0x000f000f000f000fULL, 0x000f000f000f000fULL } }, // block size 16X64, TX_4X4 { { 0xffffffffffffffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X16, TX_4X4 // TX_8X8 { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X8, TX_8X8 { { 0x0000000300000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X16, TX_8X8 { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X8, TX_8X8 { { 0x0000000f0000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X16, TX_8X8 { { 0x0000000f0000000fULL, 0x0000000f0000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X32, TX_8X8 { { 0x000000ff000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X16, TX_8X8 { { 0x000000ff000000ffULL, 0x000000ff000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X32, TX_8X8 { { 0x000000ff000000ffULL, 0x000000ff000000ffULL, 0x000000ff000000ffULL, 0x000000ff000000ffULL } }, // block size 32X64, TX_8X8 { { 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X32, TX_8X8 { { 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL } }, // block size 64X64, TX_8X8 { { 0x0000000300000003ULL, 0x0000000300000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X32, TX_8X8 { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X8, TX_8X8 { { 0x0000000f0000000fULL, 0x0000000f0000000fULL, 0x0000000f0000000fULL, 0x0000000f0000000fULL } }, // block size 16X64, TX_8X8 { { 0x0000ffff0000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X16, TX_8X8 // TX_16X16 { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X16, TX_16X16 { { 0x000000000000000fULL, 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X32, TX_16X16 { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X16, TX_16X16 { { 0x00000000000000ffULL, 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X32, TX_16X16 { { 0x00000000000000ffULL, 0x00000000000000ffULL, 0x00000000000000ffULL, 0x00000000000000ffULL } }, // block size 32X64, TX_16X16 { { 0x000000000000ffffULL, 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X32, TX_16X16 { { 0x000000000000ffffULL, 0x000000000000ffffULL, 0x000000000000ffffULL, 0x000000000000ffffULL } }, // block size 64X64, TX_16X16 { { 0x000000000000000fULL, 0x000000000000000fULL, 0x000000000000000fULL, 0x000000000000000fULL } }, // block size 16X64, TX_16X16 { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X16, TX_16X16 // TX_32X32 { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X32, TX_32X32 { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x00000000000000ffULL, 0x0000000000000000ULL } }, // block size 32X64, TX_32X32 { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X32, TX_32X32 { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x000000000000ffffULL, 0x0000000000000000ULL } }, // block size 64X64, TX_32X32 // TX_64X64 { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X64, TX_64X64 // 2:1, 1:2 transform sizes. { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X8, TX_4X8 { { 0x0000000100000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X16, TX_4X8 { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X4, TX_8X4 { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X4, TX_8X4 { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X16, TX_8X16 { { 0x0000000000000003ULL, 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X32, TX_8X16 { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X8, TX_16X8 { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X8, TX_16X8 { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X32, TX_16X32 { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x000000000000000fULL, 0x0000000000000000ULL } }, // block size 16X64, TX_16X32 { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X16, TX_32X16 { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X16, TX_32X16 { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X64, TX_32X64 { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X32, TX_64X32 // 4:1, 1:4 transform sizes. { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X16, TX_4X16 { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X4, TX_16X4 { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X32, TX_8X32 { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X8, TX_32X8 { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X64, TX_16X64 { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X16, TX_64X16 }; #if LOOP_FILTER_BITMASK LoopFilterMask *get_loop_filter_mask(const AV1_COMMON *const cm, int mi_row, int mi_col) { assert(cm->lf.lfm != NULL); const int row = mi_row >> MIN_MIB_SIZE_LOG2; // 64x64 const int col = mi_col >> MIN_MIB_SIZE_LOG2; return &cm->lf.lfm[row * cm->lf.lfm_stride + col]; } typedef void (*LpfFunc)(uint8_t *s, int p, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh); typedef void (*LpfDualFunc)(uint8_t *s, int p, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1); typedef void (*HbdLpfFunc)(uint16_t *s, int p, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int bd); typedef void (*HbdLpfDualFunc)(uint16_t *s, int p, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1, int bd); #endif // LOOP_FILTER_BITMASK
+ show +
433
434
435
436
437
438
439
440
441
442
static void update_sharpness(loop_filter_info_n *lfi, int sharpness_lvl) { int lvl; // For each possible value for the loop filter fill out limits for (lvl = 0; lvl <= MAX_LOOP_FILTER; lvl++) { // Set loop filter parameters that control sharpness. int block_inside_limit = lvl >> ((sharpness_lvl > 0) + (sharpness_lvl > 4)); if (sharpness_lvl > 0) {

[CVE-2020-0470_1.diff] av1_loopfilter.c #2
-static const int delta_lf_id_lut[MAX_MB_PLANE][2] = { - { 0, 1 }, { 2, 2 }, { 3, 3 } -}; - -enum { VERT_EDGE = 0, HORZ_EDGE = 1, NUM_EDGE_DIRS } UENUM1BYTE(EDGE_DIR); +static const int delta_lf_id_lut[MAX_MB_PLANE][2] = { { 0, 1 }, + { 2, 2 }, + { 3, 3 } };
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/av1_loopfilter.c
21
22
23
24
25
26
27
28
29
30
#include "av1/common/onyxc_int.h" #include "av1/common/reconinter.h" #include "av1/common/seg_common.h" static const SEG_LVL_FEATURES seg_lvl_lf_lut[MAX_MB_PLANE][2] = { { SEG_LVL_ALT_LF_Y_V, SEG_LVL_ALT_LF_Y_H }, { SEG_LVL_ALT_LF_U, SEG_LVL_ALT_LF_U }, { SEG_LVL_ALT_LF_V, SEG_LVL_ALT_LF_V } };
+ show +
31
32
33
34
35
static const int delta_lf_id_lut[MAX_MB_PLANE][2] = { { 0, 1 }, { 2, 2 }, { 3, 3 } }; enum { VERT_EDGE = 0, HORZ_EDGE = 1, NUM_EDGE_DIRS } UENUM1BYTE(EDGE_DIR);
+ show +
36
37
38
39
40
41
42
43
44
45
static const int mode_lf_lut[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // INTRA_MODES 1, 1, 0, 1, // INTER_MODES (GLOBALMV == 0) 1, 1, 1, 1, 1, 1, 0, 1 // INTER_COMPOUND_MODES (GLOBAL_GLOBALMV == 0) }; // 256 bit masks (64x64 / 4x4) for left transform size for Y plane. // We use 4 uint64_t to represent the 256 bit. // Each 1 represents a position where we should apply a loop filter

[CVE-2020-0470_1.diff] av1_loopfilter.c #3
-// 256 bit masks (64x64 / 4x4) for left transform size for Y plane. -// We use 4 uint64_t to represent the 256 bit. -// Each 1 represents a position where we should apply a loop filter -// across the left border of an 4x4 block boundary. -// -// In the case of TX_8x8-> ( in low order byte first we end up with -// a mask that looks like this (-- and | are used for better view) -// -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// ----------------- -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// 10101010|10101010 -// -// A loopfilter should be applied to every other 4x4 horizontally. - -// 256 bit masks (64x64 / 4x4) for above transform size for Y plane. -// We use 4 uint64_t to represent the 256 bit. -// Each 1 represents a position where we should apply a loop filter -// across the top border of an 4x4 block boundary. -// -// In the case of TX_8x8-> ( in low order byte first we end up with -// a mask that looks like this -// -// 11111111|11111111 -// 00000000|00000000 -// 11111111|11111111 -// 00000000|00000000 -// 11111111|11111111 -// 00000000|00000000 -// 11111111|11111111 -// 00000000|00000000 -// ----------------- -// 11111111|11111111 -// 00000000|00000000 -// 11111111|11111111 -// 00000000|00000000 -// 11111111|11111111 -// 00000000|00000000 -// 11111111|11111111 -// 00000000|00000000 -// -// A loopfilter should be applied to every other 4x4 horizontally. - -const int mask_id_table_tx_4x4[BLOCK_SIZES_ALL] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, -1, -1, -1, 13, 14, 15, 16, 17, 18 -}; - -const int mask_id_table_tx_8x8[BLOCK_SIZES_ALL] = { - -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, 10, 11, 12, 13 -}; - -const int mask_id_table_tx_16x16[BLOCK_SIZES_ALL] = { - -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, -1, -1, -1, -1, -1, -1, -1, 7, 8 -}; - -const int mask_id_table_tx_32x32[BLOCK_SIZES_ALL] = { -1, -1, -1, -1, -1, -1, - -1, -1, -1, 0, 1, 2, - 3, -1, -1, -1, -1, -1, - -1, -1, -1, -1 }; -const int mask_id_table_vert_border[BLOCK_SIZES_ALL] = { 0, 47, 49, 19, 51, 53, - 33, 55, 57, 42, 59, 60, - 46, -1, -1, -1, 61, 62, - 63, 64, 65, 66 }; - -const FilterMask left_mask_univariant_reordered[67] = { - // TX_4X4 - { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X4, TX_4X4 - { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X8, TX_4X4 - { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X4, TX_4X4 - { { 0x0000000000030003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X8, TX_4X4 - { { 0x0003000300030003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X16, TX_4X4 - { { 0x00000000000f000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X8, TX_4X4 - { { 0x000f000f000f000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X16, TX_4X4 - { { 0x000f000f000f000fULL, 0x000f000f000f000fULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X32, TX_4X4 - { { 0x00ff00ff00ff00ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X16, TX_4X4 - { { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X32, TX_4X4 - { { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, - 0x00ff00ff00ff00ffULL } }, // block size 32X64, TX_4X4 - { { 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X32, TX_4X4 - { { 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL, - 0xffffffffffffffffULL } }, // block size 64X64, TX_4X4 - { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X16, TX_4X4 - { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X4, TX_4X4 - { { 0x0003000300030003ULL, 0x0003000300030003ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X32, TX_4X4 - { { 0x0000000000ff00ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X8, TX_4X4 - { { 0x000f000f000f000fULL, 0x000f000f000f000fULL, 0x000f000f000f000fULL, - 0x000f000f000f000fULL } }, // block size 16X64, TX_4X4 - { { 0xffffffffffffffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X16, TX_4X4 - // TX_8X8 - { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X8, TX_8X8 - { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X16, TX_8X8 - { { 0x0000000000050005ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X8, TX_8X8 - { { 0x0005000500050005ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X16, TX_8X8 - { { 0x0005000500050005ULL, 0x0005000500050005ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X32, TX_8X8 - { { 0x0055005500550055ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X16, TX_8X8 - { { 0x0055005500550055ULL, 0x0055005500550055ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X32, TX_8X8 - { { 0x0055005500550055ULL, 0x0055005500550055ULL, 0x0055005500550055ULL, - 0x0055005500550055ULL } }, // block size 32X64, TX_8X8 - { { 0x5555555555555555ULL, 0x5555555555555555ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X32, TX_8X8 - { { 0x5555555555555555ULL, 0x5555555555555555ULL, 0x5555555555555555ULL, - 0x5555555555555555ULL } }, // block size 64X64, TX_8X8 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X32, TX_8X8 - { { 0x0000000000550055ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X8, TX_8X8 - { { 0x0005000500050005ULL, 0x0005000500050005ULL, 0x0005000500050005ULL, - 0x0005000500050005ULL } }, // block size 16X64, TX_8X8 - { { 0x5555555555555555ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X16, TX_8X8 - // TX_16X16 - { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X16, TX_16X16 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X32, TX_16X16 - { { 0x0011001100110011ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X16, TX_16X16 - { { 0x0011001100110011ULL, 0x0011001100110011ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X32, TX_16X16 - { { 0x0011001100110011ULL, 0x0011001100110011ULL, 0x0011001100110011ULL, - 0x0011001100110011ULL } }, // block size 32X64, TX_16X16 - { { 0x1111111111111111ULL, 0x1111111111111111ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X32, TX_16X16 - { { 0x1111111111111111ULL, 0x1111111111111111ULL, 0x1111111111111111ULL, - 0x1111111111111111ULL } }, // block size 64X64, TX_16X16 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL, - 0x0001000100010001ULL } }, // block size 16X64, TX_16X16 - { { 0x1111111111111111ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X16, TX_16X16 - // TX_32X32 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X32, TX_32X32 - { { 0x0101010101010101ULL, 0x0101010101010101ULL, 0x0101010101010101ULL, - 0x0101010101010101ULL } }, // block size 32X64, TX_32X32 - { { 0x0101010101010101ULL, 0x0101010101010101ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X32, TX_32X32 - { { 0x0101010101010101ULL, 0x0101010101010101ULL, 0x0101010101010101ULL, - 0x0101010101010101ULL } }, // block size 64X64, TX_32X32 - // TX_64X64 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL, - 0x0001000100010001ULL } }, // block size 64X64, TX_64X64 - // 2:1, 1:2 transform sizes. - { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X8, TX_4X8 - { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X16, TX_4X8 - { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X4, TX_8X4 - { { 0x0000000000000005ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X4, TX_8X4 - { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X16, TX_8X16 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X32, TX_8X16 - { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X8, TX_16X8 - { { 0x0000000000110011ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X8, TX_16X8 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X32, TX_16X32 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL, - 0x0001000100010001ULL } }, // block size 16X64, TX_16X32 - { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X16, TX_32X16 - { { 0x0101010101010101ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X16, TX_32X16 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL, - 0x0001000100010001ULL } }, // block size 32X64, TX_32X64 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X32, TX_64X32 - // 4:1, 1:4 transform sizes. - { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X16, TX_4X16 - { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X4, TX_16X4 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X32, TX_8X32 - { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X8, TX_32X8 - { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL, - 0x0001000100010001ULL } }, // block size 16X64, TX_16X64 - { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X16, TX_64X16 -}; - -const FilterMask above_mask_univariant_reordered[67] = { - // TX_4X4 - { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X4, TX_4X4 - { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X8, TX_4X4 - { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X4, TX_4X4 - { { 0x0000000000030003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X8, TX_4X4 - { { 0x0003000300030003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X16, TX_4X4 - { { 0x00000000000f000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X8, TX_4X4 - { { 0x000f000f000f000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X16, TX_4X4 - { { 0x000f000f000f000fULL, 0x000f000f000f000fULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X32, TX_4X4 - { { 0x00ff00ff00ff00ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X16, TX_4X4 - { { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X32, TX_4X4 - { { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, - 0x00ff00ff00ff00ffULL } }, // block size 32X64, TX_4X4 - { { 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X32, TX_4X4 - { { 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL, - 0xffffffffffffffffULL } }, // block size 64X64, TX_4x4 - { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X16, TX_4X4 - { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X4, TX_4X4 - { { 0x0003000300030003ULL, 0x0003000300030003ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X32, TX_4X4 - { { 0x0000000000ff00ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X8, TX_4X4 - { { 0x000f000f000f000fULL, 0x000f000f000f000fULL, 0x000f000f000f000fULL, - 0x000f000f000f000fULL } }, // block size 16X64, TX_4X4 - { { 0xffffffffffffffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X16, TX_4X4 - // TX_8X8 - { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X8, TX_8X8 - { { 0x0000000300000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X16, TX_8X8 - { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X8, TX_8X8 - { { 0x0000000f0000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X16, TX_8X8 - { { 0x0000000f0000000fULL, 0x0000000f0000000fULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X32, TX_8X8 - { { 0x000000ff000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X16, TX_8X8 - { { 0x000000ff000000ffULL, 0x000000ff000000ffULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X32, TX_8X8 - { { 0x000000ff000000ffULL, 0x000000ff000000ffULL, 0x000000ff000000ffULL, - 0x000000ff000000ffULL } }, // block size 32X64, TX_8X8 - { { 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X32, TX_8X8 - { { 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, - 0x0000ffff0000ffffULL } }, // block size 64X64, TX_8X8 - { { 0x0000000300000003ULL, 0x0000000300000003ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X32, TX_8X8 - { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X8, TX_8X8 - { { 0x0000000f0000000fULL, 0x0000000f0000000fULL, 0x0000000f0000000fULL, - 0x0000000f0000000fULL } }, // block size 16X64, TX_8X8 - { { 0x0000ffff0000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X16, TX_8X8 - // TX_16X16 - { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X16, TX_16X16 - { { 0x000000000000000fULL, 0x000000000000000fULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X32, TX_16X16 - { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X16, TX_16X16 - { { 0x00000000000000ffULL, 0x00000000000000ffULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X32, TX_16X16 - { { 0x00000000000000ffULL, 0x00000000000000ffULL, 0x00000000000000ffULL, - 0x00000000000000ffULL } }, // block size 32X64, TX_16X16 - { { 0x000000000000ffffULL, 0x000000000000ffffULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X32, TX_16X16 - { { 0x000000000000ffffULL, 0x000000000000ffffULL, 0x000000000000ffffULL, - 0x000000000000ffffULL } }, // block size 64X64, TX_16X16 - { { 0x000000000000000fULL, 0x000000000000000fULL, 0x000000000000000fULL, - 0x000000000000000fULL } }, // block size 16X64, TX_16X16 - { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X16, TX_16X16 - // TX_32X32 - { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X32, TX_32X32 - { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x00000000000000ffULL, - 0x0000000000000000ULL } }, // block size 32X64, TX_32X32 - { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X32, TX_32X32 - { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x000000000000ffffULL, - 0x0000000000000000ULL } }, // block size 64X64, TX_32X32 - // TX_64X64 - { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X64, TX_64X64 - // 2:1, 1:2 transform sizes. - { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X8, TX_4X8 - { { 0x0000000100000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X16, TX_4X8 - { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X4, TX_8X4 - { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X4, TX_8X4 - { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X16, TX_8X16 - { { 0x0000000000000003ULL, 0x0000000000000003ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X32, TX_8X16 - { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X8, TX_16X8 - { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X8, TX_16X8 - { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X32, TX_16X32 - { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x000000000000000fULL, - 0x0000000000000000ULL } }, // block size 16X64, TX_16X32 - { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X16, TX_32X16 - { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X16, TX_32X16 - { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X64, TX_32X64 - { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X32, TX_64X32 - // 4:1, 1:4 transform sizes. - { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 4X16, TX_4X16 - { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X4, TX_16X4 - { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 8X32, TX_8X32 - { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 32X8, TX_32X8 - { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 16X64, TX_16X64 - { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, - 0x0000000000000000ULL } }, // block size 64X16, TX_64X16 -}; - -#if LOOP_FILTER_BITMASK -LoopFilterMask *get_loop_filter_mask(const AV1_COMMON *const cm, int mi_row, - int mi_col) { - assert(cm->lf.lfm != NULL); - const int row = mi_row >> MIN_MIB_SIZE_LOG2; // 64x64 - const int col = mi_col >> MIN_MIB_SIZE_LOG2; - return &cm->lf.lfm[row * cm->lf.lfm_stride + col]; -} - -typedef void (*LpfFunc)(uint8_t *s, int p, const uint8_t *blimit, - const uint8_t *limit, const uint8_t *thresh); - -typedef void (*LpfDualFunc)(uint8_t *s, int p, const uint8_t *blimit0, - const uint8_t *limit0, const uint8_t *thresh0, - const uint8_t *blimit1, const uint8_t *limit1, - const uint8_t *thresh1); - -typedef void (*HbdLpfFunc)(uint16_t *s, int p, const uint8_t *blimit, - const uint8_t *limit, const uint8_t *thresh, int bd); - -typedef void (*HbdLpfDualFunc)(uint16_t *s, int p, const uint8_t *blimit0, - const uint8_t *limit0, const uint8_t *thresh0, - const uint8_t *blimit1, const uint8_t *limit1, - const uint8_t *thresh1, int bd); -#endif // LOOP_FILTER_BITMASK -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/av1_loopfilter.c
89
90
91
92
93
94
95
96
97
98
// 00000000|00000000 // 11111111|11111111 // 00000000|00000000 // 11111111|11111111 // 00000000|00000000 // 11111111|11111111 // 00000000|00000000 // // A loopfilter should be applied to every other 4x4 horizontally.
+ show +
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
const int mask_id_table_tx_4x4[BLOCK_SIZES_ALL] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, -1, -1, -1, 13, 14, 15, 16, 17, 18 }; const int mask_id_table_tx_8x8[BLOCK_SIZES_ALL] = { -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, 10, 11, 12, 13 }; const int mask_id_table_tx_16x16[BLOCK_SIZES_ALL] = { -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, -1, -1, -1, -1, -1, -1, -1, 7, 8 }; const int mask_id_table_tx_32x32[BLOCK_SIZES_ALL] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; const int mask_id_table_vert_border[BLOCK_SIZES_ALL] = { 0, 47, 49, 19, 51, 53, 33, 55, 57, 42, 59, 60, 46, -1, -1, -1, 61, 62, 63, 64, 65, 66 }; const FilterMask left_mask_univariant_reordered[67] = { // TX_4X4 { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X4, TX_4X4 { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X8, TX_4X4 { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X4, TX_4X4 { { 0x0000000000030003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X8, TX_4X4 { { 0x0003000300030003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X16, TX_4X4 { { 0x00000000000f000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X8, TX_4X4 { { 0x000f000f000f000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X16, TX_4X4 { { 0x000f000f000f000fULL, 0x000f000f000f000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X32, TX_4X4 { { 0x00ff00ff00ff00ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X16, TX_4X4 { { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X32, TX_4X4 { { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL } }, // block size 32X64, TX_4X4 { { 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X32, TX_4X4 { { 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL } }, // block size 64X64, TX_4X4 { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X16, TX_4X4 { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X4, TX_4X4 { { 0x0003000300030003ULL, 0x0003000300030003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X32, TX_4X4 { { 0x0000000000ff00ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X8, TX_4X4 { { 0x000f000f000f000fULL, 0x000f000f000f000fULL, 0x000f000f000f000fULL, 0x000f000f000f000fULL } }, // block size 16X64, TX_4X4 { { 0xffffffffffffffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X16, TX_4X4 // TX_8X8 { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X8, TX_8X8 { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X16, TX_8X8 { { 0x0000000000050005ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X8, TX_8X8 { { 0x0005000500050005ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X16, TX_8X8 { { 0x0005000500050005ULL, 0x0005000500050005ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X32, TX_8X8 { { 0x0055005500550055ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X16, TX_8X8 { { 0x0055005500550055ULL, 0x0055005500550055ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X32, TX_8X8 { { 0x0055005500550055ULL, 0x0055005500550055ULL, 0x0055005500550055ULL, 0x0055005500550055ULL } }, // block size 32X64, TX_8X8 { { 0x5555555555555555ULL, 0x5555555555555555ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X32, TX_8X8 { { 0x5555555555555555ULL, 0x5555555555555555ULL, 0x5555555555555555ULL, 0x5555555555555555ULL } }, // block size 64X64, TX_8X8 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X32, TX_8X8 { { 0x0000000000550055ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X8, TX_8X8 { { 0x0005000500050005ULL, 0x0005000500050005ULL, 0x0005000500050005ULL, 0x0005000500050005ULL } }, // block size 16X64, TX_8X8 { { 0x5555555555555555ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X16, TX_8X8 // TX_16X16 { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X16, TX_16X16 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X32, TX_16X16 { { 0x0011001100110011ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X16, TX_16X16 { { 0x0011001100110011ULL, 0x0011001100110011ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X32, TX_16X16 { { 0x0011001100110011ULL, 0x0011001100110011ULL, 0x0011001100110011ULL, 0x0011001100110011ULL } }, // block size 32X64, TX_16X16 { { 0x1111111111111111ULL, 0x1111111111111111ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X32, TX_16X16 { { 0x1111111111111111ULL, 0x1111111111111111ULL, 0x1111111111111111ULL, 0x1111111111111111ULL } }, // block size 64X64, TX_16X16 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL } }, // block size 16X64, TX_16X16 { { 0x1111111111111111ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X16, TX_16X16 // TX_32X32 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X32, TX_32X32 { { 0x0101010101010101ULL, 0x0101010101010101ULL, 0x0101010101010101ULL, 0x0101010101010101ULL } }, // block size 32X64, TX_32X32 { { 0x0101010101010101ULL, 0x0101010101010101ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X32, TX_32X32 { { 0x0101010101010101ULL, 0x0101010101010101ULL, 0x0101010101010101ULL, 0x0101010101010101ULL } }, // block size 64X64, TX_32X32 // TX_64X64 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL } }, // block size 64X64, TX_64X64 // 2:1, 1:2 transform sizes. { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X8, TX_4X8 { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X16, TX_4X8 { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X4, TX_8X4 { { 0x0000000000000005ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X4, TX_8X4 { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X16, TX_8X16 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X32, TX_8X16 { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X8, TX_16X8 { { 0x0000000000110011ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X8, TX_16X8 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X32, TX_16X32 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL } }, // block size 16X64, TX_16X32 { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X16, TX_32X16 { { 0x0101010101010101ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X16, TX_32X16 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL } }, // block size 32X64, TX_32X64 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X32, TX_64X32 // 4:1, 1:4 transform sizes. { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X16, TX_4X16 { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X4, TX_16X4 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X32, TX_8X32 { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X8, TX_32X8 { { 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL, 0x0001000100010001ULL } }, // block size 16X64, TX_16X64 { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X16, TX_64X16 }; const FilterMask above_mask_univariant_reordered[67] = { // TX_4X4 { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X4, TX_4X4 { { 0x0000000000010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X8, TX_4X4 { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X4, TX_4X4 { { 0x0000000000030003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X8, TX_4X4 { { 0x0003000300030003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X16, TX_4X4 { { 0x00000000000f000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X8, TX_4X4 { { 0x000f000f000f000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X16, TX_4X4 { { 0x000f000f000f000fULL, 0x000f000f000f000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X32, TX_4X4 { { 0x00ff00ff00ff00ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X16, TX_4X4 { { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X32, TX_4X4 { { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL } }, // block size 32X64, TX_4X4 { { 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X32, TX_4X4 { { 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL } }, // block size 64X64, TX_4x4 { { 0x0001000100010001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X16, TX_4X4 { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X4, TX_4X4 { { 0x0003000300030003ULL, 0x0003000300030003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X32, TX_4X4 { { 0x0000000000ff00ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X8, TX_4X4 { { 0x000f000f000f000fULL, 0x000f000f000f000fULL, 0x000f000f000f000fULL, 0x000f000f000f000fULL } }, // block size 16X64, TX_4X4 { { 0xffffffffffffffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X16, TX_4X4 // TX_8X8 { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X8, TX_8X8 { { 0x0000000300000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X16, TX_8X8 { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X8, TX_8X8 { { 0x0000000f0000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X16, TX_8X8 { { 0x0000000f0000000fULL, 0x0000000f0000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X32, TX_8X8 { { 0x000000ff000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X16, TX_8X8 { { 0x000000ff000000ffULL, 0x000000ff000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X32, TX_8X8 { { 0x000000ff000000ffULL, 0x000000ff000000ffULL, 0x000000ff000000ffULL, 0x000000ff000000ffULL } }, // block size 32X64, TX_8X8 { { 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X32, TX_8X8 { { 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL } }, // block size 64X64, TX_8X8 { { 0x0000000300000003ULL, 0x0000000300000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X32, TX_8X8 { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X8, TX_8X8 { { 0x0000000f0000000fULL, 0x0000000f0000000fULL, 0x0000000f0000000fULL, 0x0000000f0000000fULL } }, // block size 16X64, TX_8X8 { { 0x0000ffff0000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X16, TX_8X8 // TX_16X16 { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X16, TX_16X16 { { 0x000000000000000fULL, 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X32, TX_16X16 { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X16, TX_16X16 { { 0x00000000000000ffULL, 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X32, TX_16X16 { { 0x00000000000000ffULL, 0x00000000000000ffULL, 0x00000000000000ffULL, 0x00000000000000ffULL } }, // block size 32X64, TX_16X16 { { 0x000000000000ffffULL, 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X32, TX_16X16 { { 0x000000000000ffffULL, 0x000000000000ffffULL, 0x000000000000ffffULL, 0x000000000000ffffULL } }, // block size 64X64, TX_16X16 { { 0x000000000000000fULL, 0x000000000000000fULL, 0x000000000000000fULL, 0x000000000000000fULL } }, // block size 16X64, TX_16X16 { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X16, TX_16X16 // TX_32X32 { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X32, TX_32X32 { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x00000000000000ffULL, 0x0000000000000000ULL } }, // block size 32X64, TX_32X32 { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X32, TX_32X32 { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x000000000000ffffULL, 0x0000000000000000ULL } }, // block size 64X64, TX_32X32 // TX_64X64 { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X64, TX_64X64 // 2:1, 1:2 transform sizes. { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X8, TX_4X8 { { 0x0000000100000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X16, TX_4X8 { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X4, TX_8X4 { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X4, TX_8X4 { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X16, TX_8X16 { { 0x0000000000000003ULL, 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X32, TX_8X16 { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X8, TX_16X8 { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X8, TX_16X8 { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X32, TX_16X32 { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x000000000000000fULL, 0x0000000000000000ULL } }, // block size 16X64, TX_16X32 { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X16, TX_32X16 { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X16, TX_32X16 { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X64, TX_32X64 { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X32, TX_64X32 // 4:1, 1:4 transform sizes. { { 0x0000000000000001ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 4X16, TX_4X16 { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X4, TX_16X4 { { 0x0000000000000003ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 8X32, TX_8X32 { { 0x00000000000000ffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 32X8, TX_32X8 { { 0x000000000000000fULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 16X64, TX_16X64 { { 0x000000000000ffffULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL } }, // block size 64X16, TX_64X16 }; #if LOOP_FILTER_BITMASK LoopFilterMask *get_loop_filter_mask(const AV1_COMMON *const cm, int mi_row, int mi_col) { assert(cm->lf.lfm != NULL); const int row = mi_row >> MIN_MIB_SIZE_LOG2; // 64x64 const int col = mi_col >> MIN_MIB_SIZE_LOG2; return &cm->lf.lfm[row * cm->lf.lfm_stride + col]; } typedef void (*LpfFunc)(uint8_t *s, int p, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh); typedef void (*LpfDualFunc)(uint8_t *s, int p, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1); typedef void (*HbdLpfFunc)(uint16_t *s, int p, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int bd); typedef void (*HbdLpfDualFunc)(uint16_t *s, int p, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1, int bd); #endif // LOOP_FILTER_BITMASK
+ show +
433
434
435
436
437
438
439
440
441
442
static void update_sharpness(loop_filter_info_n *lfi, int sharpness_lvl) { int lvl; // For each possible value for the loop filter fill out limits for (lvl = 0; lvl <= MAX_LOOP_FILTER; lvl++) { // Set loop filter parameters that control sharpness. int block_inside_limit = lvl >> ((sharpness_lvl > 0) + (sharpness_lvl > 4)); if (sharpness_lvl > 0) {

[CVE-2020-0478_1.diff] reconinter.c #1
+#include "av1/common/av1_common_int.h" +#include "av1/common/obmc.h" -#include "av1/common/onyxc_int.h" -#include "av1/common/obmc.h" - -#define USE_PRECOMPUTED_WEDGE_MASK 1 -#define USE_PRECOMPUTED_WEDGE_SIGN 1
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/reconinter.c
17
18
19
20
21
22
23
24
25
26
#include "config/aom_dsp_rtcd.h" #include "config/aom_scale_rtcd.h" #include "aom/aom_integer.h" #include "aom_dsp/blend.h" #include "av1/common/blockd.h" #include "av1/common/mvref_common.h" #include "av1/common/reconinter.h" #include "av1/common/reconintra.h"
+ show +
27
28
29
30
31
#include "av1/common/onyxc_int.h" #include "av1/common/obmc.h" #define USE_PRECOMPUTED_WEDGE_MASK 1 #define USE_PRECOMPUTED_WEDGE_SIGN 1
+ show +
32
33
34
35
36
37
38
39
40
41
// This function will determine whether or not to create a warped // prediction. int av1_allow_warp(const MB_MODE_INFO *const mbmi, const WarpTypesAllowed *const warp_types, const WarpedMotionParams *const gm_params, int build_for_obmc, const struct scale_factors *const sf, WarpedMotionParams *final_warp_params) { // Note: As per the spec, we must test the fixed point scales here, which are // at a higher precision (1 << 14) than the xs and ys in subpel_params (that

[CVE-2020-0478_1.diff] reconinter.c #5
-#else -DECLARE_ALIGNED(16, static uint8_t, - wedge_signflip_lookup[BLOCK_SIZES_ALL][MAX_WEDGE_TYPES]); -#endif // USE_PRECOMPUTED_WEDGE_SIGN
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/reconinter.c
151
152
153
154
155
156
157
158
159
160
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // not used { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // not used { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // not used { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // not used { 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, }, { 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // not used { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // not used }; /* clang-format on */
+ show +
161
162
163
164
#else DECLARE_ALIGNED(16, static uint8_t, wedge_signflip_lookup[BLOCK_SIZES_ALL][MAX_WEDGE_TYPES]); #endif // USE_PRECOMPUTED_WEDGE_SIGN
+ show +
165
166
167
168
169
170
171
172
173
174
// [negative][direction] DECLARE_ALIGNED( 16, static uint8_t, wedge_mask_obl[2][WEDGE_DIRECTIONS][MASK_MASTER_SIZE * MASK_MASTER_SIZE]); // 4 * MAX_WEDGE_SQUARE is an easy to compute and fairly tight upper bound // on the sum of all mask sizes up to an including MAX_WEDGE_SQUARE. DECLARE_ALIGNED(16, static uint8_t, wedge_mask_buf[2 * MAX_WEDGE_TYPES * 4 * MAX_WEDGE_SQUARE]);

[CVE-2020-0478_1.diff] reconinter.c #10
-static void diffwtd_mask_d16(uint8_t *mask, int which_inverse, int mask_base, - const CONV_BUF_TYPE *src0, int src0_stride, - const CONV_BUF_TYPE *src1, int src1_stride, int h, - int w, ConvolveParams *conv_params, int bd) { +static AOM_INLINE void diffwtd_mask_d16( + uint8_t *mask, int which_inverse, int mask_base, const CONV_BUF_TYPE *src0, + int src0_stride, const CONV_BUF_TYPE *src1, int src1_stride, int h, int w, + ConvolveParams *conv_params, int bd) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/reconinter.c
268
269
270
271
272
273
274
275
276
277
(void)sb_type; switch (comp_data->type) { case COMPOUND_WEDGE: return av1_get_contiguous_soft_mask(comp_data->wedge_index, comp_data->wedge_sign, sb_type); case COMPOUND_DIFFWTD: return comp_data->seg_mask; default: assert(0); return NULL; } }
+ show +
278
279
280
281
static void diffwtd_mask_d16(uint8_t *mask, int which_inverse, int mask_base, const CONV_BUF_TYPE *src0, int src0_stride, const CONV_BUF_TYPE *src1, int src1_stride, int h, int w, ConvolveParams *conv_params, int bd) {
+ show +
282
283
284
285
286
287
288
289
290
291
int round = 2 * FILTER_BITS - conv_params->round_0 - conv_params->round_1 + (bd - 8); int i, j, m, diff; for (i = 0; i < h; ++i) { for (j = 0; j < w; ++j) { diff = abs(src0[i * src0_stride + j] - src1[i * src1_stride + j]); diff = ROUND_POWER_OF_TWO(diff, round); m = clamp(mask_base + (diff / DIFF_FACTOR), 0, AOM_BLEND_A64_MAX_ALPHA); mask[i * w + j] = which_inverse ? AOM_BLEND_A64_MAX_ALPHA - m : m; }

[CVE-2020-0478_1.diff] reconinter.c #13
-#else - static const double smoother_param = 2.85; - const int a[2] = { 2, 1 }; - const double asqrt = sqrt(a[0] * a[0] + a[1] * a[1]); - for (i = 0; i < h; i++) { - for (j = 0; j < w; ++j) { - int x = (2 * j + 1 - w); - int y = (2 * i + 1 - h); - double d = (a[0] * x + a[1] * y) / asqrt; - const int msk = (int)rint((1.0 + tanh(d / smoother_param)) * 32); - wedge_mask_obl[0][WEDGE_OBLIQUE63][i * stride + j] = msk; - const int mskx = (int)rint((1.0 + tanh(x / smoother_param)) * 32); - wedge_mask_obl[0][WEDGE_VERTICAL][i * stride + j] = mskx; - } - } -#endif // USE_PRECOMPUTED_WEDGE_MASK +
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/reconinter.c
436
437
438
439
440
441
442
443
444
445
shift_copy(wedge_master_oblique_odd, &wedge_mask_obl[0][WEDGE_OBLIQUE63][(i + 1) * stride], shift, MASK_MASTER_SIZE); memcpy(&wedge_mask_obl[0][WEDGE_VERTICAL][i * stride], wedge_master_vertical, MASK_MASTER_SIZE * sizeof(wedge_master_vertical[0])); memcpy(&wedge_mask_obl[0][WEDGE_VERTICAL][(i + 1) * stride], wedge_master_vertical, MASK_MASTER_SIZE * sizeof(wedge_master_vertical[0])); }
+ show +
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
#else static const double smoother_param = 2.85; const int a[2] = { 2, 1 }; const double asqrt = sqrt(a[0] * a[0] + a[1] * a[1]); for (i = 0; i < h; i++) { for (j = 0; j < w; ++j) { int x = (2 * j + 1 - w); int y = (2 * i + 1 - h); double d = (a[0] * x + a[1] * y) / asqrt; const int msk = (int)rint((1.0 + tanh(d / smoother_param)) * 32); wedge_mask_obl[0][WEDGE_OBLIQUE63][i * stride + j] = msk; const int mskx = (int)rint((1.0 + tanh(x / smoother_param)) * 32); wedge_mask_obl[0][WEDGE_VERTICAL][i * stride + j] = mskx; } } #endif // USE_PRECOMPUTED_WEDGE_MASK
+ show +
462
463
464
465
466
467
468
469
470
471
for (i = 0; i < h; ++i) { for (j = 0; j < w; ++j) { const int msk = wedge_mask_obl[0][WEDGE_OBLIQUE63][i * stride + j]; wedge_mask_obl[0][WEDGE_OBLIQUE27][j * stride + i] = msk; wedge_mask_obl[0][WEDGE_OBLIQUE117][i * stride + w - 1 - j] = wedge_mask_obl[0][WEDGE_OBLIQUE153][(w - 1 - j) * stride + i] = (1 << WEDGE_WEIGHT_BITS) - msk; wedge_mask_obl[1][WEDGE_OBLIQUE63][i * stride + j] = wedge_mask_obl[1][WEDGE_OBLIQUE27][j * stride + i] = (1 << WEDGE_WEIGHT_BITS) - msk;

[CVE-2020-0470_1.diff] reconinter.c #1
+#include "av1/common/av1_common_int.h" +#include "av1/common/obmc.h" -#include "av1/common/onyxc_int.h" -#include "av1/common/obmc.h" - -#define USE_PRECOMPUTED_WEDGE_MASK 1 -#define USE_PRECOMPUTED_WEDGE_SIGN 1
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/reconinter.c
17
18
19
20
21
22
23
24
25
26
#include "config/aom_dsp_rtcd.h" #include "config/aom_scale_rtcd.h" #include "aom/aom_integer.h" #include "aom_dsp/blend.h" #include "av1/common/blockd.h" #include "av1/common/mvref_common.h" #include "av1/common/reconinter.h" #include "av1/common/reconintra.h"
+ show +
27
28
29
30
31
#include "av1/common/onyxc_int.h" #include "av1/common/obmc.h" #define USE_PRECOMPUTED_WEDGE_MASK 1 #define USE_PRECOMPUTED_WEDGE_SIGN 1
+ show +
32
33
34
35
36
37
38
39
40
41
// This function will determine whether or not to create a warped // prediction. int av1_allow_warp(const MB_MODE_INFO *const mbmi, const WarpTypesAllowed *const warp_types, const WarpedMotionParams *const gm_params, int build_for_obmc, const struct scale_factors *const sf, WarpedMotionParams *final_warp_params) { // Note: As per the spec, we must test the fixed point scales here, which are // at a higher precision (1 << 14) than the xs and ys in subpel_params (that

[CVE-2020-0470_1.diff] reconinter.c #5
-#else -DECLARE_ALIGNED(16, static uint8_t, - wedge_signflip_lookup[BLOCK_SIZES_ALL][MAX_WEDGE_TYPES]); -#endif // USE_PRECOMPUTED_WEDGE_SIGN
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/reconinter.c
151
152
153
154
155
156
157
158
159
160
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // not used { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // not used { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // not used { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // not used { 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, }, { 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // not used { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // not used }; /* clang-format on */
+ show +
161
162
163
164
#else DECLARE_ALIGNED(16, static uint8_t, wedge_signflip_lookup[BLOCK_SIZES_ALL][MAX_WEDGE_TYPES]); #endif // USE_PRECOMPUTED_WEDGE_SIGN
+ show +
165
166
167
168
169
170
171
172
173
174
// [negative][direction] DECLARE_ALIGNED( 16, static uint8_t, wedge_mask_obl[2][WEDGE_DIRECTIONS][MASK_MASTER_SIZE * MASK_MASTER_SIZE]); // 4 * MAX_WEDGE_SQUARE is an easy to compute and fairly tight upper bound // on the sum of all mask sizes up to an including MAX_WEDGE_SQUARE. DECLARE_ALIGNED(16, static uint8_t, wedge_mask_buf[2 * MAX_WEDGE_TYPES * 4 * MAX_WEDGE_SQUARE]);

[CVE-2020-0470_1.diff] reconinter.c #10
-static void diffwtd_mask_d16(uint8_t *mask, int which_inverse, int mask_base, - const CONV_BUF_TYPE *src0, int src0_stride, - const CONV_BUF_TYPE *src1, int src1_stride, int h, - int w, ConvolveParams *conv_params, int bd) { +static AOM_INLINE void diffwtd_mask_d16( + uint8_t *mask, int which_inverse, int mask_base, const CONV_BUF_TYPE *src0, + int src0_stride, const CONV_BUF_TYPE *src1, int src1_stride, int h, int w, + ConvolveParams *conv_params, int bd) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/reconinter.c
268
269
270
271
272
273
274
275
276
277
(void)sb_type; switch (comp_data->type) { case COMPOUND_WEDGE: return av1_get_contiguous_soft_mask(comp_data->wedge_index, comp_data->wedge_sign, sb_type); case COMPOUND_DIFFWTD: return comp_data->seg_mask; default: assert(0); return NULL; } }
+ show +
278
279
280
281
static void diffwtd_mask_d16(uint8_t *mask, int which_inverse, int mask_base, const CONV_BUF_TYPE *src0, int src0_stride, const CONV_BUF_TYPE *src1, int src1_stride, int h, int w, ConvolveParams *conv_params, int bd) {
+ show +
282
283
284
285
286
287
288
289
290
291
int round = 2 * FILTER_BITS - conv_params->round_0 - conv_params->round_1 + (bd - 8); int i, j, m, diff; for (i = 0; i < h; ++i) { for (j = 0; j < w; ++j) { diff = abs(src0[i * src0_stride + j] - src1[i * src1_stride + j]); diff = ROUND_POWER_OF_TWO(diff, round); m = clamp(mask_base + (diff / DIFF_FACTOR), 0, AOM_BLEND_A64_MAX_ALPHA); mask[i * w + j] = which_inverse ? AOM_BLEND_A64_MAX_ALPHA - m : m; }

[CVE-2020-0470_1.diff] reconinter.c #13
-#else - static const double smoother_param = 2.85; - const int a[2] = { 2, 1 }; - const double asqrt = sqrt(a[0] * a[0] + a[1] * a[1]); - for (i = 0; i < h; i++) { - for (j = 0; j < w; ++j) { - int x = (2 * j + 1 - w); - int y = (2 * i + 1 - h); - double d = (a[0] * x + a[1] * y) / asqrt; - const int msk = (int)rint((1.0 + tanh(d / smoother_param)) * 32); - wedge_mask_obl[0][WEDGE_OBLIQUE63][i * stride + j] = msk; - const int mskx = (int)rint((1.0 + tanh(x / smoother_param)) * 32); - wedge_mask_obl[0][WEDGE_VERTICAL][i * stride + j] = mskx; - } - } -#endif // USE_PRECOMPUTED_WEDGE_MASK +
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/reconinter.c
436
437
438
439
440
441
442
443
444
445
shift_copy(wedge_master_oblique_odd, &wedge_mask_obl[0][WEDGE_OBLIQUE63][(i + 1) * stride], shift, MASK_MASTER_SIZE); memcpy(&wedge_mask_obl[0][WEDGE_VERTICAL][i * stride], wedge_master_vertical, MASK_MASTER_SIZE * sizeof(wedge_master_vertical[0])); memcpy(&wedge_mask_obl[0][WEDGE_VERTICAL][(i + 1) * stride], wedge_master_vertical, MASK_MASTER_SIZE * sizeof(wedge_master_vertical[0])); }
+ show +
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
#else static const double smoother_param = 2.85; const int a[2] = { 2, 1 }; const double asqrt = sqrt(a[0] * a[0] + a[1] * a[1]); for (i = 0; i < h; i++) { for (j = 0; j < w; ++j) { int x = (2 * j + 1 - w); int y = (2 * i + 1 - h); double d = (a[0] * x + a[1] * y) / asqrt; const int msk = (int)rint((1.0 + tanh(d / smoother_param)) * 32); wedge_mask_obl[0][WEDGE_OBLIQUE63][i * stride + j] = msk; const int mskx = (int)rint((1.0 + tanh(x / smoother_param)) * 32); wedge_mask_obl[0][WEDGE_VERTICAL][i * stride + j] = mskx; } } #endif // USE_PRECOMPUTED_WEDGE_MASK
+ show +
462
463
464
465
466
467
468
469
470
471
for (i = 0; i < h; ++i) { for (j = 0; j < w; ++j) { const int msk = wedge_mask_obl[0][WEDGE_OBLIQUE63][i * stride + j]; wedge_mask_obl[0][WEDGE_OBLIQUE27][j * stride + i] = msk; wedge_mask_obl[0][WEDGE_OBLIQUE117][i * stride + w - 1 - j] = wedge_mask_obl[0][WEDGE_OBLIQUE153][(w - 1 - j) * stride + i] = (1 << WEDGE_WEIGHT_BITS) - msk; wedge_mask_obl[1][WEDGE_OBLIQUE63][i * stride + j] = wedge_mask_obl[1][WEDGE_OBLIQUE27][j * stride + i] = (1 << WEDGE_WEIGHT_BITS) - msk;

[CVE-2020-0478_1.diff] av1_inv_txfm2d.c #1
- case TXFM_TYPE_DCT4: return av1_idct4_new; - case TXFM_TYPE_DCT8: return av1_idct8_new; - case TXFM_TYPE_DCT16: return av1_idct16_new; - case TXFM_TYPE_DCT32: return av1_idct32_new; - case TXFM_TYPE_DCT64: return av1_idct64_new; - case TXFM_TYPE_ADST4: return av1_iadst4_new; - case TXFM_TYPE_ADST8: return av1_iadst8_new; - case TXFM_TYPE_ADST16: return av1_iadst16_new; + case TXFM_TYPE_DCT4: return av1_idct4; + case TXFM_TYPE_DCT8: return av1_idct8; + case TXFM_TYPE_DCT16: return av1_idct16; + case TXFM_TYPE_DCT32: return av1_idct32; + case TXFM_TYPE_DCT64: return av1_idct64; + case TXFM_TYPE_ADST4: return av1_iadst4; + case TXFM_TYPE_ADST8: return av1_iadst8; + case TXFM_TYPE_ADST16: return av1_iadst16;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/av1_inv_txfm2d.c
106
107
108
109
110
111
112
113
114
115
highbd_clip_pixel_add(dest[dest_stride * 2], e1, bd); dest[dest_stride * 3] = highbd_clip_pixel_add(dest[dest_stride * 3], e1, bd); ip++; dest++; } } static INLINE TxfmFunc inv_txfm_type_to_func(TXFM_TYPE txfm_type) { switch (txfm_type) {
+ show +
116
117
118
119
120
121
122
123
case TXFM_TYPE_DCT4: return av1_idct4_new; case TXFM_TYPE_DCT8: return av1_idct8_new; case TXFM_TYPE_DCT16: return av1_idct16_new; case TXFM_TYPE_DCT32: return av1_idct32_new; case TXFM_TYPE_DCT64: return av1_idct64_new; case TXFM_TYPE_ADST4: return av1_iadst4_new; case TXFM_TYPE_ADST8: return av1_iadst8_new; case TXFM_TYPE_ADST16: return av1_iadst16_new;
+ show +
124
125
126
127
128
129
130
131
132
133
case TXFM_TYPE_IDENTITY4: return av1_iidentity4_c; case TXFM_TYPE_IDENTITY8: return av1_iidentity8_c; case TXFM_TYPE_IDENTITY16: return av1_iidentity16_c; case TXFM_TYPE_IDENTITY32: return av1_iidentity32_c; default: assert(0); return NULL; } } static const int8_t inv_shift_4x4[2] = { 0, -4 }; static const int8_t inv_shift_8x8[2] = { -1, -4 };

[CVE-2020-0470_1.diff] av1_inv_txfm2d.c #1
- case TXFM_TYPE_DCT4: return av1_idct4_new; - case TXFM_TYPE_DCT8: return av1_idct8_new; - case TXFM_TYPE_DCT16: return av1_idct16_new; - case TXFM_TYPE_DCT32: return av1_idct32_new; - case TXFM_TYPE_DCT64: return av1_idct64_new; - case TXFM_TYPE_ADST4: return av1_iadst4_new; - case TXFM_TYPE_ADST8: return av1_iadst8_new; - case TXFM_TYPE_ADST16: return av1_iadst16_new; + case TXFM_TYPE_DCT4: return av1_idct4; + case TXFM_TYPE_DCT8: return av1_idct8; + case TXFM_TYPE_DCT16: return av1_idct16; + case TXFM_TYPE_DCT32: return av1_idct32; + case TXFM_TYPE_DCT64: return av1_idct64; + case TXFM_TYPE_ADST4: return av1_iadst4; + case TXFM_TYPE_ADST8: return av1_iadst8; + case TXFM_TYPE_ADST16: return av1_iadst16;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/av1_inv_txfm2d.c
106
107
108
109
110
111
112
113
114
115
highbd_clip_pixel_add(dest[dest_stride * 2], e1, bd); dest[dest_stride * 3] = highbd_clip_pixel_add(dest[dest_stride * 3], e1, bd); ip++; dest++; } } static INLINE TxfmFunc inv_txfm_type_to_func(TXFM_TYPE txfm_type) { switch (txfm_type) {
+ show +
116
117
118
119
120
121
122
123
case TXFM_TYPE_DCT4: return av1_idct4_new; case TXFM_TYPE_DCT8: return av1_idct8_new; case TXFM_TYPE_DCT16: return av1_idct16_new; case TXFM_TYPE_DCT32: return av1_idct32_new; case TXFM_TYPE_DCT64: return av1_idct64_new; case TXFM_TYPE_ADST4: return av1_iadst4_new; case TXFM_TYPE_ADST8: return av1_iadst8_new; case TXFM_TYPE_ADST16: return av1_iadst16_new;
+ show +
124
125
126
127
128
129
130
131
132
133
case TXFM_TYPE_IDENTITY4: return av1_iidentity4_c; case TXFM_TYPE_IDENTITY8: return av1_iidentity8_c; case TXFM_TYPE_IDENTITY16: return av1_iidentity16_c; case TXFM_TYPE_IDENTITY32: return av1_iidentity32_c; default: assert(0); return NULL; } } static const int8_t inv_shift_4x4[2] = { 0, -4 }; static const int8_t inv_shift_8x8[2] = { -1, -4 };

[CVE-2020-0478_1.diff] cdef_block.c #4
- int iy, ix; - for (iy = 0; iy < 1 << bsizey; iy++) - for (ix = 0; ix < 1 << bsizex; ix++) - dst16[(bi << (bsizex + bsizey)) + (iy << bsizex) + ix] = - in[((by << bsizey) + iy) * CDEF_BSTRIDE + (bx << bsizex) + ix]; + for (int iy = 0; iy < 1 << bh_log2; iy++) { + memcpy(&dst16[(bi << (bw_log2 + bh_log2)) + (iy << bw_log2)], + &in[((by << bh_log2) + iy) * CDEF_BSTRIDE + (bx << bw_log2)], + ((size_t)1 << bw_log2) * sizeof(*dst16)); + }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/cdef_block.c
193
194
195
196
197
198
199
200
201
202
bsizex = 3 - xdec; bsizey = 3 - ydec; if (dirinit && pri_strength == 0 && sec_strength == 0) { // If we're here, both primary and secondary strengths are 0, and // we still haven't written anything to y[] yet, so we just copy // the input to y[]. This is necessary only for av1_cdef_search() // and only av1_cdef_search() sets dirinit. for (bi = 0; bi < cdef_count; bi++) { by = dlist[bi].by; bx = dlist[bi].bx;
+ show +
203
204
205
206
207
208
int iy, ix; // TODO(stemidts/jmvalin): SIMD optimisations for (iy = 0; iy < 1 << bsizey; iy++) for (ix = 0; ix < 1 << bsizex; ix++) dst16[(bi << (bsizex + bsizey)) + (iy << bsizex) + ix] = in[((by << bsizey) + iy) * CDEF_BSTRIDE + (bx << bsizex) + ix];
+ show +
209
210
211
212
213
214
215
216
217
218
} return; } if (pli == 0) { if (!dirinit || !*dirinit) { for (bi = 0; bi < cdef_count; bi++) { by = dlist[bi].by; bx = dlist[bi].bx; dir[by][bx] = cdef_find_dir(&in[8 * by * CDEF_BSTRIDE + 8 * bx],

[CVE-2020-0470_1.diff] cdef_block.c #4
- int iy, ix; - for (iy = 0; iy < 1 << bsizey; iy++) - for (ix = 0; ix < 1 << bsizex; ix++) - dst16[(bi << (bsizex + bsizey)) + (iy << bsizex) + ix] = - in[((by << bsizey) + iy) * CDEF_BSTRIDE + (bx << bsizex) + ix]; + for (int iy = 0; iy < 1 << bh_log2; iy++) { + memcpy(&dst16[(bi << (bw_log2 + bh_log2)) + (iy << bw_log2)], + &in[((by << bh_log2) + iy) * CDEF_BSTRIDE + (bx << bw_log2)], + ((size_t)1 << bw_log2) * sizeof(*dst16)); + }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/cdef_block.c
193
194
195
196
197
198
199
200
201
202
bsizex = 3 - xdec; bsizey = 3 - ydec; if (dirinit && pri_strength == 0 && sec_strength == 0) { // If we're here, both primary and secondary strengths are 0, and // we still haven't written anything to y[] yet, so we just copy // the input to y[]. This is necessary only for av1_cdef_search() // and only av1_cdef_search() sets dirinit. for (bi = 0; bi < cdef_count; bi++) { by = dlist[bi].by; bx = dlist[bi].bx;
+ show +
203
204
205
206
207
208
int iy, ix; // TODO(stemidts/jmvalin): SIMD optimisations for (iy = 0; iy < 1 << bsizey; iy++) for (ix = 0; ix < 1 << bsizex; ix++) dst16[(bi << (bsizex + bsizey)) + (iy << bsizex) + ix] = in[((by << bsizey) + iy) * CDEF_BSTRIDE + (bx << bsizex) + ix];
+ show +
209
210
211
212
213
214
215
216
217
218
} return; } if (pli == 0) { if (!dirinit || !*dirinit) { for (bi = 0; bi < cdef_count; bi++) { by = dlist[bi].by; bx = dlist[bi].bx; dir[by][bx] = cdef_find_dir(&in[8 * by * CDEF_BSTRIDE + 8 * bx],

[CVE-2020-0478_1.diff] filter.h #3
+#define USABLE_REF_MV_STACK_SIZE 4 +// Picture prediction structures (0-12 are predefined) in scalability metadata. +enum { + SCALABILITY_L1T2 = 0, + SCALABILITY_L1T3 = 1, + SCALABILITY_L2T1 = 2, + SCALABILITY_L2T2 = 3, + SCALABILITY_L2T3 = 4, + SCALABILITY_S2T1 = 5, + SCALABILITY_S2T2 = 6, + SCALABILITY_S2T3 = 7, + SCALABILITY_L2T1h = 8, + SCALABILITY_L2T2h = 9, + SCALABILITY_L2T3h = 10, + SCALABILITY_S2T1h = 11, + SCALABILITY_S2T2h = 12, + SCALABILITY_S2T3h = 13, + SCALABILITY_SS = 14 +} UENUM1BYTE(SCALABILITY_STRUCTURES); + +#include "av1/common/enums.h" + INTERP_INVALID = 0xff, +enum { + INTERP_EVAL_LUMA_EVAL_CHROMA = 0, + INTERP_SKIP_LUMA_EVAL_CHROMA, + INTERP_EVAL_INVALID, + INTERP_SKIP_LUMA_SKIP_CHROMA, +} UENUM1BYTE(INTERP_EVAL_PLANE); + +enum { + INTERP_HORZ_NEQ_VERT_NEQ = 0, + INTERP_HORZ_EQ_VERT_NEQ, + INTERP_HORZ_NEQ_VERT_EQ, + INTERP_HORZ_EQ_VERT_EQ, + INTERP_PRED_TYPE_ALL, +} UENUM1BYTE(INTERP_PRED_TYPE); -typedef uint32_t InterpFilters; -static INLINE InterpFilter av1_extract_interp_filter(InterpFilters filters, - int x_filter) { - return (InterpFilter)((filters >> (x_filter ? 16 : 0)) & 0xf); +typedef struct InterpFilters { + uint16_t y_filter; + uint16_t x_filter; +} InterpFilters; + +typedef union int_interpfilters { + uint32_t as_int; + InterpFilters as_filters; +} int_interpfilters; + +static INLINE InterpFilter av1_extract_interp_filter(int_interpfilters filters, + int dir) { + return (InterpFilter)((dir) ? filters.as_filters.x_filter + : filters.as_filters.y_filter); -static INLINE InterpFilters av1_make_interp_filters(InterpFilter y_filter, - InterpFilter x_filter) { - uint16_t y16 = y_filter & 0xf; - uint16_t x16 = x_filter & 0xf; - return y16 | ((uint32_t)x16 << 16); -} - -static INLINE InterpFilters av1_broadcast_interp_filter(InterpFilter filter) { - return av1_make_interp_filters(filter, filter); +static INLINE int_interpfilters +av1_broadcast_interp_filter(InterpFilter filter) { + int_interpfilters filters; + filters.as_filters.x_filter = filter; + filters.as_filters.y_filter = filter; + return filters;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/filter.h
40
41
42
43
44
45
46
47
48
49
enum { USE_2_TAPS_ORIG = 0, // This is used in temporal filtering. USE_2_TAPS, USE_4_TAPS, USE_8_TAPS, } UENUM1BYTE(SUBPEL_SEARCH_TYPE); // Pack two InterpFilter's into a uint32_t: since there are at most 10 filters, // we can use 16 bits for each and have more than enough space. This reduces // argument passing and unifies the operation of setting a (pair of) filters.
+ show +
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
typedef uint32_t InterpFilters; static INLINE InterpFilter av1_extract_interp_filter(InterpFilters filters, int x_filter) { return (InterpFilter)((filters >> (x_filter ? 16 : 0)) & 0xf); } static INLINE InterpFilters av1_make_interp_filters(InterpFilter y_filter, InterpFilter x_filter) { uint16_t y16 = y_filter & 0xf; uint16_t x16 = x_filter & 0xf; return y16 | ((uint32_t)x16 << 16); } static INLINE InterpFilters av1_broadcast_interp_filter(InterpFilter filter) { return av1_make_interp_filters(filter, filter);
+ show +
65
66
67
68
69
70
71
72
73
74
} static INLINE InterpFilter av1_unswitchable_filter(InterpFilter filter) { return filter == SWITCHABLE ? EIGHTTAP_REGULAR : filter; } /* (1 << LOG_SWITCHABLE_FILTERS) > SWITCHABLE_FILTERS */ #define LOG_SWITCHABLE_FILTERS 2 #define MAX_SUBPEL_TAPS 12

[CVE-2020-0470_1.diff] filter.h #3
+#define USABLE_REF_MV_STACK_SIZE 4 +// Picture prediction structures (0-12 are predefined) in scalability metadata. +enum { + SCALABILITY_L1T2 = 0, + SCALABILITY_L1T3 = 1, + SCALABILITY_L2T1 = 2, + SCALABILITY_L2T2 = 3, + SCALABILITY_L2T3 = 4, + SCALABILITY_S2T1 = 5, + SCALABILITY_S2T2 = 6, + SCALABILITY_S2T3 = 7, + SCALABILITY_L2T1h = 8, + SCALABILITY_L2T2h = 9, + SCALABILITY_L2T3h = 10, + SCALABILITY_S2T1h = 11, + SCALABILITY_S2T2h = 12, + SCALABILITY_S2T3h = 13, + SCALABILITY_SS = 14 +} UENUM1BYTE(SCALABILITY_STRUCTURES); + +#include "av1/common/enums.h" + INTERP_INVALID = 0xff, +enum { + INTERP_EVAL_LUMA_EVAL_CHROMA = 0, + INTERP_SKIP_LUMA_EVAL_CHROMA, + INTERP_EVAL_INVALID, + INTERP_SKIP_LUMA_SKIP_CHROMA, +} UENUM1BYTE(INTERP_EVAL_PLANE); + +enum { + INTERP_HORZ_NEQ_VERT_NEQ = 0, + INTERP_HORZ_EQ_VERT_NEQ, + INTERP_HORZ_NEQ_VERT_EQ, + INTERP_HORZ_EQ_VERT_EQ, + INTERP_PRED_TYPE_ALL, +} UENUM1BYTE(INTERP_PRED_TYPE); -typedef uint32_t InterpFilters; -static INLINE InterpFilter av1_extract_interp_filter(InterpFilters filters, - int x_filter) { - return (InterpFilter)((filters >> (x_filter ? 16 : 0)) & 0xf); +typedef struct InterpFilters { + uint16_t y_filter; + uint16_t x_filter; +} InterpFilters; + +typedef union int_interpfilters { + uint32_t as_int; + InterpFilters as_filters; +} int_interpfilters; + +static INLINE InterpFilter av1_extract_interp_filter(int_interpfilters filters, + int dir) { + return (InterpFilter)((dir) ? filters.as_filters.x_filter + : filters.as_filters.y_filter); -static INLINE InterpFilters av1_make_interp_filters(InterpFilter y_filter, - InterpFilter x_filter) { - uint16_t y16 = y_filter & 0xf; - uint16_t x16 = x_filter & 0xf; - return y16 | ((uint32_t)x16 << 16); -} - -static INLINE InterpFilters av1_broadcast_interp_filter(InterpFilter filter) { - return av1_make_interp_filters(filter, filter); +static INLINE int_interpfilters +av1_broadcast_interp_filter(InterpFilter filter) { + int_interpfilters filters; + filters.as_filters.x_filter = filter; + filters.as_filters.y_filter = filter; + return filters;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/filter.h
40
41
42
43
44
45
46
47
48
49
enum { USE_2_TAPS_ORIG = 0, // This is used in temporal filtering. USE_2_TAPS, USE_4_TAPS, USE_8_TAPS, } UENUM1BYTE(SUBPEL_SEARCH_TYPE); // Pack two InterpFilter's into a uint32_t: since there are at most 10 filters, // we can use 16 bits for each and have more than enough space. This reduces // argument passing and unifies the operation of setting a (pair of) filters.
+ show +
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
typedef uint32_t InterpFilters; static INLINE InterpFilter av1_extract_interp_filter(InterpFilters filters, int x_filter) { return (InterpFilter)((filters >> (x_filter ? 16 : 0)) & 0xf); } static INLINE InterpFilters av1_make_interp_filters(InterpFilter y_filter, InterpFilter x_filter) { uint16_t y16 = y_filter & 0xf; uint16_t x16 = x_filter & 0xf; return y16 | ((uint32_t)x16 << 16); } static INLINE InterpFilters av1_broadcast_interp_filter(InterpFilter filter) { return av1_make_interp_filters(filter, filter);
+ show +
65
66
67
68
69
70
71
72
73
74
} static INLINE InterpFilter av1_unswitchable_filter(InterpFilter filter) { return filter == SWITCHABLE ? EIGHTTAP_REGULAR : filter; } /* (1 << LOG_SWITCHABLE_FILTERS) > SWITCHABLE_FILTERS */ #define LOG_SWITCHABLE_FILTERS 2 #define MAX_SUBPEL_TAPS 12

[CVE-2020-0478_1.diff] convolve.c #34
- const uint16_t *src, int src_stride, uint16_t *dst16, int dst16_stride, - int w, int h, const InterpFilterParams *filter_params_x, - const InterpFilterParams *filter_params_y, const int subpel_x_q4, - const int subpel_y_q4, ConvolveParams *conv_params, int bd) { + const uint16_t *src, int src_stride, uint16_t *dst, int dst_stride, int w, + int h, const InterpFilterParams *filter_params_x, + const InterpFilterParams *filter_params_y, const int subpel_x_qn, + const int subpel_y_qn, ConvolveParams *conv_params, int bd) { - CONV_BUF_TYPE *dst = conv_params->dst; - int dst_stride = conv_params->dst_stride; + CONV_BUF_TYPE *dst16 = conv_params->dst; + int dst16_stride = conv_params->dst_stride;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/convolve.c
808
809
810
811
812
813
814
815
816
817
dst16[y * dst16_stride + x] = clip_pixel_highbd(ROUND_POWER_OF_TWO(tmp, round_bits), bd); } else { dst[y * dst_stride + x] = res; } } } } void av1_highbd_dist_wtd_convolve_x_c(
+ show +
818
819
820
821
822
823
const uint16_t *src, int src_stride, uint16_t *dst16, int dst16_stride, int w, int h, const InterpFilterParams *filter_params_x, const InterpFilterParams *filter_params_y, const int subpel_x_q4, const int subpel_y_q4, ConvolveParams *conv_params, int bd) { CONV_BUF_TYPE *dst = conv_params->dst; int dst_stride = conv_params->dst_stride;
+ show +
824
825
826
827
828
829
830
831
832
833
const int fo_horiz = filter_params_x->taps / 2 - 1; const int bits = FILTER_BITS - conv_params->round_1; const int offset_bits = bd + 2 * FILTER_BITS - conv_params->round_0; const int round_offset = (1 << (offset_bits - conv_params->round_1)) + (1 << (offset_bits - conv_params->round_1 - 1)); const int round_bits = 2 * FILTER_BITS - conv_params->round_0 - conv_params->round_1; assert(round_bits >= 0); (void)filter_params_y; (void)subpel_y_q4;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/convolve.c
857
858
859
860
861
862
863
864
865
866
dst16[y * dst16_stride + x] = clip_pixel_highbd(ROUND_POWER_OF_TWO(tmp, round_bits), bd); } else { dst[y * dst_stride + x] = res; } } } } void av1_highbd_dist_wtd_convolve_y_c(
+ show +
867
868
869
870
871
872
const uint16_t *src, int src_stride, uint16_t *dst16, int dst16_stride, int w, int h, const InterpFilterParams *filter_params_x, const InterpFilterParams *filter_params_y, const int subpel_x_q4, const int subpel_y_q4, ConvolveParams *conv_params, int bd) { CONV_BUF_TYPE *dst = conv_params->dst; int dst_stride = conv_params->dst_stride;
+ show +
873
874
875
876
877
878
879
880
881
882
const int fo_vert = filter_params_y->taps / 2 - 1; const int bits = FILTER_BITS - conv_params->round_0; const int offset_bits = bd + 2 * FILTER_BITS - conv_params->round_0; const int round_offset = (1 << (offset_bits - conv_params->round_1)) + (1 << (offset_bits - conv_params->round_1 - 1)); const int round_bits = 2 * FILTER_BITS - conv_params->round_0 - conv_params->round_1; assert(round_bits >= 0); (void)filter_params_x; (void)subpel_x_q4;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/convolve.c
906
907
908
909
910
911
912
913
914
915
dst16[y * dst16_stride + x] = clip_pixel_highbd(ROUND_POWER_OF_TWO(tmp, round_bits), bd); } else { dst[y * dst_stride + x] = res; } } } } void av1_highbd_dist_wtd_convolve_2d_copy_c(
+ show +
916
917
918
919
920
921
const uint16_t *src, int src_stride, uint16_t *dst16, int dst16_stride, int w, int h, const InterpFilterParams *filter_params_x, const InterpFilterParams *filter_params_y, const int subpel_x_q4, const int subpel_y_q4, ConvolveParams *conv_params, int bd) { CONV_BUF_TYPE *dst = conv_params->dst; int dst_stride = conv_params->dst_stride;
+ show +
922
923
924
925
926
927
928
929
930
931
const int bits = FILTER_BITS * 2 - conv_params->round_1 - conv_params->round_0; const int offset_bits = bd + 2 * FILTER_BITS - conv_params->round_0; const int round_offset = (1 << (offset_bits - conv_params->round_1)) + (1 << (offset_bits - conv_params->round_1 - 1)); assert(bits >= 0); (void)filter_params_x; (void)filter_params_y; (void)subpel_x_q4; (void)subpel_y_q4;

[CVE-2020-0470_1.diff] convolve.c #34
- const uint16_t *src, int src_stride, uint16_t *dst16, int dst16_stride, - int w, int h, const InterpFilterParams *filter_params_x, - const InterpFilterParams *filter_params_y, const int subpel_x_q4, - const int subpel_y_q4, ConvolveParams *conv_params, int bd) { + const uint16_t *src, int src_stride, uint16_t *dst, int dst_stride, int w, + int h, const InterpFilterParams *filter_params_x, + const InterpFilterParams *filter_params_y, const int subpel_x_qn, + const int subpel_y_qn, ConvolveParams *conv_params, int bd) { - CONV_BUF_TYPE *dst = conv_params->dst; - int dst_stride = conv_params->dst_stride; + CONV_BUF_TYPE *dst16 = conv_params->dst; + int dst16_stride = conv_params->dst_stride;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/convolve.c
808
809
810
811
812
813
814
815
816
817
dst16[y * dst16_stride + x] = clip_pixel_highbd(ROUND_POWER_OF_TWO(tmp, round_bits), bd); } else { dst[y * dst_stride + x] = res; } } } } void av1_highbd_dist_wtd_convolve_x_c(
+ show +
818
819
820
821
822
823
const uint16_t *src, int src_stride, uint16_t *dst16, int dst16_stride, int w, int h, const InterpFilterParams *filter_params_x, const InterpFilterParams *filter_params_y, const int subpel_x_q4, const int subpel_y_q4, ConvolveParams *conv_params, int bd) { CONV_BUF_TYPE *dst = conv_params->dst; int dst_stride = conv_params->dst_stride;
+ show +
824
825
826
827
828
829
830
831
832
833
const int fo_horiz = filter_params_x->taps / 2 - 1; const int bits = FILTER_BITS - conv_params->round_1; const int offset_bits = bd + 2 * FILTER_BITS - conv_params->round_0; const int round_offset = (1 << (offset_bits - conv_params->round_1)) + (1 << (offset_bits - conv_params->round_1 - 1)); const int round_bits = 2 * FILTER_BITS - conv_params->round_0 - conv_params->round_1; assert(round_bits >= 0); (void)filter_params_y; (void)subpel_y_q4;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/convolve.c
857
858
859
860
861
862
863
864
865
866
dst16[y * dst16_stride + x] = clip_pixel_highbd(ROUND_POWER_OF_TWO(tmp, round_bits), bd); } else { dst[y * dst_stride + x] = res; } } } } void av1_highbd_dist_wtd_convolve_y_c(
+ show +
867
868
869
870
871
872
const uint16_t *src, int src_stride, uint16_t *dst16, int dst16_stride, int w, int h, const InterpFilterParams *filter_params_x, const InterpFilterParams *filter_params_y, const int subpel_x_q4, const int subpel_y_q4, ConvolveParams *conv_params, int bd) { CONV_BUF_TYPE *dst = conv_params->dst; int dst_stride = conv_params->dst_stride;
+ show +
873
874
875
876
877
878
879
880
881
882
const int fo_vert = filter_params_y->taps / 2 - 1; const int bits = FILTER_BITS - conv_params->round_0; const int offset_bits = bd + 2 * FILTER_BITS - conv_params->round_0; const int round_offset = (1 << (offset_bits - conv_params->round_1)) + (1 << (offset_bits - conv_params->round_1 - 1)); const int round_bits = 2 * FILTER_BITS - conv_params->round_0 - conv_params->round_1; assert(round_bits >= 0); (void)filter_params_x; (void)subpel_x_q4;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/convolve.c
906
907
908
909
910
911
912
913
914
915
dst16[y * dst16_stride + x] = clip_pixel_highbd(ROUND_POWER_OF_TWO(tmp, round_bits), bd); } else { dst[y * dst_stride + x] = res; } } } } void av1_highbd_dist_wtd_convolve_2d_copy_c(
+ show +
916
917
918
919
920
921
const uint16_t *src, int src_stride, uint16_t *dst16, int dst16_stride, int w, int h, const InterpFilterParams *filter_params_x, const InterpFilterParams *filter_params_y, const int subpel_x_q4, const int subpel_y_q4, ConvolveParams *conv_params, int bd) { CONV_BUF_TYPE *dst = conv_params->dst; int dst_stride = conv_params->dst_stride;
+ show +
922
923
924
925
926
927
928
929
930
931
const int bits = FILTER_BITS * 2 - conv_params->round_1 - conv_params->round_0; const int offset_bits = bd + 2 * FILTER_BITS - conv_params->round_0; const int round_offset = (1 << (offset_bits - conv_params->round_1)) + (1 << (offset_bits - conv_params->round_1 - 1)); assert(bits >= 0); (void)filter_params_x; (void)filter_params_y; (void)subpel_x_q4; (void)subpel_y_q4;

[CVE-2020-0478_1.diff] av1_inv_txfm_neon.c #1
- { av1_idct4_new, av1_iadst4_new, av1_iidentity4_c }, - { av1_idct8_new, av1_iadst8_new, av1_iidentity8_c }, - { av1_idct16_new, av1_iadst16_new, av1_iidentity16_c }, - { av1_idct32_new, NULL, NULL }, - { av1_idct64_new, NULL, NULL }, + { av1_idct4, av1_iadst4, av1_iidentity4_c }, + { av1_idct8, av1_iadst8, av1_iidentity8_c }, + { av1_idct16, av1_iadst16, av1_iidentity16_c }, + { av1_idct32, NULL, NULL }, + { av1_idct64, NULL, NULL },
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
41
42
43
44
45
46
47
48
49
50
static const ITX_TYPE_1D hitx_1d_tab[TX_TYPES] = { IDCT_1D, IDCT_1D, IADST_1D, IADST_1D, IDCT_1D, IFLIPADST_1D, IFLIPADST_1D, IFLIPADST_1D, IADST_1D, IIDENTITY_1D, IIDENTITY_1D, IDCT_1D, IIDENTITY_1D, IADST_1D, IIDENTITY_1D, IFLIPADST_1D, }; // 1D functions static const transform_1d_neon lowbd_txfm_all_1d_arr[TX_SIZES][ITX_TYPES_1D] = {
+ show +
51
52
53
54
55
{ av1_idct4_new, av1_iadst4_new, av1_iidentity4_c }, { av1_idct8_new, av1_iadst8_new, av1_iidentity8_c }, { av1_idct16_new, av1_iadst16_new, av1_iidentity16_c }, { av1_idct32_new, NULL, NULL }, { av1_idct64_new, NULL, NULL },
+ show +
56
57
58
59
60
61
62
63
64
65
}; static INLINE void lowbd_add_flip_buffer_8xn_neon(int16x8_t *in, uint8_t *output, int stride, int flipud, const int height) { int j = flipud ? (height - 1) : 0; const int step = flipud ? -1 : 1; int16x8_t temp_output; for (int i = 0; i < height; ++i, j += step) {

[CVE-2020-0478_1.diff] av1_inv_txfm_neon.c #7
-static INLINE void identity8_new_neon(int16x8_t *input, int16x8_t *output, - int8_t cos_bit, int bit) { - (void)bit; - (void)cos_bit; +static int16_t sqrt_2_list[TX_SIZES] = { 5793, 2 * 4096, 2 * 5793, 4 * 4096, + 4 * 5793 }; - output[0] = vmulq_n_s16(input[0], (int16_t)2); - output[1] = vmulq_n_s16(input[1], (int16_t)2); - output[2] = vmulq_n_s16(input[2], (int16_t)2); - output[3] = vmulq_n_s16(input[3], (int16_t)2); - output[4] = vmulq_n_s16(input[4], (int16_t)2); - output[5] = vmulq_n_s16(input[5], (int16_t)2); - output[6] = vmulq_n_s16(input[6], (int16_t)2); - output[7] = vmulq_n_s16(input[7], (int16_t)2); +static INLINE void identity_txfm_round_neon(int16x8_t *input, int16x8_t *output, + int txw_idx, int8_t size, int bit) { + const int32x4_t dup_bits_n_32x4 = vdupq_n_s32((int32_t)(-bit)); + int16x4_t scale = vdup_n_s16(sqrt_2_list[txw_idx]); + int16x4_t low_i16, high_i16; + int32x4_t low_i32, high_i32; + for (int i = 0; i < size; i++) { + int32x4_t temp_out_low = vmull_s16(vget_low_s16(input[i]), scale); + int32x4_t temp_out_high = vmull_s16(vget_high_s16(input[i]), scale); + low_i32 = vrshlq_s32(vrshrq_n_s32(temp_out_low, 12), dup_bits_n_32x4); + high_i32 = vrshlq_s32(vrshrq_n_s32(temp_out_high, 12), dup_bits_n_32x4); + low_i16 = vqmovn_s32(low_i32); + high_i16 = vqmovn_s32(high_i32); + output[i] = vcombine_s16(low_i16, high_i16); + }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
482
483
484
485
486
487
488
489
490
491
static INLINE void load_buffer_32bit_to_16bit_neon(const int32_t *input, int16x8_t *const a, int out_size) { for (int i = 0; i < 8; ++i) { a[i] = vcombine_s16(vmovn_s32(vld1q_s32(input)), vmovn_s32(vld1q_s32(input + 4))); input += out_size; } }
+ show +
492
493
494
495
496
497
498
499
500
501
502
503
504
static INLINE void identity8_new_neon(int16x8_t *input, int16x8_t *output, int8_t cos_bit, int bit) { (void)bit; (void)cos_bit; output[0] = vmulq_n_s16(input[0], (int16_t)2); output[1] = vmulq_n_s16(input[1], (int16_t)2); output[2] = vmulq_n_s16(input[2], (int16_t)2); output[3] = vmulq_n_s16(input[3], (int16_t)2); output[4] = vmulq_n_s16(input[4], (int16_t)2); output[5] = vmulq_n_s16(input[5], (int16_t)2); output[6] = vmulq_n_s16(input[6], (int16_t)2); output[7] = vmulq_n_s16(input[7], (int16_t)2);
+ show +
505
506
507
508
509
510
511
512
513
514
} static INLINE void round_shift_for_rect(int16x8_t *input, int16x8_t *output, int size) { int32x4_t out_low, out_high; int16x4_t low, high; for (int z = 0; z < size; ++z) { out_low = vmull_n_s16(vget_low_s16(input[z]), (int16_t)NewInvSqrt2); out_high = vmull_n_s16(vget_high_s16(input[z]), (int16_t)NewInvSqrt2);

[CVE-2020-0478_1.diff] av1_inv_txfm_neon.c #8
-static INLINE void identity16_new_neon(int16x8_t *input, int16x8_t *output, - int8_t cos_bit, int bit) { - (void)bit; - (void)cos_bit; - - int32x4_t out_low, out_high; - int16x4_t low, high; - int16_t scale = (int16_t)(2 * NewSqrt2); - - for (int z = 0; z < 16; ++z) { - out_low = vmull_n_s16(vget_low_s16(input[z]), scale); - out_high = vmull_n_s16(vget_high_s16(input[z]), scale); - - low = vqrshrn_n_s32(out_low, (int32_t)NewSqrt2Bits); - high = vqrshrn_n_s32(out_high, (int32_t)NewSqrt2Bits); - - output[z] = vcombine_s16(low, high); - } -} - -static INLINE void identity32_new_neon(int16x8_t *input, int16x8_t *output, - int8_t cos_bit, int bit) { - (void)bit; - (void)cos_bit; - - for (int z = 0; z < 32; ++z) { - output[z] = vmulq_n_s16(input[z], (int16_t)4); - } -} - -static INLINE void idct16_low1_new_neon(int16x8_t *in, int16x8_t *out, - int8_t cos_bit, int bit) { +static INLINE void idct16_low1_neon(int16x8_t *in, int16x8_t *out, + int8_t cos_bit, int bit) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
513
514
515
516
517
518
519
520
521
522
out_low = vmull_n_s16(vget_low_s16(input[z]), (int16_t)NewInvSqrt2); out_high = vmull_n_s16(vget_high_s16(input[z]), (int16_t)NewInvSqrt2); low = vqrshrn_n_s32(out_low, (int32_t)NewSqrt2Bits); high = vqrshrn_n_s32(out_high, (int32_t)NewSqrt2Bits); output[z] = vcombine_s16(low, high); } }
+ show +
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
static INLINE void identity16_new_neon(int16x8_t *input, int16x8_t *output, int8_t cos_bit, int bit) { (void)bit; (void)cos_bit; int32x4_t out_low, out_high; int16x4_t low, high; int16_t scale = (int16_t)(2 * NewSqrt2); for (int z = 0; z < 16; ++z) { out_low = vmull_n_s16(vget_low_s16(input[z]), scale); out_high = vmull_n_s16(vget_high_s16(input[z]), scale); low = vqrshrn_n_s32(out_low, (int32_t)NewSqrt2Bits); high = vqrshrn_n_s32(out_high, (int32_t)NewSqrt2Bits); output[z] = vcombine_s16(low, high); } } static INLINE void identity32_new_neon(int16x8_t *input, int16x8_t *output, int8_t cos_bit, int bit) { (void)bit; (void)cos_bit; for (int z = 0; z < 32; ++z) { output[z] = vmulq_n_s16(input[z], (int16_t)4); } } static INLINE void idct16_low1_new_neon(int16x8_t *in, int16x8_t *out, int8_t cos_bit, int bit) {
+ show +
555
556
557
558
559
560
561
562
563
564
(void)bit; const int32_t *cospi = cospi_arr(cos_bit); int16x8_t step1; int32x4_t t32[2]; // stage 4 t32[0] = vmull_n_s16(vget_low_s16(in[0]), cospi[32]); t32[1] = vmull_n_s16(vget_high_s16(in[0]), cospi[32]); step1 = vcombine_s16(vrshrn_n_s32(t32[0], INV_COS_BIT),

[CVE-2020-0478_1.diff] av1_inv_txfm_neon.c #19
- btf_16_lane_0_1_neon(x[8], x[9], c4, &s8, &s9); - btf_16_lane_2_3_neon(x[10], x[11], c4, &s10, &s11); - btf_16_lane_1_0_neon(x[13], x[12], c4, &s13, &s12); - btf_16_lane_3_2_neon(x[15], x[14], c4, &s15, &s14); + btf_16_lane_0_1_neon(x[8], x[9], c0, &s8, &s9); + btf_16_lane_2_3_neon(x[10], x[11], c0, &s10, &s11); + btf_16_lane_1_0_neon(x[13], x[12], c0, &s13, &s12); + btf_16_lane_3_2_neon(x[15], x[14], c0, &s15, &s14);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
898
899
900
901
902
903
904
905
906
907
// Stage 4 t[0] = x[0]; t[1] = x[1]; t[2] = x[2]; t[3] = x[3]; t[4] = x[4]; t[5] = x[5]; t[6] = x[6]; t[7] = x[7];
+ show +
908
909
910
911
btf_16_lane_0_1_neon(x[8], x[9], c4, &s8, &s9); btf_16_lane_2_3_neon(x[10], x[11], c4, &s10, &s11); btf_16_lane_1_0_neon(x[13], x[12], c4, &s13, &s12); btf_16_lane_3_2_neon(x[15], x[14], c4, &s15, &s14);
+ show +
912
913
914
915
916
917
918
919
920
921
// Stage 5 x[0] = vqaddq_s16(t[0], t[4]); x[1] = vqaddq_s16(t[1], t[5]); x[2] = vqaddq_s16(t[2], t[6]); x[3] = vqaddq_s16(t[3], t[7]); x[4] = vqsubq_s16(t[0], t[4]); x[5] = vqsubq_s16(t[1], t[5]); x[6] = vqsubq_s16(t[2], t[6]); x[7] = vqsubq_s16(t[3], t[7]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
// Stage 4 t[0] = x[0]; t[1] = x[1]; t[2] = x[2]; t[3] = x[3]; t[4] = x[4]; t[5] = x[5]; t[6] = x[6]; t[7] = x[7];
+ show +
1147
1148
1149
1150
btf_16_lane_0_1_neon(x[8], x[9], c4, &s8, &s9); btf_16_lane_2_3_neon(x[10], x[11], c4, &s10, &s11); btf_16_lane_1_0_neon(x[13], x[12], c4, &s13, &s12); btf_16_lane_3_2_neon(x[15], x[14], c4, &s15, &s14);
+ show +
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
// Stage 5 x[0] = vqaddq_s16(t[0], t[4]); x[1] = vqaddq_s16(t[1], t[5]); x[2] = vqaddq_s16(t[2], t[6]); x[3] = vqaddq_s16(t[3], t[7]); x[4] = vqsubq_s16(t[0], t[4]); x[5] = vqsubq_s16(t[1], t[5]); x[6] = vqsubq_s16(t[2], t[6]); x[7] = vqsubq_s16(t[3], t[7]);

[CVE-2020-0478_1.diff] av1_inv_txfm_neon.c #24
- btf_16_lane_3_2_neon(vnegq_s16(step1[20]), vnegq_s16(step1[27]), c7, - &step2[20], &step2[27]); - btf_16_lane_3_2_neon(vnegq_s16(step1[21]), vnegq_s16(step1[26]), c7, - &step2[21], &step2[26]); + btf_16_lane_3_2_neon(step1[20], step1[27], c9, &step2[20], &step2[27]); + btf_16_lane_3_2_neon(step1[21], step1[26], c9, &step2[21], &step2[26]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
step1[28] = vqsubq_s16(step2[31], step2[28]); step1[29] = vqsubq_s16(step2[30], step2[29]); step1[30] = vqaddq_s16(step2[30], step2[29]); step1[31] = vqaddq_s16(step2[31], step2[28]); // stage 6 btf_16_lane_0_1_neon(step1[6], step1[5], c7, &step2[6], &step2[5]); btf_16_lane_2_3_neon(step1[29], step1[18], c7, &step2[29], &step2[18]); btf_16_lane_2_3_neon(step1[28], step1[19], c7, &step2[28], &step2[19]);
+ show +
1389
1390
1391
1392
btf_16_lane_3_2_neon(vnegq_s16(step1[20]), vnegq_s16(step1[27]), c7, &step2[20], &step2[27]); btf_16_lane_3_2_neon(vnegq_s16(step1[21]), vnegq_s16(step1[26]), c7, &step2[21], &step2[26]);
+ show +
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
step2[0] = vqaddq_s16(step1[0], step1[3]); step2[1] = vqaddq_s16(step1[1], step1[2]); step2[2] = vqsubq_s16(step1[1], step1[2]); step2[3] = vqsubq_s16(step1[0], step1[3]); step2[4] = step1[4]; step2[7] = step1[7]; step2[8] = vqaddq_s16(step1[8], step1[11]); step2[9] = vqaddq_s16(step1[9], step1[10]); step2[10] = vqsubq_s16(step1[9], step1[10]);

[CVE-2020-0478_1.diff] av1_inv_txfm_neon.c #29
- btf_16_lane_3_2_neon(vnegq_s16(step1[20]), vnegq_s16(step1[27]), c1, - &step2[20], &step2[27]); - btf_16_lane_3_2_neon(vnegq_s16(step1[21]), vnegq_s16(step1[26]), c1, - &step2[21], &step2[26]); + btf_16_lane_3_2_neon(step1[20], step1[27], c3, &step2[20], &step2[27]); + btf_16_lane_3_2_neon(step1[21], step1[26], c3, &step2[21], &step2[26]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
step1[28] = vqsubq_s16(step2[31], step2[28]); step1[29] = vqsubq_s16(step2[30], step2[29]); step1[30] = vqaddq_s16(step2[30], step2[29]); step1[31] = vqaddq_s16(step2[31], step2[28]); // stage 6 btf_16_lane_0_1_neon(step1[6], step1[5], c1, &step2[6], &step2[5]); btf_16_lane_2_3_neon(step1[29], step1[18], c1, &step2[29], &step2[18]); btf_16_lane_2_3_neon(step1[28], step1[19], c1, &step2[28], &step2[19]);
+ show +
1695
1696
1697
1698
btf_16_lane_3_2_neon(vnegq_s16(step1[20]), vnegq_s16(step1[27]), c1, &step2[20], &step2[27]); btf_16_lane_3_2_neon(vnegq_s16(step1[21]), vnegq_s16(step1[26]), c1, &step2[21], &step2[26]);
+ show +
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
step2[0] = step1[0]; step2[1] = step1[0]; step2[2] = step1[0]; step2[3] = step1[0]; step2[4] = step1[4]; step2[7] = step1[7]; step2[8] = vqaddq_s16(step1[8], step1[11]); step2[9] = vqaddq_s16(step1[9], step1[10]); step2[10] = vqsubq_s16(step1[9], step1[10]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
step1[28] = vqsubq_s16(step2[31], step2[28]); step1[29] = vqsubq_s16(step2[30], step2[29]); step1[30] = vqaddq_s16(step2[30], step2[29]); step1[31] = vqaddq_s16(step2[31], step2[28]); // stage 6 btf_16_lane_0_1_neon(step1[6], step1[5], c1, &step2[6], &step2[5]); btf_16_lane_2_3_neon(step1[29], step1[18], c1, &step2[29], &step2[18]); btf_16_lane_2_3_neon(step1[28], step1[19], c1, &step2[28], &step2[19]);
+ show +
1960
1961
1962
1963
btf_16_lane_3_2_neon(vnegq_s16(step1[20]), vnegq_s16(step1[27]), c1, &step2[20], &step2[27]); btf_16_lane_3_2_neon(vnegq_s16(step1[21]), vnegq_s16(step1[26]), c1, &step2[21], &step2[26]);
+ show +
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
step2[0] = vqaddq_s16(step1[0], step1[3]); step2[1] = vqaddq_s16(step1[0], step1[2]); step2[2] = vqsubq_s16(step1[0], step1[2]); step2[3] = vqsubq_s16(step1[0], step1[3]); step2[4] = step1[4]; step2[7] = step1[7]; step2[8] = vqaddq_s16(step1[8], step1[11]); step2[9] = vqaddq_s16(step1[9], step1[10]); step2[10] = vqsubq_s16(step1[9], step1[10]);

[CVE-2020-0478_1.diff] av1_inv_txfm_neon.c #33
- btf_16_lane_3_2_neon(vnegq_s16(step1[20]), vnegq_s16(step1[27]), c1, - &step2[20], &step2[27]); - btf_16_lane_3_2_neon(vnegq_s16(step1[21]), vnegq_s16(step1[26]), c1, - &step2[21], &step2[26]); + btf_16_lane_3_2_neon(step1[20], step1[27], c3, &step2[20], &step2[27]); + btf_16_lane_3_2_neon(step1[21], step1[26], c3, &step2[21], &step2[26]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
step1[28] = vqsubq_s16(step2[31], step2[28]); step1[29] = vqsubq_s16(step2[30], step2[29]); step1[30] = vqaddq_s16(step2[30], step2[29]); step1[31] = vqaddq_s16(step2[31], step2[28]); // stage 6 btf_16_lane_0_1_neon(step1[6], step1[5], c1, &step2[6], &step2[5]); btf_16_lane_2_3_neon(step1[29], step1[18], c1, &step2[29], &step2[18]); btf_16_lane_2_3_neon(step1[28], step1[19], c1, &step2[28], &step2[19]);
+ show +
1695
1696
1697
1698
btf_16_lane_3_2_neon(vnegq_s16(step1[20]), vnegq_s16(step1[27]), c1, &step2[20], &step2[27]); btf_16_lane_3_2_neon(vnegq_s16(step1[21]), vnegq_s16(step1[26]), c1, &step2[21], &step2[26]);
+ show +
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
step2[0] = step1[0]; step2[1] = step1[0]; step2[2] = step1[0]; step2[3] = step1[0]; step2[4] = step1[4]; step2[7] = step1[7]; step2[8] = vqaddq_s16(step1[8], step1[11]); step2[9] = vqaddq_s16(step1[9], step1[10]); step2[10] = vqsubq_s16(step1[9], step1[10]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
step1[28] = vqsubq_s16(step2[31], step2[28]); step1[29] = vqsubq_s16(step2[30], step2[29]); step1[30] = vqaddq_s16(step2[30], step2[29]); step1[31] = vqaddq_s16(step2[31], step2[28]); // stage 6 btf_16_lane_0_1_neon(step1[6], step1[5], c1, &step2[6], &step2[5]); btf_16_lane_2_3_neon(step1[29], step1[18], c1, &step2[29], &step2[18]); btf_16_lane_2_3_neon(step1[28], step1[19], c1, &step2[28], &step2[19]);
+ show +
1960
1961
1962
1963
btf_16_lane_3_2_neon(vnegq_s16(step1[20]), vnegq_s16(step1[27]), c1, &step2[20], &step2[27]); btf_16_lane_3_2_neon(vnegq_s16(step1[21]), vnegq_s16(step1[26]), c1, &step2[21], &step2[26]);
+ show +
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
step2[0] = vqaddq_s16(step1[0], step1[3]); step2[1] = vqaddq_s16(step1[0], step1[2]); step2[2] = vqsubq_s16(step1[0], step1[2]); step2[3] = vqsubq_s16(step1[0], step1[3]); step2[4] = step1[4]; step2[7] = step1[7]; step2[8] = vqaddq_s16(step1[8], step1[11]); step2[9] = vqaddq_s16(step1[9], step1[10]); step2[10] = vqsubq_s16(step1[9], step1[10]);

[CVE-2020-0478_1.diff] av1_inv_txfm_neon.c #40
- btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, - &step1[20], &step1[27]); - btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, - &step1[21], &step1[26]); + btf_16_lane_3_2_neon(step2[20], step2[27], c7, &step1[20], &step1[27]); + btf_16_lane_3_2_neon(step2[21], step2[26], c7, &step1[21], &step1[26]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
step2[56] = step1[56]; step2[57] = step1[57]; step2[62] = step1[62]; step2[63] = step1[63]; // stage 7 btf_16_lane_0_1_neon(step2[6], step2[5], c3, &step1[6], &step1[5]); btf_16_lane_2_3_neon(step2[29], step2[18], c3, &step1[29], &step1[18]); btf_16_lane_2_3_neon(step2[28], step2[19], c3, &step1[28], &step1[19]);
+ show +
2519
2520
2521
2522
btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, &step1[20], &step1[27]); btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, &step1[21], &step1[26]);
+ show +
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
step1[0] = vqaddq_s16(step2[0], step2[3]); step1[1] = vqaddq_s16(step2[1], step2[2]); step1[2] = vqsubq_s16(step2[1], step2[2]); step1[3] = vqsubq_s16(step2[0], step2[3]); step1[4] = step2[4]; step1[7] = step2[7]; step1[8] = vqaddq_s16(step2[8], step2[11]); step1[9] = vqaddq_s16(step2[9], step2[10]); step1[10] = vqsubq_s16(step2[9], step2[10]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
step2[55] = step1[55]; step2[56] = step1[56]; step2[57] = step1[57]; step2[62] = step1[62]; step2[63] = step1[63]; // stage 7 btf_16_lane_2_3_neon(step2[29], step2[18], c3, &step1[29], &step1[18]); btf_16_lane_2_3_neon(step2[28], step2[19], c3, &step1[28], &step1[19]);
+ show +
2997
2998
2999
3000
btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, &step1[20], &step1[27]); btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, &step1[21], &step1[26]);
+ show +
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
step1[0] = step2[0]; step1[1] = step2[1]; step1[2] = step2[1]; step1[3] = step2[0]; step1[8] = step2[8]; step1[9] = step2[9]; step1[10] = step2[9]; step1[11] = step2[8]; step1[12] = step2[15];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
step2[56] = step1[56]; step2[57] = step1[57]; step2[62] = step1[62]; step2[63] = step1[63]; // stage 7 btf_16_lane_0_1_neon(step2[6], step2[5], c3, &step1[6], &step1[5]); btf_16_lane_2_3_neon(step2[29], step2[18], c3, &step1[29], &step1[18]); btf_16_lane_2_3_neon(step2[28], step2[19], c3, &step1[28], &step1[19]);
+ show +
3455
3456
3457
3458
btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, &step1[20], &step1[27]); btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, &step1[21], &step1[26]);
+ show +
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
step1[0] = step2[0]; step1[1] = step2[1]; step1[2] = step2[1]; step1[3] = step2[0]; step1[4] = step2[4]; step1[7] = step2[7]; step1[8] = vqaddq_s16(step2[8], step2[11]); step1[9] = vqaddq_s16(step2[9], step2[10]); step1[10] = vqsubq_s16(step2[9], step2[10]);

[CVE-2020-0478_1.diff] av1_inv_txfm_neon.c #41
- btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, - &step2[40], &step2[55]); - btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, - &step2[41], &step2[54]); - btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, - &step2[42], &step2[53]); - btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, - &step2[43], &step2[52]); + btf_16_lane_3_2_neon(step1[40], step1[55], c7, &step2[40], &step2[55]); + btf_16_lane_3_2_neon(step1[41], step1[54], c7, &step2[41], &step2[54]); + btf_16_lane_3_2_neon(step1[42], step1[53], c7, &step2[42], &step2[53]); + btf_16_lane_3_2_neon(step1[43], step1[52], c7, &step2[43], &step2[52]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
step1[63] = vqaddq_s16(step2[56], step2[63]); // stage 8 btf_16_lane_0_1_neon(step1[13], step1[10], c3, &step2[13], &step2[10]); btf_16_lane_0_1_neon(step1[12], step1[11], c3, &step2[12], &step2[11]); btf_16_lane_2_3_neon(step1[59], step1[36], c3, &step2[59], &step2[36]); btf_16_lane_2_3_neon(step1[58], step1[37], c3, &step2[58], &step2[37]); btf_16_lane_2_3_neon(step1[57], step1[38], c3, &step2[57], &step2[38]); btf_16_lane_2_3_neon(step1[56], step1[39], c3, &step2[56], &step2[39]);
+ show +
2587
2588
2589
2590
2591
2592
2593
2594
btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, &step2[40], &step2[55]); btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, &step2[41], &step2[54]); btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, &step2[42], &step2[53]); btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, &step2[43], &step2[52]);
+ show +
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
step2[0] = vqaddq_s16(step1[0], step1[7]); step2[1] = vqaddq_s16(step1[1], step1[6]); step2[2] = vqaddq_s16(step1[2], step1[5]); step2[3] = vqaddq_s16(step1[3], step1[4]); step2[4] = vqsubq_s16(step1[3], step1[4]); step2[5] = vqsubq_s16(step1[2], step1[5]); step2[6] = vqsubq_s16(step1[1], step1[6]); step2[7] = vqsubq_s16(step1[0], step1[7]); step2[8] = step1[8];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
step1[63] = vqaddq_s16(step2[56], step2[63]); // stage 8 btf_16_lane_0_1_neon(step1[13], step1[10], c3, &step2[13], &step2[10]); btf_16_lane_0_1_neon(step1[12], step1[11], c3, &step2[12], &step2[11]); btf_16_lane_2_3_neon(step1[59], step1[36], c3, &step2[59], &step2[36]); btf_16_lane_2_3_neon(step1[58], step1[37], c3, &step2[58], &step2[37]); btf_16_lane_2_3_neon(step1[57], step1[38], c3, &step2[57], &step2[38]); btf_16_lane_2_3_neon(step1[56], step1[39], c3, &step2[56], &step2[39]);
+ show +
3063
3064
3065
3066
3067
3068
3069
3070
btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, &step2[40], &step2[55]); btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, &step2[41], &step2[54]); btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, &step2[42], &step2[53]); btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, &step2[43], &step2[52]);
+ show +
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
step2[0] = step1[0]; step2[1] = step1[1]; step2[2] = step1[2]; step2[3] = step1[3]; step2[4] = step1[3]; step2[5] = step1[2]; step2[6] = step1[1]; step2[7] = step1[0]; step2[8] = step1[8];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
step1[63] = vqaddq_s16(step2[56], step2[63]); // stage 8 btf_16_lane_0_1_neon(step1[13], step1[10], c3, &step2[13], &step2[10]); btf_16_lane_0_1_neon(step1[12], step1[11], c3, &step2[12], &step2[11]); btf_16_lane_2_3_neon(step1[59], step1[36], c3, &step2[59], &step2[36]); btf_16_lane_2_3_neon(step1[58], step1[37], c3, &step2[58], &step2[37]); btf_16_lane_2_3_neon(step1[57], step1[38], c3, &step2[57], &step2[38]); btf_16_lane_2_3_neon(step1[56], step1[39], c3, &step2[56], &step2[39]);
+ show +
3523
3524
3525
3526
3527
3528
3529
3530
btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, &step2[40], &step2[55]); btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, &step2[41], &step2[54]); btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, &step2[42], &step2[53]); btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, &step2[43], &step2[52]);
+ show +
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
step2[0] = vqaddq_s16(step1[0], step1[7]); step2[1] = vqaddq_s16(step1[1], step1[6]); step2[2] = vqaddq_s16(step1[2], step1[5]); step2[3] = vqaddq_s16(step1[3], step1[4]); step2[4] = vqsubq_s16(step1[3], step1[4]); step2[5] = vqsubq_s16(step1[2], step1[5]); step2[6] = vqsubq_s16(step1[1], step1[6]); step2[7] = vqsubq_s16(step1[0], step1[7]); step2[8] = step1[8];

[CVE-2020-0478_1.diff] av1_inv_txfm_neon.c #47
- btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, - &step1[20], &step1[27]); - btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, - &step1[21], &step1[26]); + btf_16_lane_3_2_neon(step2[20], step2[27], c6, &step1[20], &step1[27]); + btf_16_lane_3_2_neon(step2[21], step2[26], c6, &step1[21], &step1[26]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
step2[56] = step1[56]; step2[57] = step1[57]; step2[62] = step1[62]; step2[63] = step1[63]; // stage 7 btf_16_lane_0_1_neon(step2[6], step2[5], c3, &step1[6], &step1[5]); btf_16_lane_2_3_neon(step2[29], step2[18], c3, &step1[29], &step1[18]); btf_16_lane_2_3_neon(step2[28], step2[19], c3, &step1[28], &step1[19]);
+ show +
2519
2520
2521
2522
btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, &step1[20], &step1[27]); btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, &step1[21], &step1[26]);
+ show +
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
step1[0] = vqaddq_s16(step2[0], step2[3]); step1[1] = vqaddq_s16(step2[1], step2[2]); step1[2] = vqsubq_s16(step2[1], step2[2]); step1[3] = vqsubq_s16(step2[0], step2[3]); step1[4] = step2[4]; step1[7] = step2[7]; step1[8] = vqaddq_s16(step2[8], step2[11]); step1[9] = vqaddq_s16(step2[9], step2[10]); step1[10] = vqsubq_s16(step2[9], step2[10]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
step2[55] = step1[55]; step2[56] = step1[56]; step2[57] = step1[57]; step2[62] = step1[62]; step2[63] = step1[63]; // stage 7 btf_16_lane_2_3_neon(step2[29], step2[18], c3, &step1[29], &step1[18]); btf_16_lane_2_3_neon(step2[28], step2[19], c3, &step1[28], &step1[19]);
+ show +
2997
2998
2999
3000
btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, &step1[20], &step1[27]); btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, &step1[21], &step1[26]);
+ show +
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
step1[0] = step2[0]; step1[1] = step2[1]; step1[2] = step2[1]; step1[3] = step2[0]; step1[8] = step2[8]; step1[9] = step2[9]; step1[10] = step2[9]; step1[11] = step2[8]; step1[12] = step2[15];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
step2[56] = step1[56]; step2[57] = step1[57]; step2[62] = step1[62]; step2[63] = step1[63]; // stage 7 btf_16_lane_0_1_neon(step2[6], step2[5], c3, &step1[6], &step1[5]); btf_16_lane_2_3_neon(step2[29], step2[18], c3, &step1[29], &step1[18]); btf_16_lane_2_3_neon(step2[28], step2[19], c3, &step1[28], &step1[19]);
+ show +
3455
3456
3457
3458
btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, &step1[20], &step1[27]); btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, &step1[21], &step1[26]);
+ show +
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
step1[0] = step2[0]; step1[1] = step2[1]; step1[2] = step2[1]; step1[3] = step2[0]; step1[4] = step2[4]; step1[7] = step2[7]; step1[8] = vqaddq_s16(step2[8], step2[11]); step1[9] = vqaddq_s16(step2[9], step2[10]); step1[10] = vqsubq_s16(step2[9], step2[10]);

[CVE-2020-0478_1.diff] av1_inv_txfm_neon.c #48
- btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, - &step2[40], &step2[55]); - btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, - &step2[41], &step2[54]); - btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, - &step2[42], &step2[53]); - btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, - &step2[43], &step2[52]); + btf_16_lane_3_2_neon(step1[40], step1[55], c6, &step2[40], &step2[55]); + btf_16_lane_3_2_neon(step1[41], step1[54], c6, &step2[41], &step2[54]); + btf_16_lane_3_2_neon(step1[42], step1[53], c6, &step2[42], &step2[53]); + btf_16_lane_3_2_neon(step1[43], step1[52], c6, &step2[43], &step2[52]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
step1[63] = vqaddq_s16(step2[56], step2[63]); // stage 8 btf_16_lane_0_1_neon(step1[13], step1[10], c3, &step2[13], &step2[10]); btf_16_lane_0_1_neon(step1[12], step1[11], c3, &step2[12], &step2[11]); btf_16_lane_2_3_neon(step1[59], step1[36], c3, &step2[59], &step2[36]); btf_16_lane_2_3_neon(step1[58], step1[37], c3, &step2[58], &step2[37]); btf_16_lane_2_3_neon(step1[57], step1[38], c3, &step2[57], &step2[38]); btf_16_lane_2_3_neon(step1[56], step1[39], c3, &step2[56], &step2[39]);
+ show +
2587
2588
2589
2590
2591
2592
2593
2594
btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, &step2[40], &step2[55]); btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, &step2[41], &step2[54]); btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, &step2[42], &step2[53]); btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, &step2[43], &step2[52]);
+ show +
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
step2[0] = vqaddq_s16(step1[0], step1[7]); step2[1] = vqaddq_s16(step1[1], step1[6]); step2[2] = vqaddq_s16(step1[2], step1[5]); step2[3] = vqaddq_s16(step1[3], step1[4]); step2[4] = vqsubq_s16(step1[3], step1[4]); step2[5] = vqsubq_s16(step1[2], step1[5]); step2[6] = vqsubq_s16(step1[1], step1[6]); step2[7] = vqsubq_s16(step1[0], step1[7]); step2[8] = step1[8];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
step1[63] = vqaddq_s16(step2[56], step2[63]); // stage 8 btf_16_lane_0_1_neon(step1[13], step1[10], c3, &step2[13], &step2[10]); btf_16_lane_0_1_neon(step1[12], step1[11], c3, &step2[12], &step2[11]); btf_16_lane_2_3_neon(step1[59], step1[36], c3, &step2[59], &step2[36]); btf_16_lane_2_3_neon(step1[58], step1[37], c3, &step2[58], &step2[37]); btf_16_lane_2_3_neon(step1[57], step1[38], c3, &step2[57], &step2[38]); btf_16_lane_2_3_neon(step1[56], step1[39], c3, &step2[56], &step2[39]);
+ show +
3063
3064
3065
3066
3067
3068
3069
3070
btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, &step2[40], &step2[55]); btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, &step2[41], &step2[54]); btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, &step2[42], &step2[53]); btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, &step2[43], &step2[52]);
+ show +
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
step2[0] = step1[0]; step2[1] = step1[1]; step2[2] = step1[2]; step2[3] = step1[3]; step2[4] = step1[3]; step2[5] = step1[2]; step2[6] = step1[1]; step2[7] = step1[0]; step2[8] = step1[8];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
step1[63] = vqaddq_s16(step2[56], step2[63]); // stage 8 btf_16_lane_0_1_neon(step1[13], step1[10], c3, &step2[13], &step2[10]); btf_16_lane_0_1_neon(step1[12], step1[11], c3, &step2[12], &step2[11]); btf_16_lane_2_3_neon(step1[59], step1[36], c3, &step2[59], &step2[36]); btf_16_lane_2_3_neon(step1[58], step1[37], c3, &step2[58], &step2[37]); btf_16_lane_2_3_neon(step1[57], step1[38], c3, &step2[57], &step2[38]); btf_16_lane_2_3_neon(step1[56], step1[39], c3, &step2[56], &step2[39]);
+ show +
3523
3524
3525
3526
3527
3528
3529
3530
btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, &step2[40], &step2[55]); btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, &step2[41], &step2[54]); btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, &step2[42], &step2[53]); btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, &step2[43], &step2[52]);
+ show +
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
step2[0] = vqaddq_s16(step1[0], step1[7]); step2[1] = vqaddq_s16(step1[1], step1[6]); step2[2] = vqaddq_s16(step1[2], step1[5]); step2[3] = vqaddq_s16(step1[3], step1[4]); step2[4] = vqsubq_s16(step1[3], step1[4]); step2[5] = vqsubq_s16(step1[2], step1[5]); step2[6] = vqsubq_s16(step1[1], step1[6]); step2[7] = vqsubq_s16(step1[0], step1[7]); step2[8] = step1[8];

[CVE-2020-0478_1.diff] av1_inv_txfm_neon.c #53
- btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, - &step1[20], &step1[27]); - btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, - &step1[21], &step1[26]); + btf_16_lane_3_2_neon(step2[20], step2[27], c7, &step1[20], &step1[27]); + btf_16_lane_3_2_neon(step2[21], step2[26], c7, &step1[21], &step1[26]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
step2[56] = step1[56]; step2[57] = step1[57]; step2[62] = step1[62]; step2[63] = step1[63]; // stage 7 btf_16_lane_0_1_neon(step2[6], step2[5], c3, &step1[6], &step1[5]); btf_16_lane_2_3_neon(step2[29], step2[18], c3, &step1[29], &step1[18]); btf_16_lane_2_3_neon(step2[28], step2[19], c3, &step1[28], &step1[19]);
+ show +
2519
2520
2521
2522
btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, &step1[20], &step1[27]); btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, &step1[21], &step1[26]);
+ show +
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
step1[0] = vqaddq_s16(step2[0], step2[3]); step1[1] = vqaddq_s16(step2[1], step2[2]); step1[2] = vqsubq_s16(step2[1], step2[2]); step1[3] = vqsubq_s16(step2[0], step2[3]); step1[4] = step2[4]; step1[7] = step2[7]; step1[8] = vqaddq_s16(step2[8], step2[11]); step1[9] = vqaddq_s16(step2[9], step2[10]); step1[10] = vqsubq_s16(step2[9], step2[10]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
step2[55] = step1[55]; step2[56] = step1[56]; step2[57] = step1[57]; step2[62] = step1[62]; step2[63] = step1[63]; // stage 7 btf_16_lane_2_3_neon(step2[29], step2[18], c3, &step1[29], &step1[18]); btf_16_lane_2_3_neon(step2[28], step2[19], c3, &step1[28], &step1[19]);
+ show +
2997
2998
2999
3000
btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, &step1[20], &step1[27]); btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, &step1[21], &step1[26]);
+ show +
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
step1[0] = step2[0]; step1[1] = step2[1]; step1[2] = step2[1]; step1[3] = step2[0]; step1[8] = step2[8]; step1[9] = step2[9]; step1[10] = step2[9]; step1[11] = step2[8]; step1[12] = step2[15];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
step2[56] = step1[56]; step2[57] = step1[57]; step2[62] = step1[62]; step2[63] = step1[63]; // stage 7 btf_16_lane_0_1_neon(step2[6], step2[5], c3, &step1[6], &step1[5]); btf_16_lane_2_3_neon(step2[29], step2[18], c3, &step1[29], &step1[18]); btf_16_lane_2_3_neon(step2[28], step2[19], c3, &step1[28], &step1[19]);
+ show +
3455
3456
3457
3458
btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, &step1[20], &step1[27]); btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, &step1[21], &step1[26]);
+ show +
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
step1[0] = step2[0]; step1[1] = step2[1]; step1[2] = step2[1]; step1[3] = step2[0]; step1[4] = step2[4]; step1[7] = step2[7]; step1[8] = vqaddq_s16(step2[8], step2[11]); step1[9] = vqaddq_s16(step2[9], step2[10]); step1[10] = vqsubq_s16(step2[9], step2[10]);

[CVE-2020-0478_1.diff] av1_inv_txfm_neon.c #54
- btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, - &step2[40], &step2[55]); - btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, - &step2[41], &step2[54]); - btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, - &step2[42], &step2[53]); - btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, - &step2[43], &step2[52]); + btf_16_lane_3_2_neon(step1[40], step1[55], c7, &step2[40], &step2[55]); + btf_16_lane_3_2_neon(step1[41], step1[54], c7, &step2[41], &step2[54]); + btf_16_lane_3_2_neon(step1[42], step1[53], c7, &step2[42], &step2[53]); + btf_16_lane_3_2_neon(step1[43], step1[52], c7, &step2[43], &step2[52]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
step1[63] = vqaddq_s16(step2[56], step2[63]); // stage 8 btf_16_lane_0_1_neon(step1[13], step1[10], c3, &step2[13], &step2[10]); btf_16_lane_0_1_neon(step1[12], step1[11], c3, &step2[12], &step2[11]); btf_16_lane_2_3_neon(step1[59], step1[36], c3, &step2[59], &step2[36]); btf_16_lane_2_3_neon(step1[58], step1[37], c3, &step2[58], &step2[37]); btf_16_lane_2_3_neon(step1[57], step1[38], c3, &step2[57], &step2[38]); btf_16_lane_2_3_neon(step1[56], step1[39], c3, &step2[56], &step2[39]);
+ show +
2587
2588
2589
2590
2591
2592
2593
2594
btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, &step2[40], &step2[55]); btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, &step2[41], &step2[54]); btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, &step2[42], &step2[53]); btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, &step2[43], &step2[52]);
+ show +
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
step2[0] = vqaddq_s16(step1[0], step1[7]); step2[1] = vqaddq_s16(step1[1], step1[6]); step2[2] = vqaddq_s16(step1[2], step1[5]); step2[3] = vqaddq_s16(step1[3], step1[4]); step2[4] = vqsubq_s16(step1[3], step1[4]); step2[5] = vqsubq_s16(step1[2], step1[5]); step2[6] = vqsubq_s16(step1[1], step1[6]); step2[7] = vqsubq_s16(step1[0], step1[7]); step2[8] = step1[8];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
step1[63] = vqaddq_s16(step2[56], step2[63]); // stage 8 btf_16_lane_0_1_neon(step1[13], step1[10], c3, &step2[13], &step2[10]); btf_16_lane_0_1_neon(step1[12], step1[11], c3, &step2[12], &step2[11]); btf_16_lane_2_3_neon(step1[59], step1[36], c3, &step2[59], &step2[36]); btf_16_lane_2_3_neon(step1[58], step1[37], c3, &step2[58], &step2[37]); btf_16_lane_2_3_neon(step1[57], step1[38], c3, &step2[57], &step2[38]); btf_16_lane_2_3_neon(step1[56], step1[39], c3, &step2[56], &step2[39]);
+ show +
3063
3064
3065
3066
3067
3068
3069
3070
btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, &step2[40], &step2[55]); btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, &step2[41], &step2[54]); btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, &step2[42], &step2[53]); btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, &step2[43], &step2[52]);
+ show +
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
step2[0] = step1[0]; step2[1] = step1[1]; step2[2] = step1[2]; step2[3] = step1[3]; step2[4] = step1[3]; step2[5] = step1[2]; step2[6] = step1[1]; step2[7] = step1[0]; step2[8] = step1[8];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
step1[63] = vqaddq_s16(step2[56], step2[63]); // stage 8 btf_16_lane_0_1_neon(step1[13], step1[10], c3, &step2[13], &step2[10]); btf_16_lane_0_1_neon(step1[12], step1[11], c3, &step2[12], &step2[11]); btf_16_lane_2_3_neon(step1[59], step1[36], c3, &step2[59], &step2[36]); btf_16_lane_2_3_neon(step1[58], step1[37], c3, &step2[58], &step2[37]); btf_16_lane_2_3_neon(step1[57], step1[38], c3, &step2[57], &step2[38]); btf_16_lane_2_3_neon(step1[56], step1[39], c3, &step2[56], &step2[39]);
+ show +
3523
3524
3525
3526
3527
3528
3529
3530
btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, &step2[40], &step2[55]); btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, &step2[41], &step2[54]); btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, &step2[42], &step2[53]); btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, &step2[43], &step2[52]);
+ show +
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
step2[0] = vqaddq_s16(step1[0], step1[7]); step2[1] = vqaddq_s16(step1[1], step1[6]); step2[2] = vqaddq_s16(step1[2], step1[5]); step2[3] = vqaddq_s16(step1[3], step1[4]); step2[4] = vqsubq_s16(step1[3], step1[4]); step2[5] = vqsubq_s16(step1[2], step1[5]); step2[6] = vqsubq_s16(step1[1], step1[6]); step2[7] = vqsubq_s16(step1[0], step1[7]); step2[8] = step1[8];

[CVE-2020-0470_1.diff] av1_inv_txfm_neon.c #1
- { av1_idct4_new, av1_iadst4_new, av1_iidentity4_c }, - { av1_idct8_new, av1_iadst8_new, av1_iidentity8_c }, - { av1_idct16_new, av1_iadst16_new, av1_iidentity16_c }, - { av1_idct32_new, NULL, NULL }, - { av1_idct64_new, NULL, NULL }, + { av1_idct4, av1_iadst4, av1_iidentity4_c }, + { av1_idct8, av1_iadst8, av1_iidentity8_c }, + { av1_idct16, av1_iadst16, av1_iidentity16_c }, + { av1_idct32, NULL, NULL }, + { av1_idct64, NULL, NULL },
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
41
42
43
44
45
46
47
48
49
50
static const ITX_TYPE_1D hitx_1d_tab[TX_TYPES] = { IDCT_1D, IDCT_1D, IADST_1D, IADST_1D, IDCT_1D, IFLIPADST_1D, IFLIPADST_1D, IFLIPADST_1D, IADST_1D, IIDENTITY_1D, IIDENTITY_1D, IDCT_1D, IIDENTITY_1D, IADST_1D, IIDENTITY_1D, IFLIPADST_1D, }; // 1D functions static const transform_1d_neon lowbd_txfm_all_1d_arr[TX_SIZES][ITX_TYPES_1D] = {
+ show +
51
52
53
54
55
{ av1_idct4_new, av1_iadst4_new, av1_iidentity4_c }, { av1_idct8_new, av1_iadst8_new, av1_iidentity8_c }, { av1_idct16_new, av1_iadst16_new, av1_iidentity16_c }, { av1_idct32_new, NULL, NULL }, { av1_idct64_new, NULL, NULL },
+ show +
56
57
58
59
60
61
62
63
64
65
}; static INLINE void lowbd_add_flip_buffer_8xn_neon(int16x8_t *in, uint8_t *output, int stride, int flipud, const int height) { int j = flipud ? (height - 1) : 0; const int step = flipud ? -1 : 1; int16x8_t temp_output; for (int i = 0; i < height; ++i, j += step) {

[CVE-2020-0470_1.diff] av1_inv_txfm_neon.c #7
-static INLINE void identity8_new_neon(int16x8_t *input, int16x8_t *output, - int8_t cos_bit, int bit) { - (void)bit; - (void)cos_bit; +static int16_t sqrt_2_list[TX_SIZES] = { 5793, 2 * 4096, 2 * 5793, 4 * 4096, + 4 * 5793 }; - output[0] = vmulq_n_s16(input[0], (int16_t)2); - output[1] = vmulq_n_s16(input[1], (int16_t)2); - output[2] = vmulq_n_s16(input[2], (int16_t)2); - output[3] = vmulq_n_s16(input[3], (int16_t)2); - output[4] = vmulq_n_s16(input[4], (int16_t)2); - output[5] = vmulq_n_s16(input[5], (int16_t)2); - output[6] = vmulq_n_s16(input[6], (int16_t)2); - output[7] = vmulq_n_s16(input[7], (int16_t)2); +static INLINE void identity_txfm_round_neon(int16x8_t *input, int16x8_t *output, + int txw_idx, int8_t size, int bit) { + const int32x4_t dup_bits_n_32x4 = vdupq_n_s32((int32_t)(-bit)); + int16x4_t scale = vdup_n_s16(sqrt_2_list[txw_idx]); + int16x4_t low_i16, high_i16; + int32x4_t low_i32, high_i32; + for (int i = 0; i < size; i++) { + int32x4_t temp_out_low = vmull_s16(vget_low_s16(input[i]), scale); + int32x4_t temp_out_high = vmull_s16(vget_high_s16(input[i]), scale); + low_i32 = vrshlq_s32(vrshrq_n_s32(temp_out_low, 12), dup_bits_n_32x4); + high_i32 = vrshlq_s32(vrshrq_n_s32(temp_out_high, 12), dup_bits_n_32x4); + low_i16 = vqmovn_s32(low_i32); + high_i16 = vqmovn_s32(high_i32); + output[i] = vcombine_s16(low_i16, high_i16); + }
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
482
483
484
485
486
487
488
489
490
491
static INLINE void load_buffer_32bit_to_16bit_neon(const int32_t *input, int16x8_t *const a, int out_size) { for (int i = 0; i < 8; ++i) { a[i] = vcombine_s16(vmovn_s32(vld1q_s32(input)), vmovn_s32(vld1q_s32(input + 4))); input += out_size; } }
+ show +
492
493
494
495
496
497
498
499
500
501
502
503
504
static INLINE void identity8_new_neon(int16x8_t *input, int16x8_t *output, int8_t cos_bit, int bit) { (void)bit; (void)cos_bit; output[0] = vmulq_n_s16(input[0], (int16_t)2); output[1] = vmulq_n_s16(input[1], (int16_t)2); output[2] = vmulq_n_s16(input[2], (int16_t)2); output[3] = vmulq_n_s16(input[3], (int16_t)2); output[4] = vmulq_n_s16(input[4], (int16_t)2); output[5] = vmulq_n_s16(input[5], (int16_t)2); output[6] = vmulq_n_s16(input[6], (int16_t)2); output[7] = vmulq_n_s16(input[7], (int16_t)2);
+ show +
505
506
507
508
509
510
511
512
513
514
} static INLINE void round_shift_for_rect(int16x8_t *input, int16x8_t *output, int size) { int32x4_t out_low, out_high; int16x4_t low, high; for (int z = 0; z < size; ++z) { out_low = vmull_n_s16(vget_low_s16(input[z]), (int16_t)NewInvSqrt2); out_high = vmull_n_s16(vget_high_s16(input[z]), (int16_t)NewInvSqrt2);

[CVE-2020-0470_1.diff] av1_inv_txfm_neon.c #8
-static INLINE void identity16_new_neon(int16x8_t *input, int16x8_t *output, - int8_t cos_bit, int bit) { - (void)bit; - (void)cos_bit; - - int32x4_t out_low, out_high; - int16x4_t low, high; - int16_t scale = (int16_t)(2 * NewSqrt2); - - for (int z = 0; z < 16; ++z) { - out_low = vmull_n_s16(vget_low_s16(input[z]), scale); - out_high = vmull_n_s16(vget_high_s16(input[z]), scale); - - low = vqrshrn_n_s32(out_low, (int32_t)NewSqrt2Bits); - high = vqrshrn_n_s32(out_high, (int32_t)NewSqrt2Bits); - - output[z] = vcombine_s16(low, high); - } -} - -static INLINE void identity32_new_neon(int16x8_t *input, int16x8_t *output, - int8_t cos_bit, int bit) { - (void)bit; - (void)cos_bit; - - for (int z = 0; z < 32; ++z) { - output[z] = vmulq_n_s16(input[z], (int16_t)4); - } -} - -static INLINE void idct16_low1_new_neon(int16x8_t *in, int16x8_t *out, - int8_t cos_bit, int bit) { +static INLINE void idct16_low1_neon(int16x8_t *in, int16x8_t *out, + int8_t cos_bit, int bit) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
513
514
515
516
517
518
519
520
521
522
out_low = vmull_n_s16(vget_low_s16(input[z]), (int16_t)NewInvSqrt2); out_high = vmull_n_s16(vget_high_s16(input[z]), (int16_t)NewInvSqrt2); low = vqrshrn_n_s32(out_low, (int32_t)NewSqrt2Bits); high = vqrshrn_n_s32(out_high, (int32_t)NewSqrt2Bits); output[z] = vcombine_s16(low, high); } }
+ show +
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
static INLINE void identity16_new_neon(int16x8_t *input, int16x8_t *output, int8_t cos_bit, int bit) { (void)bit; (void)cos_bit; int32x4_t out_low, out_high; int16x4_t low, high; int16_t scale = (int16_t)(2 * NewSqrt2); for (int z = 0; z < 16; ++z) { out_low = vmull_n_s16(vget_low_s16(input[z]), scale); out_high = vmull_n_s16(vget_high_s16(input[z]), scale); low = vqrshrn_n_s32(out_low, (int32_t)NewSqrt2Bits); high = vqrshrn_n_s32(out_high, (int32_t)NewSqrt2Bits); output[z] = vcombine_s16(low, high); } } static INLINE void identity32_new_neon(int16x8_t *input, int16x8_t *output, int8_t cos_bit, int bit) { (void)bit; (void)cos_bit; for (int z = 0; z < 32; ++z) { output[z] = vmulq_n_s16(input[z], (int16_t)4); } } static INLINE void idct16_low1_new_neon(int16x8_t *in, int16x8_t *out, int8_t cos_bit, int bit) {
+ show +
555
556
557
558
559
560
561
562
563
564
(void)bit; const int32_t *cospi = cospi_arr(cos_bit); int16x8_t step1; int32x4_t t32[2]; // stage 4 t32[0] = vmull_n_s16(vget_low_s16(in[0]), cospi[32]); t32[1] = vmull_n_s16(vget_high_s16(in[0]), cospi[32]); step1 = vcombine_s16(vrshrn_n_s32(t32[0], INV_COS_BIT),

[CVE-2020-0470_1.diff] av1_inv_txfm_neon.c #19
- btf_16_lane_0_1_neon(x[8], x[9], c4, &s8, &s9); - btf_16_lane_2_3_neon(x[10], x[11], c4, &s10, &s11); - btf_16_lane_1_0_neon(x[13], x[12], c4, &s13, &s12); - btf_16_lane_3_2_neon(x[15], x[14], c4, &s15, &s14); + btf_16_lane_0_1_neon(x[8], x[9], c0, &s8, &s9); + btf_16_lane_2_3_neon(x[10], x[11], c0, &s10, &s11); + btf_16_lane_1_0_neon(x[13], x[12], c0, &s13, &s12); + btf_16_lane_3_2_neon(x[15], x[14], c0, &s15, &s14);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
898
899
900
901
902
903
904
905
906
907
// Stage 4 t[0] = x[0]; t[1] = x[1]; t[2] = x[2]; t[3] = x[3]; t[4] = x[4]; t[5] = x[5]; t[6] = x[6]; t[7] = x[7];
+ show +
908
909
910
911
btf_16_lane_0_1_neon(x[8], x[9], c4, &s8, &s9); btf_16_lane_2_3_neon(x[10], x[11], c4, &s10, &s11); btf_16_lane_1_0_neon(x[13], x[12], c4, &s13, &s12); btf_16_lane_3_2_neon(x[15], x[14], c4, &s15, &s14);
+ show +
912
913
914
915
916
917
918
919
920
921
// Stage 5 x[0] = vqaddq_s16(t[0], t[4]); x[1] = vqaddq_s16(t[1], t[5]); x[2] = vqaddq_s16(t[2], t[6]); x[3] = vqaddq_s16(t[3], t[7]); x[4] = vqsubq_s16(t[0], t[4]); x[5] = vqsubq_s16(t[1], t[5]); x[6] = vqsubq_s16(t[2], t[6]); x[7] = vqsubq_s16(t[3], t[7]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
// Stage 4 t[0] = x[0]; t[1] = x[1]; t[2] = x[2]; t[3] = x[3]; t[4] = x[4]; t[5] = x[5]; t[6] = x[6]; t[7] = x[7];
+ show +
1147
1148
1149
1150
btf_16_lane_0_1_neon(x[8], x[9], c4, &s8, &s9); btf_16_lane_2_3_neon(x[10], x[11], c4, &s10, &s11); btf_16_lane_1_0_neon(x[13], x[12], c4, &s13, &s12); btf_16_lane_3_2_neon(x[15], x[14], c4, &s15, &s14);
+ show +
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
// Stage 5 x[0] = vqaddq_s16(t[0], t[4]); x[1] = vqaddq_s16(t[1], t[5]); x[2] = vqaddq_s16(t[2], t[6]); x[3] = vqaddq_s16(t[3], t[7]); x[4] = vqsubq_s16(t[0], t[4]); x[5] = vqsubq_s16(t[1], t[5]); x[6] = vqsubq_s16(t[2], t[6]); x[7] = vqsubq_s16(t[3], t[7]);

[CVE-2020-0470_1.diff] av1_inv_txfm_neon.c #24
- btf_16_lane_3_2_neon(vnegq_s16(step1[20]), vnegq_s16(step1[27]), c7, - &step2[20], &step2[27]); - btf_16_lane_3_2_neon(vnegq_s16(step1[21]), vnegq_s16(step1[26]), c7, - &step2[21], &step2[26]); + btf_16_lane_3_2_neon(step1[20], step1[27], c9, &step2[20], &step2[27]); + btf_16_lane_3_2_neon(step1[21], step1[26], c9, &step2[21], &step2[26]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
step1[28] = vqsubq_s16(step2[31], step2[28]); step1[29] = vqsubq_s16(step2[30], step2[29]); step1[30] = vqaddq_s16(step2[30], step2[29]); step1[31] = vqaddq_s16(step2[31], step2[28]); // stage 6 btf_16_lane_0_1_neon(step1[6], step1[5], c7, &step2[6], &step2[5]); btf_16_lane_2_3_neon(step1[29], step1[18], c7, &step2[29], &step2[18]); btf_16_lane_2_3_neon(step1[28], step1[19], c7, &step2[28], &step2[19]);
+ show +
1389
1390
1391
1392
btf_16_lane_3_2_neon(vnegq_s16(step1[20]), vnegq_s16(step1[27]), c7, &step2[20], &step2[27]); btf_16_lane_3_2_neon(vnegq_s16(step1[21]), vnegq_s16(step1[26]), c7, &step2[21], &step2[26]);
+ show +
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
step2[0] = vqaddq_s16(step1[0], step1[3]); step2[1] = vqaddq_s16(step1[1], step1[2]); step2[2] = vqsubq_s16(step1[1], step1[2]); step2[3] = vqsubq_s16(step1[0], step1[3]); step2[4] = step1[4]; step2[7] = step1[7]; step2[8] = vqaddq_s16(step1[8], step1[11]); step2[9] = vqaddq_s16(step1[9], step1[10]); step2[10] = vqsubq_s16(step1[9], step1[10]);

[CVE-2020-0470_1.diff] av1_inv_txfm_neon.c #29
- btf_16_lane_3_2_neon(vnegq_s16(step1[20]), vnegq_s16(step1[27]), c1, - &step2[20], &step2[27]); - btf_16_lane_3_2_neon(vnegq_s16(step1[21]), vnegq_s16(step1[26]), c1, - &step2[21], &step2[26]); + btf_16_lane_3_2_neon(step1[20], step1[27], c3, &step2[20], &step2[27]); + btf_16_lane_3_2_neon(step1[21], step1[26], c3, &step2[21], &step2[26]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
step1[28] = vqsubq_s16(step2[31], step2[28]); step1[29] = vqsubq_s16(step2[30], step2[29]); step1[30] = vqaddq_s16(step2[30], step2[29]); step1[31] = vqaddq_s16(step2[31], step2[28]); // stage 6 btf_16_lane_0_1_neon(step1[6], step1[5], c1, &step2[6], &step2[5]); btf_16_lane_2_3_neon(step1[29], step1[18], c1, &step2[29], &step2[18]); btf_16_lane_2_3_neon(step1[28], step1[19], c1, &step2[28], &step2[19]);
+ show +
1695
1696
1697
1698
btf_16_lane_3_2_neon(vnegq_s16(step1[20]), vnegq_s16(step1[27]), c1, &step2[20], &step2[27]); btf_16_lane_3_2_neon(vnegq_s16(step1[21]), vnegq_s16(step1[26]), c1, &step2[21], &step2[26]);
+ show +
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
step2[0] = step1[0]; step2[1] = step1[0]; step2[2] = step1[0]; step2[3] = step1[0]; step2[4] = step1[4]; step2[7] = step1[7]; step2[8] = vqaddq_s16(step1[8], step1[11]); step2[9] = vqaddq_s16(step1[9], step1[10]); step2[10] = vqsubq_s16(step1[9], step1[10]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
step1[28] = vqsubq_s16(step2[31], step2[28]); step1[29] = vqsubq_s16(step2[30], step2[29]); step1[30] = vqaddq_s16(step2[30], step2[29]); step1[31] = vqaddq_s16(step2[31], step2[28]); // stage 6 btf_16_lane_0_1_neon(step1[6], step1[5], c1, &step2[6], &step2[5]); btf_16_lane_2_3_neon(step1[29], step1[18], c1, &step2[29], &step2[18]); btf_16_lane_2_3_neon(step1[28], step1[19], c1, &step2[28], &step2[19]);
+ show +
1960
1961
1962
1963
btf_16_lane_3_2_neon(vnegq_s16(step1[20]), vnegq_s16(step1[27]), c1, &step2[20], &step2[27]); btf_16_lane_3_2_neon(vnegq_s16(step1[21]), vnegq_s16(step1[26]), c1, &step2[21], &step2[26]);
+ show +
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
step2[0] = vqaddq_s16(step1[0], step1[3]); step2[1] = vqaddq_s16(step1[0], step1[2]); step2[2] = vqsubq_s16(step1[0], step1[2]); step2[3] = vqsubq_s16(step1[0], step1[3]); step2[4] = step1[4]; step2[7] = step1[7]; step2[8] = vqaddq_s16(step1[8], step1[11]); step2[9] = vqaddq_s16(step1[9], step1[10]); step2[10] = vqsubq_s16(step1[9], step1[10]);

[CVE-2020-0470_1.diff] av1_inv_txfm_neon.c #33
- btf_16_lane_3_2_neon(vnegq_s16(step1[20]), vnegq_s16(step1[27]), c1, - &step2[20], &step2[27]); - btf_16_lane_3_2_neon(vnegq_s16(step1[21]), vnegq_s16(step1[26]), c1, - &step2[21], &step2[26]); + btf_16_lane_3_2_neon(step1[20], step1[27], c3, &step2[20], &step2[27]); + btf_16_lane_3_2_neon(step1[21], step1[26], c3, &step2[21], &step2[26]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
step1[28] = vqsubq_s16(step2[31], step2[28]); step1[29] = vqsubq_s16(step2[30], step2[29]); step1[30] = vqaddq_s16(step2[30], step2[29]); step1[31] = vqaddq_s16(step2[31], step2[28]); // stage 6 btf_16_lane_0_1_neon(step1[6], step1[5], c1, &step2[6], &step2[5]); btf_16_lane_2_3_neon(step1[29], step1[18], c1, &step2[29], &step2[18]); btf_16_lane_2_3_neon(step1[28], step1[19], c1, &step2[28], &step2[19]);
+ show +
1695
1696
1697
1698
btf_16_lane_3_2_neon(vnegq_s16(step1[20]), vnegq_s16(step1[27]), c1, &step2[20], &step2[27]); btf_16_lane_3_2_neon(vnegq_s16(step1[21]), vnegq_s16(step1[26]), c1, &step2[21], &step2[26]);
+ show +
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
step2[0] = step1[0]; step2[1] = step1[0]; step2[2] = step1[0]; step2[3] = step1[0]; step2[4] = step1[4]; step2[7] = step1[7]; step2[8] = vqaddq_s16(step1[8], step1[11]); step2[9] = vqaddq_s16(step1[9], step1[10]); step2[10] = vqsubq_s16(step1[9], step1[10]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
step1[28] = vqsubq_s16(step2[31], step2[28]); step1[29] = vqsubq_s16(step2[30], step2[29]); step1[30] = vqaddq_s16(step2[30], step2[29]); step1[31] = vqaddq_s16(step2[31], step2[28]); // stage 6 btf_16_lane_0_1_neon(step1[6], step1[5], c1, &step2[6], &step2[5]); btf_16_lane_2_3_neon(step1[29], step1[18], c1, &step2[29], &step2[18]); btf_16_lane_2_3_neon(step1[28], step1[19], c1, &step2[28], &step2[19]);
+ show +
1960
1961
1962
1963
btf_16_lane_3_2_neon(vnegq_s16(step1[20]), vnegq_s16(step1[27]), c1, &step2[20], &step2[27]); btf_16_lane_3_2_neon(vnegq_s16(step1[21]), vnegq_s16(step1[26]), c1, &step2[21], &step2[26]);
+ show +
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
step2[0] = vqaddq_s16(step1[0], step1[3]); step2[1] = vqaddq_s16(step1[0], step1[2]); step2[2] = vqsubq_s16(step1[0], step1[2]); step2[3] = vqsubq_s16(step1[0], step1[3]); step2[4] = step1[4]; step2[7] = step1[7]; step2[8] = vqaddq_s16(step1[8], step1[11]); step2[9] = vqaddq_s16(step1[9], step1[10]); step2[10] = vqsubq_s16(step1[9], step1[10]);

[CVE-2020-0470_1.diff] av1_inv_txfm_neon.c #40
- btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, - &step1[20], &step1[27]); - btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, - &step1[21], &step1[26]); + btf_16_lane_3_2_neon(step2[20], step2[27], c7, &step1[20], &step1[27]); + btf_16_lane_3_2_neon(step2[21], step2[26], c7, &step1[21], &step1[26]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
step2[56] = step1[56]; step2[57] = step1[57]; step2[62] = step1[62]; step2[63] = step1[63]; // stage 7 btf_16_lane_0_1_neon(step2[6], step2[5], c3, &step1[6], &step1[5]); btf_16_lane_2_3_neon(step2[29], step2[18], c3, &step1[29], &step1[18]); btf_16_lane_2_3_neon(step2[28], step2[19], c3, &step1[28], &step1[19]);
+ show +
2519
2520
2521
2522
btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, &step1[20], &step1[27]); btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, &step1[21], &step1[26]);
+ show +
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
step1[0] = vqaddq_s16(step2[0], step2[3]); step1[1] = vqaddq_s16(step2[1], step2[2]); step1[2] = vqsubq_s16(step2[1], step2[2]); step1[3] = vqsubq_s16(step2[0], step2[3]); step1[4] = step2[4]; step1[7] = step2[7]; step1[8] = vqaddq_s16(step2[8], step2[11]); step1[9] = vqaddq_s16(step2[9], step2[10]); step1[10] = vqsubq_s16(step2[9], step2[10]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
step2[55] = step1[55]; step2[56] = step1[56]; step2[57] = step1[57]; step2[62] = step1[62]; step2[63] = step1[63]; // stage 7 btf_16_lane_2_3_neon(step2[29], step2[18], c3, &step1[29], &step1[18]); btf_16_lane_2_3_neon(step2[28], step2[19], c3, &step1[28], &step1[19]);
+ show +
2997
2998
2999
3000
btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, &step1[20], &step1[27]); btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, &step1[21], &step1[26]);
+ show +
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
step1[0] = step2[0]; step1[1] = step2[1]; step1[2] = step2[1]; step1[3] = step2[0]; step1[8] = step2[8]; step1[9] = step2[9]; step1[10] = step2[9]; step1[11] = step2[8]; step1[12] = step2[15];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
step2[56] = step1[56]; step2[57] = step1[57]; step2[62] = step1[62]; step2[63] = step1[63]; // stage 7 btf_16_lane_0_1_neon(step2[6], step2[5], c3, &step1[6], &step1[5]); btf_16_lane_2_3_neon(step2[29], step2[18], c3, &step1[29], &step1[18]); btf_16_lane_2_3_neon(step2[28], step2[19], c3, &step1[28], &step1[19]);
+ show +
3455
3456
3457
3458
btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, &step1[20], &step1[27]); btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, &step1[21], &step1[26]);
+ show +
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
step1[0] = step2[0]; step1[1] = step2[1]; step1[2] = step2[1]; step1[3] = step2[0]; step1[4] = step2[4]; step1[7] = step2[7]; step1[8] = vqaddq_s16(step2[8], step2[11]); step1[9] = vqaddq_s16(step2[9], step2[10]); step1[10] = vqsubq_s16(step2[9], step2[10]);

[CVE-2020-0470_1.diff] av1_inv_txfm_neon.c #41
- btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, - &step2[40], &step2[55]); - btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, - &step2[41], &step2[54]); - btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, - &step2[42], &step2[53]); - btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, - &step2[43], &step2[52]); + btf_16_lane_3_2_neon(step1[40], step1[55], c7, &step2[40], &step2[55]); + btf_16_lane_3_2_neon(step1[41], step1[54], c7, &step2[41], &step2[54]); + btf_16_lane_3_2_neon(step1[42], step1[53], c7, &step2[42], &step2[53]); + btf_16_lane_3_2_neon(step1[43], step1[52], c7, &step2[43], &step2[52]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
step1[63] = vqaddq_s16(step2[56], step2[63]); // stage 8 btf_16_lane_0_1_neon(step1[13], step1[10], c3, &step2[13], &step2[10]); btf_16_lane_0_1_neon(step1[12], step1[11], c3, &step2[12], &step2[11]); btf_16_lane_2_3_neon(step1[59], step1[36], c3, &step2[59], &step2[36]); btf_16_lane_2_3_neon(step1[58], step1[37], c3, &step2[58], &step2[37]); btf_16_lane_2_3_neon(step1[57], step1[38], c3, &step2[57], &step2[38]); btf_16_lane_2_3_neon(step1[56], step1[39], c3, &step2[56], &step2[39]);
+ show +
2587
2588
2589
2590
2591
2592
2593
2594
btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, &step2[40], &step2[55]); btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, &step2[41], &step2[54]); btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, &step2[42], &step2[53]); btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, &step2[43], &step2[52]);
+ show +
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
step2[0] = vqaddq_s16(step1[0], step1[7]); step2[1] = vqaddq_s16(step1[1], step1[6]); step2[2] = vqaddq_s16(step1[2], step1[5]); step2[3] = vqaddq_s16(step1[3], step1[4]); step2[4] = vqsubq_s16(step1[3], step1[4]); step2[5] = vqsubq_s16(step1[2], step1[5]); step2[6] = vqsubq_s16(step1[1], step1[6]); step2[7] = vqsubq_s16(step1[0], step1[7]); step2[8] = step1[8];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
step1[63] = vqaddq_s16(step2[56], step2[63]); // stage 8 btf_16_lane_0_1_neon(step1[13], step1[10], c3, &step2[13], &step2[10]); btf_16_lane_0_1_neon(step1[12], step1[11], c3, &step2[12], &step2[11]); btf_16_lane_2_3_neon(step1[59], step1[36], c3, &step2[59], &step2[36]); btf_16_lane_2_3_neon(step1[58], step1[37], c3, &step2[58], &step2[37]); btf_16_lane_2_3_neon(step1[57], step1[38], c3, &step2[57], &step2[38]); btf_16_lane_2_3_neon(step1[56], step1[39], c3, &step2[56], &step2[39]);
+ show +
3063
3064
3065
3066
3067
3068
3069
3070
btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, &step2[40], &step2[55]); btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, &step2[41], &step2[54]); btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, &step2[42], &step2[53]); btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, &step2[43], &step2[52]);
+ show +
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
step2[0] = step1[0]; step2[1] = step1[1]; step2[2] = step1[2]; step2[3] = step1[3]; step2[4] = step1[3]; step2[5] = step1[2]; step2[6] = step1[1]; step2[7] = step1[0]; step2[8] = step1[8];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
step1[63] = vqaddq_s16(step2[56], step2[63]); // stage 8 btf_16_lane_0_1_neon(step1[13], step1[10], c3, &step2[13], &step2[10]); btf_16_lane_0_1_neon(step1[12], step1[11], c3, &step2[12], &step2[11]); btf_16_lane_2_3_neon(step1[59], step1[36], c3, &step2[59], &step2[36]); btf_16_lane_2_3_neon(step1[58], step1[37], c3, &step2[58], &step2[37]); btf_16_lane_2_3_neon(step1[57], step1[38], c3, &step2[57], &step2[38]); btf_16_lane_2_3_neon(step1[56], step1[39], c3, &step2[56], &step2[39]);
+ show +
3523
3524
3525
3526
3527
3528
3529
3530
btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, &step2[40], &step2[55]); btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, &step2[41], &step2[54]); btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, &step2[42], &step2[53]); btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, &step2[43], &step2[52]);
+ show +
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
step2[0] = vqaddq_s16(step1[0], step1[7]); step2[1] = vqaddq_s16(step1[1], step1[6]); step2[2] = vqaddq_s16(step1[2], step1[5]); step2[3] = vqaddq_s16(step1[3], step1[4]); step2[4] = vqsubq_s16(step1[3], step1[4]); step2[5] = vqsubq_s16(step1[2], step1[5]); step2[6] = vqsubq_s16(step1[1], step1[6]); step2[7] = vqsubq_s16(step1[0], step1[7]); step2[8] = step1[8];

[CVE-2020-0470_1.diff] av1_inv_txfm_neon.c #47
- btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, - &step1[20], &step1[27]); - btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, - &step1[21], &step1[26]); + btf_16_lane_3_2_neon(step2[20], step2[27], c6, &step1[20], &step1[27]); + btf_16_lane_3_2_neon(step2[21], step2[26], c6, &step1[21], &step1[26]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
step2[56] = step1[56]; step2[57] = step1[57]; step2[62] = step1[62]; step2[63] = step1[63]; // stage 7 btf_16_lane_0_1_neon(step2[6], step2[5], c3, &step1[6], &step1[5]); btf_16_lane_2_3_neon(step2[29], step2[18], c3, &step1[29], &step1[18]); btf_16_lane_2_3_neon(step2[28], step2[19], c3, &step1[28], &step1[19]);
+ show +
2519
2520
2521
2522
btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, &step1[20], &step1[27]); btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, &step1[21], &step1[26]);
+ show +
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
step1[0] = vqaddq_s16(step2[0], step2[3]); step1[1] = vqaddq_s16(step2[1], step2[2]); step1[2] = vqsubq_s16(step2[1], step2[2]); step1[3] = vqsubq_s16(step2[0], step2[3]); step1[4] = step2[4]; step1[7] = step2[7]; step1[8] = vqaddq_s16(step2[8], step2[11]); step1[9] = vqaddq_s16(step2[9], step2[10]); step1[10] = vqsubq_s16(step2[9], step2[10]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
step2[55] = step1[55]; step2[56] = step1[56]; step2[57] = step1[57]; step2[62] = step1[62]; step2[63] = step1[63]; // stage 7 btf_16_lane_2_3_neon(step2[29], step2[18], c3, &step1[29], &step1[18]); btf_16_lane_2_3_neon(step2[28], step2[19], c3, &step1[28], &step1[19]);
+ show +
2997
2998
2999
3000
btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, &step1[20], &step1[27]); btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, &step1[21], &step1[26]);
+ show +
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
step1[0] = step2[0]; step1[1] = step2[1]; step1[2] = step2[1]; step1[3] = step2[0]; step1[8] = step2[8]; step1[9] = step2[9]; step1[10] = step2[9]; step1[11] = step2[8]; step1[12] = step2[15];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
step2[56] = step1[56]; step2[57] = step1[57]; step2[62] = step1[62]; step2[63] = step1[63]; // stage 7 btf_16_lane_0_1_neon(step2[6], step2[5], c3, &step1[6], &step1[5]); btf_16_lane_2_3_neon(step2[29], step2[18], c3, &step1[29], &step1[18]); btf_16_lane_2_3_neon(step2[28], step2[19], c3, &step1[28], &step1[19]);
+ show +
3455
3456
3457
3458
btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, &step1[20], &step1[27]); btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, &step1[21], &step1[26]);
+ show +
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
step1[0] = step2[0]; step1[1] = step2[1]; step1[2] = step2[1]; step1[3] = step2[0]; step1[4] = step2[4]; step1[7] = step2[7]; step1[8] = vqaddq_s16(step2[8], step2[11]); step1[9] = vqaddq_s16(step2[9], step2[10]); step1[10] = vqsubq_s16(step2[9], step2[10]);

[CVE-2020-0470_1.diff] av1_inv_txfm_neon.c #48
- btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, - &step2[40], &step2[55]); - btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, - &step2[41], &step2[54]); - btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, - &step2[42], &step2[53]); - btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, - &step2[43], &step2[52]); + btf_16_lane_3_2_neon(step1[40], step1[55], c6, &step2[40], &step2[55]); + btf_16_lane_3_2_neon(step1[41], step1[54], c6, &step2[41], &step2[54]); + btf_16_lane_3_2_neon(step1[42], step1[53], c6, &step2[42], &step2[53]); + btf_16_lane_3_2_neon(step1[43], step1[52], c6, &step2[43], &step2[52]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
step1[63] = vqaddq_s16(step2[56], step2[63]); // stage 8 btf_16_lane_0_1_neon(step1[13], step1[10], c3, &step2[13], &step2[10]); btf_16_lane_0_1_neon(step1[12], step1[11], c3, &step2[12], &step2[11]); btf_16_lane_2_3_neon(step1[59], step1[36], c3, &step2[59], &step2[36]); btf_16_lane_2_3_neon(step1[58], step1[37], c3, &step2[58], &step2[37]); btf_16_lane_2_3_neon(step1[57], step1[38], c3, &step2[57], &step2[38]); btf_16_lane_2_3_neon(step1[56], step1[39], c3, &step2[56], &step2[39]);
+ show +
2587
2588
2589
2590
2591
2592
2593
2594
btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, &step2[40], &step2[55]); btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, &step2[41], &step2[54]); btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, &step2[42], &step2[53]); btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, &step2[43], &step2[52]);
+ show +
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
step2[0] = vqaddq_s16(step1[0], step1[7]); step2[1] = vqaddq_s16(step1[1], step1[6]); step2[2] = vqaddq_s16(step1[2], step1[5]); step2[3] = vqaddq_s16(step1[3], step1[4]); step2[4] = vqsubq_s16(step1[3], step1[4]); step2[5] = vqsubq_s16(step1[2], step1[5]); step2[6] = vqsubq_s16(step1[1], step1[6]); step2[7] = vqsubq_s16(step1[0], step1[7]); step2[8] = step1[8];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
step1[63] = vqaddq_s16(step2[56], step2[63]); // stage 8 btf_16_lane_0_1_neon(step1[13], step1[10], c3, &step2[13], &step2[10]); btf_16_lane_0_1_neon(step1[12], step1[11], c3, &step2[12], &step2[11]); btf_16_lane_2_3_neon(step1[59], step1[36], c3, &step2[59], &step2[36]); btf_16_lane_2_3_neon(step1[58], step1[37], c3, &step2[58], &step2[37]); btf_16_lane_2_3_neon(step1[57], step1[38], c3, &step2[57], &step2[38]); btf_16_lane_2_3_neon(step1[56], step1[39], c3, &step2[56], &step2[39]);
+ show +
3063
3064
3065
3066
3067
3068
3069
3070
btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, &step2[40], &step2[55]); btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, &step2[41], &step2[54]); btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, &step2[42], &step2[53]); btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, &step2[43], &step2[52]);
+ show +
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
step2[0] = step1[0]; step2[1] = step1[1]; step2[2] = step1[2]; step2[3] = step1[3]; step2[4] = step1[3]; step2[5] = step1[2]; step2[6] = step1[1]; step2[7] = step1[0]; step2[8] = step1[8];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
step1[63] = vqaddq_s16(step2[56], step2[63]); // stage 8 btf_16_lane_0_1_neon(step1[13], step1[10], c3, &step2[13], &step2[10]); btf_16_lane_0_1_neon(step1[12], step1[11], c3, &step2[12], &step2[11]); btf_16_lane_2_3_neon(step1[59], step1[36], c3, &step2[59], &step2[36]); btf_16_lane_2_3_neon(step1[58], step1[37], c3, &step2[58], &step2[37]); btf_16_lane_2_3_neon(step1[57], step1[38], c3, &step2[57], &step2[38]); btf_16_lane_2_3_neon(step1[56], step1[39], c3, &step2[56], &step2[39]);
+ show +
3523
3524
3525
3526
3527
3528
3529
3530
btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, &step2[40], &step2[55]); btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, &step2[41], &step2[54]); btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, &step2[42], &step2[53]); btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, &step2[43], &step2[52]);
+ show +
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
step2[0] = vqaddq_s16(step1[0], step1[7]); step2[1] = vqaddq_s16(step1[1], step1[6]); step2[2] = vqaddq_s16(step1[2], step1[5]); step2[3] = vqaddq_s16(step1[3], step1[4]); step2[4] = vqsubq_s16(step1[3], step1[4]); step2[5] = vqsubq_s16(step1[2], step1[5]); step2[6] = vqsubq_s16(step1[1], step1[6]); step2[7] = vqsubq_s16(step1[0], step1[7]); step2[8] = step1[8];

[CVE-2020-0470_1.diff] av1_inv_txfm_neon.c #53
- btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, - &step1[20], &step1[27]); - btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, - &step1[21], &step1[26]); + btf_16_lane_3_2_neon(step2[20], step2[27], c7, &step1[20], &step1[27]); + btf_16_lane_3_2_neon(step2[21], step2[26], c7, &step1[21], &step1[26]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
step2[56] = step1[56]; step2[57] = step1[57]; step2[62] = step1[62]; step2[63] = step1[63]; // stage 7 btf_16_lane_0_1_neon(step2[6], step2[5], c3, &step1[6], &step1[5]); btf_16_lane_2_3_neon(step2[29], step2[18], c3, &step1[29], &step1[18]); btf_16_lane_2_3_neon(step2[28], step2[19], c3, &step1[28], &step1[19]);
+ show +
2519
2520
2521
2522
btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, &step1[20], &step1[27]); btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, &step1[21], &step1[26]);
+ show +
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
step1[0] = vqaddq_s16(step2[0], step2[3]); step1[1] = vqaddq_s16(step2[1], step2[2]); step1[2] = vqsubq_s16(step2[1], step2[2]); step1[3] = vqsubq_s16(step2[0], step2[3]); step1[4] = step2[4]; step1[7] = step2[7]; step1[8] = vqaddq_s16(step2[8], step2[11]); step1[9] = vqaddq_s16(step2[9], step2[10]); step1[10] = vqsubq_s16(step2[9], step2[10]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
step2[55] = step1[55]; step2[56] = step1[56]; step2[57] = step1[57]; step2[62] = step1[62]; step2[63] = step1[63]; // stage 7 btf_16_lane_2_3_neon(step2[29], step2[18], c3, &step1[29], &step1[18]); btf_16_lane_2_3_neon(step2[28], step2[19], c3, &step1[28], &step1[19]);
+ show +
2997
2998
2999
3000
btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, &step1[20], &step1[27]); btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, &step1[21], &step1[26]);
+ show +
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
step1[0] = step2[0]; step1[1] = step2[1]; step1[2] = step2[1]; step1[3] = step2[0]; step1[8] = step2[8]; step1[9] = step2[9]; step1[10] = step2[9]; step1[11] = step2[8]; step1[12] = step2[15];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
step2[56] = step1[56]; step2[57] = step1[57]; step2[62] = step1[62]; step2[63] = step1[63]; // stage 7 btf_16_lane_0_1_neon(step2[6], step2[5], c3, &step1[6], &step1[5]); btf_16_lane_2_3_neon(step2[29], step2[18], c3, &step1[29], &step1[18]); btf_16_lane_2_3_neon(step2[28], step2[19], c3, &step1[28], &step1[19]);
+ show +
3455
3456
3457
3458
btf_16_lane_3_2_neon(vnegq_s16(step2[20]), vnegq_s16(step2[27]), c3, &step1[20], &step1[27]); btf_16_lane_3_2_neon(vnegq_s16(step2[21]), vnegq_s16(step2[26]), c3, &step1[21], &step1[26]);
+ show +
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
step1[0] = step2[0]; step1[1] = step2[1]; step1[2] = step2[1]; step1[3] = step2[0]; step1[4] = step2[4]; step1[7] = step2[7]; step1[8] = vqaddq_s16(step2[8], step2[11]); step1[9] = vqaddq_s16(step2[9], step2[10]); step1[10] = vqsubq_s16(step2[9], step2[10]);

[CVE-2020-0470_1.diff] av1_inv_txfm_neon.c #54
- btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, - &step2[40], &step2[55]); - btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, - &step2[41], &step2[54]); - btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, - &step2[42], &step2[53]); - btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, - &step2[43], &step2[52]); + btf_16_lane_3_2_neon(step1[40], step1[55], c7, &step2[40], &step2[55]); + btf_16_lane_3_2_neon(step1[41], step1[54], c7, &step2[41], &step2[54]); + btf_16_lane_3_2_neon(step1[42], step1[53], c7, &step2[42], &step2[53]); + btf_16_lane_3_2_neon(step1[43], step1[52], c7, &step2[43], &step2[52]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
step1[63] = vqaddq_s16(step2[56], step2[63]); // stage 8 btf_16_lane_0_1_neon(step1[13], step1[10], c3, &step2[13], &step2[10]); btf_16_lane_0_1_neon(step1[12], step1[11], c3, &step2[12], &step2[11]); btf_16_lane_2_3_neon(step1[59], step1[36], c3, &step2[59], &step2[36]); btf_16_lane_2_3_neon(step1[58], step1[37], c3, &step2[58], &step2[37]); btf_16_lane_2_3_neon(step1[57], step1[38], c3, &step2[57], &step2[38]); btf_16_lane_2_3_neon(step1[56], step1[39], c3, &step2[56], &step2[39]);
+ show +
2587
2588
2589
2590
2591
2592
2593
2594
btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, &step2[40], &step2[55]); btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, &step2[41], &step2[54]); btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, &step2[42], &step2[53]); btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, &step2[43], &step2[52]);
+ show +
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
step2[0] = vqaddq_s16(step1[0], step1[7]); step2[1] = vqaddq_s16(step1[1], step1[6]); step2[2] = vqaddq_s16(step1[2], step1[5]); step2[3] = vqaddq_s16(step1[3], step1[4]); step2[4] = vqsubq_s16(step1[3], step1[4]); step2[5] = vqsubq_s16(step1[2], step1[5]); step2[6] = vqsubq_s16(step1[1], step1[6]); step2[7] = vqsubq_s16(step1[0], step1[7]); step2[8] = step1[8];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
step1[63] = vqaddq_s16(step2[56], step2[63]); // stage 8 btf_16_lane_0_1_neon(step1[13], step1[10], c3, &step2[13], &step2[10]); btf_16_lane_0_1_neon(step1[12], step1[11], c3, &step2[12], &step2[11]); btf_16_lane_2_3_neon(step1[59], step1[36], c3, &step2[59], &step2[36]); btf_16_lane_2_3_neon(step1[58], step1[37], c3, &step2[58], &step2[37]); btf_16_lane_2_3_neon(step1[57], step1[38], c3, &step2[57], &step2[38]); btf_16_lane_2_3_neon(step1[56], step1[39], c3, &step2[56], &step2[39]);
+ show +
3063
3064
3065
3066
3067
3068
3069
3070
btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, &step2[40], &step2[55]); btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, &step2[41], &step2[54]); btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, &step2[42], &step2[53]); btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, &step2[43], &step2[52]);
+ show +
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
step2[0] = step1[0]; step2[1] = step1[1]; step2[2] = step1[2]; step2[3] = step1[3]; step2[4] = step1[3]; step2[5] = step1[2]; step2[6] = step1[1]; step2[7] = step1[0]; step2[8] = step1[8];
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/av1_inv_txfm_neon.c
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
step1[63] = vqaddq_s16(step2[56], step2[63]); // stage 8 btf_16_lane_0_1_neon(step1[13], step1[10], c3, &step2[13], &step2[10]); btf_16_lane_0_1_neon(step1[12], step1[11], c3, &step2[12], &step2[11]); btf_16_lane_2_3_neon(step1[59], step1[36], c3, &step2[59], &step2[36]); btf_16_lane_2_3_neon(step1[58], step1[37], c3, &step2[58], &step2[37]); btf_16_lane_2_3_neon(step1[57], step1[38], c3, &step2[57], &step2[38]); btf_16_lane_2_3_neon(step1[56], step1[39], c3, &step2[56], &step2[39]);
+ show +
3523
3524
3525
3526
3527
3528
3529
3530
btf_16_lane_3_2_neon(vnegq_s16(step1[40]), vnegq_s16(step1[55]), c3, &step2[40], &step2[55]); btf_16_lane_3_2_neon(vnegq_s16(step1[41]), vnegq_s16(step1[54]), c3, &step2[41], &step2[54]); btf_16_lane_3_2_neon(vnegq_s16(step1[42]), vnegq_s16(step1[53]), c3, &step2[42], &step2[53]); btf_16_lane_3_2_neon(vnegq_s16(step1[43]), vnegq_s16(step1[52]), c3, &step2[43], &step2[52]);
+ show +
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
step2[0] = vqaddq_s16(step1[0], step1[7]); step2[1] = vqaddq_s16(step1[1], step1[6]); step2[2] = vqaddq_s16(step1[2], step1[5]); step2[3] = vqaddq_s16(step1[3], step1[4]); step2[4] = vqsubq_s16(step1[3], step1[4]); step2[5] = vqsubq_s16(step1[2], step1[5]); step2[6] = vqsubq_s16(step1[1], step1[6]); step2[7] = vqsubq_s16(step1[0], step1[7]); step2[8] = step1[8];

[CVE-2020-0478_1.diff] warp_plane_neon.c #2
- f0 = vld1q_s16( - (int16_t *)(warped_filter + ((sy + 0 * gamma) >> WARPEDDIFF_PREC_BITS))); - f1 = vld1q_s16( - (int16_t *)(warped_filter + ((sy + 1 * gamma) >> WARPEDDIFF_PREC_BITS))); - f2 = vld1q_s16( - (int16_t *)(warped_filter + ((sy + 2 * gamma) >> WARPEDDIFF_PREC_BITS))); - f3 = vld1q_s16( - (int16_t *)(warped_filter + ((sy + 3 * gamma) >> WARPEDDIFF_PREC_BITS))); - f4 = vld1q_s16( - (int16_t *)(warped_filter + ((sy + 4 * gamma) >> WARPEDDIFF_PREC_BITS))); - f5 = vld1q_s16( - (int16_t *)(warped_filter + ((sy + 5 * gamma) >> WARPEDDIFF_PREC_BITS))); - f6 = vld1q_s16( - (int16_t *)(warped_filter + ((sy + 6 * gamma) >> WARPEDDIFF_PREC_BITS))); - f7 = vld1q_s16( - (int16_t *)(warped_filter + ((sy + 7 * gamma) >> WARPEDDIFF_PREC_BITS))); + f0 = vld1q_s16((int16_t *)(av1_warped_filter + + ((sy + 0 * gamma) >> WARPEDDIFF_PREC_BITS))); + f1 = vld1q_s16((int16_t *)(av1_warped_filter + + ((sy + 1 * gamma) >> WARPEDDIFF_PREC_BITS))); + f2 = vld1q_s16((int16_t *)(av1_warped_filter + + ((sy + 2 * gamma) >> WARPEDDIFF_PREC_BITS))); + f3 = vld1q_s16((int16_t *)(av1_warped_filter + + ((sy + 3 * gamma) >> WARPEDDIFF_PREC_BITS))); + f4 = vld1q_s16((int16_t *)(av1_warped_filter + + ((sy + 4 * gamma) >> WARPEDDIFF_PREC_BITS))); + f5 = vld1q_s16((int16_t *)(av1_warped_filter + + ((sy + 5 * gamma) >> WARPEDDIFF_PREC_BITS))); + f6 = vld1q_s16((int16_t *)(av1_warped_filter + + ((sy + 6 * gamma) >> WARPEDDIFF_PREC_BITS))); + f7 = vld1q_s16((int16_t *)(av1_warped_filter + + ((sy + 7 * gamma) >> WARPEDDIFF_PREC_BITS)));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/warp_plane_neon.c
326
327
328
329
330
331
332
333
334
335
c0 = vtrnq_s32(vreinterpretq_s32_s16(b0.val[0]), vreinterpretq_s32_s16(b0.val[1])); c1 = vtrnq_s32(vreinterpretq_s32_s16(b1.val[0]), vreinterpretq_s32_s16(b1.val[1])); c2 = vtrnq_s32(vreinterpretq_s32_s16(b2.val[0]), vreinterpretq_s32_s16(b2.val[1])); c3 = vtrnq_s32(vreinterpretq_s32_s16(b3.val[0]), vreinterpretq_s32_s16(b3.val[1]));
+ show +
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
f0 = vld1q_s16( (int16_t *)(warped_filter + ((sy + 0 * gamma) >> WARPEDDIFF_PREC_BITS))); f1 = vld1q_s16( (int16_t *)(warped_filter + ((sy + 1 * gamma) >> WARPEDDIFF_PREC_BITS))); f2 = vld1q_s16( (int16_t *)(warped_filter + ((sy + 2 * gamma) >> WARPEDDIFF_PREC_BITS))); f3 = vld1q_s16( (int16_t *)(warped_filter + ((sy + 3 * gamma) >> WARPEDDIFF_PREC_BITS))); f4 = vld1q_s16( (int16_t *)(warped_filter + ((sy + 4 * gamma) >> WARPEDDIFF_PREC_BITS))); f5 = vld1q_s16( (int16_t *)(warped_filter + ((sy + 5 * gamma) >> WARPEDDIFF_PREC_BITS))); f6 = vld1q_s16( (int16_t *)(warped_filter + ((sy + 6 * gamma) >> WARPEDDIFF_PREC_BITS))); f7 = vld1q_s16( (int16_t *)(warped_filter + ((sy + 7 * gamma) >> WARPEDDIFF_PREC_BITS)));
+ show +
352
353
354
355
356
357
358
359
360
361
d0 = vtrnq_s32(vreinterpretq_s32_s16(f0), vreinterpretq_s32_s16(f2)); d1 = vtrnq_s32(vreinterpretq_s32_s16(f4), vreinterpretq_s32_s16(f6)); d2 = vtrnq_s32(vreinterpretq_s32_s16(f1), vreinterpretq_s32_s16(f3)); d3 = vtrnq_s32(vreinterpretq_s32_s16(f5), vreinterpretq_s32_s16(f7)); // row:0,1 even_col:0,2 src_0 = vget_low_s16(vreinterpretq_s16_s32(c0.val[0])); fltr_0 = vget_low_s16(vreinterpretq_s16_s32(d0.val[0])); res_0 = vmull_s16(src_0, fltr_0);

[CVE-2020-0470_1.diff] warp_plane_neon.c #2
- f0 = vld1q_s16( - (int16_t *)(warped_filter + ((sy + 0 * gamma) >> WARPEDDIFF_PREC_BITS))); - f1 = vld1q_s16( - (int16_t *)(warped_filter + ((sy + 1 * gamma) >> WARPEDDIFF_PREC_BITS))); - f2 = vld1q_s16( - (int16_t *)(warped_filter + ((sy + 2 * gamma) >> WARPEDDIFF_PREC_BITS))); - f3 = vld1q_s16( - (int16_t *)(warped_filter + ((sy + 3 * gamma) >> WARPEDDIFF_PREC_BITS))); - f4 = vld1q_s16( - (int16_t *)(warped_filter + ((sy + 4 * gamma) >> WARPEDDIFF_PREC_BITS))); - f5 = vld1q_s16( - (int16_t *)(warped_filter + ((sy + 5 * gamma) >> WARPEDDIFF_PREC_BITS))); - f6 = vld1q_s16( - (int16_t *)(warped_filter + ((sy + 6 * gamma) >> WARPEDDIFF_PREC_BITS))); - f7 = vld1q_s16( - (int16_t *)(warped_filter + ((sy + 7 * gamma) >> WARPEDDIFF_PREC_BITS))); + f0 = vld1q_s16((int16_t *)(av1_warped_filter + + ((sy + 0 * gamma) >> WARPEDDIFF_PREC_BITS))); + f1 = vld1q_s16((int16_t *)(av1_warped_filter + + ((sy + 1 * gamma) >> WARPEDDIFF_PREC_BITS))); + f2 = vld1q_s16((int16_t *)(av1_warped_filter + + ((sy + 2 * gamma) >> WARPEDDIFF_PREC_BITS))); + f3 = vld1q_s16((int16_t *)(av1_warped_filter + + ((sy + 3 * gamma) >> WARPEDDIFF_PREC_BITS))); + f4 = vld1q_s16((int16_t *)(av1_warped_filter + + ((sy + 4 * gamma) >> WARPEDDIFF_PREC_BITS))); + f5 = vld1q_s16((int16_t *)(av1_warped_filter + + ((sy + 5 * gamma) >> WARPEDDIFF_PREC_BITS))); + f6 = vld1q_s16((int16_t *)(av1_warped_filter + + ((sy + 6 * gamma) >> WARPEDDIFF_PREC_BITS))); + f7 = vld1q_s16((int16_t *)(av1_warped_filter + + ((sy + 7 * gamma) >> WARPEDDIFF_PREC_BITS)));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/warp_plane_neon.c
326
327
328
329
330
331
332
333
334
335
c0 = vtrnq_s32(vreinterpretq_s32_s16(b0.val[0]), vreinterpretq_s32_s16(b0.val[1])); c1 = vtrnq_s32(vreinterpretq_s32_s16(b1.val[0]), vreinterpretq_s32_s16(b1.val[1])); c2 = vtrnq_s32(vreinterpretq_s32_s16(b2.val[0]), vreinterpretq_s32_s16(b2.val[1])); c3 = vtrnq_s32(vreinterpretq_s32_s16(b3.val[0]), vreinterpretq_s32_s16(b3.val[1]));
+ show +
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
f0 = vld1q_s16( (int16_t *)(warped_filter + ((sy + 0 * gamma) >> WARPEDDIFF_PREC_BITS))); f1 = vld1q_s16( (int16_t *)(warped_filter + ((sy + 1 * gamma) >> WARPEDDIFF_PREC_BITS))); f2 = vld1q_s16( (int16_t *)(warped_filter + ((sy + 2 * gamma) >> WARPEDDIFF_PREC_BITS))); f3 = vld1q_s16( (int16_t *)(warped_filter + ((sy + 3 * gamma) >> WARPEDDIFF_PREC_BITS))); f4 = vld1q_s16( (int16_t *)(warped_filter + ((sy + 4 * gamma) >> WARPEDDIFF_PREC_BITS))); f5 = vld1q_s16( (int16_t *)(warped_filter + ((sy + 5 * gamma) >> WARPEDDIFF_PREC_BITS))); f6 = vld1q_s16( (int16_t *)(warped_filter + ((sy + 6 * gamma) >> WARPEDDIFF_PREC_BITS))); f7 = vld1q_s16( (int16_t *)(warped_filter + ((sy + 7 * gamma) >> WARPEDDIFF_PREC_BITS)));
+ show +
352
353
354
355
356
357
358
359
360
361
d0 = vtrnq_s32(vreinterpretq_s32_s16(f0), vreinterpretq_s32_s16(f2)); d1 = vtrnq_s32(vreinterpretq_s32_s16(f4), vreinterpretq_s32_s16(f6)); d2 = vtrnq_s32(vreinterpretq_s32_s16(f1), vreinterpretq_s32_s16(f3)); d3 = vtrnq_s32(vreinterpretq_s32_s16(f5), vreinterpretq_s32_s16(f7)); // row:0,1 even_col:0,2 src_0 = vget_low_s16(vreinterpretq_s16_s32(c0.val[0])); fltr_0 = vget_low_s16(vreinterpretq_s16_s32(d0.val[0])); res_0 = vmull_s16(src_0, fltr_0);

[CVE-2020-0478_1.diff] selfguided_neon.c #15
- if (8 == bit_depth) { - calc_ab_fast_internal_lbd( - (square_sum_buf - buf_stride - 1), (tmp16_buf - buf_stride - 1), - (sum_buf - buf_stride - 1), buf_stride * 2, width + 2, height + 2, r, - params->s[radius_idx], 2); - } else { +#if CONFIG_AV1_HIGHBITDEPTH + if (bit_depth > 8) { + } else { + calc_ab_fast_internal_lbd( + (square_sum_buf - buf_stride - 1), (tmp16_buf - buf_stride - 1), + (sum_buf - buf_stride - 1), buf_stride * 2, width + 2, height + 2, r, + params->s[radius_idx], 2); +#else + (void)bit_depth; + calc_ab_fast_internal_lbd((square_sum_buf - buf_stride - 1), + (tmp16_buf - buf_stride - 1), + (sum_buf - buf_stride - 1), buf_stride * 2, + width + 2, height + 2, r, params->s[radius_idx], 2); +#endif
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/selfguided_neon.c
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
dgd_stride, (int16_t *)tmp16_buf, sum_buf, square_sum_buf, buf_stride, width_ext, height_ext); square_sum_buf += SGRPROJ_BORDER_VERT * buf_stride + SGRPROJ_BORDER_HORZ; sum_buf += SGRPROJ_BORDER_VERT * buf_stride + SGRPROJ_BORDER_HORZ; tmp16_buf += SGRPROJ_BORDER_VERT * buf_stride + SGRPROJ_BORDER_HORZ; // Calculation of a, b. a output is in 16bit tmp_buf which is in range of // [1, 256] for all bit depths. b output is kept in 32bit buffer.
+ show +
1184
1185
1186
1187
1188
1189
if (8 == bit_depth) { calc_ab_fast_internal_lbd( (square_sum_buf - buf_stride - 1), (tmp16_buf - buf_stride - 1), (sum_buf - buf_stride - 1), buf_stride * 2, width + 2, height + 2, r, params->s[radius_idx], 2); } else {
+ show +
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
calc_ab_fast_internal_hbd( (square_sum_buf - buf_stride - 1), (tmp16_buf - buf_stride - 1), (sum_buf - buf_stride - 1), buf_stride * 2, width + 2, height + 2, bit_depth, r, params->s[radius_idx], 2); } final_filter_fast_internal(tmp16_buf, sum_buf, buf_stride, (int16_t *)dgd16, dgd_stride, dst, dst_stride, width, height); } static INLINE void restoration_internal(uint16_t *dgd16, int width, int height,

[CVE-2020-0478_1.diff] selfguided_neon.c #17
+#if CONFIG_AV1_HIGHBITDEPTH - if (8 == bit_depth) { - calc_ab_internal_lbd((square_sum_buf - buf_stride - 1), - (A16 - buf_stride - 1), (sum_buf - buf_stride - 1), - (B - buf_stride - 1), buf_stride, width + 2, - height + 2, r, params->s[radius_idx], 1); - } else { + if (bit_depth > 8) { + } else { + calc_ab_internal_lbd((square_sum_buf - buf_stride - 1), + (A16 - buf_stride - 1), (sum_buf - buf_stride - 1), + (B - buf_stride - 1), buf_stride, width + 2, + height + 2, r, params->s[radius_idx], 1); +#else + (void)bit_depth; + calc_ab_internal_lbd((square_sum_buf - buf_stride - 1), + (A16 - buf_stride - 1), (sum_buf - buf_stride - 1), + (B - buf_stride - 1), buf_stride, width + 2, height + 2, + r, params->s[radius_idx], 1); +#endif
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/selfguided_neon.c
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
dgd_stride, sum_buf, square_sum_buf, buf_stride, width_ext, height_ext); square_sum_buf += SGRPROJ_BORDER_VERT * buf_stride + SGRPROJ_BORDER_HORZ; B += SGRPROJ_BORDER_VERT * buf_stride + SGRPROJ_BORDER_HORZ; A16 += SGRPROJ_BORDER_VERT * buf_stride + SGRPROJ_BORDER_HORZ; sum_buf += SGRPROJ_BORDER_VERT * buf_stride + SGRPROJ_BORDER_HORZ; // Calculation of a, b. a output is in 16bit tmp_buf which is in range of // [1, 256] for all bit depths. b output is kept in 32bit buffer.
+ show +
1240
1241
1242
1243
1244
1245
if (8 == bit_depth) { calc_ab_internal_lbd((square_sum_buf - buf_stride - 1), (A16 - buf_stride - 1), (sum_buf - buf_stride - 1), (B - buf_stride - 1), buf_stride, width + 2, height + 2, r, params->s[radius_idx], 1); } else {
+ show +
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
calc_ab_internal_hbd((square_sum_buf - buf_stride - 1), (A16 - buf_stride - 1), (sum_buf - buf_stride - 1), (B - buf_stride - 1), buf_stride, width + 2, height + 2, bit_depth, r, params->s[radius_idx], 1); } final_filter_internal(A16, B, buf_stride, (int16_t *)dgd16, dgd_stride, dst, dst_stride, width, height); } static INLINE void src_convert_u8_to_u16(const uint8_t *src,

[CVE-2020-0478_1.diff] selfguided_neon.c #22
+#if CONFIG_AV1_HIGHBITDEPTH +#else + (void)highbd; + src_convert_u8_to_u16( + dat8 - SGRPROJ_BORDER_VERT * dgd_stride - SGRPROJ_BORDER_HORZ, dgd_stride, + dgd16 - SGRPROJ_BORDER_VERT * dgd16_stride - SGRPROJ_BORDER_HORZ, + dgd16_stride, width_ext, height_ext); +#endif -void apply_selfguided_restoration_neon(const uint8_t *dat8, int width, - int height, int stride, int eps, - const int *xqd, uint8_t *dst8, - int dst_stride, int32_t *tmpbuf, - int bit_depth, int highbd) { +void av1_apply_selfguided_restoration_neon(const uint8_t *dat8, int width, + int height, int stride, int eps, + const int *xqd, uint8_t *dst8, + int dst_stride, int32_t *tmpbuf, + int bit_depth, int highbd) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/selfguided_neon.c
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
if (params->r[0] > 0) restoration_fast_internal(dgd16, width, height, dgd16_stride, flt0, flt_stride, bit_depth, sgr_params_idx, 0); if (params->r[1] > 0) restoration_internal(dgd16, width, height, dgd16_stride, flt1, flt_stride, bit_depth, sgr_params_idx, 1); return 0; }
+ show +
1383
1384
1385
1386
1387
void apply_selfguided_restoration_neon(const uint8_t *dat8, int width, int height, int stride, int eps, const int *xqd, uint8_t *dst8, int dst_stride, int32_t *tmpbuf, int bit_depth, int highbd) {
+ show +
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
int32_t *flt0 = tmpbuf; int32_t *flt1 = flt0 + RESTORATION_UNITPELS_MAX; assert(width * height <= RESTORATION_UNITPELS_MAX); uint16_t dgd16_[RESTORATION_PROC_UNIT_PELS]; const int dgd16_stride = width + 2 * SGRPROJ_BORDER_HORZ; uint16_t *dgd16 = dgd16_ + dgd16_stride * SGRPROJ_BORDER_VERT + SGRPROJ_BORDER_HORZ; const int width_ext = width + 2 * SGRPROJ_BORDER_HORZ; const int height_ext = height + 2 * SGRPROJ_BORDER_VERT; const int dgd_stride = stride;

[CVE-2020-0470_1.diff] selfguided_neon.c #15
- if (8 == bit_depth) { - calc_ab_fast_internal_lbd( - (square_sum_buf - buf_stride - 1), (tmp16_buf - buf_stride - 1), - (sum_buf - buf_stride - 1), buf_stride * 2, width + 2, height + 2, r, - params->s[radius_idx], 2); - } else { +#if CONFIG_AV1_HIGHBITDEPTH + if (bit_depth > 8) { + } else { + calc_ab_fast_internal_lbd( + (square_sum_buf - buf_stride - 1), (tmp16_buf - buf_stride - 1), + (sum_buf - buf_stride - 1), buf_stride * 2, width + 2, height + 2, r, + params->s[radius_idx], 2); +#else + (void)bit_depth; + calc_ab_fast_internal_lbd((square_sum_buf - buf_stride - 1), + (tmp16_buf - buf_stride - 1), + (sum_buf - buf_stride - 1), buf_stride * 2, + width + 2, height + 2, r, params->s[radius_idx], 2); +#endif
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/selfguided_neon.c
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
dgd_stride, (int16_t *)tmp16_buf, sum_buf, square_sum_buf, buf_stride, width_ext, height_ext); square_sum_buf += SGRPROJ_BORDER_VERT * buf_stride + SGRPROJ_BORDER_HORZ; sum_buf += SGRPROJ_BORDER_VERT * buf_stride + SGRPROJ_BORDER_HORZ; tmp16_buf += SGRPROJ_BORDER_VERT * buf_stride + SGRPROJ_BORDER_HORZ; // Calculation of a, b. a output is in 16bit tmp_buf which is in range of // [1, 256] for all bit depths. b output is kept in 32bit buffer.
+ show +
1184
1185
1186
1187
1188
1189
if (8 == bit_depth) { calc_ab_fast_internal_lbd( (square_sum_buf - buf_stride - 1), (tmp16_buf - buf_stride - 1), (sum_buf - buf_stride - 1), buf_stride * 2, width + 2, height + 2, r, params->s[radius_idx], 2); } else {
+ show +
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
calc_ab_fast_internal_hbd( (square_sum_buf - buf_stride - 1), (tmp16_buf - buf_stride - 1), (sum_buf - buf_stride - 1), buf_stride * 2, width + 2, height + 2, bit_depth, r, params->s[radius_idx], 2); } final_filter_fast_internal(tmp16_buf, sum_buf, buf_stride, (int16_t *)dgd16, dgd_stride, dst, dst_stride, width, height); } static INLINE void restoration_internal(uint16_t *dgd16, int width, int height,

[CVE-2020-0470_1.diff] selfguided_neon.c #17
+#if CONFIG_AV1_HIGHBITDEPTH - if (8 == bit_depth) { - calc_ab_internal_lbd((square_sum_buf - buf_stride - 1), - (A16 - buf_stride - 1), (sum_buf - buf_stride - 1), - (B - buf_stride - 1), buf_stride, width + 2, - height + 2, r, params->s[radius_idx], 1); - } else { + if (bit_depth > 8) { + } else { + calc_ab_internal_lbd((square_sum_buf - buf_stride - 1), + (A16 - buf_stride - 1), (sum_buf - buf_stride - 1), + (B - buf_stride - 1), buf_stride, width + 2, + height + 2, r, params->s[radius_idx], 1); +#else + (void)bit_depth; + calc_ab_internal_lbd((square_sum_buf - buf_stride - 1), + (A16 - buf_stride - 1), (sum_buf - buf_stride - 1), + (B - buf_stride - 1), buf_stride, width + 2, height + 2, + r, params->s[radius_idx], 1); +#endif
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/selfguided_neon.c
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
dgd_stride, sum_buf, square_sum_buf, buf_stride, width_ext, height_ext); square_sum_buf += SGRPROJ_BORDER_VERT * buf_stride + SGRPROJ_BORDER_HORZ; B += SGRPROJ_BORDER_VERT * buf_stride + SGRPROJ_BORDER_HORZ; A16 += SGRPROJ_BORDER_VERT * buf_stride + SGRPROJ_BORDER_HORZ; sum_buf += SGRPROJ_BORDER_VERT * buf_stride + SGRPROJ_BORDER_HORZ; // Calculation of a, b. a output is in 16bit tmp_buf which is in range of // [1, 256] for all bit depths. b output is kept in 32bit buffer.
+ show +
1240
1241
1242
1243
1244
1245
if (8 == bit_depth) { calc_ab_internal_lbd((square_sum_buf - buf_stride - 1), (A16 - buf_stride - 1), (sum_buf - buf_stride - 1), (B - buf_stride - 1), buf_stride, width + 2, height + 2, r, params->s[radius_idx], 1); } else {
+ show +
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
calc_ab_internal_hbd((square_sum_buf - buf_stride - 1), (A16 - buf_stride - 1), (sum_buf - buf_stride - 1), (B - buf_stride - 1), buf_stride, width + 2, height + 2, bit_depth, r, params->s[radius_idx], 1); } final_filter_internal(A16, B, buf_stride, (int16_t *)dgd16, dgd_stride, dst, dst_stride, width, height); } static INLINE void src_convert_u8_to_u16(const uint8_t *src,

[CVE-2020-0470_1.diff] selfguided_neon.c #22
+#if CONFIG_AV1_HIGHBITDEPTH +#else + (void)highbd; + src_convert_u8_to_u16( + dat8 - SGRPROJ_BORDER_VERT * dgd_stride - SGRPROJ_BORDER_HORZ, dgd_stride, + dgd16 - SGRPROJ_BORDER_VERT * dgd16_stride - SGRPROJ_BORDER_HORZ, + dgd16_stride, width_ext, height_ext); +#endif -void apply_selfguided_restoration_neon(const uint8_t *dat8, int width, - int height, int stride, int eps, - const int *xqd, uint8_t *dst8, - int dst_stride, int32_t *tmpbuf, - int bit_depth, int highbd) { +void av1_apply_selfguided_restoration_neon(const uint8_t *dat8, int width, + int height, int stride, int eps, + const int *xqd, uint8_t *dst8, + int dst_stride, int32_t *tmpbuf, + int bit_depth, int highbd) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/arm/selfguided_neon.c
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
if (params->r[0] > 0) restoration_fast_internal(dgd16, width, height, dgd16_stride, flt0, flt_stride, bit_depth, sgr_params_idx, 0); if (params->r[1] > 0) restoration_internal(dgd16, width, height, dgd16_stride, flt1, flt_stride, bit_depth, sgr_params_idx, 1); return 0; }
+ show +
1383
1384
1385
1386
1387
void apply_selfguided_restoration_neon(const uint8_t *dat8, int width, int height, int stride, int eps, const int *xqd, uint8_t *dst8, int dst_stride, int32_t *tmpbuf, int bit_depth, int highbd) {
+ show +
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
int32_t *flt0 = tmpbuf; int32_t *flt1 = flt0 + RESTORATION_UNITPELS_MAX; assert(width * height <= RESTORATION_UNITPELS_MAX); uint16_t dgd16_[RESTORATION_PROC_UNIT_PELS]; const int dgd16_stride = width + 2 * SGRPROJ_BORDER_HORZ; uint16_t *dgd16 = dgd16_ + dgd16_stride * SGRPROJ_BORDER_VERT + SGRPROJ_BORDER_HORZ; const int width_ext = width + 2 * SGRPROJ_BORDER_HORZ; const int height_ext = height + 2 * SGRPROJ_BORDER_VERT; const int dgd_stride = stride;

[CVE-2020-0478_1.diff] cfl_avx2.c #1
-#define CFL_GET_SUBSAMPLE_FUNCTION_AVX2(sub, bd) \ - CFL_SUBSAMPLE(avx2, sub, bd, 32, 32) \ - CFL_SUBSAMPLE(avx2, sub, bd, 32, 16) \ - CFL_SUBSAMPLE(avx2, sub, bd, 32, 8) \ - cfl_subsample_##bd##_fn cfl_get_luma_subsampling_##sub##_##bd##_avx2( \ - TX_SIZE tx_size) { \ - static const cfl_subsample_##bd##_fn subfn_##sub[TX_SIZES_ALL] = { \ - subsample_##bd##_##sub##_4x4_ssse3, /* 4x4 */ \ - subsample_##bd##_##sub##_8x8_ssse3, /* 8x8 */ \ - subsample_##bd##_##sub##_16x16_ssse3, /* 16x16 */ \ - subsample_##bd##_##sub##_32x32_avx2, /* 32x32 */ \ - NULL, /* 64x64 (invalid CFL size) */ \ - subsample_##bd##_##sub##_4x8_ssse3, /* 4x8 */ \ - subsample_##bd##_##sub##_8x4_ssse3, /* 8x4 */ \ - subsample_##bd##_##sub##_8x16_ssse3, /* 8x16 */ \ - subsample_##bd##_##sub##_16x8_ssse3, /* 16x8 */ \ - subsample_##bd##_##sub##_16x32_ssse3, /* 16x32 */ \ - subsample_##bd##_##sub##_32x16_avx2, /* 32x16 */ \ - NULL, /* 32x64 (invalid CFL size) */ \ - NULL, /* 64x32 (invalid CFL size) */ \ - subsample_##bd##_##sub##_4x16_ssse3, /* 4x16 */ \ - subsample_##bd##_##sub##_16x4_ssse3, /* 16x4 */ \ - subsample_##bd##_##sub##_8x32_ssse3, /* 8x32 */ \ - subsample_##bd##_##sub##_32x8_avx2, /* 32x8 */ \ - NULL, /* 16x64 (invalid CFL size) */ \ - NULL, /* 64x16 (invalid CFL size) */ \ - }; \ - return subfn_##sub[tx_size]; \ +#define CFL_GET_SUBSAMPLE_FUNCTION_AVX2(sub, bd) \ + CFL_SUBSAMPLE(avx2, sub, bd, 32, 32) \ + CFL_SUBSAMPLE(avx2, sub, bd, 32, 16) \ + CFL_SUBSAMPLE(avx2, sub, bd, 32, 8) \ + cfl_subsample_##bd##_fn cfl_get_luma_subsampling_##sub##_##bd##_avx2( \ + TX_SIZE tx_size) { \ + static const cfl_subsample_##bd##_fn subfn_##sub[TX_SIZES_ALL] = { \ + cfl_subsample_##bd##_##sub##_4x4_ssse3, /* 4x4 */ \ + cfl_subsample_##bd##_##sub##_8x8_ssse3, /* 8x8 */ \ + cfl_subsample_##bd##_##sub##_16x16_ssse3, /* 16x16 */ \ + cfl_subsample_##bd##_##sub##_32x32_avx2, /* 32x32 */ \ + NULL, /* 64x64 (invalid CFL size) */ \ + cfl_subsample_##bd##_##sub##_4x8_ssse3, /* 4x8 */ \ + cfl_subsample_##bd##_##sub##_8x4_ssse3, /* 8x4 */ \ + cfl_subsample_##bd##_##sub##_8x16_ssse3, /* 8x16 */ \ + cfl_subsample_##bd##_##sub##_16x8_ssse3, /* 16x8 */ \ + cfl_subsample_##bd##_##sub##_16x32_ssse3, /* 16x32 */ \ + cfl_subsample_##bd##_##sub##_32x16_avx2, /* 32x16 */ \ + NULL, /* 32x64 (invalid CFL size) */ \ + NULL, /* 64x32 (invalid CFL size) */ \ + cfl_subsample_##bd##_##sub##_4x16_ssse3, /* 4x16 */ \ + cfl_subsample_##bd##_##sub##_16x4_ssse3, /* 16x4 */ \ + cfl_subsample_##bd##_##sub##_8x32_ssse3, /* 8x32 */ \ + cfl_subsample_##bd##_##sub##_32x8_avx2, /* 32x8 */ \ + NULL, /* 16x64 (invalid CFL size) */ \ + NULL, /* 64x16 (invalid CFL size) */ \ + }; \ + return subfn_##sub[tx_size]; \
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/cfl_avx2.c
9
10
11
12
13
14
15
16
17
18
* PATENTS file, you can obtain it at www.aomedia.org/license/patent. */ #include <immintrin.h> #include "config/av1_rtcd.h" #include "av1/common/cfl.h" #include "av1/common/x86/cfl_simd.h"
+ show +
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#define CFL_GET_SUBSAMPLE_FUNCTION_AVX2(sub, bd) \ CFL_SUBSAMPLE(avx2, sub, bd, 32, 32) \ CFL_SUBSAMPLE(avx2, sub, bd, 32, 16) \ CFL_SUBSAMPLE(avx2, sub, bd, 32, 8) \ cfl_subsample_##bd##_fn cfl_get_luma_subsampling_##sub##_##bd##_avx2( \ TX_SIZE tx_size) { \ static const cfl_subsample_##bd##_fn subfn_##sub[TX_SIZES_ALL] = { \ subsample_##bd##_##sub##_4x4_ssse3, /* 4x4 */ \ subsample_##bd##_##sub##_8x8_ssse3, /* 8x8 */ \ subsample_##bd##_##sub##_16x16_ssse3, /* 16x16 */ \ subsample_##bd##_##sub##_32x32_avx2, /* 32x32 */ \ NULL, /* 64x64 (invalid CFL size) */ \ subsample_##bd##_##sub##_4x8_ssse3, /* 4x8 */ \ subsample_##bd##_##sub##_8x4_ssse3, /* 8x4 */ \ subsample_##bd##_##sub##_8x16_ssse3, /* 8x16 */ \ subsample_##bd##_##sub##_16x8_ssse3, /* 16x8 */ \ subsample_##bd##_##sub##_16x32_ssse3, /* 16x32 */ \ subsample_##bd##_##sub##_32x16_avx2, /* 32x16 */ \ NULL, /* 32x64 (invalid CFL size) */ \ NULL, /* 64x32 (invalid CFL size) */ \ subsample_##bd##_##sub##_4x16_ssse3, /* 4x16 */ \ subsample_##bd##_##sub##_16x4_ssse3, /* 16x4 */ \ subsample_##bd##_##sub##_8x32_ssse3, /* 8x32 */ \ subsample_##bd##_##sub##_32x8_avx2, /* 32x8 */ \ NULL, /* 16x64 (invalid CFL size) */ \ NULL, /* 64x16 (invalid CFL size) */ \ }; \ return subfn_##sub[tx_size]; \
+ show +
47
48
49
50
51
52
53
54
55
56
} /** * Adds 4 pixels (in a 2x2 grid) and multiplies them by 2. Resulting in a more * precise version of a box filter 4:2:0 pixel subsampling in Q3. * * The CfL prediction buffer is always of size CFL_BUF_SQUARE. However, the * active area is specified using width and height. * * Note: We don't need to worry about going over the active area, as long as we

[CVE-2020-0470_1.diff] cfl_avx2.c #1
-#define CFL_GET_SUBSAMPLE_FUNCTION_AVX2(sub, bd) \ - CFL_SUBSAMPLE(avx2, sub, bd, 32, 32) \ - CFL_SUBSAMPLE(avx2, sub, bd, 32, 16) \ - CFL_SUBSAMPLE(avx2, sub, bd, 32, 8) \ - cfl_subsample_##bd##_fn cfl_get_luma_subsampling_##sub##_##bd##_avx2( \ - TX_SIZE tx_size) { \ - static const cfl_subsample_##bd##_fn subfn_##sub[TX_SIZES_ALL] = { \ - subsample_##bd##_##sub##_4x4_ssse3, /* 4x4 */ \ - subsample_##bd##_##sub##_8x8_ssse3, /* 8x8 */ \ - subsample_##bd##_##sub##_16x16_ssse3, /* 16x16 */ \ - subsample_##bd##_##sub##_32x32_avx2, /* 32x32 */ \ - NULL, /* 64x64 (invalid CFL size) */ \ - subsample_##bd##_##sub##_4x8_ssse3, /* 4x8 */ \ - subsample_##bd##_##sub##_8x4_ssse3, /* 8x4 */ \ - subsample_##bd##_##sub##_8x16_ssse3, /* 8x16 */ \ - subsample_##bd##_##sub##_16x8_ssse3, /* 16x8 */ \ - subsample_##bd##_##sub##_16x32_ssse3, /* 16x32 */ \ - subsample_##bd##_##sub##_32x16_avx2, /* 32x16 */ \ - NULL, /* 32x64 (invalid CFL size) */ \ - NULL, /* 64x32 (invalid CFL size) */ \ - subsample_##bd##_##sub##_4x16_ssse3, /* 4x16 */ \ - subsample_##bd##_##sub##_16x4_ssse3, /* 16x4 */ \ - subsample_##bd##_##sub##_8x32_ssse3, /* 8x32 */ \ - subsample_##bd##_##sub##_32x8_avx2, /* 32x8 */ \ - NULL, /* 16x64 (invalid CFL size) */ \ - NULL, /* 64x16 (invalid CFL size) */ \ - }; \ - return subfn_##sub[tx_size]; \ +#define CFL_GET_SUBSAMPLE_FUNCTION_AVX2(sub, bd) \ + CFL_SUBSAMPLE(avx2, sub, bd, 32, 32) \ + CFL_SUBSAMPLE(avx2, sub, bd, 32, 16) \ + CFL_SUBSAMPLE(avx2, sub, bd, 32, 8) \ + cfl_subsample_##bd##_fn cfl_get_luma_subsampling_##sub##_##bd##_avx2( \ + TX_SIZE tx_size) { \ + static const cfl_subsample_##bd##_fn subfn_##sub[TX_SIZES_ALL] = { \ + cfl_subsample_##bd##_##sub##_4x4_ssse3, /* 4x4 */ \ + cfl_subsample_##bd##_##sub##_8x8_ssse3, /* 8x8 */ \ + cfl_subsample_##bd##_##sub##_16x16_ssse3, /* 16x16 */ \ + cfl_subsample_##bd##_##sub##_32x32_avx2, /* 32x32 */ \ + NULL, /* 64x64 (invalid CFL size) */ \ + cfl_subsample_##bd##_##sub##_4x8_ssse3, /* 4x8 */ \ + cfl_subsample_##bd##_##sub##_8x4_ssse3, /* 8x4 */ \ + cfl_subsample_##bd##_##sub##_8x16_ssse3, /* 8x16 */ \ + cfl_subsample_##bd##_##sub##_16x8_ssse3, /* 16x8 */ \ + cfl_subsample_##bd##_##sub##_16x32_ssse3, /* 16x32 */ \ + cfl_subsample_##bd##_##sub##_32x16_avx2, /* 32x16 */ \ + NULL, /* 32x64 (invalid CFL size) */ \ + NULL, /* 64x32 (invalid CFL size) */ \ + cfl_subsample_##bd##_##sub##_4x16_ssse3, /* 4x16 */ \ + cfl_subsample_##bd##_##sub##_16x4_ssse3, /* 16x4 */ \ + cfl_subsample_##bd##_##sub##_8x32_ssse3, /* 8x32 */ \ + cfl_subsample_##bd##_##sub##_32x8_avx2, /* 32x8 */ \ + NULL, /* 16x64 (invalid CFL size) */ \ + NULL, /* 64x16 (invalid CFL size) */ \ + }; \ + return subfn_##sub[tx_size]; \
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/cfl_avx2.c
9
10
11
12
13
14
15
16
17
18
* PATENTS file, you can obtain it at www.aomedia.org/license/patent. */ #include <immintrin.h> #include "config/av1_rtcd.h" #include "av1/common/cfl.h" #include "av1/common/x86/cfl_simd.h"
+ show +
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#define CFL_GET_SUBSAMPLE_FUNCTION_AVX2(sub, bd) \ CFL_SUBSAMPLE(avx2, sub, bd, 32, 32) \ CFL_SUBSAMPLE(avx2, sub, bd, 32, 16) \ CFL_SUBSAMPLE(avx2, sub, bd, 32, 8) \ cfl_subsample_##bd##_fn cfl_get_luma_subsampling_##sub##_##bd##_avx2( \ TX_SIZE tx_size) { \ static const cfl_subsample_##bd##_fn subfn_##sub[TX_SIZES_ALL] = { \ subsample_##bd##_##sub##_4x4_ssse3, /* 4x4 */ \ subsample_##bd##_##sub##_8x8_ssse3, /* 8x8 */ \ subsample_##bd##_##sub##_16x16_ssse3, /* 16x16 */ \ subsample_##bd##_##sub##_32x32_avx2, /* 32x32 */ \ NULL, /* 64x64 (invalid CFL size) */ \ subsample_##bd##_##sub##_4x8_ssse3, /* 4x8 */ \ subsample_##bd##_##sub##_8x4_ssse3, /* 8x4 */ \ subsample_##bd##_##sub##_8x16_ssse3, /* 8x16 */ \ subsample_##bd##_##sub##_16x8_ssse3, /* 16x8 */ \ subsample_##bd##_##sub##_16x32_ssse3, /* 16x32 */ \ subsample_##bd##_##sub##_32x16_avx2, /* 32x16 */ \ NULL, /* 32x64 (invalid CFL size) */ \ NULL, /* 64x32 (invalid CFL size) */ \ subsample_##bd##_##sub##_4x16_ssse3, /* 4x16 */ \ subsample_##bd##_##sub##_16x4_ssse3, /* 16x4 */ \ subsample_##bd##_##sub##_8x32_ssse3, /* 8x32 */ \ subsample_##bd##_##sub##_32x8_avx2, /* 32x8 */ \ NULL, /* 16x64 (invalid CFL size) */ \ NULL, /* 64x16 (invalid CFL size) */ \ }; \ return subfn_##sub[tx_size]; \
+ show +
47
48
49
50
51
52
53
54
55
56
} /** * Adds 4 pixels (in a 2x2 grid) and multiplies them by 2. Resulting in a more * precise version of a box filter 4:2:0 pixel subsampling in Q3. * * The CfL prediction buffer is always of size CFL_BUF_SQUARE. However, the * active area is specified using width and height. * * Note: We don't need to worry about going over the active area, as long as we

[CVE-2020-0478_1.diff] av1_inv_txfm_ssse3.c #30
- { idct4_new_sse2, iadst4_new_sse2, iidentity4_new_ssse3 }, - { idct8_new_sse2, iadst8_new_sse2, iidentity8_new_sse2 }, - { idct16_new_sse2, iadst16_new_sse2, iidentity16_new_ssse3 }, - { idct32_new_sse2, NULL, NULL }, - { idct64_low32_new_ssse3, NULL, NULL }, + { idct4_sse2, iadst4_sse2, iidentity4_ssse3 }, + { idct8_sse2, iadst8_sse2, iidentity8_sse2 }, + { idct16_sse2, iadst16_sse2, iidentity16_ssse3 }, + { idct32_sse2, NULL, NULL }, + { idct64_low32_ssse3, NULL, NULL },
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/av1_inv_txfm_ssse3.c
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
for (int i = 0; i < height; ++i, j += step) { const __m128i v = _mm_loadl_epi64((__m128i const *)(output + i * stride)); const __m128i u = lowbd_get_recon_8x8_sse2(v, in[j]); _mm_storel_epi64((__m128i *)(output + i * stride), u); } } // 1D functions process process 8 pixels at one time. static const transform_1d_ssse3 lowbd_txfm_all_1d_w8_arr[TX_SIZES][ITX_TYPES_1D] = {
+ show +
2303
2304
2305
2306
2307
{ idct4_new_sse2, iadst4_new_sse2, iidentity4_new_ssse3 }, { idct8_new_sse2, iadst8_new_sse2, iidentity8_new_sse2 }, { idct16_new_sse2, iadst16_new_sse2, iidentity16_new_ssse3 }, { idct32_new_sse2, NULL, NULL }, { idct64_low32_new_ssse3, NULL, NULL },
+ show +
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
}; // functions for blocks with eob at DC and within // topleft 8x8, 16x16, 32x32 corner static const transform_1d_ssse3 lowbd_txfm_all_1d_zeros_w8_arr[TX_SIZES][ITX_TYPES_1D][4] = { { { idct4_new_sse2, idct4_new_sse2, NULL, NULL }, { iadst4_new_sse2, iadst4_new_sse2, NULL, NULL }, { iidentity4_new_ssse3, iidentity4_new_ssse3, NULL, NULL },

[CVE-2020-0470_1.diff] av1_inv_txfm_ssse3.c #30
- { idct4_new_sse2, iadst4_new_sse2, iidentity4_new_ssse3 }, - { idct8_new_sse2, iadst8_new_sse2, iidentity8_new_sse2 }, - { idct16_new_sse2, iadst16_new_sse2, iidentity16_new_ssse3 }, - { idct32_new_sse2, NULL, NULL }, - { idct64_low32_new_ssse3, NULL, NULL }, + { idct4_sse2, iadst4_sse2, iidentity4_ssse3 }, + { idct8_sse2, iadst8_sse2, iidentity8_sse2 }, + { idct16_sse2, iadst16_sse2, iidentity16_ssse3 }, + { idct32_sse2, NULL, NULL }, + { idct64_low32_ssse3, NULL, NULL },
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/av1_inv_txfm_ssse3.c
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
for (int i = 0; i < height; ++i, j += step) { const __m128i v = _mm_loadl_epi64((__m128i const *)(output + i * stride)); const __m128i u = lowbd_get_recon_8x8_sse2(v, in[j]); _mm_storel_epi64((__m128i *)(output + i * stride), u); } } // 1D functions process process 8 pixels at one time. static const transform_1d_ssse3 lowbd_txfm_all_1d_w8_arr[TX_SIZES][ITX_TYPES_1D] = {
+ show +
2303
2304
2305
2306
2307
{ idct4_new_sse2, iadst4_new_sse2, iidentity4_new_ssse3 }, { idct8_new_sse2, iadst8_new_sse2, iidentity8_new_sse2 }, { idct16_new_sse2, iadst16_new_sse2, iidentity16_new_ssse3 }, { idct32_new_sse2, NULL, NULL }, { idct64_low32_new_ssse3, NULL, NULL },
+ show +
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
}; // functions for blocks with eob at DC and within // topleft 8x8, 16x16, 32x32 corner static const transform_1d_ssse3 lowbd_txfm_all_1d_zeros_w8_arr[TX_SIZES][ITX_TYPES_1D][4] = { { { idct4_new_sse2, idct4_new_sse2, NULL, NULL }, { iadst4_new_sse2, iadst4_new_sse2, NULL, NULL }, { iidentity4_new_ssse3, iidentity4_new_ssse3, NULL, NULL },

[CVE-2020-0478_1.diff] intra_edge_sse4.c #1
- DECLARE_ALIGNED(16, static const int8_t, v_const[2][16]) = { - { 0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6 }, - { 4, 5, 6, 7, 5, 6, 7, 8, 6, 7, 8, 9, 7, 8, 9, 10 } - }; + DECLARE_ALIGNED( + 16, static const int8_t, + v_const[2][16]) = { { 0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6 }, + { 4, 5, 6, 7, 5, 6, 7, 8, 6, 7, 8, 9, 7, 8, 9, 10 } };
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/intra_edge_sse4.c
205
206
207
208
209
210
211
212
213
214
} void av1_upsample_intra_edge_sse4_1(uint8_t *p, int sz) { // interpolate half-sample positions assert(sz <= 24); DECLARE_ALIGNED(16, static const int8_t, kernel[1][16]) = { { -1, 9, 9, -1, -1, 9, 9, -1, -1, 9, 9, -1, -1, 9, 9, -1 } };
+ show +
215
216
217
218
DECLARE_ALIGNED(16, static const int8_t, v_const[2][16]) = { { 0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6 }, { 4, 5, 6, 7, 5, 6, 7, 8, 6, 7, 8, 9, 7, 8, 9, 10 } };
+ show +
219
220
221
222
223
224
225
226
227
228
// Extend first/last samples (upper-left p[-1], last p[sz-1]) // to support 4-tap filter p[-2] = p[-1]; p[sz] = p[sz - 1]; uint8_t *in = &p[-2]; uint8_t *out = &p[-2]; int n = sz + 1; // Input length including upper-left sample

[CVE-2020-0470_1.diff] intra_edge_sse4.c #1
- DECLARE_ALIGNED(16, static const int8_t, v_const[2][16]) = { - { 0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6 }, - { 4, 5, 6, 7, 5, 6, 7, 8, 6, 7, 8, 9, 7, 8, 9, 10 } - }; + DECLARE_ALIGNED( + 16, static const int8_t, + v_const[2][16]) = { { 0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6 }, + { 4, 5, 6, 7, 5, 6, 7, 8, 6, 7, 8, 9, 7, 8, 9, 10 } };
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/intra_edge_sse4.c
205
206
207
208
209
210
211
212
213
214
} void av1_upsample_intra_edge_sse4_1(uint8_t *p, int sz) { // interpolate half-sample positions assert(sz <= 24); DECLARE_ALIGNED(16, static const int8_t, kernel[1][16]) = { { -1, 9, 9, -1, -1, 9, 9, -1, -1, 9, 9, -1, -1, 9, 9, -1 } };
+ show +
215
216
217
218
DECLARE_ALIGNED(16, static const int8_t, v_const[2][16]) = { { 0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6 }, { 4, 5, 6, 7, 5, 6, 7, 8, 6, 7, 8, 9, 7, 8, 9, 10 } };
+ show +
219
220
221
222
223
224
225
226
227
228
// Extend first/last samples (upper-left p[-1], last p[sz-1]) // to support 4-tap filter p[-2] = p[-1]; p[sz] = p[sz - 1]; uint8_t *in = &p[-2]; uint8_t *out = &p[-2]; int n = sz + 1; // Input length including upper-left sample

[CVE-2020-0478_1.diff] highbd_inv_txfm_avx2.c #2
+static INLINE void round_shift_4x4_avx2(__m256i *in, int shift) { + if (shift != 0) { + __m256i rnding = _mm256_set1_epi32(1 << (shift - 1)); + in[0] = _mm256_add_epi32(in[0], rnding); + in[1] = _mm256_add_epi32(in[1], rnding); + in[2] = _mm256_add_epi32(in[2], rnding); + in[3] = _mm256_add_epi32(in[3], rnding); + + in[0] = _mm256_srai_epi32(in[0], shift); + in[1] = _mm256_srai_epi32(in[1], shift); + in[2] = _mm256_srai_epi32(in[2], shift); + in[3] = _mm256_srai_epi32(in[3], shift); + } +} + +static INLINE void round_shift_8x8_avx2(__m256i *in, int shift) { + round_shift_4x4_avx2(in, shift); + round_shift_4x4_avx2(in + 4, shift); + round_shift_4x4_avx2(in + 8, shift); + round_shift_4x4_avx2(in + 12, shift); +} + +static void highbd_clamp_epi32_avx2(__m256i *in, __m256i *out, + const __m256i *clamp_lo, + const __m256i *clamp_hi, int size) { + __m256i a0, a1; + for (int i = 0; i < size; i += 4) { + a0 = _mm256_max_epi32(in[i], *clamp_lo); + out[i] = _mm256_min_epi32(a0, *clamp_hi); + + a1 = _mm256_max_epi32(in[i + 1], *clamp_lo); + out[i + 1] = _mm256_min_epi32(a1, *clamp_hi); + + a0 = _mm256_max_epi32(in[i + 2], *clamp_lo); + out[i + 2] = _mm256_min_epi32(a0, *clamp_hi); + + a1 = _mm256_max_epi32(in[i + 3], *clamp_lo); + out[i + 3] = _mm256_min_epi32(a1, *clamp_hi); + } +} + -static void addsub_no_clamp_avx2(const __m256i in0, const __m256i in1, - __m256i *out0, __m256i *out1) { - __m256i a0 = _mm256_add_epi32(in0, in1); - __m256i a1 = _mm256_sub_epi32(in0, in1); - - *out0 = a0; - *out1 = a1; -} - -static void addsub_shift_avx2(const __m256i in0, const __m256i in1, - __m256i *out0, __m256i *out1, - const __m256i *clamp_lo, const __m256i *clamp_hi, - int shift) { - __m256i offset = _mm256_set1_epi32((1 << shift) >> 1); - __m256i in0_w_offset = _mm256_add_epi32(in0, offset); - __m256i a0 = _mm256_add_epi32(in0_w_offset, in1); - __m256i a1 = _mm256_sub_epi32(in0_w_offset, in1); - - a0 = _mm256_sra_epi32(a0, _mm_cvtsi32_si128(shift)); - a1 = _mm256_sra_epi32(a1, _mm_cvtsi32_si128(shift)); - - a0 = _mm256_max_epi32(a0, *clamp_lo); - a0 = _mm256_min_epi32(a0, *clamp_hi); - a1 = _mm256_max_epi32(a1, *clamp_lo); - a1 = _mm256_min_epi32(a1, *clamp_hi); - - *out0 = a0; - *out1 = a1; -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_avx2.c
228
229
230
231
232
233
234
235
236
237
a0 = _mm256_max_epi32(a0, *clamp_lo); a0 = _mm256_min_epi32(a0, *clamp_hi); a1 = _mm256_max_epi32(a1, *clamp_lo); a1 = _mm256_min_epi32(a1, *clamp_hi); *out0 = a0; *out1 = a1; }
+ show +
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
static void addsub_no_clamp_avx2(const __m256i in0, const __m256i in1, __m256i *out0, __m256i *out1) { __m256i a0 = _mm256_add_epi32(in0, in1); __m256i a1 = _mm256_sub_epi32(in0, in1); *out0 = a0; *out1 = a1; } static void addsub_shift_avx2(const __m256i in0, const __m256i in1, __m256i *out0, __m256i *out1, const __m256i *clamp_lo, const __m256i *clamp_hi, int shift) { __m256i offset = _mm256_set1_epi32((1 << shift) >> 1); __m256i in0_w_offset = _mm256_add_epi32(in0, offset); __m256i a0 = _mm256_add_epi32(in0_w_offset, in1); __m256i a1 = _mm256_sub_epi32(in0_w_offset, in1); a0 = _mm256_sra_epi32(a0, _mm_cvtsi32_si128(shift)); a1 = _mm256_sra_epi32(a1, _mm_cvtsi32_si128(shift)); a0 = _mm256_max_epi32(a0, *clamp_lo); a0 = _mm256_min_epi32(a0, *clamp_hi); a1 = _mm256_max_epi32(a1, *clamp_lo); a1 = _mm256_min_epi32(a1, *clamp_hi); *out0 = a0; *out1 = a1;
+ show +
266
267
268
269
270
271
272
273
274
275
} static INLINE void idct32_stage4_avx2( __m256i *bf1, const __m256i *cospim8, const __m256i *cospi56, const __m256i *cospi8, const __m256i *cospim56, const __m256i *cospim40, const __m256i *cospi24, const __m256i *cospi40, const __m256i *cospim24, const __m256i *rounding, int bit) { __m256i temp1, temp2; temp1 = half_btf_avx2(cospim8, &bf1[17], cospi56, &bf1[30], rounding, bit); bf1[30] = half_btf_avx2(cospi56, &bf1[17], cospi8, &bf1[30], rounding, bit);

[CVE-2020-0478_1.diff] highbd_inv_txfm_avx2.c #11
- if (do_cols) { - addsub_no_clamp_avx2(u[0], u[15], out + 0, out + 15); - addsub_no_clamp_avx2(u[1], u[14], out + 1, out + 14); - addsub_no_clamp_avx2(u[2], u[13], out + 2, out + 13); - addsub_no_clamp_avx2(u[3], u[12], out + 3, out + 12); - addsub_no_clamp_avx2(u[4], u[11], out + 4, out + 11); - addsub_no_clamp_avx2(u[5], u[10], out + 5, out + 10); - addsub_no_clamp_avx2(u[6], u[9], out + 6, out + 9); - addsub_no_clamp_avx2(u[7], u[8], out + 7, out + 8); - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m256i clamp_lo_out = _mm256_set1_epi32(AOMMAX( - -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); - const __m256i clamp_hi_out = _mm256_set1_epi32(AOMMIN( - (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); + addsub_avx2(u[0], u[15], out + 0, out + 15, &clamp_lo, &clamp_hi); + addsub_avx2(u[1], u[14], out + 1, out + 14, &clamp_lo, &clamp_hi); + addsub_avx2(u[2], u[13], out + 2, out + 13, &clamp_lo, &clamp_hi); + addsub_avx2(u[3], u[12], out + 3, out + 12, &clamp_lo, &clamp_hi); + addsub_avx2(u[4], u[11], out + 4, out + 11, &clamp_lo, &clamp_hi); + addsub_avx2(u[5], u[10], out + 5, out + 10, &clamp_lo, &clamp_hi); + addsub_avx2(u[6], u[9], out + 6, out + 9, &clamp_lo, &clamp_hi); + addsub_avx2(u[7], u[8], out + 7, out + 8, &clamp_lo, &clamp_hi); - addsub_shift_avx2(u[0], u[15], out + 0, out + 15, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(u[1], u[14], out + 1, out + 14, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(u[2], u[13], out + 2, out + 13, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(u[3], u[12], out + 3, out + 12, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(u[4], u[11], out + 4, out + 11, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(u[5], u[10], out + 5, out + 10, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(u[6], u[9], out + 6, out + 9, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(u[7], u[8], out + 7, out + 8, &clamp_lo_out, - &clamp_hi_out, out_shift); + if (!do_cols) { + const int log_range_out = AOMMAX(16, bd + 6); + const __m256i clamp_lo_out = + _mm256_set1_epi32(-(1 << (log_range_out - 1))); + const __m256i clamp_hi_out = + _mm256_set1_epi32((1 << (log_range_out - 1)) - 1); + round_shift_8x8_avx2(out, out_shift); + highbd_clamp_epi32_avx2(out, out, &clamp_lo_out, &clamp_hi_out, 16);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_avx2.c
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
x = _mm256_mullo_epi32(u[11], cospi32); y = _mm256_mullo_epi32(u[12], cospi32); u[11] = _mm256_sub_epi32(y, x); u[11] = _mm256_add_epi32(u[11], rnding); u[11] = _mm256_srai_epi32(u[11], bit); u[12] = _mm256_add_epi32(x, y); u[12] = _mm256_add_epi32(u[12], rnding); u[12] = _mm256_srai_epi32(u[12], bit); // stage 7
+ show +
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
if (do_cols) { addsub_no_clamp_avx2(u[0], u[15], out + 0, out + 15); addsub_no_clamp_avx2(u[1], u[14], out + 1, out + 14); addsub_no_clamp_avx2(u[2], u[13], out + 2, out + 13); addsub_no_clamp_avx2(u[3], u[12], out + 3, out + 12); addsub_no_clamp_avx2(u[4], u[11], out + 4, out + 11); addsub_no_clamp_avx2(u[5], u[10], out + 5, out + 10); addsub_no_clamp_avx2(u[6], u[9], out + 6, out + 9); addsub_no_clamp_avx2(u[7], u[8], out + 7, out + 8); } else { const int log_range_out = AOMMAX(16, bd + 6); const __m256i clamp_lo_out = _mm256_set1_epi32(AOMMAX( -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); const __m256i clamp_hi_out = _mm256_set1_epi32(AOMMIN( (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); addsub_shift_avx2(u[0], u[15], out + 0, out + 15, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(u[1], u[14], out + 1, out + 14, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(u[2], u[13], out + 2, out + 13, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(u[3], u[12], out + 3, out + 12, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(u[4], u[11], out + 4, out + 11, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(u[5], u[10], out + 5, out + 10, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(u[6], u[9], out + 6, out + 9, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(u[7], u[8], out + 7, out + 8, &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
} } } static void idct16_avx2(__m256i *in, __m256i *out, int bit, int do_cols, int bd, int out_shift) { const int32_t *cospi = cospi_arr(bit); const __m256i cospi60 = _mm256_set1_epi32(cospi[60]); const __m256i cospim4 = _mm256_set1_epi32(-cospi[4]); const __m256i cospi28 = _mm256_set1_epi32(cospi[28]);

[CVE-2020-0478_1.diff] highbd_inv_txfm_avx2.c #12
- if (do_cols) { - addsub_no_clamp_avx2(v[0], v[15], out + 0, out + 15); - addsub_no_clamp_avx2(v[1], v[14], out + 1, out + 14); - addsub_no_clamp_avx2(v[2], v[13], out + 2, out + 13); - addsub_no_clamp_avx2(v[3], v[12], out + 3, out + 12); - addsub_no_clamp_avx2(v[4], v[11], out + 4, out + 11); - addsub_no_clamp_avx2(v[5], v[10], out + 5, out + 10); - addsub_no_clamp_avx2(v[6], v[9], out + 6, out + 9); - addsub_no_clamp_avx2(v[7], v[8], out + 7, out + 8); - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m256i clamp_lo_out = _mm256_set1_epi32(AOMMAX( - -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); - const __m256i clamp_hi_out = _mm256_set1_epi32(AOMMIN( - (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); + addsub_avx2(v[0], v[15], out + 0, out + 15, &clamp_lo, &clamp_hi); + addsub_avx2(v[1], v[14], out + 1, out + 14, &clamp_lo, &clamp_hi); + addsub_avx2(v[2], v[13], out + 2, out + 13, &clamp_lo, &clamp_hi); + addsub_avx2(v[3], v[12], out + 3, out + 12, &clamp_lo, &clamp_hi); + addsub_avx2(v[4], v[11], out + 4, out + 11, &clamp_lo, &clamp_hi); + addsub_avx2(v[5], v[10], out + 5, out + 10, &clamp_lo, &clamp_hi); + addsub_avx2(v[6], v[9], out + 6, out + 9, &clamp_lo, &clamp_hi); + addsub_avx2(v[7], v[8], out + 7, out + 8, &clamp_lo, &clamp_hi); - addsub_shift_avx2(v[0], v[15], out + 0, out + 15, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(v[1], v[14], out + 1, out + 14, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(v[2], v[13], out + 2, out + 13, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(v[3], v[12], out + 3, out + 12, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(v[4], v[11], out + 4, out + 11, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(v[5], v[10], out + 5, out + 10, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(v[6], v[9], out + 6, out + 9, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(v[7], v[8], out + 7, out + 8, &clamp_lo_out, - &clamp_hi_out, out_shift); + if (!do_cols) { + const int log_range_out = AOMMAX(16, bd + 6); + const __m256i clamp_lo_out = + _mm256_set1_epi32(-(1 << (log_range_out - 1))); + const __m256i clamp_hi_out = + _mm256_set1_epi32((1 << (log_range_out - 1)) - 1); + round_shift_8x8_avx2(out, out_shift); + highbd_clamp_epi32_avx2(out, out, &clamp_lo_out, &clamp_hi_out, 16);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_avx2.c
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
v[11] = _mm256_srai_epi32(v[11], bit); v[12] = _mm256_add_epi32(x, y); v[12] = _mm256_add_epi32(v[12], rnding); v[12] = _mm256_srai_epi32(v[12], bit); v[14] = u[14]; v[15] = u[15]; // stage 7
+ show +
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
if (do_cols) { addsub_no_clamp_avx2(v[0], v[15], out + 0, out + 15); addsub_no_clamp_avx2(v[1], v[14], out + 1, out + 14); addsub_no_clamp_avx2(v[2], v[13], out + 2, out + 13); addsub_no_clamp_avx2(v[3], v[12], out + 3, out + 12); addsub_no_clamp_avx2(v[4], v[11], out + 4, out + 11); addsub_no_clamp_avx2(v[5], v[10], out + 5, out + 10); addsub_no_clamp_avx2(v[6], v[9], out + 6, out + 9); addsub_no_clamp_avx2(v[7], v[8], out + 7, out + 8); } else { const int log_range_out = AOMMAX(16, bd + 6); const __m256i clamp_lo_out = _mm256_set1_epi32(AOMMAX( -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); const __m256i clamp_hi_out = _mm256_set1_epi32(AOMMIN( (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); addsub_shift_avx2(v[0], v[15], out + 0, out + 15, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(v[1], v[14], out + 1, out + 14, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(v[2], v[13], out + 2, out + 13, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(v[3], v[12], out + 3, out + 12, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(v[4], v[11], out + 4, out + 11, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(v[5], v[10], out + 5, out + 10, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(v[6], v[9], out + 6, out + 9, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(v[7], v[8], out + 7, out + 8, &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
} } } static void iadst16_low1_avx2(__m256i *in, __m256i *out, int bit, int do_cols, int bd, int out_shift) { const int32_t *cospi = cospi_arr(bit); const __m256i cospi2 = _mm256_set1_epi32(cospi[2]); const __m256i cospi62 = _mm256_set1_epi32(cospi[62]); const __m256i cospi8 = _mm256_set1_epi32(cospi[8]);

[CVE-2020-0478_1.diff] highbd_inv_txfm_avx2.c #16
- const int log_range) { - if (do_cols) { - for (int i = 0; i < 32; i++) { - addsub_no_clamp_avx2(u[i], u[63 - i], &out[(i)], &out[(63 - i)]); - } - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m256i clamp_lo_out = _mm256_set1_epi32(AOMMAX( - -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); - const __m256i clamp_hi_out = _mm256_set1_epi32(AOMMIN( - (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); + const __m256i *clamp_lo, + const __m256i *clamp_hi) { + for (int i = 0; i < 32; i++) { + addsub_avx2(u[i], u[63 - i], &out[(i)], &out[(63 - i)], clamp_lo, clamp_hi); + } - for (int i = 0; i < 32; i++) { - addsub_shift_avx2(u[i], u[63 - i], &out[(i)], &out[(63 - i)], - &clamp_lo_out, &clamp_hi_out, out_shift); - } + if (!do_cols) { + const int log_range_out = AOMMAX(16, bd + 6); + const __m256i clamp_lo_out = _mm256_set1_epi32(-(1 << (log_range_out - 1))); + const __m256i clamp_hi_out = + _mm256_set1_epi32((1 << (log_range_out - 1)) - 1); + + round_shift_8x8_avx2(out, out_shift); + round_shift_8x8_avx2(out + 16, out_shift); + round_shift_8x8_avx2(out + 32, out_shift); + round_shift_8x8_avx2(out + 48, out_shift); + highbd_clamp_epi32_avx2(out, out, &clamp_lo_out, &clamp_hi_out, 64);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_avx2.c
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
u[50] = half_btf_avx2(cospi32, &u[45], cospi32, &u[50], rnding, bit); u[51] = half_btf_avx2(cospi32, &u[44], cospi32, &u[51], rnding, bit); u[44] = temp1; u[45] = temp2; u[46] = temp3; u[47] = temp4; } static INLINE void idct64_stage11_avx2(__m256i *u, __m256i *out, int do_cols, int bd, int out_shift,
+ show +
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
const int log_range) { if (do_cols) { for (int i = 0; i < 32; i++) { addsub_no_clamp_avx2(u[i], u[63 - i], &out[(i)], &out[(63 - i)]); } } else { const int log_range_out = AOMMAX(16, bd + 6); const __m256i clamp_lo_out = _mm256_set1_epi32(AOMMAX( -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); const __m256i clamp_hi_out = _mm256_set1_epi32(AOMMIN( (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); for (int i = 0; i < 32; i++) { addsub_shift_avx2(u[i], u[63 - i], &out[(i)], &out[(63 - i)], &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
} } } static void idct64_low1_avx2(__m256i *in, __m256i *out, int bit, int do_cols, int bd, int out_shift) { const int32_t *cospi = cospi_arr(bit); const __m256i rnding = _mm256_set1_epi32(1 << (bit - 1)); const int log_range = AOMMAX(16, bd + (do_cols ? 6 : 8)); const __m256i clamp_lo = _mm256_set1_epi32(-(1 << (log_range - 1)));

[CVE-2020-0470_1.diff] highbd_inv_txfm_avx2.c #2
+static INLINE void round_shift_4x4_avx2(__m256i *in, int shift) { + if (shift != 0) { + __m256i rnding = _mm256_set1_epi32(1 << (shift - 1)); + in[0] = _mm256_add_epi32(in[0], rnding); + in[1] = _mm256_add_epi32(in[1], rnding); + in[2] = _mm256_add_epi32(in[2], rnding); + in[3] = _mm256_add_epi32(in[3], rnding); + + in[0] = _mm256_srai_epi32(in[0], shift); + in[1] = _mm256_srai_epi32(in[1], shift); + in[2] = _mm256_srai_epi32(in[2], shift); + in[3] = _mm256_srai_epi32(in[3], shift); + } +} + +static INLINE void round_shift_8x8_avx2(__m256i *in, int shift) { + round_shift_4x4_avx2(in, shift); + round_shift_4x4_avx2(in + 4, shift); + round_shift_4x4_avx2(in + 8, shift); + round_shift_4x4_avx2(in + 12, shift); +} + +static void highbd_clamp_epi32_avx2(__m256i *in, __m256i *out, + const __m256i *clamp_lo, + const __m256i *clamp_hi, int size) { + __m256i a0, a1; + for (int i = 0; i < size; i += 4) { + a0 = _mm256_max_epi32(in[i], *clamp_lo); + out[i] = _mm256_min_epi32(a0, *clamp_hi); + + a1 = _mm256_max_epi32(in[i + 1], *clamp_lo); + out[i + 1] = _mm256_min_epi32(a1, *clamp_hi); + + a0 = _mm256_max_epi32(in[i + 2], *clamp_lo); + out[i + 2] = _mm256_min_epi32(a0, *clamp_hi); + + a1 = _mm256_max_epi32(in[i + 3], *clamp_lo); + out[i + 3] = _mm256_min_epi32(a1, *clamp_hi); + } +} + -static void addsub_no_clamp_avx2(const __m256i in0, const __m256i in1, - __m256i *out0, __m256i *out1) { - __m256i a0 = _mm256_add_epi32(in0, in1); - __m256i a1 = _mm256_sub_epi32(in0, in1); - - *out0 = a0; - *out1 = a1; -} - -static void addsub_shift_avx2(const __m256i in0, const __m256i in1, - __m256i *out0, __m256i *out1, - const __m256i *clamp_lo, const __m256i *clamp_hi, - int shift) { - __m256i offset = _mm256_set1_epi32((1 << shift) >> 1); - __m256i in0_w_offset = _mm256_add_epi32(in0, offset); - __m256i a0 = _mm256_add_epi32(in0_w_offset, in1); - __m256i a1 = _mm256_sub_epi32(in0_w_offset, in1); - - a0 = _mm256_sra_epi32(a0, _mm_cvtsi32_si128(shift)); - a1 = _mm256_sra_epi32(a1, _mm_cvtsi32_si128(shift)); - - a0 = _mm256_max_epi32(a0, *clamp_lo); - a0 = _mm256_min_epi32(a0, *clamp_hi); - a1 = _mm256_max_epi32(a1, *clamp_lo); - a1 = _mm256_min_epi32(a1, *clamp_hi); - - *out0 = a0; - *out1 = a1; -} -
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_avx2.c
228
229
230
231
232
233
234
235
236
237
a0 = _mm256_max_epi32(a0, *clamp_lo); a0 = _mm256_min_epi32(a0, *clamp_hi); a1 = _mm256_max_epi32(a1, *clamp_lo); a1 = _mm256_min_epi32(a1, *clamp_hi); *out0 = a0; *out1 = a1; }
+ show +
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
static void addsub_no_clamp_avx2(const __m256i in0, const __m256i in1, __m256i *out0, __m256i *out1) { __m256i a0 = _mm256_add_epi32(in0, in1); __m256i a1 = _mm256_sub_epi32(in0, in1); *out0 = a0; *out1 = a1; } static void addsub_shift_avx2(const __m256i in0, const __m256i in1, __m256i *out0, __m256i *out1, const __m256i *clamp_lo, const __m256i *clamp_hi, int shift) { __m256i offset = _mm256_set1_epi32((1 << shift) >> 1); __m256i in0_w_offset = _mm256_add_epi32(in0, offset); __m256i a0 = _mm256_add_epi32(in0_w_offset, in1); __m256i a1 = _mm256_sub_epi32(in0_w_offset, in1); a0 = _mm256_sra_epi32(a0, _mm_cvtsi32_si128(shift)); a1 = _mm256_sra_epi32(a1, _mm_cvtsi32_si128(shift)); a0 = _mm256_max_epi32(a0, *clamp_lo); a0 = _mm256_min_epi32(a0, *clamp_hi); a1 = _mm256_max_epi32(a1, *clamp_lo); a1 = _mm256_min_epi32(a1, *clamp_hi); *out0 = a0; *out1 = a1;
+ show +
266
267
268
269
270
271
272
273
274
275
} static INLINE void idct32_stage4_avx2( __m256i *bf1, const __m256i *cospim8, const __m256i *cospi56, const __m256i *cospi8, const __m256i *cospim56, const __m256i *cospim40, const __m256i *cospi24, const __m256i *cospi40, const __m256i *cospim24, const __m256i *rounding, int bit) { __m256i temp1, temp2; temp1 = half_btf_avx2(cospim8, &bf1[17], cospi56, &bf1[30], rounding, bit); bf1[30] = half_btf_avx2(cospi56, &bf1[17], cospi8, &bf1[30], rounding, bit);

[CVE-2020-0470_1.diff] highbd_inv_txfm_avx2.c #11
- if (do_cols) { - addsub_no_clamp_avx2(u[0], u[15], out + 0, out + 15); - addsub_no_clamp_avx2(u[1], u[14], out + 1, out + 14); - addsub_no_clamp_avx2(u[2], u[13], out + 2, out + 13); - addsub_no_clamp_avx2(u[3], u[12], out + 3, out + 12); - addsub_no_clamp_avx2(u[4], u[11], out + 4, out + 11); - addsub_no_clamp_avx2(u[5], u[10], out + 5, out + 10); - addsub_no_clamp_avx2(u[6], u[9], out + 6, out + 9); - addsub_no_clamp_avx2(u[7], u[8], out + 7, out + 8); - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m256i clamp_lo_out = _mm256_set1_epi32(AOMMAX( - -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); - const __m256i clamp_hi_out = _mm256_set1_epi32(AOMMIN( - (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); + addsub_avx2(u[0], u[15], out + 0, out + 15, &clamp_lo, &clamp_hi); + addsub_avx2(u[1], u[14], out + 1, out + 14, &clamp_lo, &clamp_hi); + addsub_avx2(u[2], u[13], out + 2, out + 13, &clamp_lo, &clamp_hi); + addsub_avx2(u[3], u[12], out + 3, out + 12, &clamp_lo, &clamp_hi); + addsub_avx2(u[4], u[11], out + 4, out + 11, &clamp_lo, &clamp_hi); + addsub_avx2(u[5], u[10], out + 5, out + 10, &clamp_lo, &clamp_hi); + addsub_avx2(u[6], u[9], out + 6, out + 9, &clamp_lo, &clamp_hi); + addsub_avx2(u[7], u[8], out + 7, out + 8, &clamp_lo, &clamp_hi); - addsub_shift_avx2(u[0], u[15], out + 0, out + 15, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(u[1], u[14], out + 1, out + 14, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(u[2], u[13], out + 2, out + 13, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(u[3], u[12], out + 3, out + 12, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(u[4], u[11], out + 4, out + 11, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(u[5], u[10], out + 5, out + 10, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(u[6], u[9], out + 6, out + 9, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(u[7], u[8], out + 7, out + 8, &clamp_lo_out, - &clamp_hi_out, out_shift); + if (!do_cols) { + const int log_range_out = AOMMAX(16, bd + 6); + const __m256i clamp_lo_out = + _mm256_set1_epi32(-(1 << (log_range_out - 1))); + const __m256i clamp_hi_out = + _mm256_set1_epi32((1 << (log_range_out - 1)) - 1); + round_shift_8x8_avx2(out, out_shift); + highbd_clamp_epi32_avx2(out, out, &clamp_lo_out, &clamp_hi_out, 16);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_avx2.c
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
x = _mm256_mullo_epi32(u[11], cospi32); y = _mm256_mullo_epi32(u[12], cospi32); u[11] = _mm256_sub_epi32(y, x); u[11] = _mm256_add_epi32(u[11], rnding); u[11] = _mm256_srai_epi32(u[11], bit); u[12] = _mm256_add_epi32(x, y); u[12] = _mm256_add_epi32(u[12], rnding); u[12] = _mm256_srai_epi32(u[12], bit); // stage 7
+ show +
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
if (do_cols) { addsub_no_clamp_avx2(u[0], u[15], out + 0, out + 15); addsub_no_clamp_avx2(u[1], u[14], out + 1, out + 14); addsub_no_clamp_avx2(u[2], u[13], out + 2, out + 13); addsub_no_clamp_avx2(u[3], u[12], out + 3, out + 12); addsub_no_clamp_avx2(u[4], u[11], out + 4, out + 11); addsub_no_clamp_avx2(u[5], u[10], out + 5, out + 10); addsub_no_clamp_avx2(u[6], u[9], out + 6, out + 9); addsub_no_clamp_avx2(u[7], u[8], out + 7, out + 8); } else { const int log_range_out = AOMMAX(16, bd + 6); const __m256i clamp_lo_out = _mm256_set1_epi32(AOMMAX( -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); const __m256i clamp_hi_out = _mm256_set1_epi32(AOMMIN( (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); addsub_shift_avx2(u[0], u[15], out + 0, out + 15, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(u[1], u[14], out + 1, out + 14, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(u[2], u[13], out + 2, out + 13, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(u[3], u[12], out + 3, out + 12, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(u[4], u[11], out + 4, out + 11, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(u[5], u[10], out + 5, out + 10, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(u[6], u[9], out + 6, out + 9, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(u[7], u[8], out + 7, out + 8, &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
} } } static void idct16_avx2(__m256i *in, __m256i *out, int bit, int do_cols, int bd, int out_shift) { const int32_t *cospi = cospi_arr(bit); const __m256i cospi60 = _mm256_set1_epi32(cospi[60]); const __m256i cospim4 = _mm256_set1_epi32(-cospi[4]); const __m256i cospi28 = _mm256_set1_epi32(cospi[28]);

[CVE-2020-0470_1.diff] highbd_inv_txfm_avx2.c #12
- if (do_cols) { - addsub_no_clamp_avx2(v[0], v[15], out + 0, out + 15); - addsub_no_clamp_avx2(v[1], v[14], out + 1, out + 14); - addsub_no_clamp_avx2(v[2], v[13], out + 2, out + 13); - addsub_no_clamp_avx2(v[3], v[12], out + 3, out + 12); - addsub_no_clamp_avx2(v[4], v[11], out + 4, out + 11); - addsub_no_clamp_avx2(v[5], v[10], out + 5, out + 10); - addsub_no_clamp_avx2(v[6], v[9], out + 6, out + 9); - addsub_no_clamp_avx2(v[7], v[8], out + 7, out + 8); - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m256i clamp_lo_out = _mm256_set1_epi32(AOMMAX( - -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); - const __m256i clamp_hi_out = _mm256_set1_epi32(AOMMIN( - (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); + addsub_avx2(v[0], v[15], out + 0, out + 15, &clamp_lo, &clamp_hi); + addsub_avx2(v[1], v[14], out + 1, out + 14, &clamp_lo, &clamp_hi); + addsub_avx2(v[2], v[13], out + 2, out + 13, &clamp_lo, &clamp_hi); + addsub_avx2(v[3], v[12], out + 3, out + 12, &clamp_lo, &clamp_hi); + addsub_avx2(v[4], v[11], out + 4, out + 11, &clamp_lo, &clamp_hi); + addsub_avx2(v[5], v[10], out + 5, out + 10, &clamp_lo, &clamp_hi); + addsub_avx2(v[6], v[9], out + 6, out + 9, &clamp_lo, &clamp_hi); + addsub_avx2(v[7], v[8], out + 7, out + 8, &clamp_lo, &clamp_hi); - addsub_shift_avx2(v[0], v[15], out + 0, out + 15, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(v[1], v[14], out + 1, out + 14, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(v[2], v[13], out + 2, out + 13, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(v[3], v[12], out + 3, out + 12, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(v[4], v[11], out + 4, out + 11, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(v[5], v[10], out + 5, out + 10, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(v[6], v[9], out + 6, out + 9, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_avx2(v[7], v[8], out + 7, out + 8, &clamp_lo_out, - &clamp_hi_out, out_shift); + if (!do_cols) { + const int log_range_out = AOMMAX(16, bd + 6); + const __m256i clamp_lo_out = + _mm256_set1_epi32(-(1 << (log_range_out - 1))); + const __m256i clamp_hi_out = + _mm256_set1_epi32((1 << (log_range_out - 1)) - 1); + round_shift_8x8_avx2(out, out_shift); + highbd_clamp_epi32_avx2(out, out, &clamp_lo_out, &clamp_hi_out, 16);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_avx2.c
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
v[11] = _mm256_srai_epi32(v[11], bit); v[12] = _mm256_add_epi32(x, y); v[12] = _mm256_add_epi32(v[12], rnding); v[12] = _mm256_srai_epi32(v[12], bit); v[14] = u[14]; v[15] = u[15]; // stage 7
+ show +
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
if (do_cols) { addsub_no_clamp_avx2(v[0], v[15], out + 0, out + 15); addsub_no_clamp_avx2(v[1], v[14], out + 1, out + 14); addsub_no_clamp_avx2(v[2], v[13], out + 2, out + 13); addsub_no_clamp_avx2(v[3], v[12], out + 3, out + 12); addsub_no_clamp_avx2(v[4], v[11], out + 4, out + 11); addsub_no_clamp_avx2(v[5], v[10], out + 5, out + 10); addsub_no_clamp_avx2(v[6], v[9], out + 6, out + 9); addsub_no_clamp_avx2(v[7], v[8], out + 7, out + 8); } else { const int log_range_out = AOMMAX(16, bd + 6); const __m256i clamp_lo_out = _mm256_set1_epi32(AOMMAX( -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); const __m256i clamp_hi_out = _mm256_set1_epi32(AOMMIN( (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); addsub_shift_avx2(v[0], v[15], out + 0, out + 15, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(v[1], v[14], out + 1, out + 14, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(v[2], v[13], out + 2, out + 13, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(v[3], v[12], out + 3, out + 12, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(v[4], v[11], out + 4, out + 11, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(v[5], v[10], out + 5, out + 10, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(v[6], v[9], out + 6, out + 9, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_avx2(v[7], v[8], out + 7, out + 8, &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
} } } static void iadst16_low1_avx2(__m256i *in, __m256i *out, int bit, int do_cols, int bd, int out_shift) { const int32_t *cospi = cospi_arr(bit); const __m256i cospi2 = _mm256_set1_epi32(cospi[2]); const __m256i cospi62 = _mm256_set1_epi32(cospi[62]); const __m256i cospi8 = _mm256_set1_epi32(cospi[8]);

[CVE-2020-0470_1.diff] highbd_inv_txfm_avx2.c #16
- const int log_range) { - if (do_cols) { - for (int i = 0; i < 32; i++) { - addsub_no_clamp_avx2(u[i], u[63 - i], &out[(i)], &out[(63 - i)]); - } - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m256i clamp_lo_out = _mm256_set1_epi32(AOMMAX( - -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); - const __m256i clamp_hi_out = _mm256_set1_epi32(AOMMIN( - (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); + const __m256i *clamp_lo, + const __m256i *clamp_hi) { + for (int i = 0; i < 32; i++) { + addsub_avx2(u[i], u[63 - i], &out[(i)], &out[(63 - i)], clamp_lo, clamp_hi); + } - for (int i = 0; i < 32; i++) { - addsub_shift_avx2(u[i], u[63 - i], &out[(i)], &out[(63 - i)], - &clamp_lo_out, &clamp_hi_out, out_shift); - } + if (!do_cols) { + const int log_range_out = AOMMAX(16, bd + 6); + const __m256i clamp_lo_out = _mm256_set1_epi32(-(1 << (log_range_out - 1))); + const __m256i clamp_hi_out = + _mm256_set1_epi32((1 << (log_range_out - 1)) - 1); + + round_shift_8x8_avx2(out, out_shift); + round_shift_8x8_avx2(out + 16, out_shift); + round_shift_8x8_avx2(out + 32, out_shift); + round_shift_8x8_avx2(out + 48, out_shift); + highbd_clamp_epi32_avx2(out, out, &clamp_lo_out, &clamp_hi_out, 64);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_avx2.c
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
u[50] = half_btf_avx2(cospi32, &u[45], cospi32, &u[50], rnding, bit); u[51] = half_btf_avx2(cospi32, &u[44], cospi32, &u[51], rnding, bit); u[44] = temp1; u[45] = temp2; u[46] = temp3; u[47] = temp4; } static INLINE void idct64_stage11_avx2(__m256i *u, __m256i *out, int do_cols, int bd, int out_shift,
+ show +
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
const int log_range) { if (do_cols) { for (int i = 0; i < 32; i++) { addsub_no_clamp_avx2(u[i], u[63 - i], &out[(i)], &out[(63 - i)]); } } else { const int log_range_out = AOMMAX(16, bd + 6); const __m256i clamp_lo_out = _mm256_set1_epi32(AOMMAX( -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); const __m256i clamp_hi_out = _mm256_set1_epi32(AOMMIN( (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); for (int i = 0; i < 32; i++) { addsub_shift_avx2(u[i], u[63 - i], &out[(i)], &out[(63 - i)], &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
} } } static void idct64_low1_avx2(__m256i *in, __m256i *out, int bit, int do_cols, int bd, int out_shift) { const int32_t *cospi = cospi_arr(bit); const __m256i rnding = _mm256_set1_epi32(1 << (bit - 1)); const int log_range = AOMMAX(16, bd + (do_cols ? 6 : 8)); const __m256i clamp_lo = _mm256_set1_epi32(-(1 << (log_range - 1)));

[CVE-2020-0478_1.diff] selfguided_sse4.c #2
- const __m128i a_res = _mm_set_epi32(x_by_xplus1[_mm_extract_epi32(z, 3)], - x_by_xplus1[_mm_extract_epi32(z, 2)], - x_by_xplus1[_mm_extract_epi32(z, 1)], - x_by_xplus1[_mm_extract_epi32(z, 0)]); + const __m128i a_res = + _mm_set_epi32(av1_x_by_xplus1[_mm_extract_epi32(z, 3)], + av1_x_by_xplus1[_mm_extract_epi32(z, 2)], + av1_x_by_xplus1[_mm_extract_epi32(z, 1)], + av1_x_by_xplus1[_mm_extract_epi32(z, 0)]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/selfguided_sse4.c
209
210
211
212
213
214
215
216
217
218
const __m128i p = compute_p(sum1, sum2, bit_depth, n); const __m128i z = _mm_min_epi32( _mm_srli_epi32(_mm_add_epi32(_mm_mullo_epi32(p, s), rnd_z), SGRPROJ_MTABLE_BITS), _mm_set1_epi32(255)); // 'Gather' type instructions are not available pre-AVX2, so synthesize a // gather using scalar loads.
+ show +
219
220
221
222
const __m128i a_res = _mm_set_epi32(x_by_xplus1[_mm_extract_epi32(z, 3)], x_by_xplus1[_mm_extract_epi32(z, 2)], x_by_xplus1[_mm_extract_epi32(z, 1)], x_by_xplus1[_mm_extract_epi32(z, 0)]);
+ show +
223
224
225
226
227
228
229
230
231
232
xx_storeu_128(A + i * buf_stride + j, a_res); const __m128i a_complement = _mm_sub_epi32(_mm_set1_epi32(SGRPROJ_SGR), a_res); // sum1 might have lanes greater than 2^15, so we can't use madd to do // multiplication involving sum1. However, a_complement and one_over_n // are both less than 256, so we can multiply them first. const __m128i a_comp_over_n = _mm_madd_epi16(a_complement, one_over_n);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/selfguided_sse4.c
349
350
351
352
353
354
355
356
357
358
const __m128i p = compute_p(sum1, sum2, bit_depth, n); const __m128i z = _mm_min_epi32( _mm_srli_epi32(_mm_add_epi32(_mm_mullo_epi32(p, s), rnd_z), SGRPROJ_MTABLE_BITS), _mm_set1_epi32(255)); // 'Gather' type instructions are not available pre-AVX2, so synthesize a // gather using scalar loads.
+ show +
359
360
361
362
const __m128i a_res = _mm_set_epi32(x_by_xplus1[_mm_extract_epi32(z, 3)], x_by_xplus1[_mm_extract_epi32(z, 2)], x_by_xplus1[_mm_extract_epi32(z, 1)], x_by_xplus1[_mm_extract_epi32(z, 0)]);
+ show +
363
364
365
366
367
368
369
370
371
372
xx_storeu_128(A + i * buf_stride + j, a_res); const __m128i a_complement = _mm_sub_epi32(_mm_set1_epi32(SGRPROJ_SGR), a_res); // sum1 might have lanes greater than 2^15, so we can't use madd to do // multiplication involving sum1. However, a_complement and one_over_n // are both less than 256, so we can multiply them first. const __m128i a_comp_over_n = _mm_madd_epi16(a_complement, one_over_n);

[CVE-2020-0478_1.diff] selfguided_sse4.c #4
- const __m128i a_res = _mm_set_epi32(x_by_xplus1[_mm_extract_epi32(z, 3)], - x_by_xplus1[_mm_extract_epi32(z, 2)], - x_by_xplus1[_mm_extract_epi32(z, 1)], - x_by_xplus1[_mm_extract_epi32(z, 0)]); + const __m128i a_res = + _mm_set_epi32(av1_x_by_xplus1[_mm_extract_epi32(z, 3)], + av1_x_by_xplus1[_mm_extract_epi32(z, 2)], + av1_x_by_xplus1[_mm_extract_epi32(z, 1)], + av1_x_by_xplus1[_mm_extract_epi32(z, 0)]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/selfguided_sse4.c
209
210
211
212
213
214
215
216
217
218
const __m128i p = compute_p(sum1, sum2, bit_depth, n); const __m128i z = _mm_min_epi32( _mm_srli_epi32(_mm_add_epi32(_mm_mullo_epi32(p, s), rnd_z), SGRPROJ_MTABLE_BITS), _mm_set1_epi32(255)); // 'Gather' type instructions are not available pre-AVX2, so synthesize a // gather using scalar loads.
+ show +
219
220
221
222
const __m128i a_res = _mm_set_epi32(x_by_xplus1[_mm_extract_epi32(z, 3)], x_by_xplus1[_mm_extract_epi32(z, 2)], x_by_xplus1[_mm_extract_epi32(z, 1)], x_by_xplus1[_mm_extract_epi32(z, 0)]);
+ show +
223
224
225
226
227
228
229
230
231
232
xx_storeu_128(A + i * buf_stride + j, a_res); const __m128i a_complement = _mm_sub_epi32(_mm_set1_epi32(SGRPROJ_SGR), a_res); // sum1 might have lanes greater than 2^15, so we can't use madd to do // multiplication involving sum1. However, a_complement and one_over_n // are both less than 256, so we can multiply them first. const __m128i a_comp_over_n = _mm_madd_epi16(a_complement, one_over_n);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/selfguided_sse4.c
349
350
351
352
353
354
355
356
357
358
const __m128i p = compute_p(sum1, sum2, bit_depth, n); const __m128i z = _mm_min_epi32( _mm_srli_epi32(_mm_add_epi32(_mm_mullo_epi32(p, s), rnd_z), SGRPROJ_MTABLE_BITS), _mm_set1_epi32(255)); // 'Gather' type instructions are not available pre-AVX2, so synthesize a // gather using scalar loads.
+ show +
359
360
361
362
const __m128i a_res = _mm_set_epi32(x_by_xplus1[_mm_extract_epi32(z, 3)], x_by_xplus1[_mm_extract_epi32(z, 2)], x_by_xplus1[_mm_extract_epi32(z, 1)], x_by_xplus1[_mm_extract_epi32(z, 0)]);
+ show +
363
364
365
366
367
368
369
370
371
372
xx_storeu_128(A + i * buf_stride + j, a_res); const __m128i a_complement = _mm_sub_epi32(_mm_set1_epi32(SGRPROJ_SGR), a_res); // sum1 might have lanes greater than 2^15, so we can't use madd to do // multiplication involving sum1. However, a_complement and one_over_n // are both less than 256, so we can multiply them first. const __m128i a_comp_over_n = _mm_madd_epi16(a_complement, one_over_n);

[CVE-2020-0478_1.diff] selfguided_sse4.c #6
-void apply_selfguided_restoration_sse4_1(const uint8_t *dat8, int width, - int height, int stride, int eps, - const int *xqd, uint8_t *dst8, - int dst_stride, int32_t *tmpbuf, - int bit_depth, int highbd) { +void av1_apply_selfguided_restoration_sse4_1(const uint8_t *dat8, int width, + int height, int stride, int eps, + const int *xqd, uint8_t *dst8, + int dst_stride, int32_t *tmpbuf, + int bit_depth, int highbd) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/selfguided_sse4.c
573
574
575
576
577
578
579
580
581
582
if (params->r[1] > 0) { calc_ab(A, B, C, D, width, height, buf_stride, bit_depth, sgr_params_idx, 1); final_filter(flt1, flt_stride, A, B, buf_stride, dgd8, dgd_stride, width, height, highbd); } aom_free(buf); return 0; }
+ show +
583
584
585
586
587
void apply_selfguided_restoration_sse4_1(const uint8_t *dat8, int width, int height, int stride, int eps, const int *xqd, uint8_t *dst8, int dst_stride, int32_t *tmpbuf, int bit_depth, int highbd) {
+ show +
588
589
590
591
592
593
594
595
596
597
int32_t *flt0 = tmpbuf; int32_t *flt1 = flt0 + RESTORATION_UNITPELS_MAX; assert(width * height <= RESTORATION_UNITPELS_MAX); const int ret = av1_selfguided_restoration_sse4_1( dat8, width, height, stride, flt0, flt1, width, eps, bit_depth, highbd); (void)ret; assert(!ret); const sgr_params_type *const params = &sgr_params[eps]; int xq[2]; decode_xq(xqd, xq, params);

[CVE-2020-0470_1.diff] selfguided_sse4.c #2
- const __m128i a_res = _mm_set_epi32(x_by_xplus1[_mm_extract_epi32(z, 3)], - x_by_xplus1[_mm_extract_epi32(z, 2)], - x_by_xplus1[_mm_extract_epi32(z, 1)], - x_by_xplus1[_mm_extract_epi32(z, 0)]); + const __m128i a_res = + _mm_set_epi32(av1_x_by_xplus1[_mm_extract_epi32(z, 3)], + av1_x_by_xplus1[_mm_extract_epi32(z, 2)], + av1_x_by_xplus1[_mm_extract_epi32(z, 1)], + av1_x_by_xplus1[_mm_extract_epi32(z, 0)]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/selfguided_sse4.c
209
210
211
212
213
214
215
216
217
218
const __m128i p = compute_p(sum1, sum2, bit_depth, n); const __m128i z = _mm_min_epi32( _mm_srli_epi32(_mm_add_epi32(_mm_mullo_epi32(p, s), rnd_z), SGRPROJ_MTABLE_BITS), _mm_set1_epi32(255)); // 'Gather' type instructions are not available pre-AVX2, so synthesize a // gather using scalar loads.
+ show +
219
220
221
222
const __m128i a_res = _mm_set_epi32(x_by_xplus1[_mm_extract_epi32(z, 3)], x_by_xplus1[_mm_extract_epi32(z, 2)], x_by_xplus1[_mm_extract_epi32(z, 1)], x_by_xplus1[_mm_extract_epi32(z, 0)]);
+ show +
223
224
225
226
227
228
229
230
231
232
xx_storeu_128(A + i * buf_stride + j, a_res); const __m128i a_complement = _mm_sub_epi32(_mm_set1_epi32(SGRPROJ_SGR), a_res); // sum1 might have lanes greater than 2^15, so we can't use madd to do // multiplication involving sum1. However, a_complement and one_over_n // are both less than 256, so we can multiply them first. const __m128i a_comp_over_n = _mm_madd_epi16(a_complement, one_over_n);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/selfguided_sse4.c
349
350
351
352
353
354
355
356
357
358
const __m128i p = compute_p(sum1, sum2, bit_depth, n); const __m128i z = _mm_min_epi32( _mm_srli_epi32(_mm_add_epi32(_mm_mullo_epi32(p, s), rnd_z), SGRPROJ_MTABLE_BITS), _mm_set1_epi32(255)); // 'Gather' type instructions are not available pre-AVX2, so synthesize a // gather using scalar loads.
+ show +
359
360
361
362
const __m128i a_res = _mm_set_epi32(x_by_xplus1[_mm_extract_epi32(z, 3)], x_by_xplus1[_mm_extract_epi32(z, 2)], x_by_xplus1[_mm_extract_epi32(z, 1)], x_by_xplus1[_mm_extract_epi32(z, 0)]);
+ show +
363
364
365
366
367
368
369
370
371
372
xx_storeu_128(A + i * buf_stride + j, a_res); const __m128i a_complement = _mm_sub_epi32(_mm_set1_epi32(SGRPROJ_SGR), a_res); // sum1 might have lanes greater than 2^15, so we can't use madd to do // multiplication involving sum1. However, a_complement and one_over_n // are both less than 256, so we can multiply them first. const __m128i a_comp_over_n = _mm_madd_epi16(a_complement, one_over_n);

[CVE-2020-0470_1.diff] selfguided_sse4.c #4
- const __m128i a_res = _mm_set_epi32(x_by_xplus1[_mm_extract_epi32(z, 3)], - x_by_xplus1[_mm_extract_epi32(z, 2)], - x_by_xplus1[_mm_extract_epi32(z, 1)], - x_by_xplus1[_mm_extract_epi32(z, 0)]); + const __m128i a_res = + _mm_set_epi32(av1_x_by_xplus1[_mm_extract_epi32(z, 3)], + av1_x_by_xplus1[_mm_extract_epi32(z, 2)], + av1_x_by_xplus1[_mm_extract_epi32(z, 1)], + av1_x_by_xplus1[_mm_extract_epi32(z, 0)]);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/selfguided_sse4.c
209
210
211
212
213
214
215
216
217
218
const __m128i p = compute_p(sum1, sum2, bit_depth, n); const __m128i z = _mm_min_epi32( _mm_srli_epi32(_mm_add_epi32(_mm_mullo_epi32(p, s), rnd_z), SGRPROJ_MTABLE_BITS), _mm_set1_epi32(255)); // 'Gather' type instructions are not available pre-AVX2, so synthesize a // gather using scalar loads.
+ show +
219
220
221
222
const __m128i a_res = _mm_set_epi32(x_by_xplus1[_mm_extract_epi32(z, 3)], x_by_xplus1[_mm_extract_epi32(z, 2)], x_by_xplus1[_mm_extract_epi32(z, 1)], x_by_xplus1[_mm_extract_epi32(z, 0)]);
+ show +
223
224
225
226
227
228
229
230
231
232
xx_storeu_128(A + i * buf_stride + j, a_res); const __m128i a_complement = _mm_sub_epi32(_mm_set1_epi32(SGRPROJ_SGR), a_res); // sum1 might have lanes greater than 2^15, so we can't use madd to do // multiplication involving sum1. However, a_complement and one_over_n // are both less than 256, so we can multiply them first. const __m128i a_comp_over_n = _mm_madd_epi16(a_complement, one_over_n);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/selfguided_sse4.c
349
350
351
352
353
354
355
356
357
358
const __m128i p = compute_p(sum1, sum2, bit_depth, n); const __m128i z = _mm_min_epi32( _mm_srli_epi32(_mm_add_epi32(_mm_mullo_epi32(p, s), rnd_z), SGRPROJ_MTABLE_BITS), _mm_set1_epi32(255)); // 'Gather' type instructions are not available pre-AVX2, so synthesize a // gather using scalar loads.
+ show +
359
360
361
362
const __m128i a_res = _mm_set_epi32(x_by_xplus1[_mm_extract_epi32(z, 3)], x_by_xplus1[_mm_extract_epi32(z, 2)], x_by_xplus1[_mm_extract_epi32(z, 1)], x_by_xplus1[_mm_extract_epi32(z, 0)]);
+ show +
363
364
365
366
367
368
369
370
371
372
xx_storeu_128(A + i * buf_stride + j, a_res); const __m128i a_complement = _mm_sub_epi32(_mm_set1_epi32(SGRPROJ_SGR), a_res); // sum1 might have lanes greater than 2^15, so we can't use madd to do // multiplication involving sum1. However, a_complement and one_over_n // are both less than 256, so we can multiply them first. const __m128i a_comp_over_n = _mm_madd_epi16(a_complement, one_over_n);

[CVE-2020-0470_1.diff] selfguided_sse4.c #6
-void apply_selfguided_restoration_sse4_1(const uint8_t *dat8, int width, - int height, int stride, int eps, - const int *xqd, uint8_t *dst8, - int dst_stride, int32_t *tmpbuf, - int bit_depth, int highbd) { +void av1_apply_selfguided_restoration_sse4_1(const uint8_t *dat8, int width, + int height, int stride, int eps, + const int *xqd, uint8_t *dst8, + int dst_stride, int32_t *tmpbuf, + int bit_depth, int highbd) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/selfguided_sse4.c
573
574
575
576
577
578
579
580
581
582
if (params->r[1] > 0) { calc_ab(A, B, C, D, width, height, buf_stride, bit_depth, sgr_params_idx, 1); final_filter(flt1, flt_stride, A, B, buf_stride, dgd8, dgd_stride, width, height, highbd); } aom_free(buf); return 0; }
+ show +
583
584
585
586
587
void apply_selfguided_restoration_sse4_1(const uint8_t *dat8, int width, int height, int stride, int eps, const int *xqd, uint8_t *dst8, int dst_stride, int32_t *tmpbuf, int bit_depth, int highbd) {
+ show +
588
589
590
591
592
593
594
595
596
597
int32_t *flt0 = tmpbuf; int32_t *flt1 = flt0 + RESTORATION_UNITPELS_MAX; assert(width * height <= RESTORATION_UNITPELS_MAX); const int ret = av1_selfguided_restoration_sse4_1( dat8, width, height, stride, flt0, flt1, width, eps, bit_depth, highbd); (void)ret; assert(!ret); const sgr_params_type *const params = &sgr_params[eps]; int xq[2]; decode_xq(xqd, xq, params);

[CVE-2020-0478_1.diff] selfguided_avx2.c #6
-void apply_selfguided_restoration_avx2(const uint8_t *dat8, int width, - int height, int stride, int eps, - const int *xqd, uint8_t *dst8, - int dst_stride, int32_t *tmpbuf, - int bit_depth, int highbd) { +void av1_apply_selfguided_restoration_avx2(const uint8_t *dat8, int width, + int height, int stride, int eps, + const int *xqd, uint8_t *dst8, + int dst_stride, int32_t *tmpbuf, + int bit_depth, int highbd) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/selfguided_avx2.c
623
624
625
626
627
628
629
630
631
632
if (params->r[1] > 0) { calc_ab(A, B, C, D, width, height, buf_stride, bit_depth, sgr_params_idx, 1); final_filter(flt1, flt_stride, A, B, buf_stride, dgd8, dgd_stride, width, height, highbd); } aom_free(buf); return 0; }
+ show +
633
634
635
636
637
void apply_selfguided_restoration_avx2(const uint8_t *dat8, int width, int height, int stride, int eps, const int *xqd, uint8_t *dst8, int dst_stride, int32_t *tmpbuf, int bit_depth, int highbd) {
+ show +
638
639
640
641
642
643
644
645
646
647
int32_t *flt0 = tmpbuf; int32_t *flt1 = flt0 + RESTORATION_UNITPELS_MAX; assert(width * height <= RESTORATION_UNITPELS_MAX); const int ret = av1_selfguided_restoration_avx2( dat8, width, height, stride, flt0, flt1, width, eps, bit_depth, highbd); (void)ret; assert(!ret); const sgr_params_type *const params = &sgr_params[eps]; int xq[2]; decode_xq(xqd, xq, params);

[CVE-2020-0470_1.diff] selfguided_avx2.c #6
-void apply_selfguided_restoration_avx2(const uint8_t *dat8, int width, - int height, int stride, int eps, - const int *xqd, uint8_t *dst8, - int dst_stride, int32_t *tmpbuf, - int bit_depth, int highbd) { +void av1_apply_selfguided_restoration_avx2(const uint8_t *dat8, int width, + int height, int stride, int eps, + const int *xqd, uint8_t *dst8, + int dst_stride, int32_t *tmpbuf, + int bit_depth, int highbd) {
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/selfguided_avx2.c
623
624
625
626
627
628
629
630
631
632
if (params->r[1] > 0) { calc_ab(A, B, C, D, width, height, buf_stride, bit_depth, sgr_params_idx, 1); final_filter(flt1, flt_stride, A, B, buf_stride, dgd8, dgd_stride, width, height, highbd); } aom_free(buf); return 0; }
+ show +
633
634
635
636
637
void apply_selfguided_restoration_avx2(const uint8_t *dat8, int width, int height, int stride, int eps, const int *xqd, uint8_t *dst8, int dst_stride, int32_t *tmpbuf, int bit_depth, int highbd) {
+ show +
638
639
640
641
642
643
644
645
646
647
int32_t *flt0 = tmpbuf; int32_t *flt1 = flt0 + RESTORATION_UNITPELS_MAX; assert(width * height <= RESTORATION_UNITPELS_MAX); const int ret = av1_selfguided_restoration_avx2( dat8, width, height, stride, flt0, flt1, width, eps, bit_depth, highbd); (void)ret; assert(!ret); const sgr_params_type *const params = &sgr_params[eps]; int xq[2]; decode_xq(xqd, xq, params);

[CVE-2020-0478_1.diff] highbd_warp_plane_sse4.c #3
- const __m128i tmp_1 = _mm_loadu_si128( - (__m128i *)(warped_filter + ((sx + 1 * alpha) >> WARPEDDIFF_PREC_BITS))); - const __m128i tmp_3 = _mm_loadu_si128( - (__m128i *)(warped_filter + ((sx + 3 * alpha) >> WARPEDDIFF_PREC_BITS))); - const __m128i tmp_5 = _mm_loadu_si128( - (__m128i *)(warped_filter + ((sx + 5 * alpha) >> WARPEDDIFF_PREC_BITS))); - const __m128i tmp_7 = _mm_loadu_si128( - (__m128i *)(warped_filter + ((sx + 7 * alpha) >> WARPEDDIFF_PREC_BITS))); + const __m128i tmp_1 = + _mm_loadu_si128((__m128i *)(av1_warped_filter + + ((sx + 1 * alpha) >> WARPEDDIFF_PREC_BITS))); + const __m128i tmp_3 = + _mm_loadu_si128((__m128i *)(av1_warped_filter + + ((sx + 3 * alpha) >> WARPEDDIFF_PREC_BITS))); + const __m128i tmp_5 = + _mm_loadu_si128((__m128i *)(av1_warped_filter + + ((sx + 5 * alpha) >> WARPEDDIFF_PREC_BITS))); + const __m128i tmp_7 = + _mm_loadu_si128((__m128i *)(av1_warped_filter + + ((sx + 7 * alpha) >> WARPEDDIFF_PREC_BITS)));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_warp_plane_sse4.c
56
57
58
59
60
61
62
63
64
65
// coeffs 0 1 0 1 0 1 0 1 for pixels 0, 2, 4, 6 coeff[0] = _mm_unpacklo_epi64(tmp_8, tmp_10); // coeffs 2 3 2 3 2 3 2 3 for pixels 0, 2, 4, 6 coeff[2] = _mm_unpackhi_epi64(tmp_8, tmp_10); // coeffs 4 5 4 5 4 5 4 5 for pixels 0, 2, 4, 6 coeff[4] = _mm_unpacklo_epi64(tmp_12, tmp_14); // coeffs 6 7 6 7 6 7 6 7 for pixels 0, 2, 4, 6 coeff[6] = _mm_unpackhi_epi64(tmp_12, tmp_14); // Filter odd-index pixels
+ show +
66
67
68
69
70
71
72
73
const __m128i tmp_1 = _mm_loadu_si128( (__m128i *)(warped_filter + ((sx + 1 * alpha) >> WARPEDDIFF_PREC_BITS))); const __m128i tmp_3 = _mm_loadu_si128( (__m128i *)(warped_filter + ((sx + 3 * alpha) >> WARPEDDIFF_PREC_BITS))); const __m128i tmp_5 = _mm_loadu_si128( (__m128i *)(warped_filter + ((sx + 5 * alpha) >> WARPEDDIFF_PREC_BITS))); const __m128i tmp_7 = _mm_loadu_si128( (__m128i *)(warped_filter + ((sx + 7 * alpha) >> WARPEDDIFF_PREC_BITS)));
+ show +
74
75
76
77
78
79
80
81
82
83
const __m128i tmp_9 = _mm_unpacklo_epi32(tmp_1, tmp_3); const __m128i tmp_11 = _mm_unpacklo_epi32(tmp_5, tmp_7); const __m128i tmp_13 = _mm_unpackhi_epi32(tmp_1, tmp_3); const __m128i tmp_15 = _mm_unpackhi_epi32(tmp_5, tmp_7); coeff[1] = _mm_unpacklo_epi64(tmp_9, tmp_11); coeff[3] = _mm_unpackhi_epi64(tmp_9, tmp_11); coeff[5] = _mm_unpacklo_epi64(tmp_13, tmp_15); coeff[7] = _mm_unpackhi_epi64(tmp_13, tmp_15);

[CVE-2020-0470_1.diff] highbd_warp_plane_sse4.c #3
- const __m128i tmp_1 = _mm_loadu_si128( - (__m128i *)(warped_filter + ((sx + 1 * alpha) >> WARPEDDIFF_PREC_BITS))); - const __m128i tmp_3 = _mm_loadu_si128( - (__m128i *)(warped_filter + ((sx + 3 * alpha) >> WARPEDDIFF_PREC_BITS))); - const __m128i tmp_5 = _mm_loadu_si128( - (__m128i *)(warped_filter + ((sx + 5 * alpha) >> WARPEDDIFF_PREC_BITS))); - const __m128i tmp_7 = _mm_loadu_si128( - (__m128i *)(warped_filter + ((sx + 7 * alpha) >> WARPEDDIFF_PREC_BITS))); + const __m128i tmp_1 = + _mm_loadu_si128((__m128i *)(av1_warped_filter + + ((sx + 1 * alpha) >> WARPEDDIFF_PREC_BITS))); + const __m128i tmp_3 = + _mm_loadu_si128((__m128i *)(av1_warped_filter + + ((sx + 3 * alpha) >> WARPEDDIFF_PREC_BITS))); + const __m128i tmp_5 = + _mm_loadu_si128((__m128i *)(av1_warped_filter + + ((sx + 5 * alpha) >> WARPEDDIFF_PREC_BITS))); + const __m128i tmp_7 = + _mm_loadu_si128((__m128i *)(av1_warped_filter + + ((sx + 7 * alpha) >> WARPEDDIFF_PREC_BITS)));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_warp_plane_sse4.c
56
57
58
59
60
61
62
63
64
65
// coeffs 0 1 0 1 0 1 0 1 for pixels 0, 2, 4, 6 coeff[0] = _mm_unpacklo_epi64(tmp_8, tmp_10); // coeffs 2 3 2 3 2 3 2 3 for pixels 0, 2, 4, 6 coeff[2] = _mm_unpackhi_epi64(tmp_8, tmp_10); // coeffs 4 5 4 5 4 5 4 5 for pixels 0, 2, 4, 6 coeff[4] = _mm_unpacklo_epi64(tmp_12, tmp_14); // coeffs 6 7 6 7 6 7 6 7 for pixels 0, 2, 4, 6 coeff[6] = _mm_unpackhi_epi64(tmp_12, tmp_14); // Filter odd-index pixels
+ show +
66
67
68
69
70
71
72
73
const __m128i tmp_1 = _mm_loadu_si128( (__m128i *)(warped_filter + ((sx + 1 * alpha) >> WARPEDDIFF_PREC_BITS))); const __m128i tmp_3 = _mm_loadu_si128( (__m128i *)(warped_filter + ((sx + 3 * alpha) >> WARPEDDIFF_PREC_BITS))); const __m128i tmp_5 = _mm_loadu_si128( (__m128i *)(warped_filter + ((sx + 5 * alpha) >> WARPEDDIFF_PREC_BITS))); const __m128i tmp_7 = _mm_loadu_si128( (__m128i *)(warped_filter + ((sx + 7 * alpha) >> WARPEDDIFF_PREC_BITS)));
+ show +
74
75
76
77
78
79
80
81
82
83
const __m128i tmp_9 = _mm_unpacklo_epi32(tmp_1, tmp_3); const __m128i tmp_11 = _mm_unpacklo_epi32(tmp_5, tmp_7); const __m128i tmp_13 = _mm_unpackhi_epi32(tmp_1, tmp_3); const __m128i tmp_15 = _mm_unpackhi_epi32(tmp_5, tmp_7); coeff[1] = _mm_unpacklo_epi64(tmp_9, tmp_11); coeff[3] = _mm_unpackhi_epi64(tmp_9, tmp_11); coeff[5] = _mm_unpacklo_epi64(tmp_13, tmp_15); coeff[7] = _mm_unpackhi_epi64(tmp_13, tmp_15);

[CVE-2020-0478_1.diff] highbd_inv_txfm_sse4.c #3
- const int log_range) { - if (do_cols) { - addsub_no_clamp_sse4_1(bf1[0], bf1[31], out + 0, out + 31); - addsub_no_clamp_sse4_1(bf1[1], bf1[30], out + 1, out + 30); - addsub_no_clamp_sse4_1(bf1[2], bf1[29], out + 2, out + 29); - addsub_no_clamp_sse4_1(bf1[3], bf1[28], out + 3, out + 28); - addsub_no_clamp_sse4_1(bf1[4], bf1[27], out + 4, out + 27); - addsub_no_clamp_sse4_1(bf1[5], bf1[26], out + 5, out + 26); - addsub_no_clamp_sse4_1(bf1[6], bf1[25], out + 6, out + 25); - addsub_no_clamp_sse4_1(bf1[7], bf1[24], out + 7, out + 24); - addsub_no_clamp_sse4_1(bf1[8], bf1[23], out + 8, out + 23); - addsub_no_clamp_sse4_1(bf1[9], bf1[22], out + 9, out + 22); - addsub_no_clamp_sse4_1(bf1[10], bf1[21], out + 10, out + 21); - addsub_no_clamp_sse4_1(bf1[11], bf1[20], out + 11, out + 20); - addsub_no_clamp_sse4_1(bf1[12], bf1[19], out + 12, out + 19); - addsub_no_clamp_sse4_1(bf1[13], bf1[18], out + 13, out + 18); - addsub_no_clamp_sse4_1(bf1[14], bf1[17], out + 14, out + 17); - addsub_no_clamp_sse4_1(bf1[15], bf1[16], out + 15, out + 16); - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( - -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); - const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( - (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); + const __m128i *clamp_lo, + const __m128i *clamp_hi) { + addsub_sse4_1(bf1[0], bf1[31], out + 0, out + 31, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[1], bf1[30], out + 1, out + 30, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[2], bf1[29], out + 2, out + 29, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[3], bf1[28], out + 3, out + 28, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[4], bf1[27], out + 4, out + 27, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[5], bf1[26], out + 5, out + 26, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[6], bf1[25], out + 6, out + 25, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[7], bf1[24], out + 7, out + 24, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[8], bf1[23], out + 8, out + 23, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[9], bf1[22], out + 9, out + 22, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[10], bf1[21], out + 10, out + 21, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[11], bf1[20], out + 11, out + 20, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[12], bf1[19], out + 12, out + 19, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[13], bf1[18], out + 13, out + 18, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[14], bf1[17], out + 14, out + 17, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[15], bf1[16], out + 15, out + 16, clamp_lo, clamp_hi); - addsub_shift_sse4_1(bf1[0], bf1[31], out + 0, out + 31, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[1], bf1[30], out + 1, out + 30, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[2], bf1[29], out + 2, out + 29, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[3], bf1[28], out + 3, out + 28, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[4], bf1[27], out + 4, out + 27, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[5], bf1[26], out + 5, out + 26, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[6], bf1[25], out + 6, out + 25, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[7], bf1[24], out + 7, out + 24, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[8], bf1[23], out + 8, out + 23, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[9], bf1[22], out + 9, out + 22, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[10], bf1[21], out + 10, out + 21, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[11], bf1[20], out + 11, out + 20, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[12], bf1[19], out + 12, out + 19, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[13], bf1[18], out + 13, out + 18, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[14], bf1[17], out + 14, out + 17, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[15], bf1[16], out + 15, out + 16, &clamp_lo_out, - &clamp_hi_out, out_shift); + if (!do_cols) { + const int log_range_out = AOMMAX(16, bd + 6); + const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); + const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1); + for (int i = 0; i < 32; i += 8) { + round_shift_4x4(out + i, out_shift); + round_shift_4x4(out + i + 4, out_shift); + } + highbd_clamp_epi32_sse4_1(out, out, &clamp_lo_out, &clamp_hi_out, 32);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_sse4.c
291
292
293
294
295
296
297
298
299
300
bf1[22] = temp1; temp2 = half_btf_sse4_1(cospim32, &bf1[23], cospi32, &bf1[24], rounding, bit); bf1[24] = half_btf_sse4_1(cospi32, &bf1[23], cospi32, &bf1[24], rounding, bit); bf1[23] = temp2; } static INLINE void idct32_stage9_sse4_1(__m128i *bf1, __m128i *out, const int do_cols, const int bd, const int out_shift,
+ show +
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
const int log_range) { if (do_cols) { addsub_no_clamp_sse4_1(bf1[0], bf1[31], out + 0, out + 31); addsub_no_clamp_sse4_1(bf1[1], bf1[30], out + 1, out + 30); addsub_no_clamp_sse4_1(bf1[2], bf1[29], out + 2, out + 29); addsub_no_clamp_sse4_1(bf1[3], bf1[28], out + 3, out + 28); addsub_no_clamp_sse4_1(bf1[4], bf1[27], out + 4, out + 27); addsub_no_clamp_sse4_1(bf1[5], bf1[26], out + 5, out + 26); addsub_no_clamp_sse4_1(bf1[6], bf1[25], out + 6, out + 25); addsub_no_clamp_sse4_1(bf1[7], bf1[24], out + 7, out + 24); addsub_no_clamp_sse4_1(bf1[8], bf1[23], out + 8, out + 23); addsub_no_clamp_sse4_1(bf1[9], bf1[22], out + 9, out + 22); addsub_no_clamp_sse4_1(bf1[10], bf1[21], out + 10, out + 21); addsub_no_clamp_sse4_1(bf1[11], bf1[20], out + 11, out + 20); addsub_no_clamp_sse4_1(bf1[12], bf1[19], out + 12, out + 19); addsub_no_clamp_sse4_1(bf1[13], bf1[18], out + 13, out + 18); addsub_no_clamp_sse4_1(bf1[14], bf1[17], out + 14, out + 17); addsub_no_clamp_sse4_1(bf1[15], bf1[16], out + 15, out + 16); } else { const int log_range_out = AOMMAX(16, bd + 6); const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); addsub_shift_sse4_1(bf1[0], bf1[31], out + 0, out + 31, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[1], bf1[30], out + 1, out + 30, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[2], bf1[29], out + 2, out + 29, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[3], bf1[28], out + 3, out + 28, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[4], bf1[27], out + 4, out + 27, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[5], bf1[26], out + 5, out + 26, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[6], bf1[25], out + 6, out + 25, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[7], bf1[24], out + 7, out + 24, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[8], bf1[23], out + 8, out + 23, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[9], bf1[22], out + 9, out + 22, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[10], bf1[21], out + 10, out + 21, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[11], bf1[20], out + 11, out + 20, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[12], bf1[19], out + 12, out + 19, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[13], bf1[18], out + 13, out + 18, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[14], bf1[17], out + 14, out + 17, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[15], bf1[16], out + 15, out + 16, &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
358
359
360
361
362
363
364
365
366
367
} } static void neg_shift_sse4_1(const __m128i in0, const __m128i in1, __m128i *out0, __m128i *out1, const __m128i *clamp_lo, const __m128i *clamp_hi, int shift) { __m128i offset = _mm_set1_epi32((1 << shift) >> 1); __m128i a0 = _mm_add_epi32(offset, in0); __m128i a1 = _mm_sub_epi32(offset, in1);

[CVE-2020-0478_1.diff] highbd_inv_txfm_sse4.c #10
- if (do_cols) { - addsub_no_clamp_sse4_1(u0, u7, out + 0 * 2 + col, out + 7 * 2 + col); - addsub_no_clamp_sse4_1(u1, u6, out + 1 * 2 + col, out + 6 * 2 + col); - addsub_no_clamp_sse4_1(u2, u5, out + 2 * 2 + col, out + 5 * 2 + col); - addsub_no_clamp_sse4_1(u3, u4, out + 3 * 2 + col, out + 4 * 2 + col); - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( - -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); - const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( - (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); - addsub_shift_sse4_1(u0, u7, out + 0 * 2 + col, out + 7 * 2 + col, - &clamp_lo_out, &clamp_hi_out, out_shift); - addsub_shift_sse4_1(u1, u6, out + 1 * 2 + col, out + 6 * 2 + col, - &clamp_lo_out, &clamp_hi_out, out_shift); - addsub_shift_sse4_1(u2, u5, out + 2 * 2 + col, out + 5 * 2 + col, - &clamp_lo_out, &clamp_hi_out, out_shift); - addsub_shift_sse4_1(u3, u4, out + 3 * 2 + col, out + 4 * 2 + col, - &clamp_lo_out, &clamp_hi_out, out_shift); - } + addsub_sse4_1(u0, u7, out + 0 * 2 + col, out + 7 * 2 + col, &clamp_lo, + &clamp_hi); + addsub_sse4_1(u1, u6, out + 1 * 2 + col, out + 6 * 2 + col, &clamp_lo, + &clamp_hi); + addsub_sse4_1(u2, u5, out + 2 * 2 + col, out + 5 * 2 + col, &clamp_lo, + &clamp_hi); + addsub_sse4_1(u3, u4, out + 3 * 2 + col, out + 4 * 2 + col, &clamp_lo, + &clamp_hi); + } + + if (!do_cols) { + const int log_range_out = AOMMAX(16, bd + 6); + const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); + const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1); + round_shift_8x8(out, out_shift); + highbd_clamp_epi32_sse4_1(out, out, &clamp_lo_out, &clamp_hi_out, 16);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_sse4.c
867
868
869
870
871
872
873
874
875
876
y = _mm_mullo_epi32(v6, cospi32); u6 = _mm_add_epi32(y, x); u6 = _mm_add_epi32(u6, rnding); u6 = _mm_srai_epi32(u6, bit); u5 = _mm_sub_epi32(y, x); u5 = _mm_add_epi32(u5, rnding); u5 = _mm_srai_epi32(u5, bit); // stage 5
+ show +
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
if (do_cols) { addsub_no_clamp_sse4_1(u0, u7, out + 0 * 2 + col, out + 7 * 2 + col); addsub_no_clamp_sse4_1(u1, u6, out + 1 * 2 + col, out + 6 * 2 + col); addsub_no_clamp_sse4_1(u2, u5, out + 2 * 2 + col, out + 5 * 2 + col); addsub_no_clamp_sse4_1(u3, u4, out + 3 * 2 + col, out + 4 * 2 + col); } else { const int log_range_out = AOMMAX(16, bd + 6); const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); addsub_shift_sse4_1(u0, u7, out + 0 * 2 + col, out + 7 * 2 + col, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(u1, u6, out + 1 * 2 + col, out + 6 * 2 + col, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(u2, u5, out + 2 * 2 + col, out + 5 * 2 + col, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(u3, u4, out + 3 * 2 + col, out + 4 * 2 + col, &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
896
897
898
899
900
901
902
903
904
905
} } } static void iadst8x8_sse4_1(__m128i *in, __m128i *out, int bit, int do_cols, int bd, int out_shift) { const int32_t *cospi = cospi_arr(bit); const __m128i cospi4 = _mm_set1_epi32(cospi[4]); const __m128i cospi60 = _mm_set1_epi32(cospi[60]); const __m128i cospi20 = _mm_set1_epi32(cospi[20]);

[CVE-2020-0478_1.diff] highbd_inv_txfm_sse4.c #17
+ // stage 0 + // stage 1 + u[0] = in[0]; + u[2] = in[4]; + u[4] = in[2]; + u[6] = in[6]; + u[8] = in[1]; + u[10] = in[5]; + u[12] = in[3]; + u[14] = in[7]; - { - // stage 0 - // stage 1 - u[0] = in[0]; - u[2] = in[4]; - u[4] = in[2]; - u[6] = in[6]; - u[8] = in[1]; - u[10] = in[5]; - u[12] = in[3]; - u[14] = in[7]; + // stage 2 + u[15] = half_btf_0_sse4_1(&cospi4, &u[8], &rnding, bit); + u[8] = half_btf_0_sse4_1(&cospi60, &u[8], &rnding, bit); - // stage 2 - u[15] = half_btf_0_sse4_1(&cospi4, &u[8], &rnding, bit); - u[8] = half_btf_0_sse4_1(&cospi60, &u[8], &rnding, bit); + u[9] = half_btf_0_sse4_1(&cospim36, &u[14], &rnding, bit); + u[14] = half_btf_0_sse4_1(&cospi28, &u[14], &rnding, bit); - u[9] = half_btf_0_sse4_1(&cospim36, &u[14], &rnding, bit); - u[14] = half_btf_0_sse4_1(&cospi28, &u[14], &rnding, bit); + u[13] = half_btf_0_sse4_1(&cospi20, &u[10], &rnding, bit); + u[10] = half_btf_0_sse4_1(&cospi44, &u[10], &rnding, bit); - u[13] = half_btf_0_sse4_1(&cospi20, &u[10], &rnding, bit); - u[10] = half_btf_0_sse4_1(&cospi44, &u[10], &rnding, bit); + u[11] = half_btf_0_sse4_1(&cospim52, &u[12], &rnding, bit); + u[12] = half_btf_0_sse4_1(&cospi12, &u[12], &rnding, bit); - u[11] = half_btf_0_sse4_1(&cospim52, &u[12], &rnding, bit); - u[12] = half_btf_0_sse4_1(&cospi12, &u[12], &rnding, bit); + // stage 3 + u[7] = half_btf_0_sse4_1(&cospi8, &u[4], &rnding, bit); + u[4] = half_btf_0_sse4_1(&cospi56, &u[4], &rnding, bit); + u[5] = half_btf_0_sse4_1(&cospim40, &u[6], &rnding, bit); + u[6] = half_btf_0_sse4_1(&cospi24, &u[6], &rnding, bit); - // stage 3 - u[7] = half_btf_0_sse4_1(&cospi8, &u[4], &rnding, bit); - u[4] = half_btf_0_sse4_1(&cospi56, &u[4], &rnding, bit); - u[5] = half_btf_0_sse4_1(&cospim40, &u[6], &rnding, bit); - u[6] = half_btf_0_sse4_1(&cospi24, &u[6], &rnding, bit); + addsub_sse4_1(u[8], u[9], &u[8], &u[9], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[11], u[10], &u[11], &u[10], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[12], u[13], &u[12], &u[13], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[15], u[14], &u[15], &u[14], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[8], u[9], &u[8], &u[9], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[11], u[10], &u[11], &u[10], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[12], u[13], &u[12], &u[13], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[15], u[14], &u[15], &u[14], &clamp_lo, &clamp_hi); + // stage 4 + x = _mm_mullo_epi32(u[0], cospi32); + u[0] = _mm_add_epi32(x, rnding); + u[0] = _mm_srai_epi32(u[0], bit); + u[1] = u[0]; - // stage 4 - x = _mm_mullo_epi32(u[0], cospi32); - u[0] = _mm_add_epi32(x, rnding); - u[0] = _mm_srai_epi32(u[0], bit); - u[1] = u[0]; + u[3] = half_btf_0_sse4_1(&cospi16, &u[2], &rnding, bit); + u[2] = half_btf_0_sse4_1(&cospi48, &u[2], &rnding, bit); - u[3] = half_btf_0_sse4_1(&cospi16, &u[2], &rnding, bit); - u[2] = half_btf_0_sse4_1(&cospi48, &u[2], &rnding, bit); + addsub_sse4_1(u[4], u[5], &u[4], &u[5], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[7], u[6], &u[7], &u[6], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[4], u[5], &u[4], &u[5], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[7], u[6], &u[7], &u[6], &clamp_lo, &clamp_hi); + x = half_btf_sse4_1(&cospim16, &u[9], &cospi48, &u[14], &rnding, bit); + u[14] = half_btf_sse4_1(&cospi48, &u[9], &cospi16, &u[14], &rnding, bit); + u[9] = x; + y = half_btf_sse4_1(&cospim48, &u[10], &cospim16, &u[13], &rnding, bit); + u[13] = half_btf_sse4_1(&cospim16, &u[10], &cospi48, &u[13], &rnding, bit); + u[10] = y; - x = half_btf_sse4_1(&cospim16, &u[9], &cospi48, &u[14], &rnding, bit); - u[14] = half_btf_sse4_1(&cospi48, &u[9], &cospi16, &u[14], &rnding, bit); - u[9] = x; - y = half_btf_sse4_1(&cospim48, &u[10], &cospim16, &u[13], &rnding, bit); - u[13] = half_btf_sse4_1(&cospim16, &u[10], &cospi48, &u[13], &rnding, bit); - u[10] = y; + // stage 5 + addsub_sse4_1(u[0], u[3], &u[0], &u[3], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[1], u[2], &u[1], &u[2], &clamp_lo, &clamp_hi); - // stage 5 - addsub_sse4_1(u[0], u[3], &u[0], &u[3], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[1], u[2], &u[1], &u[2], &clamp_lo, &clamp_hi); + x = _mm_mullo_epi32(u[5], cospi32); + y = _mm_mullo_epi32(u[6], cospi32); + u[5] = _mm_sub_epi32(y, x); + u[5] = _mm_add_epi32(u[5], rnding); + u[5] = _mm_srai_epi32(u[5], bit); - x = _mm_mullo_epi32(u[5], cospi32); - y = _mm_mullo_epi32(u[6], cospi32); - u[5] = _mm_sub_epi32(y, x); - u[5] = _mm_add_epi32(u[5], rnding); - u[5] = _mm_srai_epi32(u[5], bit); + u[6] = _mm_add_epi32(y, x); + u[6] = _mm_add_epi32(u[6], rnding); + u[6] = _mm_srai_epi32(u[6], bit); - u[6] = _mm_add_epi32(y, x); - u[6] = _mm_add_epi32(u[6], rnding); - u[6] = _mm_srai_epi32(u[6], bit); + addsub_sse4_1(u[8], u[11], &u[8], &u[11], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[9], u[10], &u[9], &u[10], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[15], u[12], &u[15], &u[12], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[14], u[13], &u[14], &u[13], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[8], u[11], &u[8], &u[11], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[9], u[10], &u[9], &u[10], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[15], u[12], &u[15], &u[12], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[14], u[13], &u[14], &u[13], &clamp_lo, &clamp_hi); + // stage 6 + addsub_sse4_1(u[0], u[7], &u[0], &u[7], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[1], u[6], &u[1], &u[6], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[2], u[5], &u[2], &u[5], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[3], u[4], &u[3], &u[4], &clamp_lo, &clamp_hi); - // stage 6 - addsub_sse4_1(u[0], u[7], &u[0], &u[7], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[1], u[6], &u[1], &u[6], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[2], u[5], &u[2], &u[5], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[3], u[4], &u[3], &u[4], &clamp_lo, &clamp_hi); + x = _mm_mullo_epi32(u[10], cospi32); + y = _mm_mullo_epi32(u[13], cospi32); + u[10] = _mm_sub_epi32(y, x); + u[10] = _mm_add_epi32(u[10], rnding); + u[10] = _mm_srai_epi32(u[10], bit); - x = _mm_mullo_epi32(u[10], cospi32); - y = _mm_mullo_epi32(u[13], cospi32); - u[10] = _mm_sub_epi32(y, x); - u[10] = _mm_add_epi32(u[10], rnding); - u[10] = _mm_srai_epi32(u[10], bit); + u[13] = _mm_add_epi32(x, y); + u[13] = _mm_add_epi32(u[13], rnding); + u[13] = _mm_srai_epi32(u[13], bit); - u[13] = _mm_add_epi32(x, y); - u[13] = _mm_add_epi32(u[13], rnding); - u[13] = _mm_srai_epi32(u[13], bit); + x = _mm_mullo_epi32(u[11], cospi32); + y = _mm_mullo_epi32(u[12], cospi32); + u[11] = _mm_sub_epi32(y, x); + u[11] = _mm_add_epi32(u[11], rnding); + u[11] = _mm_srai_epi32(u[11], bit); - x = _mm_mullo_epi32(u[11], cospi32); - y = _mm_mullo_epi32(u[12], cospi32); - u[11] = _mm_sub_epi32(y, x); - u[11] = _mm_add_epi32(u[11], rnding); - u[11] = _mm_srai_epi32(u[11], bit); + u[12] = _mm_add_epi32(x, y); + u[12] = _mm_add_epi32(u[12], rnding); + u[12] = _mm_srai_epi32(u[12], bit); + // stage 7 + addsub_sse4_1(u[0], u[15], out + 0, out + 15, &clamp_lo, &clamp_hi); + addsub_sse4_1(u[1], u[14], out + 1, out + 14, &clamp_lo, &clamp_hi); + addsub_sse4_1(u[2], u[13], out + 2, out + 13, &clamp_lo, &clamp_hi); + addsub_sse4_1(u[3], u[12], out + 3, out + 12, &clamp_lo, &clamp_hi); + addsub_sse4_1(u[4], u[11], out + 4, out + 11, &clamp_lo, &clamp_hi); + addsub_sse4_1(u[5], u[10], out + 5, out + 10, &clamp_lo, &clamp_hi); + addsub_sse4_1(u[6], u[9], out + 6, out + 9, &clamp_lo, &clamp_hi); + addsub_sse4_1(u[7], u[8], out + 7, out + 8, &clamp_lo, &clamp_hi); - u[12] = _mm_add_epi32(x, y); - u[12] = _mm_add_epi32(u[12], rnding); - u[12] = _mm_srai_epi32(u[12], bit); - // stage 7 - if (do_cols) { - addsub_no_clamp_sse4_1(u[0], u[15], out + 0, out + 15); - addsub_no_clamp_sse4_1(u[1], u[14], out + 1, out + 14); - addsub_no_clamp_sse4_1(u[2], u[13], out + 2, out + 13); - addsub_no_clamp_sse4_1(u[3], u[12], out + 3, out + 12); - addsub_no_clamp_sse4_1(u[4], u[11], out + 4, out + 11); - addsub_no_clamp_sse4_1(u[5], u[10], out + 5, out + 10); - addsub_no_clamp_sse4_1(u[6], u[9], out + 6, out + 9); - addsub_no_clamp_sse4_1(u[7], u[8], out + 7, out + 8); - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( - -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); - const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( - (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); - - addsub_shift_sse4_1(u[0], u[15], out + 0, out + 15, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(u[1], u[14], out + 1, out + 14, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(u[2], u[13], out + 2, out + 13, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(u[3], u[12], out + 3, out + 12, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(u[4], u[11], out + 4, out + 11, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(u[5], u[10], out + 5, out + 10, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(u[6], u[9], out + 6, out + 9, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(u[7], u[8], out + 7, out + 8, &clamp_lo_out, - &clamp_hi_out, out_shift); - } + if (!do_cols) { + const int log_range_out = AOMMAX(16, bd + 6); + const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); + const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1); + round_shift_8x8(out, out_shift); + highbd_clamp_epi32_sse4_1(out, out, &clamp_lo_out, &clamp_hi_out, 16);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_sse4.c
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
const __m128i cospim52 = _mm_set1_epi32(-cospi[52]); const __m128i rnding = _mm_set1_epi32(1 << (bit - 1)); const int log_range = AOMMAX(16, bd + (do_cols ? 6 : 8)); const __m128i clamp_lo = _mm_set1_epi32(-(1 << (log_range - 1))); const __m128i clamp_hi = _mm_set1_epi32((1 << (log_range - 1)) - 1); __m128i u[16], x, y; { // stage 0 // stage 1
+ show +
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
u[0] = in[0]; u[2] = in[4]; u[4] = in[2]; u[6] = in[6]; u[8] = in[1]; u[10] = in[5]; u[12] = in[3]; u[14] = in[7]; // stage 2 u[15] = half_btf_0_sse4_1(&cospi4, &u[8], &rnding, bit); u[8] = half_btf_0_sse4_1(&cospi60, &u[8], &rnding, bit); u[9] = half_btf_0_sse4_1(&cospim36, &u[14], &rnding, bit); u[14] = half_btf_0_sse4_1(&cospi28, &u[14], &rnding, bit); u[13] = half_btf_0_sse4_1(&cospi20, &u[10], &rnding, bit); u[10] = half_btf_0_sse4_1(&cospi44, &u[10], &rnding, bit); u[11] = half_btf_0_sse4_1(&cospim52, &u[12], &rnding, bit); u[12] = half_btf_0_sse4_1(&cospi12, &u[12], &rnding, bit); // stage 3 u[7] = half_btf_0_sse4_1(&cospi8, &u[4], &rnding, bit); u[4] = half_btf_0_sse4_1(&cospi56, &u[4], &rnding, bit); u[5] = half_btf_0_sse4_1(&cospim40, &u[6], &rnding, bit); u[6] = half_btf_0_sse4_1(&cospi24, &u[6], &rnding, bit); addsub_sse4_1(u[8], u[9], &u[8], &u[9], &clamp_lo, &clamp_hi); addsub_sse4_1(u[11], u[10], &u[11], &u[10], &clamp_lo, &clamp_hi); addsub_sse4_1(u[12], u[13], &u[12], &u[13], &clamp_lo, &clamp_hi); addsub_sse4_1(u[15], u[14], &u[15], &u[14], &clamp_lo, &clamp_hi); // stage 4 x = _mm_mullo_epi32(u[0], cospi32); u[0] = _mm_add_epi32(x, rnding); u[0] = _mm_srai_epi32(u[0], bit); u[1] = u[0]; u[3] = half_btf_0_sse4_1(&cospi16, &u[2], &rnding, bit); u[2] = half_btf_0_sse4_1(&cospi48, &u[2], &rnding, bit); addsub_sse4_1(u[4], u[5], &u[4], &u[5], &clamp_lo, &clamp_hi); addsub_sse4_1(u[7], u[6], &u[7], &u[6], &clamp_lo, &clamp_hi); x = half_btf_sse4_1(&cospim16, &u[9], &cospi48, &u[14], &rnding, bit); u[14] = half_btf_sse4_1(&cospi48, &u[9], &cospi16, &u[14], &rnding, bit); u[9] = x; y = half_btf_sse4_1(&cospim48, &u[10], &cospim16, &u[13], &rnding, bit); u[13] = half_btf_sse4_1(&cospim16, &u[10], &cospi48, &u[13], &rnding, bit); u[10] = y; // stage 5 addsub_sse4_1(u[0], u[3], &u[0], &u[3], &clamp_lo, &clamp_hi); addsub_sse4_1(u[1], u[2], &u[1], &u[2], &clamp_lo, &clamp_hi); x = _mm_mullo_epi32(u[5], cospi32); y = _mm_mullo_epi32(u[6], cospi32); u[5] = _mm_sub_epi32(y, x); u[5] = _mm_add_epi32(u[5], rnding); u[5] = _mm_srai_epi32(u[5], bit); u[6] = _mm_add_epi32(y, x); u[6] = _mm_add_epi32(u[6], rnding); u[6] = _mm_srai_epi32(u[6], bit); addsub_sse4_1(u[8], u[11], &u[8], &u[11], &clamp_lo, &clamp_hi); addsub_sse4_1(u[9], u[10], &u[9], &u[10], &clamp_lo, &clamp_hi); addsub_sse4_1(u[15], u[12], &u[15], &u[12], &clamp_lo, &clamp_hi); addsub_sse4_1(u[14], u[13], &u[14], &u[13], &clamp_lo, &clamp_hi); // stage 6 addsub_sse4_1(u[0], u[7], &u[0], &u[7], &clamp_lo, &clamp_hi); addsub_sse4_1(u[1], u[6], &u[1], &u[6], &clamp_lo, &clamp_hi); addsub_sse4_1(u[2], u[5], &u[2], &u[5], &clamp_lo, &clamp_hi); addsub_sse4_1(u[3], u[4], &u[3], &u[4], &clamp_lo, &clamp_hi); x = _mm_mullo_epi32(u[10], cospi32); y = _mm_mullo_epi32(u[13], cospi32); u[10] = _mm_sub_epi32(y, x); u[10] = _mm_add_epi32(u[10], rnding); u[10] = _mm_srai_epi32(u[10], bit); u[13] = _mm_add_epi32(x, y); u[13] = _mm_add_epi32(u[13], rnding); u[13] = _mm_srai_epi32(u[13], bit); x = _mm_mullo_epi32(u[11], cospi32); y = _mm_mullo_epi32(u[12], cospi32); u[11] = _mm_sub_epi32(y, x); u[11] = _mm_add_epi32(u[11], rnding); u[11] = _mm_srai_epi32(u[11], bit); u[12] = _mm_add_epi32(x, y); u[12] = _mm_add_epi32(u[12], rnding); u[12] = _mm_srai_epi32(u[12], bit); // stage 7 if (do_cols) { addsub_no_clamp_sse4_1(u[0], u[15], out + 0, out + 15); addsub_no_clamp_sse4_1(u[1], u[14], out + 1, out + 14); addsub_no_clamp_sse4_1(u[2], u[13], out + 2, out + 13); addsub_no_clamp_sse4_1(u[3], u[12], out + 3, out + 12); addsub_no_clamp_sse4_1(u[4], u[11], out + 4, out + 11); addsub_no_clamp_sse4_1(u[5], u[10], out + 5, out + 10); addsub_no_clamp_sse4_1(u[6], u[9], out + 6, out + 9); addsub_no_clamp_sse4_1(u[7], u[8], out + 7, out + 8); } else { const int log_range_out = AOMMAX(16, bd + 6); const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); addsub_shift_sse4_1(u[0], u[15], out + 0, out + 15, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(u[1], u[14], out + 1, out + 14, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(u[2], u[13], out + 2, out + 13, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(u[3], u[12], out + 3, out + 12, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(u[4], u[11], out + 4, out + 11, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(u[5], u[10], out + 5, out + 10, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(u[6], u[9], out + 6, out + 9, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(u[7], u[8], out + 7, out + 8, &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
} } } static void iadst16x16_low1_sse4_1(__m128i *in, __m128i *out, int bit, int do_cols, int bd, int out_shift) { const int32_t *cospi = cospi_arr(bit); const __m128i cospi2 = _mm_set1_epi32(cospi[2]); const __m128i cospi62 = _mm_set1_epi32(cospi[62]); const __m128i cospi8 = _mm_set1_epi32(cospi[8]);

[CVE-2020-0478_1.diff] highbd_inv_txfm_sse4.c #18
+ // stage 0 + // stage 1 + // stage 2 + x = _mm_mullo_epi32(in[0], cospi62); + v[0] = _mm_add_epi32(x, rnding); + v[0] = _mm_srai_epi32(v[0], bit); - // Calculate the column 0, 1, 2, 3 - { - // stage 0 - // stage 1 - // stage 2 - x = _mm_mullo_epi32(in[0], cospi62); - v[0] = _mm_add_epi32(x, rnding); - v[0] = _mm_srai_epi32(v[0], bit); + x = _mm_mullo_epi32(in[0], cospi2); + v[1] = _mm_sub_epi32(zero, x); + v[1] = _mm_add_epi32(v[1], rnding); + v[1] = _mm_srai_epi32(v[1], bit); - x = _mm_mullo_epi32(in[0], cospi2); - v[1] = _mm_sub_epi32(zero, x); - v[1] = _mm_add_epi32(v[1], rnding); - v[1] = _mm_srai_epi32(v[1], bit); + // stage 3 + v[8] = v[0]; + v[9] = v[1]; - // stage 3 - v[8] = v[0]; - v[9] = v[1]; + // stage 4 + temp1 = _mm_mullo_epi32(v[8], cospi8); + x = _mm_mullo_epi32(v[9], cospi56); + temp1 = _mm_add_epi32(temp1, x); + temp1 = _mm_add_epi32(temp1, rnding); + temp1 = _mm_srai_epi32(temp1, bit); - // stage 4 - temp1 = _mm_mullo_epi32(v[8], cospi8); - x = _mm_mullo_epi32(v[9], cospi56); - temp1 = _mm_add_epi32(temp1, x); - temp1 = _mm_add_epi32(temp1, rnding); - temp1 = _mm_srai_epi32(temp1, bit); + temp2 = _mm_mullo_epi32(v[8], cospi56); + x = _mm_mullo_epi32(v[9], cospi8); + temp2 = _mm_sub_epi32(temp2, x); + temp2 = _mm_add_epi32(temp2, rnding); + temp2 = _mm_srai_epi32(temp2, bit); + v[8] = temp1; + v[9] = temp2; - temp2 = _mm_mullo_epi32(v[8], cospi56); - x = _mm_mullo_epi32(v[9], cospi8); - temp2 = _mm_sub_epi32(temp2, x); - temp2 = _mm_add_epi32(temp2, rnding); - temp2 = _mm_srai_epi32(temp2, bit); - v[8] = temp1; - v[9] = temp2; + // stage 5 + v[4] = v[0]; + v[5] = v[1]; + v[12] = v[8]; + v[13] = v[9]; - // stage 5 - v[4] = v[0]; - v[5] = v[1]; - v[12] = v[8]; - v[13] = v[9]; + // stage 6 + temp1 = _mm_mullo_epi32(v[4], cospi16); + x = _mm_mullo_epi32(v[5], cospi48); + temp1 = _mm_add_epi32(temp1, x); + temp1 = _mm_add_epi32(temp1, rnding); + temp1 = _mm_srai_epi32(temp1, bit); - // stage 6 - temp1 = _mm_mullo_epi32(v[4], cospi16); - x = _mm_mullo_epi32(v[5], cospi48); - temp1 = _mm_add_epi32(temp1, x); - temp1 = _mm_add_epi32(temp1, rnding); - temp1 = _mm_srai_epi32(temp1, bit); + temp2 = _mm_mullo_epi32(v[4], cospi48); + x = _mm_mullo_epi32(v[5], cospi16); + temp2 = _mm_sub_epi32(temp2, x); + temp2 = _mm_add_epi32(temp2, rnding); + temp2 = _mm_srai_epi32(temp2, bit); + v[4] = temp1; + v[5] = temp2; - temp2 = _mm_mullo_epi32(v[4], cospi48); - x = _mm_mullo_epi32(v[5], cospi16); - temp2 = _mm_sub_epi32(temp2, x); - temp2 = _mm_add_epi32(temp2, rnding); - temp2 = _mm_srai_epi32(temp2, bit); - v[4] = temp1; - v[5] = temp2; + temp1 = _mm_mullo_epi32(v[12], cospi16); + x = _mm_mullo_epi32(v[13], cospi48); + temp1 = _mm_add_epi32(temp1, x); + temp1 = _mm_add_epi32(temp1, rnding); + temp1 = _mm_srai_epi32(temp1, bit); - temp1 = _mm_mullo_epi32(v[12], cospi16); - x = _mm_mullo_epi32(v[13], cospi48); - temp1 = _mm_add_epi32(temp1, x); - temp1 = _mm_add_epi32(temp1, rnding); - temp1 = _mm_srai_epi32(temp1, bit); + temp2 = _mm_mullo_epi32(v[12], cospi48); + x = _mm_mullo_epi32(v[13], cospi16); + temp2 = _mm_sub_epi32(temp2, x); + temp2 = _mm_add_epi32(temp2, rnding); + temp2 = _mm_srai_epi32(temp2, bit); + v[12] = temp1; + v[13] = temp2; - temp2 = _mm_mullo_epi32(v[12], cospi48); - x = _mm_mullo_epi32(v[13], cospi16); - temp2 = _mm_sub_epi32(temp2, x); - temp2 = _mm_add_epi32(temp2, rnding); - temp2 = _mm_srai_epi32(temp2, bit); - v[12] = temp1; - v[13] = temp2; + // stage 7 + v[2] = v[0]; + v[3] = v[1]; + v[6] = v[4]; + v[7] = v[5]; + v[10] = v[8]; + v[11] = v[9]; + v[14] = v[12]; + v[15] = v[13]; - // stage 7 - v[2] = v[0]; - v[3] = v[1]; - v[6] = v[4]; - v[7] = v[5]; - v[10] = v[8]; - v[11] = v[9]; - v[14] = v[12]; - v[15] = v[13]; + // stage 8 + y = _mm_mullo_epi32(v[2], cospi32); + x = _mm_mullo_epi32(v[3], cospi32); + v[2] = _mm_add_epi32(y, x); + v[2] = _mm_add_epi32(v[2], rnding); + v[2] = _mm_srai_epi32(v[2], bit); - // stage 8 - y = _mm_mullo_epi32(v[2], cospi32); - x = _mm_mullo_epi32(v[3], cospi32); - v[2] = _mm_add_epi32(y, x); - v[2] = _mm_add_epi32(v[2], rnding); - v[2] = _mm_srai_epi32(v[2], bit); + v[3] = _mm_sub_epi32(y, x); + v[3] = _mm_add_epi32(v[3], rnding); + v[3] = _mm_srai_epi32(v[3], bit); - v[3] = _mm_sub_epi32(y, x); - v[3] = _mm_add_epi32(v[3], rnding); - v[3] = _mm_srai_epi32(v[3], bit); + y = _mm_mullo_epi32(v[6], cospi32); + x = _mm_mullo_epi32(v[7], cospi32); + v[6] = _mm_add_epi32(y, x); + v[6] = _mm_add_epi32(v[6], rnding); + v[6] = _mm_srai_epi32(v[6], bit); - y = _mm_mullo_epi32(v[6], cospi32); - x = _mm_mullo_epi32(v[7], cospi32); - v[6] = _mm_add_epi32(y, x); - v[6] = _mm_add_epi32(v[6], rnding); - v[6] = _mm_srai_epi32(v[6], bit); + v[7] = _mm_sub_epi32(y, x); + v[7] = _mm_add_epi32(v[7], rnding); + v[7] = _mm_srai_epi32(v[7], bit); - v[7] = _mm_sub_epi32(y, x); - v[7] = _mm_add_epi32(v[7], rnding); - v[7] = _mm_srai_epi32(v[7], bit); + y = _mm_mullo_epi32(v[10], cospi32); + x = _mm_mullo_epi32(v[11], cospi32); + v[10] = _mm_add_epi32(y, x); + v[10] = _mm_add_epi32(v[10], rnding); + v[10] = _mm_srai_epi32(v[10], bit); - y = _mm_mullo_epi32(v[10], cospi32); - x = _mm_mullo_epi32(v[11], cospi32); - v[10] = _mm_add_epi32(y, x); - v[10] = _mm_add_epi32(v[10], rnding); - v[10] = _mm_srai_epi32(v[10], bit); + v[11] = _mm_sub_epi32(y, x); + v[11] = _mm_add_epi32(v[11], rnding); + v[11] = _mm_srai_epi32(v[11], bit); - v[11] = _mm_sub_epi32(y, x); - v[11] = _mm_add_epi32(v[11], rnding); - v[11] = _mm_srai_epi32(v[11], bit); + y = _mm_mullo_epi32(v[14], cospi32); + x = _mm_mullo_epi32(v[15], cospi32); + v[14] = _mm_add_epi32(y, x); + v[14] = _mm_add_epi32(v[14], rnding); + v[14] = _mm_srai_epi32(v[14], bit); - y = _mm_mullo_epi32(v[14], cospi32); - x = _mm_mullo_epi32(v[15], cospi32); - v[14] = _mm_add_epi32(y, x); - v[14] = _mm_add_epi32(v[14], rnding); - v[14] = _mm_srai_epi32(v[14], bit); + v[15] = _mm_sub_epi32(y, x); + v[15] = _mm_add_epi32(v[15], rnding); + v[15] = _mm_srai_epi32(v[15], bit); - v[15] = _mm_sub_epi32(y, x); - v[15] = _mm_add_epi32(v[15], rnding); - v[15] = _mm_srai_epi32(v[15], bit); + // stage 9 + if (do_cols) { + out[0] = v[0]; + out[1] = _mm_sub_epi32(zero, v[8]); + out[2] = v[12]; + out[3] = _mm_sub_epi32(zero, v[4]); + out[4] = v[6]; + out[5] = _mm_sub_epi32(zero, v[14]); + out[6] = v[10]; + out[7] = _mm_sub_epi32(zero, v[2]); + out[8] = v[3]; + out[9] = _mm_sub_epi32(zero, v[11]); + out[10] = v[15]; + out[11] = _mm_sub_epi32(zero, v[7]); + out[12] = v[5]; + out[13] = _mm_sub_epi32(zero, v[13]); + out[14] = v[9]; + out[15] = _mm_sub_epi32(zero, v[1]); + } else { + const int log_range_out = AOMMAX(16, bd + 6); + const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); + const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1); - // stage 9 - if (do_cols) { - out[0] = v[0]; - out[1] = _mm_sub_epi32(_mm_setzero_si128(), v[8]); - out[2] = v[12]; - out[3] = _mm_sub_epi32(_mm_setzero_si128(), v[4]); - out[4] = v[6]; - out[5] = _mm_sub_epi32(_mm_setzero_si128(), v[14]); - out[6] = v[10]; - out[7] = _mm_sub_epi32(_mm_setzero_si128(), v[2]); - out[8] = v[3]; - out[9] = _mm_sub_epi32(_mm_setzero_si128(), v[11]); - out[10] = v[15]; - out[11] = _mm_sub_epi32(_mm_setzero_si128(), v[7]); - out[12] = v[5]; - out[13] = _mm_sub_epi32(_mm_setzero_si128(), v[13]); - out[14] = v[9]; - out[15] = _mm_sub_epi32(_mm_setzero_si128(), v[1]); - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); - const __m128i clamp_hi_out = - _mm_set1_epi32((1 << (log_range_out - 1)) - 1); - - neg_shift_sse4_1(v[0], v[8], out + 0, out + 1, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(v[12], v[4], out + 2, out + 3, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(v[6], v[14], out + 4, out + 5, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(v[10], v[2], out + 6, out + 7, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(v[3], v[11], out + 8, out + 9, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(v[15], v[7], out + 10, out + 11, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(v[5], v[13], out + 12, out + 13, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(v[9], v[1], out + 14, out + 15, &clamp_lo_out, - &clamp_hi_out, out_shift); - } + neg_shift_sse4_1(v[0], v[8], out + 0, out + 1, &clamp_lo_out, &clamp_hi_out, + out_shift); + neg_shift_sse4_1(v[12], v[4], out + 2, out + 3, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(v[6], v[14], out + 4, out + 5, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(v[10], v[2], out + 6, out + 7, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(v[3], v[11], out + 8, out + 9, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(v[15], v[7], out + 10, out + 11, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(v[5], v[13], out + 12, out + 13, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(v[9], v[1], out + 14, out + 15, &clamp_lo_out, + &clamp_hi_out, out_shift);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_sse4.c
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
const __m128i cospi32 = _mm_set1_epi32(cospi[32]); const __m128i rnding = _mm_set1_epi32(1 << (bit - 1)); const __m128i zero = _mm_setzero_si128(); __m128i v[16], x, y, temp1, temp2; // Calculate the column 0, 1, 2, 3 { // stage 0 // stage 1 // stage 2
+ show +
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
x = _mm_mullo_epi32(in[0], cospi62); v[0] = _mm_add_epi32(x, rnding); v[0] = _mm_srai_epi32(v[0], bit); x = _mm_mullo_epi32(in[0], cospi2); v[1] = _mm_sub_epi32(zero, x); v[1] = _mm_add_epi32(v[1], rnding); v[1] = _mm_srai_epi32(v[1], bit); // stage 3 v[8] = v[0]; v[9] = v[1]; // stage 4 temp1 = _mm_mullo_epi32(v[8], cospi8); x = _mm_mullo_epi32(v[9], cospi56); temp1 = _mm_add_epi32(temp1, x); temp1 = _mm_add_epi32(temp1, rnding); temp1 = _mm_srai_epi32(temp1, bit); temp2 = _mm_mullo_epi32(v[8], cospi56); x = _mm_mullo_epi32(v[9], cospi8); temp2 = _mm_sub_epi32(temp2, x); temp2 = _mm_add_epi32(temp2, rnding); temp2 = _mm_srai_epi32(temp2, bit); v[8] = temp1; v[9] = temp2; // stage 5 v[4] = v[0]; v[5] = v[1]; v[12] = v[8]; v[13] = v[9]; // stage 6 temp1 = _mm_mullo_epi32(v[4], cospi16); x = _mm_mullo_epi32(v[5], cospi48); temp1 = _mm_add_epi32(temp1, x); temp1 = _mm_add_epi32(temp1, rnding); temp1 = _mm_srai_epi32(temp1, bit); temp2 = _mm_mullo_epi32(v[4], cospi48); x = _mm_mullo_epi32(v[5], cospi16); temp2 = _mm_sub_epi32(temp2, x); temp2 = _mm_add_epi32(temp2, rnding); temp2 = _mm_srai_epi32(temp2, bit); v[4] = temp1; v[5] = temp2; temp1 = _mm_mullo_epi32(v[12], cospi16); x = _mm_mullo_epi32(v[13], cospi48); temp1 = _mm_add_epi32(temp1, x); temp1 = _mm_add_epi32(temp1, rnding); temp1 = _mm_srai_epi32(temp1, bit); temp2 = _mm_mullo_epi32(v[12], cospi48); x = _mm_mullo_epi32(v[13], cospi16); temp2 = _mm_sub_epi32(temp2, x); temp2 = _mm_add_epi32(temp2, rnding); temp2 = _mm_srai_epi32(temp2, bit); v[12] = temp1; v[13] = temp2; // stage 7 v[2] = v[0]; v[3] = v[1]; v[6] = v[4]; v[7] = v[5]; v[10] = v[8]; v[11] = v[9]; v[14] = v[12]; v[15] = v[13]; // stage 8 y = _mm_mullo_epi32(v[2], cospi32); x = _mm_mullo_epi32(v[3], cospi32); v[2] = _mm_add_epi32(y, x); v[2] = _mm_add_epi32(v[2], rnding); v[2] = _mm_srai_epi32(v[2], bit); v[3] = _mm_sub_epi32(y, x); v[3] = _mm_add_epi32(v[3], rnding); v[3] = _mm_srai_epi32(v[3], bit); y = _mm_mullo_epi32(v[6], cospi32); x = _mm_mullo_epi32(v[7], cospi32); v[6] = _mm_add_epi32(y, x); v[6] = _mm_add_epi32(v[6], rnding); v[6] = _mm_srai_epi32(v[6], bit); v[7] = _mm_sub_epi32(y, x); v[7] = _mm_add_epi32(v[7], rnding); v[7] = _mm_srai_epi32(v[7], bit); y = _mm_mullo_epi32(v[10], cospi32); x = _mm_mullo_epi32(v[11], cospi32); v[10] = _mm_add_epi32(y, x); v[10] = _mm_add_epi32(v[10], rnding); v[10] = _mm_srai_epi32(v[10], bit); v[11] = _mm_sub_epi32(y, x); v[11] = _mm_add_epi32(v[11], rnding); v[11] = _mm_srai_epi32(v[11], bit); y = _mm_mullo_epi32(v[14], cospi32); x = _mm_mullo_epi32(v[15], cospi32); v[14] = _mm_add_epi32(y, x); v[14] = _mm_add_epi32(v[14], rnding); v[14] = _mm_srai_epi32(v[14], bit); v[15] = _mm_sub_epi32(y, x); v[15] = _mm_add_epi32(v[15], rnding); v[15] = _mm_srai_epi32(v[15], bit); // stage 9 if (do_cols) { out[0] = v[0]; out[1] = _mm_sub_epi32(_mm_setzero_si128(), v[8]); out[2] = v[12]; out[3] = _mm_sub_epi32(_mm_setzero_si128(), v[4]); out[4] = v[6]; out[5] = _mm_sub_epi32(_mm_setzero_si128(), v[14]); out[6] = v[10]; out[7] = _mm_sub_epi32(_mm_setzero_si128(), v[2]); out[8] = v[3]; out[9] = _mm_sub_epi32(_mm_setzero_si128(), v[11]); out[10] = v[15]; out[11] = _mm_sub_epi32(_mm_setzero_si128(), v[7]); out[12] = v[5]; out[13] = _mm_sub_epi32(_mm_setzero_si128(), v[13]); out[14] = v[9]; out[15] = _mm_sub_epi32(_mm_setzero_si128(), v[1]); } else { const int log_range_out = AOMMAX(16, bd + 6); const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1); neg_shift_sse4_1(v[0], v[8], out + 0, out + 1, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(v[12], v[4], out + 2, out + 3, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(v[6], v[14], out + 4, out + 5, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(v[10], v[2], out + 6, out + 7, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(v[3], v[11], out + 8, out + 9, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(v[15], v[7], out + 10, out + 11, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(v[5], v[13], out + 12, out + 13, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(v[9], v[1], out + 14, out + 15, &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
} } } static void iadst16x16_low8_sse4_1(__m128i *in, __m128i *out, int bit, int do_cols, int bd, int out_shift) { const int32_t *cospi = cospi_arr(bit); const __m128i cospi2 = _mm_set1_epi32(cospi[2]); const __m128i cospi62 = _mm_set1_epi32(cospi[62]); const __m128i cospi10 = _mm_set1_epi32(cospi[10]);

[CVE-2020-0478_1.diff] highbd_inv_txfm_sse4.c #19
+ __m128i zero = _mm_setzero_si128(); - // Calculate the column 0, 1, 2, 3 - { - // stage 0 - // stage 1 - // stage 2 - __m128i zero = _mm_setzero_si128(); - x = _mm_mullo_epi32(in[0], cospi62); - u[0] = _mm_add_epi32(x, rnding); - u[0] = _mm_srai_epi32(u[0], bit); + // stage 0 + // stage 1 + // stage 2 + x = _mm_mullo_epi32(in[0], cospi62); + u[0] = _mm_add_epi32(x, rnding); + u[0] = _mm_srai_epi32(u[0], bit); - x = _mm_mullo_epi32(in[0], cospi2); - u[1] = _mm_sub_epi32(zero, x); - u[1] = _mm_add_epi32(u[1], rnding); - u[1] = _mm_srai_epi32(u[1], bit); + x = _mm_mullo_epi32(in[0], cospi2); + u[1] = _mm_sub_epi32(zero, x); + u[1] = _mm_add_epi32(u[1], rnding); + u[1] = _mm_srai_epi32(u[1], bit); - x = _mm_mullo_epi32(in[2], cospi54); - u[2] = _mm_add_epi32(x, rnding); - u[2] = _mm_srai_epi32(u[2], bit); + x = _mm_mullo_epi32(in[2], cospi54); + u[2] = _mm_add_epi32(x, rnding); + u[2] = _mm_srai_epi32(u[2], bit); - x = _mm_mullo_epi32(in[2], cospi10); - u[3] = _mm_sub_epi32(zero, x); - u[3] = _mm_add_epi32(u[3], rnding); - u[3] = _mm_srai_epi32(u[3], bit); + x = _mm_mullo_epi32(in[2], cospi10); + u[3] = _mm_sub_epi32(zero, x); + u[3] = _mm_add_epi32(u[3], rnding); + u[3] = _mm_srai_epi32(u[3], bit); - x = _mm_mullo_epi32(in[4], cospi46); - u[4] = _mm_add_epi32(x, rnding); - u[4] = _mm_srai_epi32(u[4], bit); + x = _mm_mullo_epi32(in[4], cospi46); + u[4] = _mm_add_epi32(x, rnding); + u[4] = _mm_srai_epi32(u[4], bit); - x = _mm_mullo_epi32(in[4], cospi18); - u[5] = _mm_sub_epi32(zero, x); - u[5] = _mm_add_epi32(u[5], rnding); - u[5] = _mm_srai_epi32(u[5], bit); + x = _mm_mullo_epi32(in[4], cospi18); + u[5] = _mm_sub_epi32(zero, x); + u[5] = _mm_add_epi32(u[5], rnding); + u[5] = _mm_srai_epi32(u[5], bit); - x = _mm_mullo_epi32(in[6], cospi38); - u[6] = _mm_add_epi32(x, rnding); - u[6] = _mm_srai_epi32(u[6], bit); + x = _mm_mullo_epi32(in[6], cospi38); + u[6] = _mm_add_epi32(x, rnding); + u[6] = _mm_srai_epi32(u[6], bit); - x = _mm_mullo_epi32(in[6], cospi26); - u[7] = _mm_sub_epi32(zero, x); - u[7] = _mm_add_epi32(u[7], rnding); - u[7] = _mm_srai_epi32(u[7], bit); + x = _mm_mullo_epi32(in[6], cospi26); + u[7] = _mm_sub_epi32(zero, x); + u[7] = _mm_add_epi32(u[7], rnding); + u[7] = _mm_srai_epi32(u[7], bit); - u[8] = _mm_mullo_epi32(in[7], cospi34); - u[8] = _mm_add_epi32(u[8], rnding); - u[8] = _mm_srai_epi32(u[8], bit); + u[8] = _mm_mullo_epi32(in[7], cospi34); + u[8] = _mm_add_epi32(u[8], rnding); + u[8] = _mm_srai_epi32(u[8], bit); - u[9] = _mm_mullo_epi32(in[7], cospi30); - u[9] = _mm_add_epi32(u[9], rnding); - u[9] = _mm_srai_epi32(u[9], bit); + u[9] = _mm_mullo_epi32(in[7], cospi30); + u[9] = _mm_add_epi32(u[9], rnding); + u[9] = _mm_srai_epi32(u[9], bit); - u[10] = _mm_mullo_epi32(in[5], cospi42); - u[10] = _mm_add_epi32(u[10], rnding); - u[10] = _mm_srai_epi32(u[10], bit); + u[10] = _mm_mullo_epi32(in[5], cospi42); + u[10] = _mm_add_epi32(u[10], rnding); + u[10] = _mm_srai_epi32(u[10], bit); - u[11] = _mm_mullo_epi32(in[5], cospi22); - u[11] = _mm_add_epi32(u[11], rnding); - u[11] = _mm_srai_epi32(u[11], bit); + u[11] = _mm_mullo_epi32(in[5], cospi22); + u[11] = _mm_add_epi32(u[11], rnding); + u[11] = _mm_srai_epi32(u[11], bit); - u[12] = _mm_mullo_epi32(in[3], cospi50); - u[12] = _mm_add_epi32(u[12], rnding); - u[12] = _mm_srai_epi32(u[12], bit); + u[12] = _mm_mullo_epi32(in[3], cospi50); + u[12] = _mm_add_epi32(u[12], rnding); + u[12] = _mm_srai_epi32(u[12], bit); - u[13] = _mm_mullo_epi32(in[3], cospi14); - u[13] = _mm_add_epi32(u[13], rnding); - u[13] = _mm_srai_epi32(u[13], bit); + u[13] = _mm_mullo_epi32(in[3], cospi14); + u[13] = _mm_add_epi32(u[13], rnding); + u[13] = _mm_srai_epi32(u[13], bit); - u[14] = _mm_mullo_epi32(in[1], cospi58); - u[14] = _mm_add_epi32(u[14], rnding); - u[14] = _mm_srai_epi32(u[14], bit); + u[14] = _mm_mullo_epi32(in[1], cospi58); + u[14] = _mm_add_epi32(u[14], rnding); + u[14] = _mm_srai_epi32(u[14], bit); - u[15] = _mm_mullo_epi32(in[1], cospi6); - u[15] = _mm_add_epi32(u[15], rnding); - u[15] = _mm_srai_epi32(u[15], bit); + u[15] = _mm_mullo_epi32(in[1], cospi6); + u[15] = _mm_add_epi32(u[15], rnding); + u[15] = _mm_srai_epi32(u[15], bit); - // stage 3 - addsub_sse4_1(u[0], u[8], &u[0], &u[8], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[1], u[9], &u[1], &u[9], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[2], u[10], &u[2], &u[10], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[3], u[11], &u[3], &u[11], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[4], u[12], &u[4], &u[12], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[5], u[13], &u[5], &u[13], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[6], u[14], &u[6], &u[14], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[7], u[15], &u[7], &u[15], &clamp_lo, &clamp_hi); + // stage 3 + addsub_sse4_1(u[0], u[8], &u[0], &u[8], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[1], u[9], &u[1], &u[9], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[2], u[10], &u[2], &u[10], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[3], u[11], &u[3], &u[11], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[4], u[12], &u[4], &u[12], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[5], u[13], &u[5], &u[13], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[6], u[14], &u[6], &u[14], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[7], u[15], &u[7], &u[15], &clamp_lo, &clamp_hi); - // stage 4 - y = _mm_mullo_epi32(u[8], cospi56); - x = _mm_mullo_epi32(u[9], cospi56); - u[8] = _mm_mullo_epi32(u[8], cospi8); - u[8] = _mm_add_epi32(u[8], x); - u[8] = _mm_add_epi32(u[8], rnding); - u[8] = _mm_srai_epi32(u[8], bit); + // stage 4 + y = _mm_mullo_epi32(u[8], cospi56); + x = _mm_mullo_epi32(u[9], cospi56); + u[8] = _mm_mullo_epi32(u[8], cospi8); + u[8] = _mm_add_epi32(u[8], x); + u[8] = _mm_add_epi32(u[8], rnding); + u[8] = _mm_srai_epi32(u[8], bit); - x = _mm_mullo_epi32(u[9], cospi8); - u[9] = _mm_sub_epi32(y, x); - u[9] = _mm_add_epi32(u[9], rnding); - u[9] = _mm_srai_epi32(u[9], bit); + x = _mm_mullo_epi32(u[9], cospi8); + u[9] = _mm_sub_epi32(y, x); + u[9] = _mm_add_epi32(u[9], rnding); + u[9] = _mm_srai_epi32(u[9], bit); - x = _mm_mullo_epi32(u[11], cospi24); - y = _mm_mullo_epi32(u[10], cospi24); - u[10] = _mm_mullo_epi32(u[10], cospi40); - u[10] = _mm_add_epi32(u[10], x); - u[10] = _mm_add_epi32(u[10], rnding); - u[10] = _mm_srai_epi32(u[10], bit); + x = _mm_mullo_epi32(u[11], cospi24); + y = _mm_mullo_epi32(u[10], cospi24); + u[10] = _mm_mullo_epi32(u[10], cospi40); + u[10] = _mm_add_epi32(u[10], x); + u[10] = _mm_add_epi32(u[10], rnding); + u[10] = _mm_srai_epi32(u[10], bit); - x = _mm_mullo_epi32(u[11], cospi40); - u[11] = _mm_sub_epi32(y, x); - u[11] = _mm_add_epi32(u[11], rnding); - u[11] = _mm_srai_epi32(u[11], bit); + x = _mm_mullo_epi32(u[11], cospi40); + u[11] = _mm_sub_epi32(y, x); + u[11] = _mm_add_epi32(u[11], rnding); + u[11] = _mm_srai_epi32(u[11], bit); - x = _mm_mullo_epi32(u[13], cospi8); - y = _mm_mullo_epi32(u[12], cospi8); - u[12] = _mm_mullo_epi32(u[12], cospim56); - u[12] = _mm_add_epi32(u[12], x); - u[12] = _mm_add_epi32(u[12], rnding); - u[12] = _mm_srai_epi32(u[12], bit); + x = _mm_mullo_epi32(u[13], cospi8); + y = _mm_mullo_epi32(u[12], cospi8); + u[12] = _mm_mullo_epi32(u[12], cospim56); + u[12] = _mm_add_epi32(u[12], x); + u[12] = _mm_add_epi32(u[12], rnding); + u[12] = _mm_srai_epi32(u[12], bit); - x = _mm_mullo_epi32(u[13], cospim56); - u[13] = _mm_sub_epi32(y, x); - u[13] = _mm_add_epi32(u[13], rnding); - u[13] = _mm_srai_epi32(u[13], bit); + x = _mm_mullo_epi32(u[13], cospim56); + u[13] = _mm_sub_epi32(y, x); + u[13] = _mm_add_epi32(u[13], rnding); + u[13] = _mm_srai_epi32(u[13], bit); - x = _mm_mullo_epi32(u[15], cospi40); - y = _mm_mullo_epi32(u[14], cospi40); - u[14] = _mm_mullo_epi32(u[14], cospim24); - u[14] = _mm_add_epi32(u[14], x); - u[14] = _mm_add_epi32(u[14], rnding); - u[14] = _mm_srai_epi32(u[14], bit); + x = _mm_mullo_epi32(u[15], cospi40); + y = _mm_mullo_epi32(u[14], cospi40); + u[14] = _mm_mullo_epi32(u[14], cospim24); + u[14] = _mm_add_epi32(u[14], x); + u[14] = _mm_add_epi32(u[14], rnding); + u[14] = _mm_srai_epi32(u[14], bit); - x = _mm_mullo_epi32(u[15], cospim24); - u[15] = _mm_sub_epi32(y, x); - u[15] = _mm_add_epi32(u[15], rnding); - u[15] = _mm_srai_epi32(u[15], bit); + x = _mm_mullo_epi32(u[15], cospim24); + u[15] = _mm_sub_epi32(y, x); + u[15] = _mm_add_epi32(u[15], rnding); + u[15] = _mm_srai_epi32(u[15], bit); - // stage 5 - addsub_sse4_1(u[0], u[4], &u[0], &u[4], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[1], u[5], &u[1], &u[5], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[2], u[6], &u[2], &u[6], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[3], u[7], &u[3], &u[7], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[8], u[12], &u[8], &u[12], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[9], u[13], &u[9], &u[13], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[10], u[14], &u[10], &u[14], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[11], u[15], &u[11], &u[15], &clamp_lo, &clamp_hi); + // stage 5 + addsub_sse4_1(u[0], u[4], &u[0], &u[4], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[1], u[5], &u[1], &u[5], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[2], u[6], &u[2], &u[6], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[3], u[7], &u[3], &u[7], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[8], u[12], &u[8], &u[12], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[9], u[13], &u[9], &u[13], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[10], u[14], &u[10], &u[14], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[11], u[15], &u[11], &u[15], &clamp_lo, &clamp_hi); - // stage 6 - x = _mm_mullo_epi32(u[5], cospi48); - y = _mm_mullo_epi32(u[4], cospi48); - u[4] = _mm_mullo_epi32(u[4], cospi16); - u[4] = _mm_add_epi32(u[4], x); - u[4] = _mm_add_epi32(u[4], rnding); - u[4] = _mm_srai_epi32(u[4], bit); + // stage 6 + x = _mm_mullo_epi32(u[5], cospi48); + y = _mm_mullo_epi32(u[4], cospi48); + u[4] = _mm_mullo_epi32(u[4], cospi16); + u[4] = _mm_add_epi32(u[4], x); + u[4] = _mm_add_epi32(u[4], rnding); + u[4] = _mm_srai_epi32(u[4], bit); - x = _mm_mullo_epi32(u[5], cospi16); - u[5] = _mm_sub_epi32(y, x); - u[5] = _mm_add_epi32(u[5], rnding); - u[5] = _mm_srai_epi32(u[5], bit); + x = _mm_mullo_epi32(u[5], cospi16); + u[5] = _mm_sub_epi32(y, x); + u[5] = _mm_add_epi32(u[5], rnding); + u[5] = _mm_srai_epi32(u[5], bit); - x = _mm_mullo_epi32(u[7], cospi16); - y = _mm_mullo_epi32(u[6], cospi16); - u[6] = _mm_mullo_epi32(u[6], cospim48); - u[6] = _mm_add_epi32(u[6], x); - u[6] = _mm_add_epi32(u[6], rnding); - u[6] = _mm_srai_epi32(u[6], bit); + x = _mm_mullo_epi32(u[7], cospi16); + y = _mm_mullo_epi32(u[6], cospi16); + u[6] = _mm_mullo_epi32(u[6], cospim48); + u[6] = _mm_add_epi32(u[6], x); + u[6] = _mm_add_epi32(u[6], rnding); + u[6] = _mm_srai_epi32(u[6], bit); - x = _mm_mullo_epi32(u[7], cospim48); - u[7] = _mm_sub_epi32(y, x); - u[7] = _mm_add_epi32(u[7], rnding); - u[7] = _mm_srai_epi32(u[7], bit); + x = _mm_mullo_epi32(u[7], cospim48); + u[7] = _mm_sub_epi32(y, x); + u[7] = _mm_add_epi32(u[7], rnding); + u[7] = _mm_srai_epi32(u[7], bit); - x = _mm_mullo_epi32(u[13], cospi48); - y = _mm_mullo_epi32(u[12], cospi48); - u[12] = _mm_mullo_epi32(u[12], cospi16); - u[12] = _mm_add_epi32(u[12], x); - u[12] = _mm_add_epi32(u[12], rnding); - u[12] = _mm_srai_epi32(u[12], bit); + x = _mm_mullo_epi32(u[13], cospi48); + y = _mm_mullo_epi32(u[12], cospi48); + u[12] = _mm_mullo_epi32(u[12], cospi16); + u[12] = _mm_add_epi32(u[12], x); + u[12] = _mm_add_epi32(u[12], rnding); + u[12] = _mm_srai_epi32(u[12], bit); - x = _mm_mullo_epi32(u[13], cospi16); - u[13] = _mm_sub_epi32(y, x); - u[13] = _mm_add_epi32(u[13], rnding); - u[13] = _mm_srai_epi32(u[13], bit); + x = _mm_mullo_epi32(u[13], cospi16); + u[13] = _mm_sub_epi32(y, x); + u[13] = _mm_add_epi32(u[13], rnding); + u[13] = _mm_srai_epi32(u[13], bit); - x = _mm_mullo_epi32(u[15], cospi16); - y = _mm_mullo_epi32(u[14], cospi16); - u[14] = _mm_mullo_epi32(u[14], cospim48); - u[14] = _mm_add_epi32(u[14], x); - u[14] = _mm_add_epi32(u[14], rnding); - u[14] = _mm_srai_epi32(u[14], bit); + x = _mm_mullo_epi32(u[15], cospi16); + y = _mm_mullo_epi32(u[14], cospi16); + u[14] = _mm_mullo_epi32(u[14], cospim48); + u[14] = _mm_add_epi32(u[14], x); + u[14] = _mm_add_epi32(u[14], rnding); + u[14] = _mm_srai_epi32(u[14], bit); - x = _mm_mullo_epi32(u[15], cospim48); - u[15] = _mm_sub_epi32(y, x); - u[15] = _mm_add_epi32(u[15], rnding); - u[15] = _mm_srai_epi32(u[15], bit); + x = _mm_mullo_epi32(u[15], cospim48); + u[15] = _mm_sub_epi32(y, x); + u[15] = _mm_add_epi32(u[15], rnding); + u[15] = _mm_srai_epi32(u[15], bit); - // stage 7 - addsub_sse4_1(u[0], u[2], &u[0], &u[2], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[1], u[3], &u[1], &u[3], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[4], u[6], &u[4], &u[6], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[5], u[7], &u[5], &u[7], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[8], u[10], &u[8], &u[10], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[9], u[11], &u[9], &u[11], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[12], u[14], &u[12], &u[14], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[13], u[15], &u[13], &u[15], &clamp_lo, &clamp_hi); + // stage 7 + addsub_sse4_1(u[0], u[2], &u[0], &u[2], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[1], u[3], &u[1], &u[3], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[4], u[6], &u[4], &u[6], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[5], u[7], &u[5], &u[7], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[8], u[10], &u[8], &u[10], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[9], u[11], &u[9], &u[11], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[12], u[14], &u[12], &u[14], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[13], u[15], &u[13], &u[15], &clamp_lo, &clamp_hi); - // stage 8 - y = _mm_mullo_epi32(u[2], cospi32); - x = _mm_mullo_epi32(u[3], cospi32); - u[2] = _mm_add_epi32(y, x); - u[2] = _mm_add_epi32(u[2], rnding); - u[2] = _mm_srai_epi32(u[2], bit); + // stage 8 + y = _mm_mullo_epi32(u[2], cospi32); + x = _mm_mullo_epi32(u[3], cospi32); + u[2] = _mm_add_epi32(y, x); + u[2] = _mm_add_epi32(u[2], rnding); + u[2] = _mm_srai_epi32(u[2], bit); - u[3] = _mm_sub_epi32(y, x); - u[3] = _mm_add_epi32(u[3], rnding); - u[3] = _mm_srai_epi32(u[3], bit); - y = _mm_mullo_epi32(u[6], cospi32); - x = _mm_mullo_epi32(u[7], cospi32); - u[6] = _mm_add_epi32(y, x); - u[6] = _mm_add_epi32(u[6], rnding); - u[6] = _mm_srai_epi32(u[6], bit); + u[3] = _mm_sub_epi32(y, x); + u[3] = _mm_add_epi32(u[3], rnding); + u[3] = _mm_srai_epi32(u[3], bit); + y = _mm_mullo_epi32(u[6], cospi32); + x = _mm_mullo_epi32(u[7], cospi32); + u[6] = _mm_add_epi32(y, x); + u[6] = _mm_add_epi32(u[6], rnding); + u[6] = _mm_srai_epi32(u[6], bit); - u[7] = _mm_sub_epi32(y, x); - u[7] = _mm_add_epi32(u[7], rnding); - u[7] = _mm_srai_epi32(u[7], bit); + u[7] = _mm_sub_epi32(y, x); + u[7] = _mm_add_epi32(u[7], rnding); + u[7] = _mm_srai_epi32(u[7], bit); - y = _mm_mullo_epi32(u[10], cospi32); - x = _mm_mullo_epi32(u[11], cospi32); - u[10] = _mm_add_epi32(y, x); - u[10] = _mm_add_epi32(u[10], rnding); - u[10] = _mm_srai_epi32(u[10], bit); + y = _mm_mullo_epi32(u[10], cospi32); + x = _mm_mullo_epi32(u[11], cospi32); + u[10] = _mm_add_epi32(y, x); + u[10] = _mm_add_epi32(u[10], rnding); + u[10] = _mm_srai_epi32(u[10], bit); - u[11] = _mm_sub_epi32(y, x); - u[11] = _mm_add_epi32(u[11], rnding); - u[11] = _mm_srai_epi32(u[11], bit); + u[11] = _mm_sub_epi32(y, x); + u[11] = _mm_add_epi32(u[11], rnding); + u[11] = _mm_srai_epi32(u[11], bit); - y = _mm_mullo_epi32(u[14], cospi32); - x = _mm_mullo_epi32(u[15], cospi32); - u[14] = _mm_add_epi32(y, x); - u[14] = _mm_add_epi32(u[14], rnding); - u[14] = _mm_srai_epi32(u[14], bit); + y = _mm_mullo_epi32(u[14], cospi32); + x = _mm_mullo_epi32(u[15], cospi32); + u[14] = _mm_add_epi32(y, x); + u[14] = _mm_add_epi32(u[14], rnding); + u[14] = _mm_srai_epi32(u[14], bit); - u[15] = _mm_sub_epi32(y, x); - u[15] = _mm_add_epi32(u[15], rnding); - u[15] = _mm_srai_epi32(u[15], bit); + u[15] = _mm_sub_epi32(y, x); + u[15] = _mm_add_epi32(u[15], rnding); + u[15] = _mm_srai_epi32(u[15], bit); - // stage 9 - if (do_cols) { - out[0] = u[0]; - out[1] = _mm_sub_epi32(_mm_setzero_si128(), u[8]); - out[2] = u[12]; - out[3] = _mm_sub_epi32(_mm_setzero_si128(), u[4]); - out[4] = u[6]; - out[5] = _mm_sub_epi32(_mm_setzero_si128(), u[14]); - out[6] = u[10]; - out[7] = _mm_sub_epi32(_mm_setzero_si128(), u[2]); - out[8] = u[3]; - out[9] = _mm_sub_epi32(_mm_setzero_si128(), u[11]); - out[10] = u[15]; - out[11] = _mm_sub_epi32(_mm_setzero_si128(), u[7]); - out[12] = u[5]; - out[13] = _mm_sub_epi32(_mm_setzero_si128(), u[13]); - out[14] = u[9]; - out[15] = _mm_sub_epi32(_mm_setzero_si128(), u[1]); - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); - const __m128i clamp_hi_out = - _mm_set1_epi32((1 << (log_range_out - 1)) - 1); + // stage 9 + if (do_cols) { + out[0] = u[0]; + out[1] = _mm_sub_epi32(zero, u[8]); + out[2] = u[12]; + out[3] = _mm_sub_epi32(zero, u[4]); + out[4] = u[6]; + out[5] = _mm_sub_epi32(zero, u[14]); + out[6] = u[10]; + out[7] = _mm_sub_epi32(zero, u[2]); + out[8] = u[3]; + out[9] = _mm_sub_epi32(zero, u[11]); + out[10] = u[15]; + out[11] = _mm_sub_epi32(zero, u[7]); + out[12] = u[5]; + out[13] = _mm_sub_epi32(zero, u[13]); + out[14] = u[9]; + out[15] = _mm_sub_epi32(zero, u[1]); + } else { + const int log_range_out = AOMMAX(16, bd + 6); + const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); + const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1); - neg_shift_sse4_1(u[0], u[8], out + 0, out + 1, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(u[12], u[4], out + 2, out + 3, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(u[6], u[14], out + 4, out + 5, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(u[10], u[2], out + 6, out + 7, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(u[3], u[11], out + 8, out + 9, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(u[15], u[7], out + 10, out + 11, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(u[5], u[13], out + 12, out + 13, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(u[9], u[1], out + 14, out + 15, &clamp_lo_out, - &clamp_hi_out, out_shift); - } + neg_shift_sse4_1(u[0], u[8], out + 0, out + 1, &clamp_lo_out, &clamp_hi_out, + out_shift); + neg_shift_sse4_1(u[12], u[4], out + 2, out + 3, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(u[6], u[14], out + 4, out + 5, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(u[10], u[2], out + 6, out + 7, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(u[3], u[11], out + 8, out + 9, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(u[15], u[7], out + 10, out + 11, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(u[5], u[13], out + 12, out + 13, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(u[9], u[1], out + 14, out + 15, &clamp_lo_out, + &clamp_hi_out, out_shift);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_sse4.c
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
const int log_range = AOMMAX(16, bd + (do_cols ? 6 : 8)); const __m128i clamp_lo = _mm_set1_epi32(-(1 << (log_range - 1))); const __m128i clamp_hi = _mm_set1_epi32((1 << (log_range - 1)) - 1); __m128i u[16], x, y; // Calculate the column 0, 1, 2, 3 { // stage 0 // stage 1 // stage 2
+ show +
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
__m128i zero = _mm_setzero_si128(); x = _mm_mullo_epi32(in[0], cospi62); u[0] = _mm_add_epi32(x, rnding); u[0] = _mm_srai_epi32(u[0], bit); x = _mm_mullo_epi32(in[0], cospi2); u[1] = _mm_sub_epi32(zero, x); u[1] = _mm_add_epi32(u[1], rnding); u[1] = _mm_srai_epi32(u[1], bit); x = _mm_mullo_epi32(in[2], cospi54); u[2] = _mm_add_epi32(x, rnding); u[2] = _mm_srai_epi32(u[2], bit); x = _mm_mullo_epi32(in[2], cospi10); u[3] = _mm_sub_epi32(zero, x); u[3] = _mm_add_epi32(u[3], rnding); u[3] = _mm_srai_epi32(u[3], bit); x = _mm_mullo_epi32(in[4], cospi46); u[4] = _mm_add_epi32(x, rnding); u[4] = _mm_srai_epi32(u[4], bit); x = _mm_mullo_epi32(in[4], cospi18); u[5] = _mm_sub_epi32(zero, x); u[5] = _mm_add_epi32(u[5], rnding); u[5] = _mm_srai_epi32(u[5], bit); x = _mm_mullo_epi32(in[6], cospi38); u[6] = _mm_add_epi32(x, rnding); u[6] = _mm_srai_epi32(u[6], bit); x = _mm_mullo_epi32(in[6], cospi26); u[7] = _mm_sub_epi32(zero, x); u[7] = _mm_add_epi32(u[7], rnding); u[7] = _mm_srai_epi32(u[7], bit); u[8] = _mm_mullo_epi32(in[7], cospi34); u[8] = _mm_add_epi32(u[8], rnding); u[8] = _mm_srai_epi32(u[8], bit); u[9] = _mm_mullo_epi32(in[7], cospi30); u[9] = _mm_add_epi32(u[9], rnding); u[9] = _mm_srai_epi32(u[9], bit); u[10] = _mm_mullo_epi32(in[5], cospi42); u[10] = _mm_add_epi32(u[10], rnding); u[10] = _mm_srai_epi32(u[10], bit); u[11] = _mm_mullo_epi32(in[5], cospi22); u[11] = _mm_add_epi32(u[11], rnding); u[11] = _mm_srai_epi32(u[11], bit); u[12] = _mm_mullo_epi32(in[3], cospi50); u[12] = _mm_add_epi32(u[12], rnding); u[12] = _mm_srai_epi32(u[12], bit); u[13] = _mm_mullo_epi32(in[3], cospi14); u[13] = _mm_add_epi32(u[13], rnding); u[13] = _mm_srai_epi32(u[13], bit); u[14] = _mm_mullo_epi32(in[1], cospi58); u[14] = _mm_add_epi32(u[14], rnding); u[14] = _mm_srai_epi32(u[14], bit); u[15] = _mm_mullo_epi32(in[1], cospi6); u[15] = _mm_add_epi32(u[15], rnding); u[15] = _mm_srai_epi32(u[15], bit); // stage 3 addsub_sse4_1(u[0], u[8], &u[0], &u[8], &clamp_lo, &clamp_hi); addsub_sse4_1(u[1], u[9], &u[1], &u[9], &clamp_lo, &clamp_hi); addsub_sse4_1(u[2], u[10], &u[2], &u[10], &clamp_lo, &clamp_hi); addsub_sse4_1(u[3], u[11], &u[3], &u[11], &clamp_lo, &clamp_hi); addsub_sse4_1(u[4], u[12], &u[4], &u[12], &clamp_lo, &clamp_hi); addsub_sse4_1(u[5], u[13], &u[5], &u[13], &clamp_lo, &clamp_hi); addsub_sse4_1(u[6], u[14], &u[6], &u[14], &clamp_lo, &clamp_hi); addsub_sse4_1(u[7], u[15], &u[7], &u[15], &clamp_lo, &clamp_hi); // stage 4 y = _mm_mullo_epi32(u[8], cospi56); x = _mm_mullo_epi32(u[9], cospi56); u[8] = _mm_mullo_epi32(u[8], cospi8); u[8] = _mm_add_epi32(u[8], x); u[8] = _mm_add_epi32(u[8], rnding); u[8] = _mm_srai_epi32(u[8], bit); x = _mm_mullo_epi32(u[9], cospi8); u[9] = _mm_sub_epi32(y, x); u[9] = _mm_add_epi32(u[9], rnding); u[9] = _mm_srai_epi32(u[9], bit); x = _mm_mullo_epi32(u[11], cospi24); y = _mm_mullo_epi32(u[10], cospi24); u[10] = _mm_mullo_epi32(u[10], cospi40); u[10] = _mm_add_epi32(u[10], x); u[10] = _mm_add_epi32(u[10], rnding); u[10] = _mm_srai_epi32(u[10], bit); x = _mm_mullo_epi32(u[11], cospi40); u[11] = _mm_sub_epi32(y, x); u[11] = _mm_add_epi32(u[11], rnding); u[11] = _mm_srai_epi32(u[11], bit); x = _mm_mullo_epi32(u[13], cospi8); y = _mm_mullo_epi32(u[12], cospi8); u[12] = _mm_mullo_epi32(u[12], cospim56); u[12] = _mm_add_epi32(u[12], x); u[12] = _mm_add_epi32(u[12], rnding); u[12] = _mm_srai_epi32(u[12], bit); x = _mm_mullo_epi32(u[13], cospim56); u[13] = _mm_sub_epi32(y, x); u[13] = _mm_add_epi32(u[13], rnding); u[13] = _mm_srai_epi32(u[13], bit); x = _mm_mullo_epi32(u[15], cospi40); y = _mm_mullo_epi32(u[14], cospi40); u[14] = _mm_mullo_epi32(u[14], cospim24); u[14] = _mm_add_epi32(u[14], x); u[14] = _mm_add_epi32(u[14], rnding); u[14] = _mm_srai_epi32(u[14], bit); x = _mm_mullo_epi32(u[15], cospim24); u[15] = _mm_sub_epi32(y, x); u[15] = _mm_add_epi32(u[15], rnding); u[15] = _mm_srai_epi32(u[15], bit); // stage 5 addsub_sse4_1(u[0], u[4], &u[0], &u[4], &clamp_lo, &clamp_hi); addsub_sse4_1(u[1], u[5], &u[1], &u[5], &clamp_lo, &clamp_hi); addsub_sse4_1(u[2], u[6], &u[2], &u[6], &clamp_lo, &clamp_hi); addsub_sse4_1(u[3], u[7], &u[3], &u[7], &clamp_lo, &clamp_hi); addsub_sse4_1(u[8], u[12], &u[8], &u[12], &clamp_lo, &clamp_hi); addsub_sse4_1(u[9], u[13], &u[9], &u[13], &clamp_lo, &clamp_hi); addsub_sse4_1(u[10], u[14], &u[10], &u[14], &clamp_lo, &clamp_hi); addsub_sse4_1(u[11], u[15], &u[11], &u[15], &clamp_lo, &clamp_hi); // stage 6 x = _mm_mullo_epi32(u[5], cospi48); y = _mm_mullo_epi32(u[4], cospi48); u[4] = _mm_mullo_epi32(u[4], cospi16); u[4] = _mm_add_epi32(u[4], x); u[4] = _mm_add_epi32(u[4], rnding); u[4] = _mm_srai_epi32(u[4], bit); x = _mm_mullo_epi32(u[5], cospi16); u[5] = _mm_sub_epi32(y, x); u[5] = _mm_add_epi32(u[5], rnding); u[5] = _mm_srai_epi32(u[5], bit); x = _mm_mullo_epi32(u[7], cospi16); y = _mm_mullo_epi32(u[6], cospi16); u[6] = _mm_mullo_epi32(u[6], cospim48); u[6] = _mm_add_epi32(u[6], x); u[6] = _mm_add_epi32(u[6], rnding); u[6] = _mm_srai_epi32(u[6], bit); x = _mm_mullo_epi32(u[7], cospim48); u[7] = _mm_sub_epi32(y, x); u[7] = _mm_add_epi32(u[7], rnding); u[7] = _mm_srai_epi32(u[7], bit); x = _mm_mullo_epi32(u[13], cospi48); y = _mm_mullo_epi32(u[12], cospi48); u[12] = _mm_mullo_epi32(u[12], cospi16); u[12] = _mm_add_epi32(u[12], x); u[12] = _mm_add_epi32(u[12], rnding); u[12] = _mm_srai_epi32(u[12], bit); x = _mm_mullo_epi32(u[13], cospi16); u[13] = _mm_sub_epi32(y, x); u[13] = _mm_add_epi32(u[13], rnding); u[13] = _mm_srai_epi32(u[13], bit); x = _mm_mullo_epi32(u[15], cospi16); y = _mm_mullo_epi32(u[14], cospi16); u[14] = _mm_mullo_epi32(u[14], cospim48); u[14] = _mm_add_epi32(u[14], x); u[14] = _mm_add_epi32(u[14], rnding); u[14] = _mm_srai_epi32(u[14], bit); x = _mm_mullo_epi32(u[15], cospim48); u[15] = _mm_sub_epi32(y, x); u[15] = _mm_add_epi32(u[15], rnding); u[15] = _mm_srai_epi32(u[15], bit); // stage 7 addsub_sse4_1(u[0], u[2], &u[0], &u[2], &clamp_lo, &clamp_hi); addsub_sse4_1(u[1], u[3], &u[1], &u[3], &clamp_lo, &clamp_hi); addsub_sse4_1(u[4], u[6], &u[4], &u[6], &clamp_lo, &clamp_hi); addsub_sse4_1(u[5], u[7], &u[5], &u[7], &clamp_lo, &clamp_hi); addsub_sse4_1(u[8], u[10], &u[8], &u[10], &clamp_lo, &clamp_hi); addsub_sse4_1(u[9], u[11], &u[9], &u[11], &clamp_lo, &clamp_hi); addsub_sse4_1(u[12], u[14], &u[12], &u[14], &clamp_lo, &clamp_hi); addsub_sse4_1(u[13], u[15], &u[13], &u[15], &clamp_lo, &clamp_hi); // stage 8 y = _mm_mullo_epi32(u[2], cospi32); x = _mm_mullo_epi32(u[3], cospi32); u[2] = _mm_add_epi32(y, x); u[2] = _mm_add_epi32(u[2], rnding); u[2] = _mm_srai_epi32(u[2], bit); u[3] = _mm_sub_epi32(y, x); u[3] = _mm_add_epi32(u[3], rnding); u[3] = _mm_srai_epi32(u[3], bit); y = _mm_mullo_epi32(u[6], cospi32); x = _mm_mullo_epi32(u[7], cospi32); u[6] = _mm_add_epi32(y, x); u[6] = _mm_add_epi32(u[6], rnding); u[6] = _mm_srai_epi32(u[6], bit); u[7] = _mm_sub_epi32(y, x); u[7] = _mm_add_epi32(u[7], rnding); u[7] = _mm_srai_epi32(u[7], bit); y = _mm_mullo_epi32(u[10], cospi32); x = _mm_mullo_epi32(u[11], cospi32); u[10] = _mm_add_epi32(y, x); u[10] = _mm_add_epi32(u[10], rnding); u[10] = _mm_srai_epi32(u[10], bit); u[11] = _mm_sub_epi32(y, x); u[11] = _mm_add_epi32(u[11], rnding); u[11] = _mm_srai_epi32(u[11], bit); y = _mm_mullo_epi32(u[14], cospi32); x = _mm_mullo_epi32(u[15], cospi32); u[14] = _mm_add_epi32(y, x); u[14] = _mm_add_epi32(u[14], rnding); u[14] = _mm_srai_epi32(u[14], bit); u[15] = _mm_sub_epi32(y, x); u[15] = _mm_add_epi32(u[15], rnding); u[15] = _mm_srai_epi32(u[15], bit); // stage 9 if (do_cols) { out[0] = u[0]; out[1] = _mm_sub_epi32(_mm_setzero_si128(), u[8]); out[2] = u[12]; out[3] = _mm_sub_epi32(_mm_setzero_si128(), u[4]); out[4] = u[6]; out[5] = _mm_sub_epi32(_mm_setzero_si128(), u[14]); out[6] = u[10]; out[7] = _mm_sub_epi32(_mm_setzero_si128(), u[2]); out[8] = u[3]; out[9] = _mm_sub_epi32(_mm_setzero_si128(), u[11]); out[10] = u[15]; out[11] = _mm_sub_epi32(_mm_setzero_si128(), u[7]); out[12] = u[5]; out[13] = _mm_sub_epi32(_mm_setzero_si128(), u[13]); out[14] = u[9]; out[15] = _mm_sub_epi32(_mm_setzero_si128(), u[1]); } else { const int log_range_out = AOMMAX(16, bd + 6); const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1); neg_shift_sse4_1(u[0], u[8], out + 0, out + 1, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(u[12], u[4], out + 2, out + 3, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(u[6], u[14], out + 4, out + 5, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(u[10], u[2], out + 6, out + 7, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(u[3], u[11], out + 8, out + 9, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(u[15], u[7], out + 10, out + 11, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(u[5], u[13], out + 12, out + 13, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(u[9], u[1], out + 14, out + 15, &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
} } } static void idct16x16_sse4_1(__m128i *in, __m128i *out, int bit, int do_cols, int bd, int out_shift) { const int32_t *cospi = cospi_arr(bit); const __m128i cospi60 = _mm_set1_epi32(cospi[60]); const __m128i cospim4 = _mm_set1_epi32(-cospi[4]); const __m128i cospi28 = _mm_set1_epi32(cospi[28]);

[CVE-2020-0478_1.diff] highbd_inv_txfm_sse4.c #20
- if (do_cols) { - addsub_no_clamp_sse4_1(v[0], v[15], out + 0, out + 15); - addsub_no_clamp_sse4_1(v[1], v[14], out + 1, out + 14); - addsub_no_clamp_sse4_1(v[2], v[13], out + 2, out + 13); - addsub_no_clamp_sse4_1(v[3], v[12], out + 3, out + 12); - addsub_no_clamp_sse4_1(v[4], v[11], out + 4, out + 11); - addsub_no_clamp_sse4_1(v[5], v[10], out + 5, out + 10); - addsub_no_clamp_sse4_1(v[6], v[9], out + 6, out + 9); - addsub_no_clamp_sse4_1(v[7], v[8], out + 7, out + 8); - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( - -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); - const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( - (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); + addsub_sse4_1(v[0], v[15], out + 0, out + 15, &clamp_lo, &clamp_hi); + addsub_sse4_1(v[1], v[14], out + 1, out + 14, &clamp_lo, &clamp_hi); + addsub_sse4_1(v[2], v[13], out + 2, out + 13, &clamp_lo, &clamp_hi); + addsub_sse4_1(v[3], v[12], out + 3, out + 12, &clamp_lo, &clamp_hi); + addsub_sse4_1(v[4], v[11], out + 4, out + 11, &clamp_lo, &clamp_hi); + addsub_sse4_1(v[5], v[10], out + 5, out + 10, &clamp_lo, &clamp_hi); + addsub_sse4_1(v[6], v[9], out + 6, out + 9, &clamp_lo, &clamp_hi); + addsub_sse4_1(v[7], v[8], out + 7, out + 8, &clamp_lo, &clamp_hi); - addsub_shift_sse4_1(v[0], v[15], out + 0, out + 15, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(v[1], v[14], out + 1, out + 14, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(v[2], v[13], out + 2, out + 13, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(v[3], v[12], out + 3, out + 12, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(v[4], v[11], out + 4, out + 11, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(v[5], v[10], out + 5, out + 10, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(v[6], v[9], out + 6, out + 9, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(v[7], v[8], out + 7, out + 8, &clamp_lo_out, - &clamp_hi_out, out_shift); + if (!do_cols) { + const int log_range_out = AOMMAX(16, bd + 6); + const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); + const __m128i clamp_hi_out = + _mm_set1_epi32((1 << (log_range_out - 1)) - 1); + round_shift_8x8(out, out_shift); + highbd_clamp_epi32_sse4_1(out, out, &clamp_lo_out, &clamp_hi_out, 16);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_sse4.c
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
v[11] = _mm_srai_epi32(v[11], bit); v[12] = _mm_add_epi32(x, y); v[12] = _mm_add_epi32(v[12], rnding); v[12] = _mm_srai_epi32(v[12], bit); v[14] = u[14]; v[15] = u[15]; // stage 7
+ show +
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
if (do_cols) { addsub_no_clamp_sse4_1(v[0], v[15], out + 0, out + 15); addsub_no_clamp_sse4_1(v[1], v[14], out + 1, out + 14); addsub_no_clamp_sse4_1(v[2], v[13], out + 2, out + 13); addsub_no_clamp_sse4_1(v[3], v[12], out + 3, out + 12); addsub_no_clamp_sse4_1(v[4], v[11], out + 4, out + 11); addsub_no_clamp_sse4_1(v[5], v[10], out + 5, out + 10); addsub_no_clamp_sse4_1(v[6], v[9], out + 6, out + 9); addsub_no_clamp_sse4_1(v[7], v[8], out + 7, out + 8); } else { const int log_range_out = AOMMAX(16, bd + 6); const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); addsub_shift_sse4_1(v[0], v[15], out + 0, out + 15, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(v[1], v[14], out + 1, out + 14, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(v[2], v[13], out + 2, out + 13, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(v[3], v[12], out + 3, out + 12, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(v[4], v[11], out + 4, out + 11, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(v[5], v[10], out + 5, out + 10, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(v[6], v[9], out + 6, out + 9, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(v[7], v[8], out + 7, out + 8, &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
} } } static void iadst16x16_sse4_1(__m128i *in, __m128i *out, int bit, int do_cols, int bd, int out_shift) { const int32_t *cospi = cospi_arr(bit); const __m128i cospi2 = _mm_set1_epi32(cospi[2]); const __m128i cospi62 = _mm_set1_epi32(cospi[62]); const __m128i cospi10 = _mm_set1_epi32(cospi[10]);

[CVE-2020-0478_1.diff] highbd_inv_txfm_sse4.c #22
- const int log_range) { - if (do_cols) { - for (int i = 0; i < 32; i++) { - addsub_no_clamp_sse4_1(u[i], u[63 - i], &out[(i)], &out[(63 - i)]); - } - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( - -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); - const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( - (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); + const __m128i *clamp_lo, + const __m128i *clamp_hi) { + for (int i = 0; i < 32; i++) { + addsub_sse4_1(u[i], u[63 - i], out + i, out + 63 - i, clamp_lo, clamp_hi); + } - for (int i = 0; i < 32; i++) { - addsub_shift_sse4_1(u[i], u[63 - i], &out[(i)], &out[(63 - i)], - &clamp_lo_out, &clamp_hi_out, out_shift); + if (!do_cols) { + const int log_range_out = AOMMAX(16, bd + 6); + const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); + const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1); + + for (int i = 0; i < 64; i += 4) { + round_shift_4x4(out + i, out_shift); + highbd_clamp_epi32_sse4_1(out + i, out + i, &clamp_lo_out, &clamp_hi_out, + 4);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_sse4.c
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
u[50] = half_btf_sse4_1(cospi32, &u[45], cospi32, &u[50], rnding, bit); u[51] = half_btf_sse4_1(cospi32, &u[44], cospi32, &u[51], rnding, bit); u[44] = temp1; u[45] = temp2; u[46] = temp3; u[47] = temp4; } static INLINE void idct64_stage11_sse4_1(__m128i *u, __m128i *out, int do_cols, int bd, int out_shift,
+ show +
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
const int log_range) { if (do_cols) { for (int i = 0; i < 32; i++) { addsub_no_clamp_sse4_1(u[i], u[63 - i], &out[(i)], &out[(63 - i)]); } } else { const int log_range_out = AOMMAX(16, bd + 6); const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); for (int i = 0; i < 32; i++) { addsub_shift_sse4_1(u[i], u[63 - i], &out[(i)], &out[(63 - i)], &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
} } } static void idct64x64_low1_sse4_1(__m128i *in, __m128i *out, int bit, int do_cols, int bd, int out_shift) { const int32_t *cospi = cospi_arr(bit); const __m128i rnding = _mm_set1_epi32(1 << (bit - 1)); const int log_range = AOMMAX(16, bd + (do_cols ? 6 : 8)); const __m128i clamp_lo = _mm_set1_epi32(-(1 << (log_range - 1)));

[CVE-2020-0478_1.diff] highbd_inv_txfm_sse4.c #28
- if (do_cols) { - for (i = 0; i < 32; i++) { - addsub_no_clamp_sse4_1(v[i], v[63 - i], &out[(i)], &out[(63 - i)]); - } - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( - -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); - const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( - (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); + for (i = 0; i < 32; i++) { + addsub_sse4_1(v[i], v[63 - i], &out[(i)], &out[(63 - i)], &clamp_lo, + &clamp_hi); + } - for (i = 0; i < 32; i++) { - addsub_shift_sse4_1(v[i], v[63 - i], &out[(i)], &out[(63 - i)], - &clamp_lo_out, &clamp_hi_out, out_shift); + if (!do_cols) { + const int log_range_out = AOMMAX(16, bd + 6); + const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); + const __m128i clamp_hi_out = + _mm_set1_epi32((1 << (log_range_out - 1)) - 1); + for (i = 0; i < 64; i += 4) { + round_shift_4x4(out + i, out_shift); + highbd_clamp_epi32_sse4_1(out + i, out + i, &clamp_lo_out, + &clamp_hi_out, 4);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_sse4.c
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
v[50] = half_btf_sse4_1(&cospi32, &u[45], &cospi32, &u[50], &rnding, bit); v[51] = half_btf_sse4_1(&cospi32, &u[44], &cospi32, &u[51], &rnding, bit); v[52] = half_btf_sse4_1(&cospi32, &u[43], &cospi32, &u[52], &rnding, bit); v[53] = half_btf_sse4_1(&cospi32, &u[42], &cospi32, &u[53], &rnding, bit); v[54] = half_btf_sse4_1(&cospi32, &u[41], &cospi32, &u[54], &rnding, bit); v[55] = half_btf_sse4_1(&cospi32, &u[40], &cospi32, &u[55], &rnding, bit); for (i = 56; i < 64; i++) v[i] = u[i]; // stage 11
+ show +
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
if (do_cols) { for (i = 0; i < 32; i++) { addsub_no_clamp_sse4_1(v[i], v[63 - i], &out[(i)], &out[(63 - i)]); } } else { const int log_range_out = AOMMAX(16, bd + 6); const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); for (i = 0; i < 32; i++) { addsub_shift_sse4_1(v[i], v[63 - i], &out[(i)], &out[(63 - i)], &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
} } } } static void idct32x32_low1_sse4_1(__m128i *in, __m128i *out, int bit, int do_cols, int bd, int out_shift) { const int32_t *cospi = cospi_arr(bit); const __m128i cospi32 = _mm_set1_epi32(cospi[32]); const __m128i rounding = _mm_set1_epi32(1 << (bit - 1));

[CVE-2020-0478_1.diff] highbd_inv_txfm_sse4.c #30
- const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( - -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); - const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( - (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); - - __m128i offset = _mm_set1_epi32((1 << out_shift) >> 1); - bf1 = _mm_add_epi32(bf1, offset); - bf1 = _mm_sra_epi32(bf1, _mm_cvtsi32_si128(out_shift)); - bf1 = _mm_max_epi32(bf1, clamp_lo_out); - bf1 = _mm_min_epi32(bf1, clamp_hi_out); + clamp_lo = _mm_set1_epi32(-(1 << (log_range_out - 1))); + clamp_hi = _mm_set1_epi32((1 << (log_range_out - 1)) - 1); + if (out_shift != 0) { + __m128i offset = _mm_set1_epi32((1 << out_shift) >> 1); + bf1 = _mm_add_epi32(bf1, offset); + bf1 = _mm_sra_epi32(bf1, _mm_cvtsi32_si128(out_shift)); + } + + bf1 = _mm_max_epi32(bf1, clamp_lo); + bf1 = _mm_min_epi32(bf1, clamp_hi);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_sse4.c
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
// stage 6 // stage 7 // stage 8 // stage 9 if (do_cols) { bf1 = _mm_max_epi32(bf1, clamp_lo); bf1 = _mm_min_epi32(bf1, clamp_hi); } else { const int log_range_out = AOMMAX(16, bd + 6);
+ show +
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); __m128i offset = _mm_set1_epi32((1 << out_shift) >> 1); bf1 = _mm_add_epi32(bf1, offset); bf1 = _mm_sra_epi32(bf1, _mm_cvtsi32_si128(out_shift)); bf1 = _mm_max_epi32(bf1, clamp_lo_out); bf1 = _mm_min_epi32(bf1, clamp_hi_out);
+ show +
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
} out[0] = bf1; out[1] = bf1; out[2] = bf1; out[3] = bf1; out[4] = bf1; out[5] = bf1; out[6] = bf1; out[7] = bf1; out[8] = bf1;

[CVE-2020-0478_1.diff] highbd_inv_txfm_sse4.c #33
- if (do_cols) { - addsub_no_clamp_sse4_1(bf0[0], bf0[31], out + 0, out + 31); - addsub_no_clamp_sse4_1(bf0[1], bf0[30], out + 1, out + 30); - addsub_no_clamp_sse4_1(bf0[2], bf0[29], out + 2, out + 29); - addsub_no_clamp_sse4_1(bf0[3], bf0[28], out + 3, out + 28); - addsub_no_clamp_sse4_1(bf0[4], bf0[27], out + 4, out + 27); - addsub_no_clamp_sse4_1(bf0[5], bf0[26], out + 5, out + 26); - addsub_no_clamp_sse4_1(bf0[6], bf0[25], out + 6, out + 25); - addsub_no_clamp_sse4_1(bf0[7], bf0[24], out + 7, out + 24); - addsub_no_clamp_sse4_1(bf0[8], bf0[23], out + 8, out + 23); - addsub_no_clamp_sse4_1(bf0[9], bf0[22], out + 9, out + 22); - addsub_no_clamp_sse4_1(bf0[10], bf0[21], out + 10, out + 21); - addsub_no_clamp_sse4_1(bf0[11], bf0[20], out + 11, out + 20); - addsub_no_clamp_sse4_1(bf0[12], bf0[19], out + 12, out + 19); - addsub_no_clamp_sse4_1(bf0[13], bf0[18], out + 13, out + 18); - addsub_no_clamp_sse4_1(bf0[14], bf0[17], out + 14, out + 17); - addsub_no_clamp_sse4_1(bf0[15], bf0[16], out + 15, out + 16); - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( - -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); - const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( - (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); + addsub_sse4_1(bf0[0], bf0[31], out + 0, out + 31, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[1], bf0[30], out + 1, out + 30, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[2], bf0[29], out + 2, out + 29, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[3], bf0[28], out + 3, out + 28, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[4], bf0[27], out + 4, out + 27, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[5], bf0[26], out + 5, out + 26, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[6], bf0[25], out + 6, out + 25, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[7], bf0[24], out + 7, out + 24, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[8], bf0[23], out + 8, out + 23, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[9], bf0[22], out + 9, out + 22, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[10], bf0[21], out + 10, out + 21, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[11], bf0[20], out + 11, out + 20, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[12], bf0[19], out + 12, out + 19, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[13], bf0[18], out + 13, out + 18, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[14], bf0[17], out + 14, out + 17, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[15], bf0[16], out + 15, out + 16, &clamp_lo, &clamp_hi); - addsub_shift_sse4_1(bf0[0], bf0[31], out + 0, out + 31, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[1], bf0[30], out + 1, out + 30, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[2], bf0[29], out + 2, out + 29, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[3], bf0[28], out + 3, out + 28, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[4], bf0[27], out + 4, out + 27, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[5], bf0[26], out + 5, out + 26, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[6], bf0[25], out + 6, out + 25, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[7], bf0[24], out + 7, out + 24, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[8], bf0[23], out + 8, out + 23, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[9], bf0[22], out + 9, out + 22, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[10], bf0[21], out + 10, out + 21, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[11], bf0[20], out + 11, out + 20, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[12], bf0[19], out + 12, out + 19, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[13], bf0[18], out + 13, out + 18, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[14], bf0[17], out + 14, out + 17, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[15], bf0[16], out + 15, out + 16, &clamp_lo_out, - &clamp_hi_out, out_shift); + if (!do_cols) { + const int log_range_out = AOMMAX(16, bd + 6); + const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); + const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1); + round_shift_8x8(out, out_shift); + round_shift_8x8(out + 16, out_shift); + highbd_clamp_epi32_sse4_1(out, out, &clamp_lo_out, &clamp_hi_out, 32);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_sse4.c
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
bf0[26] = half_btf_sse4_1(&cospi32, &bf1[21], &cospi32, &bf1[26], &rounding, bit); bf0[27] = half_btf_sse4_1(&cospi32, &bf1[20], &cospi32, &bf1[27], &rounding, bit); bf0[28] = bf1[28]; bf0[29] = bf1[29]; bf0[30] = bf1[30]; bf0[31] = bf1[31]; // stage 9
+ show +
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
if (do_cols) { addsub_no_clamp_sse4_1(bf0[0], bf0[31], out + 0, out + 31); addsub_no_clamp_sse4_1(bf0[1], bf0[30], out + 1, out + 30); addsub_no_clamp_sse4_1(bf0[2], bf0[29], out + 2, out + 29); addsub_no_clamp_sse4_1(bf0[3], bf0[28], out + 3, out + 28); addsub_no_clamp_sse4_1(bf0[4], bf0[27], out + 4, out + 27); addsub_no_clamp_sse4_1(bf0[5], bf0[26], out + 5, out + 26); addsub_no_clamp_sse4_1(bf0[6], bf0[25], out + 6, out + 25); addsub_no_clamp_sse4_1(bf0[7], bf0[24], out + 7, out + 24); addsub_no_clamp_sse4_1(bf0[8], bf0[23], out + 8, out + 23); addsub_no_clamp_sse4_1(bf0[9], bf0[22], out + 9, out + 22); addsub_no_clamp_sse4_1(bf0[10], bf0[21], out + 10, out + 21); addsub_no_clamp_sse4_1(bf0[11], bf0[20], out + 11, out + 20); addsub_no_clamp_sse4_1(bf0[12], bf0[19], out + 12, out + 19); addsub_no_clamp_sse4_1(bf0[13], bf0[18], out + 13, out + 18); addsub_no_clamp_sse4_1(bf0[14], bf0[17], out + 14, out + 17); addsub_no_clamp_sse4_1(bf0[15], bf0[16], out + 15, out + 16); } else { const int log_range_out = AOMMAX(16, bd + 6); const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); addsub_shift_sse4_1(bf0[0], bf0[31], out + 0, out + 31, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[1], bf0[30], out + 1, out + 30, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[2], bf0[29], out + 2, out + 29, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[3], bf0[28], out + 3, out + 28, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[4], bf0[27], out + 4, out + 27, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[5], bf0[26], out + 5, out + 26, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[6], bf0[25], out + 6, out + 25, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[7], bf0[24], out + 7, out + 24, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[8], bf0[23], out + 8, out + 23, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[9], bf0[22], out + 9, out + 22, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[10], bf0[21], out + 10, out + 21, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[11], bf0[20], out + 11, out + 20, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[12], bf0[19], out + 12, out + 19, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[13], bf0[18], out + 13, out + 18, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[14], bf0[17], out + 14, out + 17, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[15], bf0[16], out + 15, out + 16, &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
} } void av1_highbd_inv_txfm_add_8x8_sse4_1(const tran_low_t *input, uint8_t *dest, int stride, const TxfmParam *txfm_param) { int bd = txfm_param->bd; const TX_TYPE tx_type = txfm_param->tx_type; const int32_t *src = cast_to_int32(input); switch (tx_type) {

[CVE-2020-0470_1.diff] highbd_inv_txfm_sse4.c #3
- const int log_range) { - if (do_cols) { - addsub_no_clamp_sse4_1(bf1[0], bf1[31], out + 0, out + 31); - addsub_no_clamp_sse4_1(bf1[1], bf1[30], out + 1, out + 30); - addsub_no_clamp_sse4_1(bf1[2], bf1[29], out + 2, out + 29); - addsub_no_clamp_sse4_1(bf1[3], bf1[28], out + 3, out + 28); - addsub_no_clamp_sse4_1(bf1[4], bf1[27], out + 4, out + 27); - addsub_no_clamp_sse4_1(bf1[5], bf1[26], out + 5, out + 26); - addsub_no_clamp_sse4_1(bf1[6], bf1[25], out + 6, out + 25); - addsub_no_clamp_sse4_1(bf1[7], bf1[24], out + 7, out + 24); - addsub_no_clamp_sse4_1(bf1[8], bf1[23], out + 8, out + 23); - addsub_no_clamp_sse4_1(bf1[9], bf1[22], out + 9, out + 22); - addsub_no_clamp_sse4_1(bf1[10], bf1[21], out + 10, out + 21); - addsub_no_clamp_sse4_1(bf1[11], bf1[20], out + 11, out + 20); - addsub_no_clamp_sse4_1(bf1[12], bf1[19], out + 12, out + 19); - addsub_no_clamp_sse4_1(bf1[13], bf1[18], out + 13, out + 18); - addsub_no_clamp_sse4_1(bf1[14], bf1[17], out + 14, out + 17); - addsub_no_clamp_sse4_1(bf1[15], bf1[16], out + 15, out + 16); - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( - -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); - const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( - (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); + const __m128i *clamp_lo, + const __m128i *clamp_hi) { + addsub_sse4_1(bf1[0], bf1[31], out + 0, out + 31, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[1], bf1[30], out + 1, out + 30, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[2], bf1[29], out + 2, out + 29, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[3], bf1[28], out + 3, out + 28, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[4], bf1[27], out + 4, out + 27, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[5], bf1[26], out + 5, out + 26, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[6], bf1[25], out + 6, out + 25, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[7], bf1[24], out + 7, out + 24, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[8], bf1[23], out + 8, out + 23, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[9], bf1[22], out + 9, out + 22, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[10], bf1[21], out + 10, out + 21, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[11], bf1[20], out + 11, out + 20, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[12], bf1[19], out + 12, out + 19, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[13], bf1[18], out + 13, out + 18, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[14], bf1[17], out + 14, out + 17, clamp_lo, clamp_hi); + addsub_sse4_1(bf1[15], bf1[16], out + 15, out + 16, clamp_lo, clamp_hi); - addsub_shift_sse4_1(bf1[0], bf1[31], out + 0, out + 31, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[1], bf1[30], out + 1, out + 30, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[2], bf1[29], out + 2, out + 29, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[3], bf1[28], out + 3, out + 28, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[4], bf1[27], out + 4, out + 27, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[5], bf1[26], out + 5, out + 26, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[6], bf1[25], out + 6, out + 25, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[7], bf1[24], out + 7, out + 24, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[8], bf1[23], out + 8, out + 23, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[9], bf1[22], out + 9, out + 22, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[10], bf1[21], out + 10, out + 21, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[11], bf1[20], out + 11, out + 20, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[12], bf1[19], out + 12, out + 19, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[13], bf1[18], out + 13, out + 18, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[14], bf1[17], out + 14, out + 17, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf1[15], bf1[16], out + 15, out + 16, &clamp_lo_out, - &clamp_hi_out, out_shift); + if (!do_cols) { + const int log_range_out = AOMMAX(16, bd + 6); + const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); + const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1); + for (int i = 0; i < 32; i += 8) { + round_shift_4x4(out + i, out_shift); + round_shift_4x4(out + i + 4, out_shift); + } + highbd_clamp_epi32_sse4_1(out, out, &clamp_lo_out, &clamp_hi_out, 32);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_sse4.c
291
292
293
294
295
296
297
298
299
300
bf1[22] = temp1; temp2 = half_btf_sse4_1(cospim32, &bf1[23], cospi32, &bf1[24], rounding, bit); bf1[24] = half_btf_sse4_1(cospi32, &bf1[23], cospi32, &bf1[24], rounding, bit); bf1[23] = temp2; } static INLINE void idct32_stage9_sse4_1(__m128i *bf1, __m128i *out, const int do_cols, const int bd, const int out_shift,
+ show +
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
const int log_range) { if (do_cols) { addsub_no_clamp_sse4_1(bf1[0], bf1[31], out + 0, out + 31); addsub_no_clamp_sse4_1(bf1[1], bf1[30], out + 1, out + 30); addsub_no_clamp_sse4_1(bf1[2], bf1[29], out + 2, out + 29); addsub_no_clamp_sse4_1(bf1[3], bf1[28], out + 3, out + 28); addsub_no_clamp_sse4_1(bf1[4], bf1[27], out + 4, out + 27); addsub_no_clamp_sse4_1(bf1[5], bf1[26], out + 5, out + 26); addsub_no_clamp_sse4_1(bf1[6], bf1[25], out + 6, out + 25); addsub_no_clamp_sse4_1(bf1[7], bf1[24], out + 7, out + 24); addsub_no_clamp_sse4_1(bf1[8], bf1[23], out + 8, out + 23); addsub_no_clamp_sse4_1(bf1[9], bf1[22], out + 9, out + 22); addsub_no_clamp_sse4_1(bf1[10], bf1[21], out + 10, out + 21); addsub_no_clamp_sse4_1(bf1[11], bf1[20], out + 11, out + 20); addsub_no_clamp_sse4_1(bf1[12], bf1[19], out + 12, out + 19); addsub_no_clamp_sse4_1(bf1[13], bf1[18], out + 13, out + 18); addsub_no_clamp_sse4_1(bf1[14], bf1[17], out + 14, out + 17); addsub_no_clamp_sse4_1(bf1[15], bf1[16], out + 15, out + 16); } else { const int log_range_out = AOMMAX(16, bd + 6); const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); addsub_shift_sse4_1(bf1[0], bf1[31], out + 0, out + 31, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[1], bf1[30], out + 1, out + 30, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[2], bf1[29], out + 2, out + 29, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[3], bf1[28], out + 3, out + 28, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[4], bf1[27], out + 4, out + 27, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[5], bf1[26], out + 5, out + 26, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[6], bf1[25], out + 6, out + 25, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[7], bf1[24], out + 7, out + 24, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[8], bf1[23], out + 8, out + 23, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[9], bf1[22], out + 9, out + 22, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[10], bf1[21], out + 10, out + 21, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[11], bf1[20], out + 11, out + 20, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[12], bf1[19], out + 12, out + 19, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[13], bf1[18], out + 13, out + 18, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[14], bf1[17], out + 14, out + 17, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf1[15], bf1[16], out + 15, out + 16, &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
358
359
360
361
362
363
364
365
366
367
} } static void neg_shift_sse4_1(const __m128i in0, const __m128i in1, __m128i *out0, __m128i *out1, const __m128i *clamp_lo, const __m128i *clamp_hi, int shift) { __m128i offset = _mm_set1_epi32((1 << shift) >> 1); __m128i a0 = _mm_add_epi32(offset, in0); __m128i a1 = _mm_sub_epi32(offset, in1);

[CVE-2020-0470_1.diff] highbd_inv_txfm_sse4.c #10
- if (do_cols) { - addsub_no_clamp_sse4_1(u0, u7, out + 0 * 2 + col, out + 7 * 2 + col); - addsub_no_clamp_sse4_1(u1, u6, out + 1 * 2 + col, out + 6 * 2 + col); - addsub_no_clamp_sse4_1(u2, u5, out + 2 * 2 + col, out + 5 * 2 + col); - addsub_no_clamp_sse4_1(u3, u4, out + 3 * 2 + col, out + 4 * 2 + col); - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( - -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); - const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( - (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); - addsub_shift_sse4_1(u0, u7, out + 0 * 2 + col, out + 7 * 2 + col, - &clamp_lo_out, &clamp_hi_out, out_shift); - addsub_shift_sse4_1(u1, u6, out + 1 * 2 + col, out + 6 * 2 + col, - &clamp_lo_out, &clamp_hi_out, out_shift); - addsub_shift_sse4_1(u2, u5, out + 2 * 2 + col, out + 5 * 2 + col, - &clamp_lo_out, &clamp_hi_out, out_shift); - addsub_shift_sse4_1(u3, u4, out + 3 * 2 + col, out + 4 * 2 + col, - &clamp_lo_out, &clamp_hi_out, out_shift); - } + addsub_sse4_1(u0, u7, out + 0 * 2 + col, out + 7 * 2 + col, &clamp_lo, + &clamp_hi); + addsub_sse4_1(u1, u6, out + 1 * 2 + col, out + 6 * 2 + col, &clamp_lo, + &clamp_hi); + addsub_sse4_1(u2, u5, out + 2 * 2 + col, out + 5 * 2 + col, &clamp_lo, + &clamp_hi); + addsub_sse4_1(u3, u4, out + 3 * 2 + col, out + 4 * 2 + col, &clamp_lo, + &clamp_hi); + } + + if (!do_cols) { + const int log_range_out = AOMMAX(16, bd + 6); + const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); + const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1); + round_shift_8x8(out, out_shift); + highbd_clamp_epi32_sse4_1(out, out, &clamp_lo_out, &clamp_hi_out, 16);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_sse4.c
867
868
869
870
871
872
873
874
875
876
y = _mm_mullo_epi32(v6, cospi32); u6 = _mm_add_epi32(y, x); u6 = _mm_add_epi32(u6, rnding); u6 = _mm_srai_epi32(u6, bit); u5 = _mm_sub_epi32(y, x); u5 = _mm_add_epi32(u5, rnding); u5 = _mm_srai_epi32(u5, bit); // stage 5
+ show +
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
if (do_cols) { addsub_no_clamp_sse4_1(u0, u7, out + 0 * 2 + col, out + 7 * 2 + col); addsub_no_clamp_sse4_1(u1, u6, out + 1 * 2 + col, out + 6 * 2 + col); addsub_no_clamp_sse4_1(u2, u5, out + 2 * 2 + col, out + 5 * 2 + col); addsub_no_clamp_sse4_1(u3, u4, out + 3 * 2 + col, out + 4 * 2 + col); } else { const int log_range_out = AOMMAX(16, bd + 6); const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); addsub_shift_sse4_1(u0, u7, out + 0 * 2 + col, out + 7 * 2 + col, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(u1, u6, out + 1 * 2 + col, out + 6 * 2 + col, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(u2, u5, out + 2 * 2 + col, out + 5 * 2 + col, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(u3, u4, out + 3 * 2 + col, out + 4 * 2 + col, &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
896
897
898
899
900
901
902
903
904
905
} } } static void iadst8x8_sse4_1(__m128i *in, __m128i *out, int bit, int do_cols, int bd, int out_shift) { const int32_t *cospi = cospi_arr(bit); const __m128i cospi4 = _mm_set1_epi32(cospi[4]); const __m128i cospi60 = _mm_set1_epi32(cospi[60]); const __m128i cospi20 = _mm_set1_epi32(cospi[20]);

[CVE-2020-0470_1.diff] highbd_inv_txfm_sse4.c #17
+ // stage 0 + // stage 1 + u[0] = in[0]; + u[2] = in[4]; + u[4] = in[2]; + u[6] = in[6]; + u[8] = in[1]; + u[10] = in[5]; + u[12] = in[3]; + u[14] = in[7]; - { - // stage 0 - // stage 1 - u[0] = in[0]; - u[2] = in[4]; - u[4] = in[2]; - u[6] = in[6]; - u[8] = in[1]; - u[10] = in[5]; - u[12] = in[3]; - u[14] = in[7]; + // stage 2 + u[15] = half_btf_0_sse4_1(&cospi4, &u[8], &rnding, bit); + u[8] = half_btf_0_sse4_1(&cospi60, &u[8], &rnding, bit); - // stage 2 - u[15] = half_btf_0_sse4_1(&cospi4, &u[8], &rnding, bit); - u[8] = half_btf_0_sse4_1(&cospi60, &u[8], &rnding, bit); + u[9] = half_btf_0_sse4_1(&cospim36, &u[14], &rnding, bit); + u[14] = half_btf_0_sse4_1(&cospi28, &u[14], &rnding, bit); - u[9] = half_btf_0_sse4_1(&cospim36, &u[14], &rnding, bit); - u[14] = half_btf_0_sse4_1(&cospi28, &u[14], &rnding, bit); + u[13] = half_btf_0_sse4_1(&cospi20, &u[10], &rnding, bit); + u[10] = half_btf_0_sse4_1(&cospi44, &u[10], &rnding, bit); - u[13] = half_btf_0_sse4_1(&cospi20, &u[10], &rnding, bit); - u[10] = half_btf_0_sse4_1(&cospi44, &u[10], &rnding, bit); + u[11] = half_btf_0_sse4_1(&cospim52, &u[12], &rnding, bit); + u[12] = half_btf_0_sse4_1(&cospi12, &u[12], &rnding, bit); - u[11] = half_btf_0_sse4_1(&cospim52, &u[12], &rnding, bit); - u[12] = half_btf_0_sse4_1(&cospi12, &u[12], &rnding, bit); + // stage 3 + u[7] = half_btf_0_sse4_1(&cospi8, &u[4], &rnding, bit); + u[4] = half_btf_0_sse4_1(&cospi56, &u[4], &rnding, bit); + u[5] = half_btf_0_sse4_1(&cospim40, &u[6], &rnding, bit); + u[6] = half_btf_0_sse4_1(&cospi24, &u[6], &rnding, bit); - // stage 3 - u[7] = half_btf_0_sse4_1(&cospi8, &u[4], &rnding, bit); - u[4] = half_btf_0_sse4_1(&cospi56, &u[4], &rnding, bit); - u[5] = half_btf_0_sse4_1(&cospim40, &u[6], &rnding, bit); - u[6] = half_btf_0_sse4_1(&cospi24, &u[6], &rnding, bit); + addsub_sse4_1(u[8], u[9], &u[8], &u[9], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[11], u[10], &u[11], &u[10], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[12], u[13], &u[12], &u[13], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[15], u[14], &u[15], &u[14], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[8], u[9], &u[8], &u[9], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[11], u[10], &u[11], &u[10], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[12], u[13], &u[12], &u[13], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[15], u[14], &u[15], &u[14], &clamp_lo, &clamp_hi); + // stage 4 + x = _mm_mullo_epi32(u[0], cospi32); + u[0] = _mm_add_epi32(x, rnding); + u[0] = _mm_srai_epi32(u[0], bit); + u[1] = u[0]; - // stage 4 - x = _mm_mullo_epi32(u[0], cospi32); - u[0] = _mm_add_epi32(x, rnding); - u[0] = _mm_srai_epi32(u[0], bit); - u[1] = u[0]; + u[3] = half_btf_0_sse4_1(&cospi16, &u[2], &rnding, bit); + u[2] = half_btf_0_sse4_1(&cospi48, &u[2], &rnding, bit); - u[3] = half_btf_0_sse4_1(&cospi16, &u[2], &rnding, bit); - u[2] = half_btf_0_sse4_1(&cospi48, &u[2], &rnding, bit); + addsub_sse4_1(u[4], u[5], &u[4], &u[5], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[7], u[6], &u[7], &u[6], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[4], u[5], &u[4], &u[5], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[7], u[6], &u[7], &u[6], &clamp_lo, &clamp_hi); + x = half_btf_sse4_1(&cospim16, &u[9], &cospi48, &u[14], &rnding, bit); + u[14] = half_btf_sse4_1(&cospi48, &u[9], &cospi16, &u[14], &rnding, bit); + u[9] = x; + y = half_btf_sse4_1(&cospim48, &u[10], &cospim16, &u[13], &rnding, bit); + u[13] = half_btf_sse4_1(&cospim16, &u[10], &cospi48, &u[13], &rnding, bit); + u[10] = y; - x = half_btf_sse4_1(&cospim16, &u[9], &cospi48, &u[14], &rnding, bit); - u[14] = half_btf_sse4_1(&cospi48, &u[9], &cospi16, &u[14], &rnding, bit); - u[9] = x; - y = half_btf_sse4_1(&cospim48, &u[10], &cospim16, &u[13], &rnding, bit); - u[13] = half_btf_sse4_1(&cospim16, &u[10], &cospi48, &u[13], &rnding, bit); - u[10] = y; + // stage 5 + addsub_sse4_1(u[0], u[3], &u[0], &u[3], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[1], u[2], &u[1], &u[2], &clamp_lo, &clamp_hi); - // stage 5 - addsub_sse4_1(u[0], u[3], &u[0], &u[3], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[1], u[2], &u[1], &u[2], &clamp_lo, &clamp_hi); + x = _mm_mullo_epi32(u[5], cospi32); + y = _mm_mullo_epi32(u[6], cospi32); + u[5] = _mm_sub_epi32(y, x); + u[5] = _mm_add_epi32(u[5], rnding); + u[5] = _mm_srai_epi32(u[5], bit); - x = _mm_mullo_epi32(u[5], cospi32); - y = _mm_mullo_epi32(u[6], cospi32); - u[5] = _mm_sub_epi32(y, x); - u[5] = _mm_add_epi32(u[5], rnding); - u[5] = _mm_srai_epi32(u[5], bit); + u[6] = _mm_add_epi32(y, x); + u[6] = _mm_add_epi32(u[6], rnding); + u[6] = _mm_srai_epi32(u[6], bit); - u[6] = _mm_add_epi32(y, x); - u[6] = _mm_add_epi32(u[6], rnding); - u[6] = _mm_srai_epi32(u[6], bit); + addsub_sse4_1(u[8], u[11], &u[8], &u[11], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[9], u[10], &u[9], &u[10], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[15], u[12], &u[15], &u[12], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[14], u[13], &u[14], &u[13], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[8], u[11], &u[8], &u[11], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[9], u[10], &u[9], &u[10], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[15], u[12], &u[15], &u[12], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[14], u[13], &u[14], &u[13], &clamp_lo, &clamp_hi); + // stage 6 + addsub_sse4_1(u[0], u[7], &u[0], &u[7], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[1], u[6], &u[1], &u[6], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[2], u[5], &u[2], &u[5], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[3], u[4], &u[3], &u[4], &clamp_lo, &clamp_hi); - // stage 6 - addsub_sse4_1(u[0], u[7], &u[0], &u[7], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[1], u[6], &u[1], &u[6], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[2], u[5], &u[2], &u[5], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[3], u[4], &u[3], &u[4], &clamp_lo, &clamp_hi); + x = _mm_mullo_epi32(u[10], cospi32); + y = _mm_mullo_epi32(u[13], cospi32); + u[10] = _mm_sub_epi32(y, x); + u[10] = _mm_add_epi32(u[10], rnding); + u[10] = _mm_srai_epi32(u[10], bit); - x = _mm_mullo_epi32(u[10], cospi32); - y = _mm_mullo_epi32(u[13], cospi32); - u[10] = _mm_sub_epi32(y, x); - u[10] = _mm_add_epi32(u[10], rnding); - u[10] = _mm_srai_epi32(u[10], bit); + u[13] = _mm_add_epi32(x, y); + u[13] = _mm_add_epi32(u[13], rnding); + u[13] = _mm_srai_epi32(u[13], bit); - u[13] = _mm_add_epi32(x, y); - u[13] = _mm_add_epi32(u[13], rnding); - u[13] = _mm_srai_epi32(u[13], bit); + x = _mm_mullo_epi32(u[11], cospi32); + y = _mm_mullo_epi32(u[12], cospi32); + u[11] = _mm_sub_epi32(y, x); + u[11] = _mm_add_epi32(u[11], rnding); + u[11] = _mm_srai_epi32(u[11], bit); - x = _mm_mullo_epi32(u[11], cospi32); - y = _mm_mullo_epi32(u[12], cospi32); - u[11] = _mm_sub_epi32(y, x); - u[11] = _mm_add_epi32(u[11], rnding); - u[11] = _mm_srai_epi32(u[11], bit); + u[12] = _mm_add_epi32(x, y); + u[12] = _mm_add_epi32(u[12], rnding); + u[12] = _mm_srai_epi32(u[12], bit); + // stage 7 + addsub_sse4_1(u[0], u[15], out + 0, out + 15, &clamp_lo, &clamp_hi); + addsub_sse4_1(u[1], u[14], out + 1, out + 14, &clamp_lo, &clamp_hi); + addsub_sse4_1(u[2], u[13], out + 2, out + 13, &clamp_lo, &clamp_hi); + addsub_sse4_1(u[3], u[12], out + 3, out + 12, &clamp_lo, &clamp_hi); + addsub_sse4_1(u[4], u[11], out + 4, out + 11, &clamp_lo, &clamp_hi); + addsub_sse4_1(u[5], u[10], out + 5, out + 10, &clamp_lo, &clamp_hi); + addsub_sse4_1(u[6], u[9], out + 6, out + 9, &clamp_lo, &clamp_hi); + addsub_sse4_1(u[7], u[8], out + 7, out + 8, &clamp_lo, &clamp_hi); - u[12] = _mm_add_epi32(x, y); - u[12] = _mm_add_epi32(u[12], rnding); - u[12] = _mm_srai_epi32(u[12], bit); - // stage 7 - if (do_cols) { - addsub_no_clamp_sse4_1(u[0], u[15], out + 0, out + 15); - addsub_no_clamp_sse4_1(u[1], u[14], out + 1, out + 14); - addsub_no_clamp_sse4_1(u[2], u[13], out + 2, out + 13); - addsub_no_clamp_sse4_1(u[3], u[12], out + 3, out + 12); - addsub_no_clamp_sse4_1(u[4], u[11], out + 4, out + 11); - addsub_no_clamp_sse4_1(u[5], u[10], out + 5, out + 10); - addsub_no_clamp_sse4_1(u[6], u[9], out + 6, out + 9); - addsub_no_clamp_sse4_1(u[7], u[8], out + 7, out + 8); - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( - -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); - const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( - (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); - - addsub_shift_sse4_1(u[0], u[15], out + 0, out + 15, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(u[1], u[14], out + 1, out + 14, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(u[2], u[13], out + 2, out + 13, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(u[3], u[12], out + 3, out + 12, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(u[4], u[11], out + 4, out + 11, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(u[5], u[10], out + 5, out + 10, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(u[6], u[9], out + 6, out + 9, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(u[7], u[8], out + 7, out + 8, &clamp_lo_out, - &clamp_hi_out, out_shift); - } + if (!do_cols) { + const int log_range_out = AOMMAX(16, bd + 6); + const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); + const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1); + round_shift_8x8(out, out_shift); + highbd_clamp_epi32_sse4_1(out, out, &clamp_lo_out, &clamp_hi_out, 16);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_sse4.c
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
const __m128i cospim52 = _mm_set1_epi32(-cospi[52]); const __m128i rnding = _mm_set1_epi32(1 << (bit - 1)); const int log_range = AOMMAX(16, bd + (do_cols ? 6 : 8)); const __m128i clamp_lo = _mm_set1_epi32(-(1 << (log_range - 1))); const __m128i clamp_hi = _mm_set1_epi32((1 << (log_range - 1)) - 1); __m128i u[16], x, y; { // stage 0 // stage 1
+ show +
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
u[0] = in[0]; u[2] = in[4]; u[4] = in[2]; u[6] = in[6]; u[8] = in[1]; u[10] = in[5]; u[12] = in[3]; u[14] = in[7]; // stage 2 u[15] = half_btf_0_sse4_1(&cospi4, &u[8], &rnding, bit); u[8] = half_btf_0_sse4_1(&cospi60, &u[8], &rnding, bit); u[9] = half_btf_0_sse4_1(&cospim36, &u[14], &rnding, bit); u[14] = half_btf_0_sse4_1(&cospi28, &u[14], &rnding, bit); u[13] = half_btf_0_sse4_1(&cospi20, &u[10], &rnding, bit); u[10] = half_btf_0_sse4_1(&cospi44, &u[10], &rnding, bit); u[11] = half_btf_0_sse4_1(&cospim52, &u[12], &rnding, bit); u[12] = half_btf_0_sse4_1(&cospi12, &u[12], &rnding, bit); // stage 3 u[7] = half_btf_0_sse4_1(&cospi8, &u[4], &rnding, bit); u[4] = half_btf_0_sse4_1(&cospi56, &u[4], &rnding, bit); u[5] = half_btf_0_sse4_1(&cospim40, &u[6], &rnding, bit); u[6] = half_btf_0_sse4_1(&cospi24, &u[6], &rnding, bit); addsub_sse4_1(u[8], u[9], &u[8], &u[9], &clamp_lo, &clamp_hi); addsub_sse4_1(u[11], u[10], &u[11], &u[10], &clamp_lo, &clamp_hi); addsub_sse4_1(u[12], u[13], &u[12], &u[13], &clamp_lo, &clamp_hi); addsub_sse4_1(u[15], u[14], &u[15], &u[14], &clamp_lo, &clamp_hi); // stage 4 x = _mm_mullo_epi32(u[0], cospi32); u[0] = _mm_add_epi32(x, rnding); u[0] = _mm_srai_epi32(u[0], bit); u[1] = u[0]; u[3] = half_btf_0_sse4_1(&cospi16, &u[2], &rnding, bit); u[2] = half_btf_0_sse4_1(&cospi48, &u[2], &rnding, bit); addsub_sse4_1(u[4], u[5], &u[4], &u[5], &clamp_lo, &clamp_hi); addsub_sse4_1(u[7], u[6], &u[7], &u[6], &clamp_lo, &clamp_hi); x = half_btf_sse4_1(&cospim16, &u[9], &cospi48, &u[14], &rnding, bit); u[14] = half_btf_sse4_1(&cospi48, &u[9], &cospi16, &u[14], &rnding, bit); u[9] = x; y = half_btf_sse4_1(&cospim48, &u[10], &cospim16, &u[13], &rnding, bit); u[13] = half_btf_sse4_1(&cospim16, &u[10], &cospi48, &u[13], &rnding, bit); u[10] = y; // stage 5 addsub_sse4_1(u[0], u[3], &u[0], &u[3], &clamp_lo, &clamp_hi); addsub_sse4_1(u[1], u[2], &u[1], &u[2], &clamp_lo, &clamp_hi); x = _mm_mullo_epi32(u[5], cospi32); y = _mm_mullo_epi32(u[6], cospi32); u[5] = _mm_sub_epi32(y, x); u[5] = _mm_add_epi32(u[5], rnding); u[5] = _mm_srai_epi32(u[5], bit); u[6] = _mm_add_epi32(y, x); u[6] = _mm_add_epi32(u[6], rnding); u[6] = _mm_srai_epi32(u[6], bit); addsub_sse4_1(u[8], u[11], &u[8], &u[11], &clamp_lo, &clamp_hi); addsub_sse4_1(u[9], u[10], &u[9], &u[10], &clamp_lo, &clamp_hi); addsub_sse4_1(u[15], u[12], &u[15], &u[12], &clamp_lo, &clamp_hi); addsub_sse4_1(u[14], u[13], &u[14], &u[13], &clamp_lo, &clamp_hi); // stage 6 addsub_sse4_1(u[0], u[7], &u[0], &u[7], &clamp_lo, &clamp_hi); addsub_sse4_1(u[1], u[6], &u[1], &u[6], &clamp_lo, &clamp_hi); addsub_sse4_1(u[2], u[5], &u[2], &u[5], &clamp_lo, &clamp_hi); addsub_sse4_1(u[3], u[4], &u[3], &u[4], &clamp_lo, &clamp_hi); x = _mm_mullo_epi32(u[10], cospi32); y = _mm_mullo_epi32(u[13], cospi32); u[10] = _mm_sub_epi32(y, x); u[10] = _mm_add_epi32(u[10], rnding); u[10] = _mm_srai_epi32(u[10], bit); u[13] = _mm_add_epi32(x, y); u[13] = _mm_add_epi32(u[13], rnding); u[13] = _mm_srai_epi32(u[13], bit); x = _mm_mullo_epi32(u[11], cospi32); y = _mm_mullo_epi32(u[12], cospi32); u[11] = _mm_sub_epi32(y, x); u[11] = _mm_add_epi32(u[11], rnding); u[11] = _mm_srai_epi32(u[11], bit); u[12] = _mm_add_epi32(x, y); u[12] = _mm_add_epi32(u[12], rnding); u[12] = _mm_srai_epi32(u[12], bit); // stage 7 if (do_cols) { addsub_no_clamp_sse4_1(u[0], u[15], out + 0, out + 15); addsub_no_clamp_sse4_1(u[1], u[14], out + 1, out + 14); addsub_no_clamp_sse4_1(u[2], u[13], out + 2, out + 13); addsub_no_clamp_sse4_1(u[3], u[12], out + 3, out + 12); addsub_no_clamp_sse4_1(u[4], u[11], out + 4, out + 11); addsub_no_clamp_sse4_1(u[5], u[10], out + 5, out + 10); addsub_no_clamp_sse4_1(u[6], u[9], out + 6, out + 9); addsub_no_clamp_sse4_1(u[7], u[8], out + 7, out + 8); } else { const int log_range_out = AOMMAX(16, bd + 6); const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); addsub_shift_sse4_1(u[0], u[15], out + 0, out + 15, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(u[1], u[14], out + 1, out + 14, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(u[2], u[13], out + 2, out + 13, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(u[3], u[12], out + 3, out + 12, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(u[4], u[11], out + 4, out + 11, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(u[5], u[10], out + 5, out + 10, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(u[6], u[9], out + 6, out + 9, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(u[7], u[8], out + 7, out + 8, &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
} } } static void iadst16x16_low1_sse4_1(__m128i *in, __m128i *out, int bit, int do_cols, int bd, int out_shift) { const int32_t *cospi = cospi_arr(bit); const __m128i cospi2 = _mm_set1_epi32(cospi[2]); const __m128i cospi62 = _mm_set1_epi32(cospi[62]); const __m128i cospi8 = _mm_set1_epi32(cospi[8]);

[CVE-2020-0470_1.diff] highbd_inv_txfm_sse4.c #18
+ // stage 0 + // stage 1 + // stage 2 + x = _mm_mullo_epi32(in[0], cospi62); + v[0] = _mm_add_epi32(x, rnding); + v[0] = _mm_srai_epi32(v[0], bit); - // Calculate the column 0, 1, 2, 3 - { - // stage 0 - // stage 1 - // stage 2 - x = _mm_mullo_epi32(in[0], cospi62); - v[0] = _mm_add_epi32(x, rnding); - v[0] = _mm_srai_epi32(v[0], bit); + x = _mm_mullo_epi32(in[0], cospi2); + v[1] = _mm_sub_epi32(zero, x); + v[1] = _mm_add_epi32(v[1], rnding); + v[1] = _mm_srai_epi32(v[1], bit); - x = _mm_mullo_epi32(in[0], cospi2); - v[1] = _mm_sub_epi32(zero, x); - v[1] = _mm_add_epi32(v[1], rnding); - v[1] = _mm_srai_epi32(v[1], bit); + // stage 3 + v[8] = v[0]; + v[9] = v[1]; - // stage 3 - v[8] = v[0]; - v[9] = v[1]; + // stage 4 + temp1 = _mm_mullo_epi32(v[8], cospi8); + x = _mm_mullo_epi32(v[9], cospi56); + temp1 = _mm_add_epi32(temp1, x); + temp1 = _mm_add_epi32(temp1, rnding); + temp1 = _mm_srai_epi32(temp1, bit); - // stage 4 - temp1 = _mm_mullo_epi32(v[8], cospi8); - x = _mm_mullo_epi32(v[9], cospi56); - temp1 = _mm_add_epi32(temp1, x); - temp1 = _mm_add_epi32(temp1, rnding); - temp1 = _mm_srai_epi32(temp1, bit); + temp2 = _mm_mullo_epi32(v[8], cospi56); + x = _mm_mullo_epi32(v[9], cospi8); + temp2 = _mm_sub_epi32(temp2, x); + temp2 = _mm_add_epi32(temp2, rnding); + temp2 = _mm_srai_epi32(temp2, bit); + v[8] = temp1; + v[9] = temp2; - temp2 = _mm_mullo_epi32(v[8], cospi56); - x = _mm_mullo_epi32(v[9], cospi8); - temp2 = _mm_sub_epi32(temp2, x); - temp2 = _mm_add_epi32(temp2, rnding); - temp2 = _mm_srai_epi32(temp2, bit); - v[8] = temp1; - v[9] = temp2; + // stage 5 + v[4] = v[0]; + v[5] = v[1]; + v[12] = v[8]; + v[13] = v[9]; - // stage 5 - v[4] = v[0]; - v[5] = v[1]; - v[12] = v[8]; - v[13] = v[9]; + // stage 6 + temp1 = _mm_mullo_epi32(v[4], cospi16); + x = _mm_mullo_epi32(v[5], cospi48); + temp1 = _mm_add_epi32(temp1, x); + temp1 = _mm_add_epi32(temp1, rnding); + temp1 = _mm_srai_epi32(temp1, bit); - // stage 6 - temp1 = _mm_mullo_epi32(v[4], cospi16); - x = _mm_mullo_epi32(v[5], cospi48); - temp1 = _mm_add_epi32(temp1, x); - temp1 = _mm_add_epi32(temp1, rnding); - temp1 = _mm_srai_epi32(temp1, bit); + temp2 = _mm_mullo_epi32(v[4], cospi48); + x = _mm_mullo_epi32(v[5], cospi16); + temp2 = _mm_sub_epi32(temp2, x); + temp2 = _mm_add_epi32(temp2, rnding); + temp2 = _mm_srai_epi32(temp2, bit); + v[4] = temp1; + v[5] = temp2; - temp2 = _mm_mullo_epi32(v[4], cospi48); - x = _mm_mullo_epi32(v[5], cospi16); - temp2 = _mm_sub_epi32(temp2, x); - temp2 = _mm_add_epi32(temp2, rnding); - temp2 = _mm_srai_epi32(temp2, bit); - v[4] = temp1; - v[5] = temp2; + temp1 = _mm_mullo_epi32(v[12], cospi16); + x = _mm_mullo_epi32(v[13], cospi48); + temp1 = _mm_add_epi32(temp1, x); + temp1 = _mm_add_epi32(temp1, rnding); + temp1 = _mm_srai_epi32(temp1, bit); - temp1 = _mm_mullo_epi32(v[12], cospi16); - x = _mm_mullo_epi32(v[13], cospi48); - temp1 = _mm_add_epi32(temp1, x); - temp1 = _mm_add_epi32(temp1, rnding); - temp1 = _mm_srai_epi32(temp1, bit); + temp2 = _mm_mullo_epi32(v[12], cospi48); + x = _mm_mullo_epi32(v[13], cospi16); + temp2 = _mm_sub_epi32(temp2, x); + temp2 = _mm_add_epi32(temp2, rnding); + temp2 = _mm_srai_epi32(temp2, bit); + v[12] = temp1; + v[13] = temp2; - temp2 = _mm_mullo_epi32(v[12], cospi48); - x = _mm_mullo_epi32(v[13], cospi16); - temp2 = _mm_sub_epi32(temp2, x); - temp2 = _mm_add_epi32(temp2, rnding); - temp2 = _mm_srai_epi32(temp2, bit); - v[12] = temp1; - v[13] = temp2; + // stage 7 + v[2] = v[0]; + v[3] = v[1]; + v[6] = v[4]; + v[7] = v[5]; + v[10] = v[8]; + v[11] = v[9]; + v[14] = v[12]; + v[15] = v[13]; - // stage 7 - v[2] = v[0]; - v[3] = v[1]; - v[6] = v[4]; - v[7] = v[5]; - v[10] = v[8]; - v[11] = v[9]; - v[14] = v[12]; - v[15] = v[13]; + // stage 8 + y = _mm_mullo_epi32(v[2], cospi32); + x = _mm_mullo_epi32(v[3], cospi32); + v[2] = _mm_add_epi32(y, x); + v[2] = _mm_add_epi32(v[2], rnding); + v[2] = _mm_srai_epi32(v[2], bit); - // stage 8 - y = _mm_mullo_epi32(v[2], cospi32); - x = _mm_mullo_epi32(v[3], cospi32); - v[2] = _mm_add_epi32(y, x); - v[2] = _mm_add_epi32(v[2], rnding); - v[2] = _mm_srai_epi32(v[2], bit); + v[3] = _mm_sub_epi32(y, x); + v[3] = _mm_add_epi32(v[3], rnding); + v[3] = _mm_srai_epi32(v[3], bit); - v[3] = _mm_sub_epi32(y, x); - v[3] = _mm_add_epi32(v[3], rnding); - v[3] = _mm_srai_epi32(v[3], bit); + y = _mm_mullo_epi32(v[6], cospi32); + x = _mm_mullo_epi32(v[7], cospi32); + v[6] = _mm_add_epi32(y, x); + v[6] = _mm_add_epi32(v[6], rnding); + v[6] = _mm_srai_epi32(v[6], bit); - y = _mm_mullo_epi32(v[6], cospi32); - x = _mm_mullo_epi32(v[7], cospi32); - v[6] = _mm_add_epi32(y, x); - v[6] = _mm_add_epi32(v[6], rnding); - v[6] = _mm_srai_epi32(v[6], bit); + v[7] = _mm_sub_epi32(y, x); + v[7] = _mm_add_epi32(v[7], rnding); + v[7] = _mm_srai_epi32(v[7], bit); - v[7] = _mm_sub_epi32(y, x); - v[7] = _mm_add_epi32(v[7], rnding); - v[7] = _mm_srai_epi32(v[7], bit); + y = _mm_mullo_epi32(v[10], cospi32); + x = _mm_mullo_epi32(v[11], cospi32); + v[10] = _mm_add_epi32(y, x); + v[10] = _mm_add_epi32(v[10], rnding); + v[10] = _mm_srai_epi32(v[10], bit); - y = _mm_mullo_epi32(v[10], cospi32); - x = _mm_mullo_epi32(v[11], cospi32); - v[10] = _mm_add_epi32(y, x); - v[10] = _mm_add_epi32(v[10], rnding); - v[10] = _mm_srai_epi32(v[10], bit); + v[11] = _mm_sub_epi32(y, x); + v[11] = _mm_add_epi32(v[11], rnding); + v[11] = _mm_srai_epi32(v[11], bit); - v[11] = _mm_sub_epi32(y, x); - v[11] = _mm_add_epi32(v[11], rnding); - v[11] = _mm_srai_epi32(v[11], bit); + y = _mm_mullo_epi32(v[14], cospi32); + x = _mm_mullo_epi32(v[15], cospi32); + v[14] = _mm_add_epi32(y, x); + v[14] = _mm_add_epi32(v[14], rnding); + v[14] = _mm_srai_epi32(v[14], bit); - y = _mm_mullo_epi32(v[14], cospi32); - x = _mm_mullo_epi32(v[15], cospi32); - v[14] = _mm_add_epi32(y, x); - v[14] = _mm_add_epi32(v[14], rnding); - v[14] = _mm_srai_epi32(v[14], bit); + v[15] = _mm_sub_epi32(y, x); + v[15] = _mm_add_epi32(v[15], rnding); + v[15] = _mm_srai_epi32(v[15], bit); - v[15] = _mm_sub_epi32(y, x); - v[15] = _mm_add_epi32(v[15], rnding); - v[15] = _mm_srai_epi32(v[15], bit); + // stage 9 + if (do_cols) { + out[0] = v[0]; + out[1] = _mm_sub_epi32(zero, v[8]); + out[2] = v[12]; + out[3] = _mm_sub_epi32(zero, v[4]); + out[4] = v[6]; + out[5] = _mm_sub_epi32(zero, v[14]); + out[6] = v[10]; + out[7] = _mm_sub_epi32(zero, v[2]); + out[8] = v[3]; + out[9] = _mm_sub_epi32(zero, v[11]); + out[10] = v[15]; + out[11] = _mm_sub_epi32(zero, v[7]); + out[12] = v[5]; + out[13] = _mm_sub_epi32(zero, v[13]); + out[14] = v[9]; + out[15] = _mm_sub_epi32(zero, v[1]); + } else { + const int log_range_out = AOMMAX(16, bd + 6); + const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); + const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1); - // stage 9 - if (do_cols) { - out[0] = v[0]; - out[1] = _mm_sub_epi32(_mm_setzero_si128(), v[8]); - out[2] = v[12]; - out[3] = _mm_sub_epi32(_mm_setzero_si128(), v[4]); - out[4] = v[6]; - out[5] = _mm_sub_epi32(_mm_setzero_si128(), v[14]); - out[6] = v[10]; - out[7] = _mm_sub_epi32(_mm_setzero_si128(), v[2]); - out[8] = v[3]; - out[9] = _mm_sub_epi32(_mm_setzero_si128(), v[11]); - out[10] = v[15]; - out[11] = _mm_sub_epi32(_mm_setzero_si128(), v[7]); - out[12] = v[5]; - out[13] = _mm_sub_epi32(_mm_setzero_si128(), v[13]); - out[14] = v[9]; - out[15] = _mm_sub_epi32(_mm_setzero_si128(), v[1]); - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); - const __m128i clamp_hi_out = - _mm_set1_epi32((1 << (log_range_out - 1)) - 1); - - neg_shift_sse4_1(v[0], v[8], out + 0, out + 1, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(v[12], v[4], out + 2, out + 3, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(v[6], v[14], out + 4, out + 5, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(v[10], v[2], out + 6, out + 7, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(v[3], v[11], out + 8, out + 9, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(v[15], v[7], out + 10, out + 11, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(v[5], v[13], out + 12, out + 13, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(v[9], v[1], out + 14, out + 15, &clamp_lo_out, - &clamp_hi_out, out_shift); - } + neg_shift_sse4_1(v[0], v[8], out + 0, out + 1, &clamp_lo_out, &clamp_hi_out, + out_shift); + neg_shift_sse4_1(v[12], v[4], out + 2, out + 3, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(v[6], v[14], out + 4, out + 5, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(v[10], v[2], out + 6, out + 7, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(v[3], v[11], out + 8, out + 9, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(v[15], v[7], out + 10, out + 11, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(v[5], v[13], out + 12, out + 13, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(v[9], v[1], out + 14, out + 15, &clamp_lo_out, + &clamp_hi_out, out_shift);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_sse4.c
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
const __m128i cospi32 = _mm_set1_epi32(cospi[32]); const __m128i rnding = _mm_set1_epi32(1 << (bit - 1)); const __m128i zero = _mm_setzero_si128(); __m128i v[16], x, y, temp1, temp2; // Calculate the column 0, 1, 2, 3 { // stage 0 // stage 1 // stage 2
+ show +
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
x = _mm_mullo_epi32(in[0], cospi62); v[0] = _mm_add_epi32(x, rnding); v[0] = _mm_srai_epi32(v[0], bit); x = _mm_mullo_epi32(in[0], cospi2); v[1] = _mm_sub_epi32(zero, x); v[1] = _mm_add_epi32(v[1], rnding); v[1] = _mm_srai_epi32(v[1], bit); // stage 3 v[8] = v[0]; v[9] = v[1]; // stage 4 temp1 = _mm_mullo_epi32(v[8], cospi8); x = _mm_mullo_epi32(v[9], cospi56); temp1 = _mm_add_epi32(temp1, x); temp1 = _mm_add_epi32(temp1, rnding); temp1 = _mm_srai_epi32(temp1, bit); temp2 = _mm_mullo_epi32(v[8], cospi56); x = _mm_mullo_epi32(v[9], cospi8); temp2 = _mm_sub_epi32(temp2, x); temp2 = _mm_add_epi32(temp2, rnding); temp2 = _mm_srai_epi32(temp2, bit); v[8] = temp1; v[9] = temp2; // stage 5 v[4] = v[0]; v[5] = v[1]; v[12] = v[8]; v[13] = v[9]; // stage 6 temp1 = _mm_mullo_epi32(v[4], cospi16); x = _mm_mullo_epi32(v[5], cospi48); temp1 = _mm_add_epi32(temp1, x); temp1 = _mm_add_epi32(temp1, rnding); temp1 = _mm_srai_epi32(temp1, bit); temp2 = _mm_mullo_epi32(v[4], cospi48); x = _mm_mullo_epi32(v[5], cospi16); temp2 = _mm_sub_epi32(temp2, x); temp2 = _mm_add_epi32(temp2, rnding); temp2 = _mm_srai_epi32(temp2, bit); v[4] = temp1; v[5] = temp2; temp1 = _mm_mullo_epi32(v[12], cospi16); x = _mm_mullo_epi32(v[13], cospi48); temp1 = _mm_add_epi32(temp1, x); temp1 = _mm_add_epi32(temp1, rnding); temp1 = _mm_srai_epi32(temp1, bit); temp2 = _mm_mullo_epi32(v[12], cospi48); x = _mm_mullo_epi32(v[13], cospi16); temp2 = _mm_sub_epi32(temp2, x); temp2 = _mm_add_epi32(temp2, rnding); temp2 = _mm_srai_epi32(temp2, bit); v[12] = temp1; v[13] = temp2; // stage 7 v[2] = v[0]; v[3] = v[1]; v[6] = v[4]; v[7] = v[5]; v[10] = v[8]; v[11] = v[9]; v[14] = v[12]; v[15] = v[13]; // stage 8 y = _mm_mullo_epi32(v[2], cospi32); x = _mm_mullo_epi32(v[3], cospi32); v[2] = _mm_add_epi32(y, x); v[2] = _mm_add_epi32(v[2], rnding); v[2] = _mm_srai_epi32(v[2], bit); v[3] = _mm_sub_epi32(y, x); v[3] = _mm_add_epi32(v[3], rnding); v[3] = _mm_srai_epi32(v[3], bit); y = _mm_mullo_epi32(v[6], cospi32); x = _mm_mullo_epi32(v[7], cospi32); v[6] = _mm_add_epi32(y, x); v[6] = _mm_add_epi32(v[6], rnding); v[6] = _mm_srai_epi32(v[6], bit); v[7] = _mm_sub_epi32(y, x); v[7] = _mm_add_epi32(v[7], rnding); v[7] = _mm_srai_epi32(v[7], bit); y = _mm_mullo_epi32(v[10], cospi32); x = _mm_mullo_epi32(v[11], cospi32); v[10] = _mm_add_epi32(y, x); v[10] = _mm_add_epi32(v[10], rnding); v[10] = _mm_srai_epi32(v[10], bit); v[11] = _mm_sub_epi32(y, x); v[11] = _mm_add_epi32(v[11], rnding); v[11] = _mm_srai_epi32(v[11], bit); y = _mm_mullo_epi32(v[14], cospi32); x = _mm_mullo_epi32(v[15], cospi32); v[14] = _mm_add_epi32(y, x); v[14] = _mm_add_epi32(v[14], rnding); v[14] = _mm_srai_epi32(v[14], bit); v[15] = _mm_sub_epi32(y, x); v[15] = _mm_add_epi32(v[15], rnding); v[15] = _mm_srai_epi32(v[15], bit); // stage 9 if (do_cols) { out[0] = v[0]; out[1] = _mm_sub_epi32(_mm_setzero_si128(), v[8]); out[2] = v[12]; out[3] = _mm_sub_epi32(_mm_setzero_si128(), v[4]); out[4] = v[6]; out[5] = _mm_sub_epi32(_mm_setzero_si128(), v[14]); out[6] = v[10]; out[7] = _mm_sub_epi32(_mm_setzero_si128(), v[2]); out[8] = v[3]; out[9] = _mm_sub_epi32(_mm_setzero_si128(), v[11]); out[10] = v[15]; out[11] = _mm_sub_epi32(_mm_setzero_si128(), v[7]); out[12] = v[5]; out[13] = _mm_sub_epi32(_mm_setzero_si128(), v[13]); out[14] = v[9]; out[15] = _mm_sub_epi32(_mm_setzero_si128(), v[1]); } else { const int log_range_out = AOMMAX(16, bd + 6); const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1); neg_shift_sse4_1(v[0], v[8], out + 0, out + 1, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(v[12], v[4], out + 2, out + 3, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(v[6], v[14], out + 4, out + 5, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(v[10], v[2], out + 6, out + 7, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(v[3], v[11], out + 8, out + 9, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(v[15], v[7], out + 10, out + 11, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(v[5], v[13], out + 12, out + 13, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(v[9], v[1], out + 14, out + 15, &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
} } } static void iadst16x16_low8_sse4_1(__m128i *in, __m128i *out, int bit, int do_cols, int bd, int out_shift) { const int32_t *cospi = cospi_arr(bit); const __m128i cospi2 = _mm_set1_epi32(cospi[2]); const __m128i cospi62 = _mm_set1_epi32(cospi[62]); const __m128i cospi10 = _mm_set1_epi32(cospi[10]);

[CVE-2020-0470_1.diff] highbd_inv_txfm_sse4.c #19
+ __m128i zero = _mm_setzero_si128(); - // Calculate the column 0, 1, 2, 3 - { - // stage 0 - // stage 1 - // stage 2 - __m128i zero = _mm_setzero_si128(); - x = _mm_mullo_epi32(in[0], cospi62); - u[0] = _mm_add_epi32(x, rnding); - u[0] = _mm_srai_epi32(u[0], bit); + // stage 0 + // stage 1 + // stage 2 + x = _mm_mullo_epi32(in[0], cospi62); + u[0] = _mm_add_epi32(x, rnding); + u[0] = _mm_srai_epi32(u[0], bit); - x = _mm_mullo_epi32(in[0], cospi2); - u[1] = _mm_sub_epi32(zero, x); - u[1] = _mm_add_epi32(u[1], rnding); - u[1] = _mm_srai_epi32(u[1], bit); + x = _mm_mullo_epi32(in[0], cospi2); + u[1] = _mm_sub_epi32(zero, x); + u[1] = _mm_add_epi32(u[1], rnding); + u[1] = _mm_srai_epi32(u[1], bit); - x = _mm_mullo_epi32(in[2], cospi54); - u[2] = _mm_add_epi32(x, rnding); - u[2] = _mm_srai_epi32(u[2], bit); + x = _mm_mullo_epi32(in[2], cospi54); + u[2] = _mm_add_epi32(x, rnding); + u[2] = _mm_srai_epi32(u[2], bit); - x = _mm_mullo_epi32(in[2], cospi10); - u[3] = _mm_sub_epi32(zero, x); - u[3] = _mm_add_epi32(u[3], rnding); - u[3] = _mm_srai_epi32(u[3], bit); + x = _mm_mullo_epi32(in[2], cospi10); + u[3] = _mm_sub_epi32(zero, x); + u[3] = _mm_add_epi32(u[3], rnding); + u[3] = _mm_srai_epi32(u[3], bit); - x = _mm_mullo_epi32(in[4], cospi46); - u[4] = _mm_add_epi32(x, rnding); - u[4] = _mm_srai_epi32(u[4], bit); + x = _mm_mullo_epi32(in[4], cospi46); + u[4] = _mm_add_epi32(x, rnding); + u[4] = _mm_srai_epi32(u[4], bit); - x = _mm_mullo_epi32(in[4], cospi18); - u[5] = _mm_sub_epi32(zero, x); - u[5] = _mm_add_epi32(u[5], rnding); - u[5] = _mm_srai_epi32(u[5], bit); + x = _mm_mullo_epi32(in[4], cospi18); + u[5] = _mm_sub_epi32(zero, x); + u[5] = _mm_add_epi32(u[5], rnding); + u[5] = _mm_srai_epi32(u[5], bit); - x = _mm_mullo_epi32(in[6], cospi38); - u[6] = _mm_add_epi32(x, rnding); - u[6] = _mm_srai_epi32(u[6], bit); + x = _mm_mullo_epi32(in[6], cospi38); + u[6] = _mm_add_epi32(x, rnding); + u[6] = _mm_srai_epi32(u[6], bit); - x = _mm_mullo_epi32(in[6], cospi26); - u[7] = _mm_sub_epi32(zero, x); - u[7] = _mm_add_epi32(u[7], rnding); - u[7] = _mm_srai_epi32(u[7], bit); + x = _mm_mullo_epi32(in[6], cospi26); + u[7] = _mm_sub_epi32(zero, x); + u[7] = _mm_add_epi32(u[7], rnding); + u[7] = _mm_srai_epi32(u[7], bit); - u[8] = _mm_mullo_epi32(in[7], cospi34); - u[8] = _mm_add_epi32(u[8], rnding); - u[8] = _mm_srai_epi32(u[8], bit); + u[8] = _mm_mullo_epi32(in[7], cospi34); + u[8] = _mm_add_epi32(u[8], rnding); + u[8] = _mm_srai_epi32(u[8], bit); - u[9] = _mm_mullo_epi32(in[7], cospi30); - u[9] = _mm_add_epi32(u[9], rnding); - u[9] = _mm_srai_epi32(u[9], bit); + u[9] = _mm_mullo_epi32(in[7], cospi30); + u[9] = _mm_add_epi32(u[9], rnding); + u[9] = _mm_srai_epi32(u[9], bit); - u[10] = _mm_mullo_epi32(in[5], cospi42); - u[10] = _mm_add_epi32(u[10], rnding); - u[10] = _mm_srai_epi32(u[10], bit); + u[10] = _mm_mullo_epi32(in[5], cospi42); + u[10] = _mm_add_epi32(u[10], rnding); + u[10] = _mm_srai_epi32(u[10], bit); - u[11] = _mm_mullo_epi32(in[5], cospi22); - u[11] = _mm_add_epi32(u[11], rnding); - u[11] = _mm_srai_epi32(u[11], bit); + u[11] = _mm_mullo_epi32(in[5], cospi22); + u[11] = _mm_add_epi32(u[11], rnding); + u[11] = _mm_srai_epi32(u[11], bit); - u[12] = _mm_mullo_epi32(in[3], cospi50); - u[12] = _mm_add_epi32(u[12], rnding); - u[12] = _mm_srai_epi32(u[12], bit); + u[12] = _mm_mullo_epi32(in[3], cospi50); + u[12] = _mm_add_epi32(u[12], rnding); + u[12] = _mm_srai_epi32(u[12], bit); - u[13] = _mm_mullo_epi32(in[3], cospi14); - u[13] = _mm_add_epi32(u[13], rnding); - u[13] = _mm_srai_epi32(u[13], bit); + u[13] = _mm_mullo_epi32(in[3], cospi14); + u[13] = _mm_add_epi32(u[13], rnding); + u[13] = _mm_srai_epi32(u[13], bit); - u[14] = _mm_mullo_epi32(in[1], cospi58); - u[14] = _mm_add_epi32(u[14], rnding); - u[14] = _mm_srai_epi32(u[14], bit); + u[14] = _mm_mullo_epi32(in[1], cospi58); + u[14] = _mm_add_epi32(u[14], rnding); + u[14] = _mm_srai_epi32(u[14], bit); - u[15] = _mm_mullo_epi32(in[1], cospi6); - u[15] = _mm_add_epi32(u[15], rnding); - u[15] = _mm_srai_epi32(u[15], bit); + u[15] = _mm_mullo_epi32(in[1], cospi6); + u[15] = _mm_add_epi32(u[15], rnding); + u[15] = _mm_srai_epi32(u[15], bit); - // stage 3 - addsub_sse4_1(u[0], u[8], &u[0], &u[8], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[1], u[9], &u[1], &u[9], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[2], u[10], &u[2], &u[10], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[3], u[11], &u[3], &u[11], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[4], u[12], &u[4], &u[12], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[5], u[13], &u[5], &u[13], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[6], u[14], &u[6], &u[14], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[7], u[15], &u[7], &u[15], &clamp_lo, &clamp_hi); + // stage 3 + addsub_sse4_1(u[0], u[8], &u[0], &u[8], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[1], u[9], &u[1], &u[9], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[2], u[10], &u[2], &u[10], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[3], u[11], &u[3], &u[11], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[4], u[12], &u[4], &u[12], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[5], u[13], &u[5], &u[13], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[6], u[14], &u[6], &u[14], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[7], u[15], &u[7], &u[15], &clamp_lo, &clamp_hi); - // stage 4 - y = _mm_mullo_epi32(u[8], cospi56); - x = _mm_mullo_epi32(u[9], cospi56); - u[8] = _mm_mullo_epi32(u[8], cospi8); - u[8] = _mm_add_epi32(u[8], x); - u[8] = _mm_add_epi32(u[8], rnding); - u[8] = _mm_srai_epi32(u[8], bit); + // stage 4 + y = _mm_mullo_epi32(u[8], cospi56); + x = _mm_mullo_epi32(u[9], cospi56); + u[8] = _mm_mullo_epi32(u[8], cospi8); + u[8] = _mm_add_epi32(u[8], x); + u[8] = _mm_add_epi32(u[8], rnding); + u[8] = _mm_srai_epi32(u[8], bit); - x = _mm_mullo_epi32(u[9], cospi8); - u[9] = _mm_sub_epi32(y, x); - u[9] = _mm_add_epi32(u[9], rnding); - u[9] = _mm_srai_epi32(u[9], bit); + x = _mm_mullo_epi32(u[9], cospi8); + u[9] = _mm_sub_epi32(y, x); + u[9] = _mm_add_epi32(u[9], rnding); + u[9] = _mm_srai_epi32(u[9], bit); - x = _mm_mullo_epi32(u[11], cospi24); - y = _mm_mullo_epi32(u[10], cospi24); - u[10] = _mm_mullo_epi32(u[10], cospi40); - u[10] = _mm_add_epi32(u[10], x); - u[10] = _mm_add_epi32(u[10], rnding); - u[10] = _mm_srai_epi32(u[10], bit); + x = _mm_mullo_epi32(u[11], cospi24); + y = _mm_mullo_epi32(u[10], cospi24); + u[10] = _mm_mullo_epi32(u[10], cospi40); + u[10] = _mm_add_epi32(u[10], x); + u[10] = _mm_add_epi32(u[10], rnding); + u[10] = _mm_srai_epi32(u[10], bit); - x = _mm_mullo_epi32(u[11], cospi40); - u[11] = _mm_sub_epi32(y, x); - u[11] = _mm_add_epi32(u[11], rnding); - u[11] = _mm_srai_epi32(u[11], bit); + x = _mm_mullo_epi32(u[11], cospi40); + u[11] = _mm_sub_epi32(y, x); + u[11] = _mm_add_epi32(u[11], rnding); + u[11] = _mm_srai_epi32(u[11], bit); - x = _mm_mullo_epi32(u[13], cospi8); - y = _mm_mullo_epi32(u[12], cospi8); - u[12] = _mm_mullo_epi32(u[12], cospim56); - u[12] = _mm_add_epi32(u[12], x); - u[12] = _mm_add_epi32(u[12], rnding); - u[12] = _mm_srai_epi32(u[12], bit); + x = _mm_mullo_epi32(u[13], cospi8); + y = _mm_mullo_epi32(u[12], cospi8); + u[12] = _mm_mullo_epi32(u[12], cospim56); + u[12] = _mm_add_epi32(u[12], x); + u[12] = _mm_add_epi32(u[12], rnding); + u[12] = _mm_srai_epi32(u[12], bit); - x = _mm_mullo_epi32(u[13], cospim56); - u[13] = _mm_sub_epi32(y, x); - u[13] = _mm_add_epi32(u[13], rnding); - u[13] = _mm_srai_epi32(u[13], bit); + x = _mm_mullo_epi32(u[13], cospim56); + u[13] = _mm_sub_epi32(y, x); + u[13] = _mm_add_epi32(u[13], rnding); + u[13] = _mm_srai_epi32(u[13], bit); - x = _mm_mullo_epi32(u[15], cospi40); - y = _mm_mullo_epi32(u[14], cospi40); - u[14] = _mm_mullo_epi32(u[14], cospim24); - u[14] = _mm_add_epi32(u[14], x); - u[14] = _mm_add_epi32(u[14], rnding); - u[14] = _mm_srai_epi32(u[14], bit); + x = _mm_mullo_epi32(u[15], cospi40); + y = _mm_mullo_epi32(u[14], cospi40); + u[14] = _mm_mullo_epi32(u[14], cospim24); + u[14] = _mm_add_epi32(u[14], x); + u[14] = _mm_add_epi32(u[14], rnding); + u[14] = _mm_srai_epi32(u[14], bit); - x = _mm_mullo_epi32(u[15], cospim24); - u[15] = _mm_sub_epi32(y, x); - u[15] = _mm_add_epi32(u[15], rnding); - u[15] = _mm_srai_epi32(u[15], bit); + x = _mm_mullo_epi32(u[15], cospim24); + u[15] = _mm_sub_epi32(y, x); + u[15] = _mm_add_epi32(u[15], rnding); + u[15] = _mm_srai_epi32(u[15], bit); - // stage 5 - addsub_sse4_1(u[0], u[4], &u[0], &u[4], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[1], u[5], &u[1], &u[5], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[2], u[6], &u[2], &u[6], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[3], u[7], &u[3], &u[7], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[8], u[12], &u[8], &u[12], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[9], u[13], &u[9], &u[13], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[10], u[14], &u[10], &u[14], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[11], u[15], &u[11], &u[15], &clamp_lo, &clamp_hi); + // stage 5 + addsub_sse4_1(u[0], u[4], &u[0], &u[4], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[1], u[5], &u[1], &u[5], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[2], u[6], &u[2], &u[6], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[3], u[7], &u[3], &u[7], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[8], u[12], &u[8], &u[12], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[9], u[13], &u[9], &u[13], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[10], u[14], &u[10], &u[14], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[11], u[15], &u[11], &u[15], &clamp_lo, &clamp_hi); - // stage 6 - x = _mm_mullo_epi32(u[5], cospi48); - y = _mm_mullo_epi32(u[4], cospi48); - u[4] = _mm_mullo_epi32(u[4], cospi16); - u[4] = _mm_add_epi32(u[4], x); - u[4] = _mm_add_epi32(u[4], rnding); - u[4] = _mm_srai_epi32(u[4], bit); + // stage 6 + x = _mm_mullo_epi32(u[5], cospi48); + y = _mm_mullo_epi32(u[4], cospi48); + u[4] = _mm_mullo_epi32(u[4], cospi16); + u[4] = _mm_add_epi32(u[4], x); + u[4] = _mm_add_epi32(u[4], rnding); + u[4] = _mm_srai_epi32(u[4], bit); - x = _mm_mullo_epi32(u[5], cospi16); - u[5] = _mm_sub_epi32(y, x); - u[5] = _mm_add_epi32(u[5], rnding); - u[5] = _mm_srai_epi32(u[5], bit); + x = _mm_mullo_epi32(u[5], cospi16); + u[5] = _mm_sub_epi32(y, x); + u[5] = _mm_add_epi32(u[5], rnding); + u[5] = _mm_srai_epi32(u[5], bit); - x = _mm_mullo_epi32(u[7], cospi16); - y = _mm_mullo_epi32(u[6], cospi16); - u[6] = _mm_mullo_epi32(u[6], cospim48); - u[6] = _mm_add_epi32(u[6], x); - u[6] = _mm_add_epi32(u[6], rnding); - u[6] = _mm_srai_epi32(u[6], bit); + x = _mm_mullo_epi32(u[7], cospi16); + y = _mm_mullo_epi32(u[6], cospi16); + u[6] = _mm_mullo_epi32(u[6], cospim48); + u[6] = _mm_add_epi32(u[6], x); + u[6] = _mm_add_epi32(u[6], rnding); + u[6] = _mm_srai_epi32(u[6], bit); - x = _mm_mullo_epi32(u[7], cospim48); - u[7] = _mm_sub_epi32(y, x); - u[7] = _mm_add_epi32(u[7], rnding); - u[7] = _mm_srai_epi32(u[7], bit); + x = _mm_mullo_epi32(u[7], cospim48); + u[7] = _mm_sub_epi32(y, x); + u[7] = _mm_add_epi32(u[7], rnding); + u[7] = _mm_srai_epi32(u[7], bit); - x = _mm_mullo_epi32(u[13], cospi48); - y = _mm_mullo_epi32(u[12], cospi48); - u[12] = _mm_mullo_epi32(u[12], cospi16); - u[12] = _mm_add_epi32(u[12], x); - u[12] = _mm_add_epi32(u[12], rnding); - u[12] = _mm_srai_epi32(u[12], bit); + x = _mm_mullo_epi32(u[13], cospi48); + y = _mm_mullo_epi32(u[12], cospi48); + u[12] = _mm_mullo_epi32(u[12], cospi16); + u[12] = _mm_add_epi32(u[12], x); + u[12] = _mm_add_epi32(u[12], rnding); + u[12] = _mm_srai_epi32(u[12], bit); - x = _mm_mullo_epi32(u[13], cospi16); - u[13] = _mm_sub_epi32(y, x); - u[13] = _mm_add_epi32(u[13], rnding); - u[13] = _mm_srai_epi32(u[13], bit); + x = _mm_mullo_epi32(u[13], cospi16); + u[13] = _mm_sub_epi32(y, x); + u[13] = _mm_add_epi32(u[13], rnding); + u[13] = _mm_srai_epi32(u[13], bit); - x = _mm_mullo_epi32(u[15], cospi16); - y = _mm_mullo_epi32(u[14], cospi16); - u[14] = _mm_mullo_epi32(u[14], cospim48); - u[14] = _mm_add_epi32(u[14], x); - u[14] = _mm_add_epi32(u[14], rnding); - u[14] = _mm_srai_epi32(u[14], bit); + x = _mm_mullo_epi32(u[15], cospi16); + y = _mm_mullo_epi32(u[14], cospi16); + u[14] = _mm_mullo_epi32(u[14], cospim48); + u[14] = _mm_add_epi32(u[14], x); + u[14] = _mm_add_epi32(u[14], rnding); + u[14] = _mm_srai_epi32(u[14], bit); - x = _mm_mullo_epi32(u[15], cospim48); - u[15] = _mm_sub_epi32(y, x); - u[15] = _mm_add_epi32(u[15], rnding); - u[15] = _mm_srai_epi32(u[15], bit); + x = _mm_mullo_epi32(u[15], cospim48); + u[15] = _mm_sub_epi32(y, x); + u[15] = _mm_add_epi32(u[15], rnding); + u[15] = _mm_srai_epi32(u[15], bit); - // stage 7 - addsub_sse4_1(u[0], u[2], &u[0], &u[2], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[1], u[3], &u[1], &u[3], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[4], u[6], &u[4], &u[6], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[5], u[7], &u[5], &u[7], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[8], u[10], &u[8], &u[10], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[9], u[11], &u[9], &u[11], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[12], u[14], &u[12], &u[14], &clamp_lo, &clamp_hi); - addsub_sse4_1(u[13], u[15], &u[13], &u[15], &clamp_lo, &clamp_hi); + // stage 7 + addsub_sse4_1(u[0], u[2], &u[0], &u[2], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[1], u[3], &u[1], &u[3], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[4], u[6], &u[4], &u[6], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[5], u[7], &u[5], &u[7], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[8], u[10], &u[8], &u[10], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[9], u[11], &u[9], &u[11], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[12], u[14], &u[12], &u[14], &clamp_lo, &clamp_hi); + addsub_sse4_1(u[13], u[15], &u[13], &u[15], &clamp_lo, &clamp_hi); - // stage 8 - y = _mm_mullo_epi32(u[2], cospi32); - x = _mm_mullo_epi32(u[3], cospi32); - u[2] = _mm_add_epi32(y, x); - u[2] = _mm_add_epi32(u[2], rnding); - u[2] = _mm_srai_epi32(u[2], bit); + // stage 8 + y = _mm_mullo_epi32(u[2], cospi32); + x = _mm_mullo_epi32(u[3], cospi32); + u[2] = _mm_add_epi32(y, x); + u[2] = _mm_add_epi32(u[2], rnding); + u[2] = _mm_srai_epi32(u[2], bit); - u[3] = _mm_sub_epi32(y, x); - u[3] = _mm_add_epi32(u[3], rnding); - u[3] = _mm_srai_epi32(u[3], bit); - y = _mm_mullo_epi32(u[6], cospi32); - x = _mm_mullo_epi32(u[7], cospi32); - u[6] = _mm_add_epi32(y, x); - u[6] = _mm_add_epi32(u[6], rnding); - u[6] = _mm_srai_epi32(u[6], bit); + u[3] = _mm_sub_epi32(y, x); + u[3] = _mm_add_epi32(u[3], rnding); + u[3] = _mm_srai_epi32(u[3], bit); + y = _mm_mullo_epi32(u[6], cospi32); + x = _mm_mullo_epi32(u[7], cospi32); + u[6] = _mm_add_epi32(y, x); + u[6] = _mm_add_epi32(u[6], rnding); + u[6] = _mm_srai_epi32(u[6], bit); - u[7] = _mm_sub_epi32(y, x); - u[7] = _mm_add_epi32(u[7], rnding); - u[7] = _mm_srai_epi32(u[7], bit); + u[7] = _mm_sub_epi32(y, x); + u[7] = _mm_add_epi32(u[7], rnding); + u[7] = _mm_srai_epi32(u[7], bit); - y = _mm_mullo_epi32(u[10], cospi32); - x = _mm_mullo_epi32(u[11], cospi32); - u[10] = _mm_add_epi32(y, x); - u[10] = _mm_add_epi32(u[10], rnding); - u[10] = _mm_srai_epi32(u[10], bit); + y = _mm_mullo_epi32(u[10], cospi32); + x = _mm_mullo_epi32(u[11], cospi32); + u[10] = _mm_add_epi32(y, x); + u[10] = _mm_add_epi32(u[10], rnding); + u[10] = _mm_srai_epi32(u[10], bit); - u[11] = _mm_sub_epi32(y, x); - u[11] = _mm_add_epi32(u[11], rnding); - u[11] = _mm_srai_epi32(u[11], bit); + u[11] = _mm_sub_epi32(y, x); + u[11] = _mm_add_epi32(u[11], rnding); + u[11] = _mm_srai_epi32(u[11], bit); - y = _mm_mullo_epi32(u[14], cospi32); - x = _mm_mullo_epi32(u[15], cospi32); - u[14] = _mm_add_epi32(y, x); - u[14] = _mm_add_epi32(u[14], rnding); - u[14] = _mm_srai_epi32(u[14], bit); + y = _mm_mullo_epi32(u[14], cospi32); + x = _mm_mullo_epi32(u[15], cospi32); + u[14] = _mm_add_epi32(y, x); + u[14] = _mm_add_epi32(u[14], rnding); + u[14] = _mm_srai_epi32(u[14], bit); - u[15] = _mm_sub_epi32(y, x); - u[15] = _mm_add_epi32(u[15], rnding); - u[15] = _mm_srai_epi32(u[15], bit); + u[15] = _mm_sub_epi32(y, x); + u[15] = _mm_add_epi32(u[15], rnding); + u[15] = _mm_srai_epi32(u[15], bit); - // stage 9 - if (do_cols) { - out[0] = u[0]; - out[1] = _mm_sub_epi32(_mm_setzero_si128(), u[8]); - out[2] = u[12]; - out[3] = _mm_sub_epi32(_mm_setzero_si128(), u[4]); - out[4] = u[6]; - out[5] = _mm_sub_epi32(_mm_setzero_si128(), u[14]); - out[6] = u[10]; - out[7] = _mm_sub_epi32(_mm_setzero_si128(), u[2]); - out[8] = u[3]; - out[9] = _mm_sub_epi32(_mm_setzero_si128(), u[11]); - out[10] = u[15]; - out[11] = _mm_sub_epi32(_mm_setzero_si128(), u[7]); - out[12] = u[5]; - out[13] = _mm_sub_epi32(_mm_setzero_si128(), u[13]); - out[14] = u[9]; - out[15] = _mm_sub_epi32(_mm_setzero_si128(), u[1]); - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); - const __m128i clamp_hi_out = - _mm_set1_epi32((1 << (log_range_out - 1)) - 1); + // stage 9 + if (do_cols) { + out[0] = u[0]; + out[1] = _mm_sub_epi32(zero, u[8]); + out[2] = u[12]; + out[3] = _mm_sub_epi32(zero, u[4]); + out[4] = u[6]; + out[5] = _mm_sub_epi32(zero, u[14]); + out[6] = u[10]; + out[7] = _mm_sub_epi32(zero, u[2]); + out[8] = u[3]; + out[9] = _mm_sub_epi32(zero, u[11]); + out[10] = u[15]; + out[11] = _mm_sub_epi32(zero, u[7]); + out[12] = u[5]; + out[13] = _mm_sub_epi32(zero, u[13]); + out[14] = u[9]; + out[15] = _mm_sub_epi32(zero, u[1]); + } else { + const int log_range_out = AOMMAX(16, bd + 6); + const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); + const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1); - neg_shift_sse4_1(u[0], u[8], out + 0, out + 1, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(u[12], u[4], out + 2, out + 3, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(u[6], u[14], out + 4, out + 5, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(u[10], u[2], out + 6, out + 7, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(u[3], u[11], out + 8, out + 9, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(u[15], u[7], out + 10, out + 11, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(u[5], u[13], out + 12, out + 13, &clamp_lo_out, - &clamp_hi_out, out_shift); - neg_shift_sse4_1(u[9], u[1], out + 14, out + 15, &clamp_lo_out, - &clamp_hi_out, out_shift); - } + neg_shift_sse4_1(u[0], u[8], out + 0, out + 1, &clamp_lo_out, &clamp_hi_out, + out_shift); + neg_shift_sse4_1(u[12], u[4], out + 2, out + 3, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(u[6], u[14], out + 4, out + 5, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(u[10], u[2], out + 6, out + 7, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(u[3], u[11], out + 8, out + 9, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(u[15], u[7], out + 10, out + 11, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(u[5], u[13], out + 12, out + 13, &clamp_lo_out, + &clamp_hi_out, out_shift); + neg_shift_sse4_1(u[9], u[1], out + 14, out + 15, &clamp_lo_out, + &clamp_hi_out, out_shift);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_sse4.c
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
const int log_range = AOMMAX(16, bd + (do_cols ? 6 : 8)); const __m128i clamp_lo = _mm_set1_epi32(-(1 << (log_range - 1))); const __m128i clamp_hi = _mm_set1_epi32((1 << (log_range - 1)) - 1); __m128i u[16], x, y; // Calculate the column 0, 1, 2, 3 { // stage 0 // stage 1 // stage 2
+ show +
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
__m128i zero = _mm_setzero_si128(); x = _mm_mullo_epi32(in[0], cospi62); u[0] = _mm_add_epi32(x, rnding); u[0] = _mm_srai_epi32(u[0], bit); x = _mm_mullo_epi32(in[0], cospi2); u[1] = _mm_sub_epi32(zero, x); u[1] = _mm_add_epi32(u[1], rnding); u[1] = _mm_srai_epi32(u[1], bit); x = _mm_mullo_epi32(in[2], cospi54); u[2] = _mm_add_epi32(x, rnding); u[2] = _mm_srai_epi32(u[2], bit); x = _mm_mullo_epi32(in[2], cospi10); u[3] = _mm_sub_epi32(zero, x); u[3] = _mm_add_epi32(u[3], rnding); u[3] = _mm_srai_epi32(u[3], bit); x = _mm_mullo_epi32(in[4], cospi46); u[4] = _mm_add_epi32(x, rnding); u[4] = _mm_srai_epi32(u[4], bit); x = _mm_mullo_epi32(in[4], cospi18); u[5] = _mm_sub_epi32(zero, x); u[5] = _mm_add_epi32(u[5], rnding); u[5] = _mm_srai_epi32(u[5], bit); x = _mm_mullo_epi32(in[6], cospi38); u[6] = _mm_add_epi32(x, rnding); u[6] = _mm_srai_epi32(u[6], bit); x = _mm_mullo_epi32(in[6], cospi26); u[7] = _mm_sub_epi32(zero, x); u[7] = _mm_add_epi32(u[7], rnding); u[7] = _mm_srai_epi32(u[7], bit); u[8] = _mm_mullo_epi32(in[7], cospi34); u[8] = _mm_add_epi32(u[8], rnding); u[8] = _mm_srai_epi32(u[8], bit); u[9] = _mm_mullo_epi32(in[7], cospi30); u[9] = _mm_add_epi32(u[9], rnding); u[9] = _mm_srai_epi32(u[9], bit); u[10] = _mm_mullo_epi32(in[5], cospi42); u[10] = _mm_add_epi32(u[10], rnding); u[10] = _mm_srai_epi32(u[10], bit); u[11] = _mm_mullo_epi32(in[5], cospi22); u[11] = _mm_add_epi32(u[11], rnding); u[11] = _mm_srai_epi32(u[11], bit); u[12] = _mm_mullo_epi32(in[3], cospi50); u[12] = _mm_add_epi32(u[12], rnding); u[12] = _mm_srai_epi32(u[12], bit); u[13] = _mm_mullo_epi32(in[3], cospi14); u[13] = _mm_add_epi32(u[13], rnding); u[13] = _mm_srai_epi32(u[13], bit); u[14] = _mm_mullo_epi32(in[1], cospi58); u[14] = _mm_add_epi32(u[14], rnding); u[14] = _mm_srai_epi32(u[14], bit); u[15] = _mm_mullo_epi32(in[1], cospi6); u[15] = _mm_add_epi32(u[15], rnding); u[15] = _mm_srai_epi32(u[15], bit); // stage 3 addsub_sse4_1(u[0], u[8], &u[0], &u[8], &clamp_lo, &clamp_hi); addsub_sse4_1(u[1], u[9], &u[1], &u[9], &clamp_lo, &clamp_hi); addsub_sse4_1(u[2], u[10], &u[2], &u[10], &clamp_lo, &clamp_hi); addsub_sse4_1(u[3], u[11], &u[3], &u[11], &clamp_lo, &clamp_hi); addsub_sse4_1(u[4], u[12], &u[4], &u[12], &clamp_lo, &clamp_hi); addsub_sse4_1(u[5], u[13], &u[5], &u[13], &clamp_lo, &clamp_hi); addsub_sse4_1(u[6], u[14], &u[6], &u[14], &clamp_lo, &clamp_hi); addsub_sse4_1(u[7], u[15], &u[7], &u[15], &clamp_lo, &clamp_hi); // stage 4 y = _mm_mullo_epi32(u[8], cospi56); x = _mm_mullo_epi32(u[9], cospi56); u[8] = _mm_mullo_epi32(u[8], cospi8); u[8] = _mm_add_epi32(u[8], x); u[8] = _mm_add_epi32(u[8], rnding); u[8] = _mm_srai_epi32(u[8], bit); x = _mm_mullo_epi32(u[9], cospi8); u[9] = _mm_sub_epi32(y, x); u[9] = _mm_add_epi32(u[9], rnding); u[9] = _mm_srai_epi32(u[9], bit); x = _mm_mullo_epi32(u[11], cospi24); y = _mm_mullo_epi32(u[10], cospi24); u[10] = _mm_mullo_epi32(u[10], cospi40); u[10] = _mm_add_epi32(u[10], x); u[10] = _mm_add_epi32(u[10], rnding); u[10] = _mm_srai_epi32(u[10], bit); x = _mm_mullo_epi32(u[11], cospi40); u[11] = _mm_sub_epi32(y, x); u[11] = _mm_add_epi32(u[11], rnding); u[11] = _mm_srai_epi32(u[11], bit); x = _mm_mullo_epi32(u[13], cospi8); y = _mm_mullo_epi32(u[12], cospi8); u[12] = _mm_mullo_epi32(u[12], cospim56); u[12] = _mm_add_epi32(u[12], x); u[12] = _mm_add_epi32(u[12], rnding); u[12] = _mm_srai_epi32(u[12], bit); x = _mm_mullo_epi32(u[13], cospim56); u[13] = _mm_sub_epi32(y, x); u[13] = _mm_add_epi32(u[13], rnding); u[13] = _mm_srai_epi32(u[13], bit); x = _mm_mullo_epi32(u[15], cospi40); y = _mm_mullo_epi32(u[14], cospi40); u[14] = _mm_mullo_epi32(u[14], cospim24); u[14] = _mm_add_epi32(u[14], x); u[14] = _mm_add_epi32(u[14], rnding); u[14] = _mm_srai_epi32(u[14], bit); x = _mm_mullo_epi32(u[15], cospim24); u[15] = _mm_sub_epi32(y, x); u[15] = _mm_add_epi32(u[15], rnding); u[15] = _mm_srai_epi32(u[15], bit); // stage 5 addsub_sse4_1(u[0], u[4], &u[0], &u[4], &clamp_lo, &clamp_hi); addsub_sse4_1(u[1], u[5], &u[1], &u[5], &clamp_lo, &clamp_hi); addsub_sse4_1(u[2], u[6], &u[2], &u[6], &clamp_lo, &clamp_hi); addsub_sse4_1(u[3], u[7], &u[3], &u[7], &clamp_lo, &clamp_hi); addsub_sse4_1(u[8], u[12], &u[8], &u[12], &clamp_lo, &clamp_hi); addsub_sse4_1(u[9], u[13], &u[9], &u[13], &clamp_lo, &clamp_hi); addsub_sse4_1(u[10], u[14], &u[10], &u[14], &clamp_lo, &clamp_hi); addsub_sse4_1(u[11], u[15], &u[11], &u[15], &clamp_lo, &clamp_hi); // stage 6 x = _mm_mullo_epi32(u[5], cospi48); y = _mm_mullo_epi32(u[4], cospi48); u[4] = _mm_mullo_epi32(u[4], cospi16); u[4] = _mm_add_epi32(u[4], x); u[4] = _mm_add_epi32(u[4], rnding); u[4] = _mm_srai_epi32(u[4], bit); x = _mm_mullo_epi32(u[5], cospi16); u[5] = _mm_sub_epi32(y, x); u[5] = _mm_add_epi32(u[5], rnding); u[5] = _mm_srai_epi32(u[5], bit); x = _mm_mullo_epi32(u[7], cospi16); y = _mm_mullo_epi32(u[6], cospi16); u[6] = _mm_mullo_epi32(u[6], cospim48); u[6] = _mm_add_epi32(u[6], x); u[6] = _mm_add_epi32(u[6], rnding); u[6] = _mm_srai_epi32(u[6], bit); x = _mm_mullo_epi32(u[7], cospim48); u[7] = _mm_sub_epi32(y, x); u[7] = _mm_add_epi32(u[7], rnding); u[7] = _mm_srai_epi32(u[7], bit); x = _mm_mullo_epi32(u[13], cospi48); y = _mm_mullo_epi32(u[12], cospi48); u[12] = _mm_mullo_epi32(u[12], cospi16); u[12] = _mm_add_epi32(u[12], x); u[12] = _mm_add_epi32(u[12], rnding); u[12] = _mm_srai_epi32(u[12], bit); x = _mm_mullo_epi32(u[13], cospi16); u[13] = _mm_sub_epi32(y, x); u[13] = _mm_add_epi32(u[13], rnding); u[13] = _mm_srai_epi32(u[13], bit); x = _mm_mullo_epi32(u[15], cospi16); y = _mm_mullo_epi32(u[14], cospi16); u[14] = _mm_mullo_epi32(u[14], cospim48); u[14] = _mm_add_epi32(u[14], x); u[14] = _mm_add_epi32(u[14], rnding); u[14] = _mm_srai_epi32(u[14], bit); x = _mm_mullo_epi32(u[15], cospim48); u[15] = _mm_sub_epi32(y, x); u[15] = _mm_add_epi32(u[15], rnding); u[15] = _mm_srai_epi32(u[15], bit); // stage 7 addsub_sse4_1(u[0], u[2], &u[0], &u[2], &clamp_lo, &clamp_hi); addsub_sse4_1(u[1], u[3], &u[1], &u[3], &clamp_lo, &clamp_hi); addsub_sse4_1(u[4], u[6], &u[4], &u[6], &clamp_lo, &clamp_hi); addsub_sse4_1(u[5], u[7], &u[5], &u[7], &clamp_lo, &clamp_hi); addsub_sse4_1(u[8], u[10], &u[8], &u[10], &clamp_lo, &clamp_hi); addsub_sse4_1(u[9], u[11], &u[9], &u[11], &clamp_lo, &clamp_hi); addsub_sse4_1(u[12], u[14], &u[12], &u[14], &clamp_lo, &clamp_hi); addsub_sse4_1(u[13], u[15], &u[13], &u[15], &clamp_lo, &clamp_hi); // stage 8 y = _mm_mullo_epi32(u[2], cospi32); x = _mm_mullo_epi32(u[3], cospi32); u[2] = _mm_add_epi32(y, x); u[2] = _mm_add_epi32(u[2], rnding); u[2] = _mm_srai_epi32(u[2], bit); u[3] = _mm_sub_epi32(y, x); u[3] = _mm_add_epi32(u[3], rnding); u[3] = _mm_srai_epi32(u[3], bit); y = _mm_mullo_epi32(u[6], cospi32); x = _mm_mullo_epi32(u[7], cospi32); u[6] = _mm_add_epi32(y, x); u[6] = _mm_add_epi32(u[6], rnding); u[6] = _mm_srai_epi32(u[6], bit); u[7] = _mm_sub_epi32(y, x); u[7] = _mm_add_epi32(u[7], rnding); u[7] = _mm_srai_epi32(u[7], bit); y = _mm_mullo_epi32(u[10], cospi32); x = _mm_mullo_epi32(u[11], cospi32); u[10] = _mm_add_epi32(y, x); u[10] = _mm_add_epi32(u[10], rnding); u[10] = _mm_srai_epi32(u[10], bit); u[11] = _mm_sub_epi32(y, x); u[11] = _mm_add_epi32(u[11], rnding); u[11] = _mm_srai_epi32(u[11], bit); y = _mm_mullo_epi32(u[14], cospi32); x = _mm_mullo_epi32(u[15], cospi32); u[14] = _mm_add_epi32(y, x); u[14] = _mm_add_epi32(u[14], rnding); u[14] = _mm_srai_epi32(u[14], bit); u[15] = _mm_sub_epi32(y, x); u[15] = _mm_add_epi32(u[15], rnding); u[15] = _mm_srai_epi32(u[15], bit); // stage 9 if (do_cols) { out[0] = u[0]; out[1] = _mm_sub_epi32(_mm_setzero_si128(), u[8]); out[2] = u[12]; out[3] = _mm_sub_epi32(_mm_setzero_si128(), u[4]); out[4] = u[6]; out[5] = _mm_sub_epi32(_mm_setzero_si128(), u[14]); out[6] = u[10]; out[7] = _mm_sub_epi32(_mm_setzero_si128(), u[2]); out[8] = u[3]; out[9] = _mm_sub_epi32(_mm_setzero_si128(), u[11]); out[10] = u[15]; out[11] = _mm_sub_epi32(_mm_setzero_si128(), u[7]); out[12] = u[5]; out[13] = _mm_sub_epi32(_mm_setzero_si128(), u[13]); out[14] = u[9]; out[15] = _mm_sub_epi32(_mm_setzero_si128(), u[1]); } else { const int log_range_out = AOMMAX(16, bd + 6); const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1); neg_shift_sse4_1(u[0], u[8], out + 0, out + 1, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(u[12], u[4], out + 2, out + 3, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(u[6], u[14], out + 4, out + 5, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(u[10], u[2], out + 6, out + 7, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(u[3], u[11], out + 8, out + 9, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(u[15], u[7], out + 10, out + 11, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(u[5], u[13], out + 12, out + 13, &clamp_lo_out, &clamp_hi_out, out_shift); neg_shift_sse4_1(u[9], u[1], out + 14, out + 15, &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
} } } static void idct16x16_sse4_1(__m128i *in, __m128i *out, int bit, int do_cols, int bd, int out_shift) { const int32_t *cospi = cospi_arr(bit); const __m128i cospi60 = _mm_set1_epi32(cospi[60]); const __m128i cospim4 = _mm_set1_epi32(-cospi[4]); const __m128i cospi28 = _mm_set1_epi32(cospi[28]);

[CVE-2020-0470_1.diff] highbd_inv_txfm_sse4.c #20
- if (do_cols) { - addsub_no_clamp_sse4_1(v[0], v[15], out + 0, out + 15); - addsub_no_clamp_sse4_1(v[1], v[14], out + 1, out + 14); - addsub_no_clamp_sse4_1(v[2], v[13], out + 2, out + 13); - addsub_no_clamp_sse4_1(v[3], v[12], out + 3, out + 12); - addsub_no_clamp_sse4_1(v[4], v[11], out + 4, out + 11); - addsub_no_clamp_sse4_1(v[5], v[10], out + 5, out + 10); - addsub_no_clamp_sse4_1(v[6], v[9], out + 6, out + 9); - addsub_no_clamp_sse4_1(v[7], v[8], out + 7, out + 8); - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( - -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); - const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( - (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); + addsub_sse4_1(v[0], v[15], out + 0, out + 15, &clamp_lo, &clamp_hi); + addsub_sse4_1(v[1], v[14], out + 1, out + 14, &clamp_lo, &clamp_hi); + addsub_sse4_1(v[2], v[13], out + 2, out + 13, &clamp_lo, &clamp_hi); + addsub_sse4_1(v[3], v[12], out + 3, out + 12, &clamp_lo, &clamp_hi); + addsub_sse4_1(v[4], v[11], out + 4, out + 11, &clamp_lo, &clamp_hi); + addsub_sse4_1(v[5], v[10], out + 5, out + 10, &clamp_lo, &clamp_hi); + addsub_sse4_1(v[6], v[9], out + 6, out + 9, &clamp_lo, &clamp_hi); + addsub_sse4_1(v[7], v[8], out + 7, out + 8, &clamp_lo, &clamp_hi); - addsub_shift_sse4_1(v[0], v[15], out + 0, out + 15, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(v[1], v[14], out + 1, out + 14, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(v[2], v[13], out + 2, out + 13, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(v[3], v[12], out + 3, out + 12, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(v[4], v[11], out + 4, out + 11, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(v[5], v[10], out + 5, out + 10, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(v[6], v[9], out + 6, out + 9, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(v[7], v[8], out + 7, out + 8, &clamp_lo_out, - &clamp_hi_out, out_shift); + if (!do_cols) { + const int log_range_out = AOMMAX(16, bd + 6); + const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); + const __m128i clamp_hi_out = + _mm_set1_epi32((1 << (log_range_out - 1)) - 1); + round_shift_8x8(out, out_shift); + highbd_clamp_epi32_sse4_1(out, out, &clamp_lo_out, &clamp_hi_out, 16);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_sse4.c
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
v[11] = _mm_srai_epi32(v[11], bit); v[12] = _mm_add_epi32(x, y); v[12] = _mm_add_epi32(v[12], rnding); v[12] = _mm_srai_epi32(v[12], bit); v[14] = u[14]; v[15] = u[15]; // stage 7
+ show +
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
if (do_cols) { addsub_no_clamp_sse4_1(v[0], v[15], out + 0, out + 15); addsub_no_clamp_sse4_1(v[1], v[14], out + 1, out + 14); addsub_no_clamp_sse4_1(v[2], v[13], out + 2, out + 13); addsub_no_clamp_sse4_1(v[3], v[12], out + 3, out + 12); addsub_no_clamp_sse4_1(v[4], v[11], out + 4, out + 11); addsub_no_clamp_sse4_1(v[5], v[10], out + 5, out + 10); addsub_no_clamp_sse4_1(v[6], v[9], out + 6, out + 9); addsub_no_clamp_sse4_1(v[7], v[8], out + 7, out + 8); } else { const int log_range_out = AOMMAX(16, bd + 6); const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); addsub_shift_sse4_1(v[0], v[15], out + 0, out + 15, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(v[1], v[14], out + 1, out + 14, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(v[2], v[13], out + 2, out + 13, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(v[3], v[12], out + 3, out + 12, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(v[4], v[11], out + 4, out + 11, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(v[5], v[10], out + 5, out + 10, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(v[6], v[9], out + 6, out + 9, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(v[7], v[8], out + 7, out + 8, &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
} } } static void iadst16x16_sse4_1(__m128i *in, __m128i *out, int bit, int do_cols, int bd, int out_shift) { const int32_t *cospi = cospi_arr(bit); const __m128i cospi2 = _mm_set1_epi32(cospi[2]); const __m128i cospi62 = _mm_set1_epi32(cospi[62]); const __m128i cospi10 = _mm_set1_epi32(cospi[10]);

[CVE-2020-0470_1.diff] highbd_inv_txfm_sse4.c #22
- const int log_range) { - if (do_cols) { - for (int i = 0; i < 32; i++) { - addsub_no_clamp_sse4_1(u[i], u[63 - i], &out[(i)], &out[(63 - i)]); - } - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( - -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); - const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( - (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); + const __m128i *clamp_lo, + const __m128i *clamp_hi) { + for (int i = 0; i < 32; i++) { + addsub_sse4_1(u[i], u[63 - i], out + i, out + 63 - i, clamp_lo, clamp_hi); + } - for (int i = 0; i < 32; i++) { - addsub_shift_sse4_1(u[i], u[63 - i], &out[(i)], &out[(63 - i)], - &clamp_lo_out, &clamp_hi_out, out_shift); + if (!do_cols) { + const int log_range_out = AOMMAX(16, bd + 6); + const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); + const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1); + + for (int i = 0; i < 64; i += 4) { + round_shift_4x4(out + i, out_shift); + highbd_clamp_epi32_sse4_1(out + i, out + i, &clamp_lo_out, &clamp_hi_out, + 4);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_sse4.c
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
u[50] = half_btf_sse4_1(cospi32, &u[45], cospi32, &u[50], rnding, bit); u[51] = half_btf_sse4_1(cospi32, &u[44], cospi32, &u[51], rnding, bit); u[44] = temp1; u[45] = temp2; u[46] = temp3; u[47] = temp4; } static INLINE void idct64_stage11_sse4_1(__m128i *u, __m128i *out, int do_cols, int bd, int out_shift,
+ show +
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
const int log_range) { if (do_cols) { for (int i = 0; i < 32; i++) { addsub_no_clamp_sse4_1(u[i], u[63 - i], &out[(i)], &out[(63 - i)]); } } else { const int log_range_out = AOMMAX(16, bd + 6); const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); for (int i = 0; i < 32; i++) { addsub_shift_sse4_1(u[i], u[63 - i], &out[(i)], &out[(63 - i)], &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
} } } static void idct64x64_low1_sse4_1(__m128i *in, __m128i *out, int bit, int do_cols, int bd, int out_shift) { const int32_t *cospi = cospi_arr(bit); const __m128i rnding = _mm_set1_epi32(1 << (bit - 1)); const int log_range = AOMMAX(16, bd + (do_cols ? 6 : 8)); const __m128i clamp_lo = _mm_set1_epi32(-(1 << (log_range - 1)));

[CVE-2020-0470_1.diff] highbd_inv_txfm_sse4.c #28
- if (do_cols) { - for (i = 0; i < 32; i++) { - addsub_no_clamp_sse4_1(v[i], v[63 - i], &out[(i)], &out[(63 - i)]); - } - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( - -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); - const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( - (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); + for (i = 0; i < 32; i++) { + addsub_sse4_1(v[i], v[63 - i], &out[(i)], &out[(63 - i)], &clamp_lo, + &clamp_hi); + } - for (i = 0; i < 32; i++) { - addsub_shift_sse4_1(v[i], v[63 - i], &out[(i)], &out[(63 - i)], - &clamp_lo_out, &clamp_hi_out, out_shift); + if (!do_cols) { + const int log_range_out = AOMMAX(16, bd + 6); + const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); + const __m128i clamp_hi_out = + _mm_set1_epi32((1 << (log_range_out - 1)) - 1); + for (i = 0; i < 64; i += 4) { + round_shift_4x4(out + i, out_shift); + highbd_clamp_epi32_sse4_1(out + i, out + i, &clamp_lo_out, + &clamp_hi_out, 4);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_sse4.c
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
v[50] = half_btf_sse4_1(&cospi32, &u[45], &cospi32, &u[50], &rnding, bit); v[51] = half_btf_sse4_1(&cospi32, &u[44], &cospi32, &u[51], &rnding, bit); v[52] = half_btf_sse4_1(&cospi32, &u[43], &cospi32, &u[52], &rnding, bit); v[53] = half_btf_sse4_1(&cospi32, &u[42], &cospi32, &u[53], &rnding, bit); v[54] = half_btf_sse4_1(&cospi32, &u[41], &cospi32, &u[54], &rnding, bit); v[55] = half_btf_sse4_1(&cospi32, &u[40], &cospi32, &u[55], &rnding, bit); for (i = 56; i < 64; i++) v[i] = u[i]; // stage 11
+ show +
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
if (do_cols) { for (i = 0; i < 32; i++) { addsub_no_clamp_sse4_1(v[i], v[63 - i], &out[(i)], &out[(63 - i)]); } } else { const int log_range_out = AOMMAX(16, bd + 6); const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); for (i = 0; i < 32; i++) { addsub_shift_sse4_1(v[i], v[63 - i], &out[(i)], &out[(63 - i)], &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
} } } } static void idct32x32_low1_sse4_1(__m128i *in, __m128i *out, int bit, int do_cols, int bd, int out_shift) { const int32_t *cospi = cospi_arr(bit); const __m128i cospi32 = _mm_set1_epi32(cospi[32]); const __m128i rounding = _mm_set1_epi32(1 << (bit - 1));

[CVE-2020-0470_1.diff] highbd_inv_txfm_sse4.c #30
- const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( - -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); - const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( - (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); - - __m128i offset = _mm_set1_epi32((1 << out_shift) >> 1); - bf1 = _mm_add_epi32(bf1, offset); - bf1 = _mm_sra_epi32(bf1, _mm_cvtsi32_si128(out_shift)); - bf1 = _mm_max_epi32(bf1, clamp_lo_out); - bf1 = _mm_min_epi32(bf1, clamp_hi_out); + clamp_lo = _mm_set1_epi32(-(1 << (log_range_out - 1))); + clamp_hi = _mm_set1_epi32((1 << (log_range_out - 1)) - 1); + if (out_shift != 0) { + __m128i offset = _mm_set1_epi32((1 << out_shift) >> 1); + bf1 = _mm_add_epi32(bf1, offset); + bf1 = _mm_sra_epi32(bf1, _mm_cvtsi32_si128(out_shift)); + } + + bf1 = _mm_max_epi32(bf1, clamp_lo); + bf1 = _mm_min_epi32(bf1, clamp_hi);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_sse4.c
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
// stage 6 // stage 7 // stage 8 // stage 9 if (do_cols) { bf1 = _mm_max_epi32(bf1, clamp_lo); bf1 = _mm_min_epi32(bf1, clamp_hi); } else { const int log_range_out = AOMMAX(16, bd + 6);
+ show +
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); __m128i offset = _mm_set1_epi32((1 << out_shift) >> 1); bf1 = _mm_add_epi32(bf1, offset); bf1 = _mm_sra_epi32(bf1, _mm_cvtsi32_si128(out_shift)); bf1 = _mm_max_epi32(bf1, clamp_lo_out); bf1 = _mm_min_epi32(bf1, clamp_hi_out);
+ show +
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
} out[0] = bf1; out[1] = bf1; out[2] = bf1; out[3] = bf1; out[4] = bf1; out[5] = bf1; out[6] = bf1; out[7] = bf1; out[8] = bf1;

[CVE-2020-0470_1.diff] highbd_inv_txfm_sse4.c #33
- if (do_cols) { - addsub_no_clamp_sse4_1(bf0[0], bf0[31], out + 0, out + 31); - addsub_no_clamp_sse4_1(bf0[1], bf0[30], out + 1, out + 30); - addsub_no_clamp_sse4_1(bf0[2], bf0[29], out + 2, out + 29); - addsub_no_clamp_sse4_1(bf0[3], bf0[28], out + 3, out + 28); - addsub_no_clamp_sse4_1(bf0[4], bf0[27], out + 4, out + 27); - addsub_no_clamp_sse4_1(bf0[5], bf0[26], out + 5, out + 26); - addsub_no_clamp_sse4_1(bf0[6], bf0[25], out + 6, out + 25); - addsub_no_clamp_sse4_1(bf0[7], bf0[24], out + 7, out + 24); - addsub_no_clamp_sse4_1(bf0[8], bf0[23], out + 8, out + 23); - addsub_no_clamp_sse4_1(bf0[9], bf0[22], out + 9, out + 22); - addsub_no_clamp_sse4_1(bf0[10], bf0[21], out + 10, out + 21); - addsub_no_clamp_sse4_1(bf0[11], bf0[20], out + 11, out + 20); - addsub_no_clamp_sse4_1(bf0[12], bf0[19], out + 12, out + 19); - addsub_no_clamp_sse4_1(bf0[13], bf0[18], out + 13, out + 18); - addsub_no_clamp_sse4_1(bf0[14], bf0[17], out + 14, out + 17); - addsub_no_clamp_sse4_1(bf0[15], bf0[16], out + 15, out + 16); - } else { - const int log_range_out = AOMMAX(16, bd + 6); - const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( - -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); - const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( - (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); + addsub_sse4_1(bf0[0], bf0[31], out + 0, out + 31, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[1], bf0[30], out + 1, out + 30, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[2], bf0[29], out + 2, out + 29, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[3], bf0[28], out + 3, out + 28, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[4], bf0[27], out + 4, out + 27, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[5], bf0[26], out + 5, out + 26, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[6], bf0[25], out + 6, out + 25, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[7], bf0[24], out + 7, out + 24, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[8], bf0[23], out + 8, out + 23, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[9], bf0[22], out + 9, out + 22, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[10], bf0[21], out + 10, out + 21, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[11], bf0[20], out + 11, out + 20, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[12], bf0[19], out + 12, out + 19, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[13], bf0[18], out + 13, out + 18, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[14], bf0[17], out + 14, out + 17, &clamp_lo, &clamp_hi); + addsub_sse4_1(bf0[15], bf0[16], out + 15, out + 16, &clamp_lo, &clamp_hi); - addsub_shift_sse4_1(bf0[0], bf0[31], out + 0, out + 31, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[1], bf0[30], out + 1, out + 30, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[2], bf0[29], out + 2, out + 29, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[3], bf0[28], out + 3, out + 28, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[4], bf0[27], out + 4, out + 27, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[5], bf0[26], out + 5, out + 26, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[6], bf0[25], out + 6, out + 25, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[7], bf0[24], out + 7, out + 24, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[8], bf0[23], out + 8, out + 23, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[9], bf0[22], out + 9, out + 22, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[10], bf0[21], out + 10, out + 21, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[11], bf0[20], out + 11, out + 20, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[12], bf0[19], out + 12, out + 19, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[13], bf0[18], out + 13, out + 18, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[14], bf0[17], out + 14, out + 17, &clamp_lo_out, - &clamp_hi_out, out_shift); - addsub_shift_sse4_1(bf0[15], bf0[16], out + 15, out + 16, &clamp_lo_out, - &clamp_hi_out, out_shift); + if (!do_cols) { + const int log_range_out = AOMMAX(16, bd + 6); + const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1))); + const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1); + round_shift_8x8(out, out_shift); + round_shift_8x8(out + 16, out_shift); + highbd_clamp_epi32_sse4_1(out, out, &clamp_lo_out, &clamp_hi_out, 32);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/highbd_inv_txfm_sse4.c
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
bf0[26] = half_btf_sse4_1(&cospi32, &bf1[21], &cospi32, &bf1[26], &rounding, bit); bf0[27] = half_btf_sse4_1(&cospi32, &bf1[20], &cospi32, &bf1[27], &rounding, bit); bf0[28] = bf1[28]; bf0[29] = bf1[29]; bf0[30] = bf1[30]; bf0[31] = bf1[31]; // stage 9
+ show +
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
if (do_cols) { addsub_no_clamp_sse4_1(bf0[0], bf0[31], out + 0, out + 31); addsub_no_clamp_sse4_1(bf0[1], bf0[30], out + 1, out + 30); addsub_no_clamp_sse4_1(bf0[2], bf0[29], out + 2, out + 29); addsub_no_clamp_sse4_1(bf0[3], bf0[28], out + 3, out + 28); addsub_no_clamp_sse4_1(bf0[4], bf0[27], out + 4, out + 27); addsub_no_clamp_sse4_1(bf0[5], bf0[26], out + 5, out + 26); addsub_no_clamp_sse4_1(bf0[6], bf0[25], out + 6, out + 25); addsub_no_clamp_sse4_1(bf0[7], bf0[24], out + 7, out + 24); addsub_no_clamp_sse4_1(bf0[8], bf0[23], out + 8, out + 23); addsub_no_clamp_sse4_1(bf0[9], bf0[22], out + 9, out + 22); addsub_no_clamp_sse4_1(bf0[10], bf0[21], out + 10, out + 21); addsub_no_clamp_sse4_1(bf0[11], bf0[20], out + 11, out + 20); addsub_no_clamp_sse4_1(bf0[12], bf0[19], out + 12, out + 19); addsub_no_clamp_sse4_1(bf0[13], bf0[18], out + 13, out + 18); addsub_no_clamp_sse4_1(bf0[14], bf0[17], out + 14, out + 17); addsub_no_clamp_sse4_1(bf0[15], bf0[16], out + 15, out + 16); } else { const int log_range_out = AOMMAX(16, bd + 6); const __m128i clamp_lo_out = _mm_set1_epi32(AOMMAX( -(1 << (log_range_out - 1)), -(1 << (log_range - 1 - out_shift)))); const __m128i clamp_hi_out = _mm_set1_epi32(AOMMIN( (1 << (log_range_out - 1)) - 1, (1 << (log_range - 1 - out_shift)))); addsub_shift_sse4_1(bf0[0], bf0[31], out + 0, out + 31, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[1], bf0[30], out + 1, out + 30, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[2], bf0[29], out + 2, out + 29, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[3], bf0[28], out + 3, out + 28, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[4], bf0[27], out + 4, out + 27, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[5], bf0[26], out + 5, out + 26, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[6], bf0[25], out + 6, out + 25, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[7], bf0[24], out + 7, out + 24, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[8], bf0[23], out + 8, out + 23, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[9], bf0[22], out + 9, out + 22, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[10], bf0[21], out + 10, out + 21, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[11], bf0[20], out + 11, out + 20, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[12], bf0[19], out + 12, out + 19, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[13], bf0[18], out + 13, out + 18, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[14], bf0[17], out + 14, out + 17, &clamp_lo_out, &clamp_hi_out, out_shift); addsub_shift_sse4_1(bf0[15], bf0[16], out + 15, out + 16, &clamp_lo_out, &clamp_hi_out, out_shift);
+ show +
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
} } void av1_highbd_inv_txfm_add_8x8_sse4_1(const tran_low_t *input, uint8_t *dest, int stride, const TxfmParam *txfm_param) { int bd = txfm_param->bd; const TX_TYPE tx_type = txfm_param->tx_type; const int32_t *src = cast_to_int32(input); switch (tx_type) {

[CVE-2020-0478_1.diff] warp_plane_sse4.c #5
- _mm_loadl_epi64((__m128i *)&filter_8bit[sx >> WARPEDDIFF_PREC_BITS]); + _mm_loadl_epi64((__m128i *)&av1_filter_8bit[sx >> WARPEDDIFF_PREC_BITS]); - coeff[0] = _mm_shuffle_epi8( - tmp_0, _mm_loadu_si128((__m128i *)shuffle_alpha0_mask01)); + coeff[0] = + _mm_shuffle_epi8(tmp_0, _mm_load_si128((__m128i *)shuffle_alpha0_mask01)); - coeff[1] = _mm_shuffle_epi8( - tmp_0, _mm_loadu_si128((__m128i *)shuffle_alpha0_mask23)); + coeff[1] = + _mm_shuffle_epi8(tmp_0, _mm_load_si128((__m128i *)shuffle_alpha0_mask23)); - coeff[2] = _mm_shuffle_epi8( - tmp_0, _mm_loadu_si128((__m128i *)shuffle_alpha0_mask45)); + coeff[2] = + _mm_shuffle_epi8(tmp_0, _mm_load_si128((__m128i *)shuffle_alpha0_mask45)); - coeff[3] = _mm_shuffle_epi8( - tmp_0, _mm_loadu_si128((__m128i *)shuffle_alpha0_mask67)); + coeff[3] = + _mm_shuffle_epi8(tmp_0, _mm_load_si128((__m128i *)shuffle_alpha0_mask67));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/warp_plane_sse4.c
312
313
314
315
316
317
318
319
320
321
// Coeffs 1 3 for pixels 0 2 4 6 1 3 5 7 coeff[2] = _mm_unpacklo_epi64(tmp_13, tmp_15); // Coeffs 5 7 for pixels 0 2 4 6 1 3 5 7 coeff[3] = _mm_unpackhi_epi64(tmp_13, tmp_15); } static INLINE void prepare_horizontal_filter_coeff_alpha0(int sx, __m128i *coeff) { // Filter even-index pixels const __m128i tmp_0 =
+ show +
322
323
324
325
326
327
328
329
330
331
332
333
334
335
_mm_loadl_epi64((__m128i *)&filter_8bit[sx >> WARPEDDIFF_PREC_BITS]); // Coeffs 0 2 for pixels 0 2 4 6 1 3 5 7 coeff[0] = _mm_shuffle_epi8( tmp_0, _mm_loadu_si128((__m128i *)shuffle_alpha0_mask01)); // Coeffs 4 6 for pixels 0 2 4 6 1 3 5 7 coeff[1] = _mm_shuffle_epi8( tmp_0, _mm_loadu_si128((__m128i *)shuffle_alpha0_mask23)); // Coeffs 1 3 for pixels 0 2 4 6 1 3 5 7 coeff[2] = _mm_shuffle_epi8( tmp_0, _mm_loadu_si128((__m128i *)shuffle_alpha0_mask45)); // Coeffs 5 7 for pixels 0 2 4 6 1 3 5 7 coeff[3] = _mm_shuffle_epi8( tmp_0, _mm_loadu_si128((__m128i *)shuffle_alpha0_mask67));
+ show +
336
337
338
339
340
341
342
343
344
345
} static INLINE void horizontal_filter(__m128i src, __m128i *tmp, int sx, int alpha, int k, const int offset_bits_horiz, const int reduce_bits_horiz) { __m128i coeff[4]; prepare_horizontal_filter_coeff(alpha, sx, coeff); filter_src_pixels(src, tmp, coeff, offset_bits_horiz, reduce_bits_horiz, k); }

[CVE-2020-0478_1.diff] warp_plane_sse4.c #7
- const __m128i tmp_1 = _mm_loadu_si128( - (__m128i *)(warped_filter + ((sy + 1 * gamma) >> WARPEDDIFF_PREC_BITS))); - const __m128i tmp_3 = _mm_loadu_si128( - (__m128i *)(warped_filter + ((sy + 3 * gamma) >> WARPEDDIFF_PREC_BITS))); - const __m128i tmp_5 = _mm_loadu_si128( - (__m128i *)(warped_filter + ((sy + 5 * gamma) >> WARPEDDIFF_PREC_BITS))); - const __m128i tmp_7 = _mm_loadu_si128( - (__m128i *)(warped_filter + ((sy + 7 * gamma) >> WARPEDDIFF_PREC_BITS))); + const __m128i tmp_1 = + _mm_loadu_si128((__m128i *)(av1_warped_filter + + ((sy + 1 * gamma) >> WARPEDDIFF_PREC_BITS))); + const __m128i tmp_3 = + _mm_loadu_si128((__m128i *)(av1_warped_filter + + ((sy + 3 * gamma) >> WARPEDDIFF_PREC_BITS))); + const __m128i tmp_5 = + _mm_loadu_si128((__m128i *)(av1_warped_filter + + ((sy + 5 * gamma) >> WARPEDDIFF_PREC_BITS))); + const __m128i tmp_7 = + _mm_loadu_si128((__m128i *)(av1_warped_filter + + ((sy + 7 * gamma) >> WARPEDDIFF_PREC_BITS)));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/warp_plane_sse4.c
469
470
471
472
473
474
475
476
477
478
const __m128i tmp_10 = _mm_unpacklo_epi32(tmp_4, tmp_6); const __m128i tmp_12 = _mm_unpackhi_epi32(tmp_0, tmp_2); const __m128i tmp_14 = _mm_unpackhi_epi32(tmp_4, tmp_6); // even coeffs coeffs[0] = _mm_unpacklo_epi64(tmp_8, tmp_10); coeffs[1] = _mm_unpackhi_epi64(tmp_8, tmp_10); coeffs[2] = _mm_unpacklo_epi64(tmp_12, tmp_14); coeffs[3] = _mm_unpackhi_epi64(tmp_12, tmp_14);
+ show +
479
480
481
482
483
484
485
486
const __m128i tmp_1 = _mm_loadu_si128( (__m128i *)(warped_filter + ((sy + 1 * gamma) >> WARPEDDIFF_PREC_BITS))); const __m128i tmp_3 = _mm_loadu_si128( (__m128i *)(warped_filter + ((sy + 3 * gamma) >> WARPEDDIFF_PREC_BITS))); const __m128i tmp_5 = _mm_loadu_si128( (__m128i *)(warped_filter + ((sy + 5 * gamma) >> WARPEDDIFF_PREC_BITS))); const __m128i tmp_7 = _mm_loadu_si128( (__m128i *)(warped_filter + ((sy + 7 * gamma) >> WARPEDDIFF_PREC_BITS)));
+ show +
487
488
489
490
491
492
493
494
495
496
const __m128i tmp_9 = _mm_unpacklo_epi32(tmp_1, tmp_3); const __m128i tmp_11 = _mm_unpacklo_epi32(tmp_5, tmp_7); const __m128i tmp_13 = _mm_unpackhi_epi32(tmp_1, tmp_3); const __m128i tmp_15 = _mm_unpackhi_epi32(tmp_5, tmp_7); // odd coeffs coeffs[4] = _mm_unpacklo_epi64(tmp_9, tmp_11); coeffs[5] = _mm_unpackhi_epi64(tmp_9, tmp_11); coeffs[6] = _mm_unpacklo_epi64(tmp_13, tmp_15);

[CVE-2020-0470_1.diff] warp_plane_sse4.c #5
- _mm_loadl_epi64((__m128i *)&filter_8bit[sx >> WARPEDDIFF_PREC_BITS]); + _mm_loadl_epi64((__m128i *)&av1_filter_8bit[sx >> WARPEDDIFF_PREC_BITS]); - coeff[0] = _mm_shuffle_epi8( - tmp_0, _mm_loadu_si128((__m128i *)shuffle_alpha0_mask01)); + coeff[0] = + _mm_shuffle_epi8(tmp_0, _mm_load_si128((__m128i *)shuffle_alpha0_mask01)); - coeff[1] = _mm_shuffle_epi8( - tmp_0, _mm_loadu_si128((__m128i *)shuffle_alpha0_mask23)); + coeff[1] = + _mm_shuffle_epi8(tmp_0, _mm_load_si128((__m128i *)shuffle_alpha0_mask23)); - coeff[2] = _mm_shuffle_epi8( - tmp_0, _mm_loadu_si128((__m128i *)shuffle_alpha0_mask45)); + coeff[2] = + _mm_shuffle_epi8(tmp_0, _mm_load_si128((__m128i *)shuffle_alpha0_mask45)); - coeff[3] = _mm_shuffle_epi8( - tmp_0, _mm_loadu_si128((__m128i *)shuffle_alpha0_mask67)); + coeff[3] = + _mm_shuffle_epi8(tmp_0, _mm_load_si128((__m128i *)shuffle_alpha0_mask67));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/warp_plane_sse4.c
312
313
314
315
316
317
318
319
320
321
// Coeffs 1 3 for pixels 0 2 4 6 1 3 5 7 coeff[2] = _mm_unpacklo_epi64(tmp_13, tmp_15); // Coeffs 5 7 for pixels 0 2 4 6 1 3 5 7 coeff[3] = _mm_unpackhi_epi64(tmp_13, tmp_15); } static INLINE void prepare_horizontal_filter_coeff_alpha0(int sx, __m128i *coeff) { // Filter even-index pixels const __m128i tmp_0 =
+ show +
322
323
324
325
326
327
328
329
330
331
332
333
334
335
_mm_loadl_epi64((__m128i *)&filter_8bit[sx >> WARPEDDIFF_PREC_BITS]); // Coeffs 0 2 for pixels 0 2 4 6 1 3 5 7 coeff[0] = _mm_shuffle_epi8( tmp_0, _mm_loadu_si128((__m128i *)shuffle_alpha0_mask01)); // Coeffs 4 6 for pixels 0 2 4 6 1 3 5 7 coeff[1] = _mm_shuffle_epi8( tmp_0, _mm_loadu_si128((__m128i *)shuffle_alpha0_mask23)); // Coeffs 1 3 for pixels 0 2 4 6 1 3 5 7 coeff[2] = _mm_shuffle_epi8( tmp_0, _mm_loadu_si128((__m128i *)shuffle_alpha0_mask45)); // Coeffs 5 7 for pixels 0 2 4 6 1 3 5 7 coeff[3] = _mm_shuffle_epi8( tmp_0, _mm_loadu_si128((__m128i *)shuffle_alpha0_mask67));
+ show +
336
337
338
339
340
341
342
343
344
345
} static INLINE void horizontal_filter(__m128i src, __m128i *tmp, int sx, int alpha, int k, const int offset_bits_horiz, const int reduce_bits_horiz) { __m128i coeff[4]; prepare_horizontal_filter_coeff(alpha, sx, coeff); filter_src_pixels(src, tmp, coeff, offset_bits_horiz, reduce_bits_horiz, k); }

[CVE-2020-0470_1.diff] warp_plane_sse4.c #7
- const __m128i tmp_1 = _mm_loadu_si128( - (__m128i *)(warped_filter + ((sy + 1 * gamma) >> WARPEDDIFF_PREC_BITS))); - const __m128i tmp_3 = _mm_loadu_si128( - (__m128i *)(warped_filter + ((sy + 3 * gamma) >> WARPEDDIFF_PREC_BITS))); - const __m128i tmp_5 = _mm_loadu_si128( - (__m128i *)(warped_filter + ((sy + 5 * gamma) >> WARPEDDIFF_PREC_BITS))); - const __m128i tmp_7 = _mm_loadu_si128( - (__m128i *)(warped_filter + ((sy + 7 * gamma) >> WARPEDDIFF_PREC_BITS))); + const __m128i tmp_1 = + _mm_loadu_si128((__m128i *)(av1_warped_filter + + ((sy + 1 * gamma) >> WARPEDDIFF_PREC_BITS))); + const __m128i tmp_3 = + _mm_loadu_si128((__m128i *)(av1_warped_filter + + ((sy + 3 * gamma) >> WARPEDDIFF_PREC_BITS))); + const __m128i tmp_5 = + _mm_loadu_si128((__m128i *)(av1_warped_filter + + ((sy + 5 * gamma) >> WARPEDDIFF_PREC_BITS))); + const __m128i tmp_7 = + _mm_loadu_si128((__m128i *)(av1_warped_filter + + ((sy + 7 * gamma) >> WARPEDDIFF_PREC_BITS)));
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/av1/common/x86/warp_plane_sse4.c
469
470
471
472
473
474
475
476
477
478
const __m128i tmp_10 = _mm_unpacklo_epi32(tmp_4, tmp_6); const __m128i tmp_12 = _mm_unpackhi_epi32(tmp_0, tmp_2); const __m128i tmp_14 = _mm_unpackhi_epi32(tmp_4, tmp_6); // even coeffs coeffs[0] = _mm_unpacklo_epi64(tmp_8, tmp_10); coeffs[1] = _mm_unpackhi_epi64(tmp_8, tmp_10); coeffs[2] = _mm_unpacklo_epi64(tmp_12, tmp_14); coeffs[3] = _mm_unpackhi_epi64(tmp_12, tmp_14);
+ show +
479
480
481
482
483
484
485
486
const __m128i tmp_1 = _mm_loadu_si128( (__m128i *)(warped_filter + ((sy + 1 * gamma) >> WARPEDDIFF_PREC_BITS))); const __m128i tmp_3 = _mm_loadu_si128( (__m128i *)(warped_filter + ((sy + 3 * gamma) >> WARPEDDIFF_PREC_BITS))); const __m128i tmp_5 = _mm_loadu_si128( (__m128i *)(warped_filter + ((sy + 5 * gamma) >> WARPEDDIFF_PREC_BITS))); const __m128i tmp_7 = _mm_loadu_si128( (__m128i *)(warped_filter + ((sy + 7 * gamma) >> WARPEDDIFF_PREC_BITS)));
+ show +
487
488
489
490
491
492
493
494
495
496
const __m128i tmp_9 = _mm_unpacklo_epi32(tmp_1, tmp_3); const __m128i tmp_11 = _mm_unpacklo_epi32(tmp_5, tmp_7); const __m128i tmp_13 = _mm_unpackhi_epi32(tmp_1, tmp_3); const __m128i tmp_15 = _mm_unpackhi_epi32(tmp_5, tmp_7); // odd coeffs coeffs[4] = _mm_unpacklo_epi64(tmp_9, tmp_11); coeffs[5] = _mm_unpackhi_epi64(tmp_9, tmp_11); coeffs[6] = _mm_unpacklo_epi64(tmp_13, tmp_15);

[CVE-2020-0478_1.diff] obudec.c #1
- uint8_t *new_buffer = (uint8_t *)realloc(*buffer, tu_size); - if (!new_buffer) { - free(*buffer); - fprintf(stderr, "obudec: Out of memory.\n"); - return -1; + if (tu_size > 0) { + uint8_t *new_buffer = (uint8_t *)realloc(*buffer, tu_size); + if (!new_buffer) { + free(*buffer); + fprintf(stderr, "obudec: Out of memory.\n"); + return -1; + } + *buffer = new_buffer; - *buffer = new_buffer;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/common/obudec.c
431
432
433
434
435
436
437
438
439
440
} } } #if defined AOM_MAX_ALLOCABLE_MEMORY if (tu_size > AOM_MAX_ALLOCABLE_MEMORY) { fprintf(stderr, "obudec: Temporal Unit size exceeds max alloc size.\n"); return -1; } #endif
+ show +
441
442
443
444
445
446
447
uint8_t *new_buffer = (uint8_t *)realloc(*buffer, tu_size); if (!new_buffer) { free(*buffer); fprintf(stderr, "obudec: Out of memory.\n"); return -1; } *buffer = new_buffer;
+ show +
448
449
450
451
452
453
454
455
456
457
*bytes_read = tu_size; *buffer_size = tu_size; if (!obu_ctx->is_annexb) { memcpy(*buffer, obu_ctx->buffer, tu_size); // At this point, (obu_ctx->buffer + obu_ctx->bytes_buffered + obu_size) // points to the end of the buffer. memmove(obu_ctx->buffer, obu_ctx->buffer + obu_ctx->bytes_buffered, obu_size);

[CVE-2020-0478_1.diff] obudec.c #2
- memcpy(*buffer, obu_ctx->buffer, obu_ctx->bytes_buffered); - offset = obu_ctx->bytes_buffered; - data_size = tu_size - obu_ctx->bytes_buffered; - obu_ctx->bytes_buffered = 0; + const size_t copy_size = AOMMIN(obu_ctx->bytes_buffered, tu_size); + memcpy(*buffer, obu_ctx->buffer, copy_size); + offset = copy_size; + data_size = tu_size - copy_size; + obu_ctx->bytes_buffered -= copy_size;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/common/obudec.c
458
459
460
461
462
463
464
465
466
467
obu_ctx->bytes_buffered = obu_size; } else { if (!feof(f)) { size_t data_size; size_t offset; if (!obu_ctx->bytes_buffered) { data_size = tu_size - length_of_temporal_unit_size; memcpy(*buffer, &tuheader[0], length_of_temporal_unit_size); offset = length_of_temporal_unit_size; } else {
+ show +
468
469
470
471
memcpy(*buffer, obu_ctx->buffer, obu_ctx->bytes_buffered); offset = obu_ctx->bytes_buffered; data_size = tu_size - obu_ctx->bytes_buffered; obu_ctx->bytes_buffered = 0;
+ show +
472
473
474
475
476
477
478
479
480
481
} if (fread(*buffer + offset, 1, data_size, f) != data_size) { fprintf(stderr, "obudec: Failed to read full temporal unit\n"); return -1; } } } return 0; }

[CVE-2020-0470_1.diff] obudec.c #1
- uint8_t *new_buffer = (uint8_t *)realloc(*buffer, tu_size); - if (!new_buffer) { - free(*buffer); - fprintf(stderr, "obudec: Out of memory.\n"); - return -1; + if (tu_size > 0) { + uint8_t *new_buffer = (uint8_t *)realloc(*buffer, tu_size); + if (!new_buffer) { + free(*buffer); + fprintf(stderr, "obudec: Out of memory.\n"); + return -1; + } + *buffer = new_buffer; - *buffer = new_buffer;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/common/obudec.c
431
432
433
434
435
436
437
438
439
440
} } } #if defined AOM_MAX_ALLOCABLE_MEMORY if (tu_size > AOM_MAX_ALLOCABLE_MEMORY) { fprintf(stderr, "obudec: Temporal Unit size exceeds max alloc size.\n"); return -1; } #endif
+ show +
441
442
443
444
445
446
447
uint8_t *new_buffer = (uint8_t *)realloc(*buffer, tu_size); if (!new_buffer) { free(*buffer); fprintf(stderr, "obudec: Out of memory.\n"); return -1; } *buffer = new_buffer;
+ show +
448
449
450
451
452
453
454
455
456
457
*bytes_read = tu_size; *buffer_size = tu_size; if (!obu_ctx->is_annexb) { memcpy(*buffer, obu_ctx->buffer, tu_size); // At this point, (obu_ctx->buffer + obu_ctx->bytes_buffered + obu_size) // points to the end of the buffer. memmove(obu_ctx->buffer, obu_ctx->buffer + obu_ctx->bytes_buffered, obu_size);

[CVE-2020-0470_1.diff] obudec.c #2
- memcpy(*buffer, obu_ctx->buffer, obu_ctx->bytes_buffered); - offset = obu_ctx->bytes_buffered; - data_size = tu_size - obu_ctx->bytes_buffered; - obu_ctx->bytes_buffered = 0; + const size_t copy_size = AOMMIN(obu_ctx->bytes_buffered, tu_size); + memcpy(*buffer, obu_ctx->buffer, copy_size); + offset = copy_size; + data_size = tu_size - copy_size; + obu_ctx->bytes_buffered -= copy_size;
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/common/obudec.c
458
459
460
461
462
463
464
465
466
467
obu_ctx->bytes_buffered = obu_size; } else { if (!feof(f)) { size_t data_size; size_t offset; if (!obu_ctx->bytes_buffered) { data_size = tu_size - length_of_temporal_unit_size; memcpy(*buffer, &tuheader[0], length_of_temporal_unit_size); offset = length_of_temporal_unit_size; } else {
+ show +
468
469
470
471
memcpy(*buffer, obu_ctx->buffer, obu_ctx->bytes_buffered); offset = obu_ctx->bytes_buffered; data_size = tu_size - obu_ctx->bytes_buffered; obu_ctx->bytes_buffered = 0;
+ show +
472
473
474
475
476
477
478
479
480
481
} if (fread(*buffer + offset, 1, data_size, f) != data_size) { fprintf(stderr, "obudec: Failed to read full temporal unit\n"); return -1; } } } return 0; }

[CVE-2020-0478_1.diff] args.c #3
- char **new_args = argv_dup(*argc, (const char **)argv_local); - char *new_line = (char *)malloc(sizeof(*new_line) * 128); + GET_PARAMS(super_block_size); + GET_PARAMS(max_partition_size); + GET_PARAMS(min_partition_size); + GET_PARAMS(disable_ab_partition_type); + GET_PARAMS(disable_rect_partition_type); + GET_PARAMS(disable_1to4_partition_type); + GET_PARAMS(disable_flip_idtx); + GET_PARAMS(disable_cdef); + GET_PARAMS(disable_lr); + GET_PARAMS(disable_obmc); + GET_PARAMS(disable_warp_motion); + GET_PARAMS(disable_global_motion); + GET_PARAMS(disable_dist_wtd_comp); + GET_PARAMS(disable_diff_wtd_comp); + GET_PARAMS(disable_inter_intra_comp); + GET_PARAMS(disable_masked_comp); + GET_PARAMS(disable_one_sided_comp); + GET_PARAMS(disable_palette); + GET_PARAMS(disable_intrabc); + GET_PARAMS(disable_cfl); + GET_PARAMS(disable_smooth_intra); + GET_PARAMS(disable_filter_intra); + GET_PARAMS(disable_dual_filter); + GET_PARAMS(disable_intra_angle_delta); + GET_PARAMS(disable_intra_edge_filter); + GET_PARAMS(disable_tx_64x64); + GET_PARAMS(disable_smooth_inter_intra); + GET_PARAMS(disable_inter_inter_wedge); + GET_PARAMS(disable_inter_intra_wedge); + GET_PARAMS(disable_paeth_intra); + GET_PARAMS(disable_trellis_quant); + GET_PARAMS(disable_ref_frame_mv); + GET_PARAMS(reduced_reference_set); + GET_PARAMS(reduced_tx_type_set); - if (argv_local != argv_org) free(argv_local); - - if (!strcmp(right, "ON")) - snprintf(new_line, sizeof(*new_line) * 128, "--%s", left); - else - snprintf(new_line, sizeof(*new_line) * 128, "--%s=%s", left, right); - - new_args[(*argc) - 1] = new_args[(*argc) - 2]; - new_args[(*argc) - 2] = new_line; - argv_local = new_args; - *argv = new_args; - (*argc)++; + fprintf(stderr, "\nInvalid parameter: %s", left); + exit(-1); + + if (config->super_block_size != 128 && config->super_block_size != 64) { + fprintf(stderr, "\n%s", kSbSizeWarningString); + exit(-1); + } + if (config->min_partition_size > config->max_partition_size) { + fprintf(stderr, "\n%s", kMinpartWarningString); + exit(-1); + } + if (config->max_partition_size > config->super_block_size) { + fprintf(stderr, "\n%s", kMaxpartWarningString); + exit(-1); + } + + config->init_by_cfg_file = 1; +
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/common/args.c
67
68
69
70
71
72
73
74
75
76
left = ignore_front_spaces(actual_line); right = ignore_front_spaces(right + 1); comment = strchr(right, '#'); if (comment != NULL) comment[0] = '\0'; ignore_end_spaces(left); ignore_end_spaces(right);
+ show +
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
char **new_args = argv_dup(*argc, (const char **)argv_local); char *new_line = (char *)malloc(sizeof(*new_line) * 128); if (argv_local != argv_org) free(argv_local); if (!strcmp(right, "ON")) snprintf(new_line, sizeof(*new_line) * 128, "--%s", left); else snprintf(new_line, sizeof(*new_line) * 128, "--%s=%s", left, right); new_args[(*argc) - 1] = new_args[(*argc) - 2]; new_args[(*argc) - 2] = new_line; argv_local = new_args; *argv = new_args; (*argc)++;
+ show +
92
93
94
95
96
97
98
99
100
101
} fclose(f); return 0; } int arg_match(struct arg *arg_, const struct arg_def *def, char **argv) { struct arg arg; if (!argv[0] || argv[0][0] != '-') return 0;

[CVE-2020-0478_1.diff] args.c #4
-struct aom_rational { - int num; /**< fraction numerator */ - int den; /**< fraction denominator */ -};
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/common/args.c
202
203
204
205
206
207
208
209
210
211
if (rawval >= INT_MIN && rawval <= INT_MAX) return (int)rawval; die("Option %s: Value %ld out of range for signed int\n", arg->name, rawval); } die("Option %s: Invalid character '%c'\n", arg->name, *endptr); return 0; }
+ show +
212
213
214
215
struct aom_rational { int num; /**< fraction numerator */ int den; /**< fraction denominator */ };
+ show +
216
217
218
219
220
221
222
223
224
225
struct aom_rational arg_parse_rational(const struct arg *arg) { long int rawval; char *endptr; struct aom_rational rat; /* parse numerator */ rawval = strtol(arg->val, &endptr, 10); if (arg->val[0] != '\0' && endptr[0] == '/') { if (rawval >= INT_MIN && rawval <= INT_MAX)

[CVE-2020-0470_1.diff] args.c #3
- char **new_args = argv_dup(*argc, (const char **)argv_local); - char *new_line = (char *)malloc(sizeof(*new_line) * 128); + GET_PARAMS(super_block_size); + GET_PARAMS(max_partition_size); + GET_PARAMS(min_partition_size); + GET_PARAMS(disable_ab_partition_type); + GET_PARAMS(disable_rect_partition_type); + GET_PARAMS(disable_1to4_partition_type); + GET_PARAMS(disable_flip_idtx); + GET_PARAMS(disable_cdef); + GET_PARAMS(disable_lr); + GET_PARAMS(disable_obmc); + GET_PARAMS(disable_warp_motion); + GET_PARAMS(disable_global_motion); + GET_PARAMS(disable_dist_wtd_comp); + GET_PARAMS(disable_diff_wtd_comp); + GET_PARAMS(disable_inter_intra_comp); + GET_PARAMS(disable_masked_comp); + GET_PARAMS(disable_one_sided_comp); + GET_PARAMS(disable_palette); + GET_PARAMS(disable_intrabc); + GET_PARAMS(disable_cfl); + GET_PARAMS(disable_smooth_intra); + GET_PARAMS(disable_filter_intra); + GET_PARAMS(disable_dual_filter); + GET_PARAMS(disable_intra_angle_delta); + GET_PARAMS(disable_intra_edge_filter); + GET_PARAMS(disable_tx_64x64); + GET_PARAMS(disable_smooth_inter_intra); + GET_PARAMS(disable_inter_inter_wedge); + GET_PARAMS(disable_inter_intra_wedge); + GET_PARAMS(disable_paeth_intra); + GET_PARAMS(disable_trellis_quant); + GET_PARAMS(disable_ref_frame_mv); + GET_PARAMS(reduced_reference_set); + GET_PARAMS(reduced_tx_type_set); - if (argv_local != argv_org) free(argv_local); - - if (!strcmp(right, "ON")) - snprintf(new_line, sizeof(*new_line) * 128, "--%s", left); - else - snprintf(new_line, sizeof(*new_line) * 128, "--%s=%s", left, right); - - new_args[(*argc) - 1] = new_args[(*argc) - 2]; - new_args[(*argc) - 2] = new_line; - argv_local = new_args; - *argv = new_args; - (*argc)++; + fprintf(stderr, "\nInvalid parameter: %s", left); + exit(-1); + + if (config->super_block_size != 128 && config->super_block_size != 64) { + fprintf(stderr, "\n%s", kSbSizeWarningString); + exit(-1); + } + if (config->min_partition_size > config->max_partition_size) { + fprintf(stderr, "\n%s", kMinpartWarningString); + exit(-1); + } + if (config->max_partition_size > config->super_block_size) { + fprintf(stderr, "\n%s", kMaxpartWarningString); + exit(-1); + } + + config->init_by_cfg_file = 1; +
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/common/args.c
67
68
69
70
71
72
73
74
75
76
left = ignore_front_spaces(actual_line); right = ignore_front_spaces(right + 1); comment = strchr(right, '#'); if (comment != NULL) comment[0] = '\0'; ignore_end_spaces(left); ignore_end_spaces(right);
+ show +
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
char **new_args = argv_dup(*argc, (const char **)argv_local); char *new_line = (char *)malloc(sizeof(*new_line) * 128); if (argv_local != argv_org) free(argv_local); if (!strcmp(right, "ON")) snprintf(new_line, sizeof(*new_line) * 128, "--%s", left); else snprintf(new_line, sizeof(*new_line) * 128, "--%s=%s", left, right); new_args[(*argc) - 1] = new_args[(*argc) - 2]; new_args[(*argc) - 2] = new_line; argv_local = new_args; *argv = new_args; (*argc)++;
+ show +
92
93
94
95
96
97
98
99
100
101
} fclose(f); return 0; } int arg_match(struct arg *arg_, const struct arg_def *def, char **argv) { struct arg arg; if (!argv[0] || argv[0][0] != '-') return 0;

[CVE-2020-0470_1.diff] args.c #4
-struct aom_rational { - int num; /**< fraction numerator */ - int den; /**< fraction denominator */ -};
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/common/args.c
202
203
204
205
206
207
208
209
210
211
if (rawval >= INT_MIN && rawval <= INT_MAX) return (int)rawval; die("Option %s: Value %ld out of range for signed int\n", arg->name, rawval); } die("Option %s: Invalid character '%c'\n", arg->name, *endptr); return 0; }
+ show +
212
213
214
215
struct aom_rational { int num; /**< fraction numerator */ int den; /**< fraction denominator */ };
+ show +
216
217
218
219
220
221
222
223
224
225
struct aom_rational arg_parse_rational(const struct arg *arg) { long int rawval; char *endptr; struct aom_rational rat; /* parse numerator */ rawval = strtol(arg->val, &endptr, 10); if (arg->val[0] != '\0' && endptr[0] == '/') { if (rawval >= INT_MIN && rawval <= INT_MAX)

[CVE-2020-0478_1.diff] gtest.cc #8
-GTEST_ATTRIBUTE_NO_SANITIZE_UNSIGNED_OVERFLOW_ -UInt32 Random::Generate(UInt32 range) { +uint32_t Random::Generate(uint32_t range) { - state_ = (1103515245U*state_ + 12345U) % kMaxRange; + // Use wider types than necessary to prevent unsigned overflow diagnostics. + state_ = static_cast<uint32_t>(1103515245ULL * state_ + 12345U) % kMaxRange; - GTEST_CHECK_(range > 0) - << "Cannot generate a number in the range [0, 0)."; + GTEST_CHECK_(range > 0) << "Cannot generate a number in the range [0, 0).";
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest.cc
301
302
303
304
305
306
307
308
309
310
flagfile, internal::StringFromGTestEnv("flagfile", ""), "This flag specifies the flagfile to read command-line flags from."); #endif // GTEST_USE_OWN_FLAGFILE_FLAG_ namespace internal { // Generates a random number from [0, range), using a Linear // Congruential Generator (LCG). Crashes if 'range' is 0 or greater // than kMaxRange.
+ show +
311
312
313
314
315
316
317
GTEST_ATTRIBUTE_NO_SANITIZE_UNSIGNED_OVERFLOW_ UInt32 Random::Generate(UInt32 range) { // These constants are the same as are used in glibc's rand(3). state_ = (1103515245U*state_ + 12345U) % kMaxRange; GTEST_CHECK_(range > 0) << "Cannot generate a number in the range [0, 0).";
+ show +
318
319
320
321
322
323
324
325
326
327
GTEST_CHECK_(range <= kMaxRange) << "Generation of a number in [0, " << range << ") was requested, " << "but this can only generate numbers in [0, " << kMaxRange << ")."; // Converting via modulus introduces a bit of downward bias, but // it's simple, and a linear congruential generator isn't too good // to begin with. return state_ % range; }

[CVE-2020-0470_1.diff] gtest.cc #8
-GTEST_ATTRIBUTE_NO_SANITIZE_UNSIGNED_OVERFLOW_ -UInt32 Random::Generate(UInt32 range) { +uint32_t Random::Generate(uint32_t range) { - state_ = (1103515245U*state_ + 12345U) % kMaxRange; + // Use wider types than necessary to prevent unsigned overflow diagnostics. + state_ = static_cast<uint32_t>(1103515245ULL * state_ + 12345U) % kMaxRange; - GTEST_CHECK_(range > 0) - << "Cannot generate a number in the range [0, 0)."; + GTEST_CHECK_(range > 0) << "Cannot generate a number in the range [0, 0).";
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/googletest/src/googletest/src/gtest.cc
301
302
303
304
305
306
307
308
309
310
flagfile, internal::StringFromGTestEnv("flagfile", ""), "This flag specifies the flagfile to read command-line flags from."); #endif // GTEST_USE_OWN_FLAGFILE_FLAG_ namespace internal { // Generates a random number from [0, range), using a Linear // Congruential Generator (LCG). Crashes if 'range' is 0 or greater // than kMaxRange.
+ show +
311
312
313
314
315
316
317
GTEST_ATTRIBUTE_NO_SANITIZE_UNSIGNED_OVERFLOW_ UInt32 Random::Generate(UInt32 range) { // These constants are the same as are used in glibc's rand(3). state_ = (1103515245U*state_ + 12345U) % kMaxRange; GTEST_CHECK_(range > 0) << "Cannot generate a number in the range [0, 0).";
+ show +
318
319
320
321
322
323
324
325
326
327
GTEST_CHECK_(range <= kMaxRange) << "Generation of a number in [0, " << range << ") was requested, " << "but this can only generate numbers in [0, " << kMaxRange << ")."; // Converting via modulus introduces a bit of downward bias, but // it's simple, and a linear congruential generator isn't too good // to begin with. return state_ % range; }

[CVE-2020-0478_1.diff] fast.h #1
-int fast9_corner_score(const byte* p, const int pixel[], int bstart); +int aom_fast9_corner_score(const byte* p, const int pixel[], int bstart); -xy* fast9_detect(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners); +xy* aom_fast9_detect(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners); -int* fast9_score(const byte* i, int stride, xy* corners, int num_corners, int b); +int* aom_fast9_score(const byte* i, int stride, xy* corners, int num_corners, int b); -xy* fast9_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners); +xy* aom_fast9_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners); -xy* nonmax_suppression(const xy* corners, const int* scores, int num_corners, int* ret_num_nonmax); +xy* aom_nonmax_suppression(const xy* corners, const int* scores, int num_corners, int* ret_num_nonmax);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/fastfeat/fast.h
1
2
3
4
5
6
7
// clang-format off #ifndef FAST_H #define FAST_H typedef struct { int x, y; } xy; typedef unsigned char byte;
+ show +
8
9
10
11
12
13
14
15
16
int fast9_corner_score(const byte* p, const int pixel[], int bstart); xy* fast9_detect(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners); int* fast9_score(const byte* i, int stride, xy* corners, int num_corners, int b); xy* fast9_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners); xy* nonmax_suppression(const xy* corners, const int* scores, int num_corners, int* ret_num_nonmax);
+ show +
17
18
19
20
#endif // clang-format on

[CVE-2020-0470_1.diff] fast.h #1
-int fast9_corner_score(const byte* p, const int pixel[], int bstart); +int aom_fast9_corner_score(const byte* p, const int pixel[], int bstart); -xy* fast9_detect(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners); +xy* aom_fast9_detect(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners); -int* fast9_score(const byte* i, int stride, xy* corners, int num_corners, int b); +int* aom_fast9_score(const byte* i, int stride, xy* corners, int num_corners, int b); -xy* fast9_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners); +xy* aom_fast9_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners); -xy* nonmax_suppression(const xy* corners, const int* scores, int num_corners, int* ret_num_nonmax); +xy* aom_nonmax_suppression(const xy* corners, const int* scores, int num_corners, int* ret_num_nonmax);
/media/esteban/ACOS/ResurrectionX/external/libaom/libaom/third_party/fastfeat/fast.h
1
2
3
4
5
6
7
// clang-format off #ifndef FAST_H #define FAST_H typedef struct { int x, y; } xy; typedef unsigned char byte;
+ show +
8
9
10
11
12
13
14
15
16
int fast9_corner_score(const byte* p, const int pixel[], int bstart); xy* fast9_detect(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners); int* fast9_score(const byte* i, int stride, xy* corners, int num_corners, int b); xy* fast9_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners); xy* nonmax_suppression(const xy* corners, const int* scores, int num_corners, int* ret_num_nonmax);
+ show +
17
18
19
20
#endif // clang-format on

[CVE-2023-21034_1.diff] SensorService.cpp #4
+ resetTargetSdkVersionCache(opPackageName); + resetTargetSdkVersionCache(opPackageName); + resetTargetSdkVersionCache(opPackageName); - { - Mutex::Autolock packageLock(sPackageTargetVersionLock); - auto iter = sPackageTargetVersion.find(c->mOpPackageName); - if (iter != sPackageTargetVersion.end()) { - sPackageTargetVersion.erase(iter); - } - } -
/media/esteban/ACOS/ResurrectionX/frameworks/native/services/sensorservice/SensorService.cpp
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
} } c->updateLooperRegistration(mLooper); mConnectionHolder.removeEventConnection(connection); BatteryService::cleanup(c->getUid()); if (c->needsWakeLock()) { checkWakeLockStateLocked(&connLock); } {
+ show +
1367
1368
1369
1370
Mutex::Autolock packageLock(sPackageTargetVersionLock); auto iter = sPackageTargetVersion.find(c->mOpPackageName); if (iter != sPackageTargetVersion.end()) { sPackageTargetVersion.erase(iter);
+ show +
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
} } SensorDevice& dev(SensorDevice::getInstance()); dev.notifyConnectionDestroyed(c); } void SensorService::cleanupConnection(SensorDirectConnection* c) { Mutex::Autolock _l(mLock);

[CVE-2021-39690_1.diff] SurfaceFlinger.cpp #2
+ mMaxRenderTargetSize = + std::min(getRenderEngine().getMaxTextureSize(), getRenderEngine().getMaxViewportDims()); -size_t SurfaceFlinger::getMaxTextureSize() const { - return getRenderEngine().getMaxTextureSize(); -} - -size_t SurfaceFlinger::getMaxViewportDims() const { - return getRenderEngine().getMaxViewportDims(); -} -
/media/esteban/ACOS/ResurrectionX/frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
727
728
729
730
731
732
733
734
735
736
void SurfaceFlinger::startBootAnim() { // Start boot animation service by setting a property mailbox // if property setting thread is already running, Start() will be just a NOP mStartPropertySetThread->Start(); // Wait until property was set if (mStartPropertySetThread->join() != NO_ERROR) { ALOGE("Join StartPropertySetThread failed!"); } }
+ show +
737
738
739
740
741
742
size_t SurfaceFlinger::getMaxTextureSize() const { return getRenderEngine().getMaxTextureSize(); } size_t SurfaceFlinger::getMaxViewportDims() const { return getRenderEngine().getMaxViewportDims();
+ show +
743
744
745
746
747
748
749
750
751
752
} // ---------------------------------------------------------------------------- bool SurfaceFlinger::authenticateSurfaceTexture( const sp<IGraphicBufferProducer>& bufferProducer) const { Mutex::Autolock _l(mStateLock); return authenticateSurfaceTextureLocked(bufferProducer); }

[CVE-2021-39690_1.diff] BufferQueueLayer.cpp #1
- uint32_t const maxSurfaceDims = - std::min(mFlinger->getMaxTextureSize(), mFlinger->getMaxViewportDims()); - - if ((uint32_t(w) > maxSurfaceDims) || (uint32_t(h) > maxSurfaceDims)) { - ALOGE("dimensions too large %u x %u", uint32_t(w), uint32_t(h)); + if (mFlinger->exceedsMaxRenderTargetSize(w, h)) { + ALOGE("dimensions too large %" PRIu32 " x %" PRIu32, w, h);
/media/esteban/ACOS/ResurrectionX/frameworks/native/services/surfaceflinger/BufferQueueLayer.cpp
546
547
548
549
550
551
552
553
554
555
if (!mFlinger->isLayerTripleBufferingDisabled()) { mProducer->setMaxDequeuedBufferCount(2); } if (const auto display = mFlinger->getDefaultDisplayDevice()) { updateTransformHint(display); } } status_t BufferQueueLayer::setDefaultBufferProperties(uint32_t w, uint32_t h, PixelFormat format) {
+ show +
556
557
558
559
560
561
562
uint32_t const maxSurfaceDims = std::min(mFlinger->getMaxTextureSize(), mFlinger->getMaxViewportDims()); // never allow a surface larger than what our underlying GL implementation // can handle. if ((uint32_t(w) > maxSurfaceDims) || (uint32_t(h) > maxSurfaceDims)) { ALOGE("dimensions too large %u x %u", uint32_t(w), uint32_t(h));
+ show +
563
564
565
566
567
568
569
570
571
572
return BAD_VALUE; } uint64_t usageBits = getEffectiveUsage(0); if (mName == FOD_LAYER_NAME) { usageBits = getFodUsageBits(usageBits, false); } else if (mName == FOD_TOUCHED_LAYER_NAME) { usageBits = getFodUsageBits(usageBits, true); }

[CVE-2021-1027_1.diff] Layer.cpp #1
- sp<Handle> handle = static_cast<Handle*>(relativeToHandle.get()); - if (handle == nullptr) { - return false; - } - sp<Layer> relative = handle->owner.promote(); + sp<Layer> relative = fromHandle(relativeToHandle).promote();
/media/esteban/ACOS/ResurrectionX/frameworks/native/services/surfaceflinger/Layer.cpp
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
} void Layer::setZOrderRelativeOf(const wp<Layer>& relativeOf) { mCurrentState.zOrderRelativeOf = relativeOf; mCurrentState.sequence++; mCurrentState.modified = true; setTransactionFlags(eTransactionNeeded); } bool Layer::setRelativeLayer(const sp<IBinder>& relativeToHandle, int32_t relativeZ) {
+ show +
1017
1018
1019
1020
1021
sp<Handle> handle = static_cast<Handle*>(relativeToHandle.get()); if (handle == nullptr) { return false; } sp<Layer> relative = handle->owner.promote();
+ show +
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
if (relative == nullptr) { return false; } if (mCurrentState.z == relativeZ && usingRelativeZ(LayerVector::StateSet::Current) && mCurrentState.zOrderRelativeOf == relative) { return false; } mCurrentState.sequence++;

[CVE-2021-1028_1.diff] Layer.cpp #1
- sp<Handle> handle = static_cast<Handle*>(relativeToHandle.get()); - if (handle == nullptr) { - return false; - } - sp<Layer> relative = handle->owner.promote(); + sp<Layer> relative = fromHandle(relativeToHandle).promote();
/media/esteban/ACOS/ResurrectionX/frameworks/native/services/surfaceflinger/Layer.cpp
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
} void Layer::setZOrderRelativeOf(const wp<Layer>& relativeOf) { mCurrentState.zOrderRelativeOf = relativeOf; mCurrentState.sequence++; mCurrentState.modified = true; setTransactionFlags(eTransactionNeeded); } bool Layer::setRelativeLayer(const sp<IBinder>& relativeToHandle, int32_t relativeZ) {
+ show +
1017
1018
1019
1020
1021
sp<Handle> handle = static_cast<Handle*>(relativeToHandle.get()); if (handle == nullptr) { return false; } sp<Layer> relative = handle->owner.promote();
+ show +
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
if (relative == nullptr) { return false; } if (mCurrentState.z == relativeZ && usingRelativeZ(LayerVector::StateSet::Current) && mCurrentState.zOrderRelativeOf == relative) { return false; } mCurrentState.sequence++;

[CVE-2021-1029_1.diff] Layer.cpp #1
- sp<Handle> handle = static_cast<Handle*>(relativeToHandle.get()); - if (handle == nullptr) { - return false; - } - sp<Layer> relative = handle->owner.promote(); + sp<Layer> relative = fromHandle(relativeToHandle).promote();
/media/esteban/ACOS/ResurrectionX/frameworks/native/services/surfaceflinger/Layer.cpp
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
} void Layer::setZOrderRelativeOf(const wp<Layer>& relativeOf) { mCurrentState.zOrderRelativeOf = relativeOf; mCurrentState.sequence++; mCurrentState.modified = true; setTransactionFlags(eTransactionNeeded); } bool Layer::setRelativeLayer(const sp<IBinder>& relativeToHandle, int32_t relativeZ) {
+ show +
1017
1018
1019
1020
1021
sp<Handle> handle = static_cast<Handle*>(relativeToHandle.get()); if (handle == nullptr) { return false; } sp<Layer> relative = handle->owner.promote();
+ show +
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
if (relative == nullptr) { return false; } if (mCurrentState.z == relativeZ && usingRelativeZ(LayerVector::StateSet::Current) && mCurrentState.zOrderRelativeOf == relative) { return false; } mCurrentState.sequence++;

[CVE-2023-21243_1.diff] NetworkSuggestionStoreDataTest.java #1
+ ActivityManager activityManager = context.getSystemService(ActivityManager.class); + mIsLowMemory = activityManager.isLowRamDevice(); + if (config.getServiceFriendlyNames() != null && isFromSuggestion) { + Log.e(TAG, "Passpoint from suggestion should not have ServiceFriendlyNames"); + return false; + } + if (getPasspointProviderWithPackage(packageName).size() + >= WifiManager.getMaxNumberOfNetworkSuggestionsPerApp(mIsLowMemory)) { + Log.e(TAG, "packageName " + packageName + " has too many passpoint with exceed the " + + "limitation"); + return false; + } - Map<String, String> friendlyNames = new HashMap<>(); - friendlyNames.put("en", friendlyName); - friendlyNames.put("kr", friendlyName + 1); - friendlyNames.put("jp", friendlyName + 2); - config.setServiceFriendlyNames(friendlyNames);
/media/esteban/ACOS/ResurrectionX/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java
257
258
259
260
261
262
263
264
265
266
* * @return {@link PasspointConfiguration} */ private PasspointConfiguration createTestConfigWithUserCredential(String fqdn, String friendlyName) { PasspointConfiguration config = new PasspointConfiguration(); HomeSp homeSp = new HomeSp(); homeSp.setFqdn(fqdn); homeSp.setFriendlyName(friendlyName); config.setHomeSp(homeSp);
+ show +
267
268
269
270
271
Map<String, String> friendlyNames = new HashMap<>(); friendlyNames.put("en", friendlyName); friendlyNames.put("kr", friendlyName + 1); friendlyNames.put("jp", friendlyName + 2); config.setServiceFriendlyNames(friendlyNames);
+ show +
272
273
274
275
276
277
278
279
280
281
Credential credential = new Credential(); credential.setRealm(TEST_REALM); credential.setCaCertificate(FakeKeys.CA_CERT0); Credential.UserCredential userCredential = new Credential.UserCredential(); userCredential.setUsername("username"); userCredential.setPassword("password"); userCredential.setEapType(EAPConstants.EAP_TTLS); userCredential.setNonEapInnerMethod(Credential.UserCredential.AUTH_METHOD_MSCHAP); credential.setUserCredential(userCredential); config.setCredential(credential);

[CVE-2023-21243_1.diff] WifiNetworkSuggestionsManagerTest.java #1
- Map<String, String> friendlyNames = new HashMap<>(); - friendlyNames.put("en", friendlyName); - friendlyNames.put("kr", friendlyName + 1); - friendlyNames.put("jp", friendlyName + 2); - config.setServiceFriendlyNames(friendlyNames);
/media/esteban/ACOS/ResurrectionX/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java
257
258
259
260
261
262
263
264
265
266
* * @return {@link PasspointConfiguration} */ private PasspointConfiguration createTestConfigWithUserCredential(String fqdn, String friendlyName) { PasspointConfiguration config = new PasspointConfiguration(); HomeSp homeSp = new HomeSp(); homeSp.setFqdn(fqdn); homeSp.setFriendlyName(friendlyName); config.setHomeSp(homeSp);
+ show +
267
268
269
270
271
Map<String, String> friendlyNames = new HashMap<>(); friendlyNames.put("en", friendlyName); friendlyNames.put("kr", friendlyName + 1); friendlyNames.put("jp", friendlyName + 2); config.setServiceFriendlyNames(friendlyNames);
+ show +
272
273
274
275
276
277
278
279
280
281
Credential credential = new Credential(); credential.setRealm(TEST_REALM); credential.setCaCertificate(FakeKeys.CA_CERT0); Credential.UserCredential userCredential = new Credential.UserCredential(); userCredential.setUsername("username"); userCredential.setPassword("password"); userCredential.setEapType(EAPConstants.EAP_TTLS); userCredential.setNonEapInnerMethod(Credential.UserCredential.AUTH_METHOD_MSCHAP); credential.setUserCredential(userCredential); config.setCredential(credential);

[CVE-2023-21243_1.diff] PasspointManagerTest.java #4
+import android.app.ActivityManager; + @Mock ActivityManager mActivityManager; + when(mContext.getSystemService(ActivityManager.class)).thenReturn(mActivityManager); - Map<String, String> friendlyNames = new HashMap<>(); - friendlyNames.put("en", friendlyName); - friendlyNames.put("kr", friendlyName + 1); - friendlyNames.put("jp", friendlyName + 2); - config.setServiceFriendlyNames(friendlyNames);
/media/esteban/ACOS/ResurrectionX/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java
257
258
259
260
261
262
263
264
265
266
* * @return {@link PasspointConfiguration} */ private PasspointConfiguration createTestConfigWithUserCredential(String fqdn, String friendlyName) { PasspointConfiguration config = new PasspointConfiguration(); HomeSp homeSp = new HomeSp(); homeSp.setFqdn(fqdn); homeSp.setFriendlyName(friendlyName); config.setHomeSp(homeSp);
+ show +
267
268
269
270
271
Map<String, String> friendlyNames = new HashMap<>(); friendlyNames.put("en", friendlyName); friendlyNames.put("kr", friendlyName + 1); friendlyNames.put("jp", friendlyName + 2); config.setServiceFriendlyNames(friendlyNames);
+ show +
272
273
274
275
276
277
278
279
280
281
Credential credential = new Credential(); credential.setRealm(TEST_REALM); credential.setCaCertificate(FakeKeys.CA_CERT0); Credential.UserCredential userCredential = new Credential.UserCredential(); userCredential.setUsername("username"); userCredential.setPassword("password"); userCredential.setEapType(EAPConstants.EAP_TTLS); userCredential.setNonEapInnerMethod(Credential.UserCredential.AUTH_METHOD_MSCHAP); credential.setUserCredential(userCredential); config.setCredential(credential);

[CVE-2023-20920_1.diff] UsbRequest.java #1
+ * This is meant to be called by UsbRequest's queue() in order to synchronize on + * UsbDeviceConnection's mLock to prevent the connection being closed while queueing. + */ + /* package */ boolean queueRequest(UsbRequest request, ByteBuffer buffer, int length) { + synchronized (mLock) { + if (!isOpen()) { + return false; + } + + return request.queueIfConnectionOpen(buffer, length); + } + } + + /** + * This is meant to be called by UsbRequest's queue() in order to synchronize on + * UsbDeviceConnection's mLock to prevent the connection being closed while queueing. + */ + /* package */ boolean queueRequest(UsbRequest request, @Nullable ByteBuffer buffer) { + synchronized (mLock) { + if (!isOpen()) { + return false; + } + + return request.queueIfConnectionOpen(buffer); + } + } + + /** - if (mNativeContext != 0) { - mEndpoint = null; - mConnection = null; - native_close(); - mCloseGuard.close(); + synchronized (mLock) { + if (mNativeContext != 0) { + mEndpoint = null; + mConnection = null; + native_close(); + mCloseGuard.close(); + }
/media/esteban/ACOS/ResurrectionX/frameworks/base/core/java/android/hardware/usb/UsbRequest.java
105
106
107
108
109
110
111
112
113
114
mCloseGuard.open("close"); } return wasInitialized; } /** * Releases all resources related to this request. */ public void close() {
+ show +
115
116
117
118
119
if (mNativeContext != 0) { mEndpoint = null; mConnection = null; native_close(); mCloseGuard.close();
+ show +
120
121
122
123
124
125
126
127
128
129
} } @Override protected void finalize() throws Throwable { try { if (mCloseGuard != null) { mCloseGuard.warnIfOpen(); }

[CVE-2021-0928_1.diff] VendorTagDescriptorCache.java #1
- try { - VendorTagDescriptorCache vendorDescriptorCache = new VendorTagDescriptorCache(source); - return vendorDescriptorCache; - } catch (Exception e) { - Log.e(TAG, "Exception creating VendorTagDescriptorCache from parcel", e); - return null; - } + return new VendorTagDescriptorCache(source);
/media/esteban/ACOS/ResurrectionX/frameworks/base/core/java/android/hardware/camera2/params/VendorTagDescriptorCache.java
29
30
31
32
33
34
35
36
37
38
*/ public final class VendorTagDescriptorCache implements Parcelable { private VendorTagDescriptorCache(Parcel source) { } public static final @android.annotation.NonNull Parcelable.Creator<VendorTagDescriptorCache> CREATOR = new Parcelable.Creator<VendorTagDescriptorCache>() { @Override public VendorTagDescriptorCache createFromParcel(Parcel source) {
+ show +
39
40
41
42
43
44
try { VendorTagDescriptorCache vendorDescriptorCache = new VendorTagDescriptorCache(source); return vendorDescriptorCache; } catch (Exception e) { Log.e(TAG, "Exception creating VendorTagDescriptorCache from parcel", e); return null;
+ show +
45
46
47
48
49
50
51
52
53
54
} } @Override public VendorTagDescriptorCache[] newArray(int size) { return new VendorTagDescriptorCache[size]; } }; @Override

[CVE-2021-0928_1.diff] OutputConfiguration.java #1
- try { - OutputConfiguration outputConfiguration = new OutputConfiguration(source); - return outputConfiguration; - } catch (Exception e) { - Log.e(TAG, "Exception creating OutputConfiguration from parcel", e); - return null; - } + return new OutputConfiguration(source);
/media/esteban/ACOS/ResurrectionX/frameworks/base/core/java/android/hardware/camera2/params/OutputConfiguration.java
624
625
626
627
628
629
630
631
632
633
* The default value is {@value #SURFACE_GROUP_ID_NONE}. */ public int getSurfaceGroupId() { return mSurfaceGroupId; } public static final @android.annotation.NonNull Parcelable.Creator<OutputConfiguration> CREATOR = new Parcelable.Creator<OutputConfiguration>() { @Override public OutputConfiguration createFromParcel(Parcel source) {
+ show +
634
635
636
637
638
639
try { OutputConfiguration outputConfiguration = new OutputConfiguration(source); return outputConfiguration; } catch (Exception e) { Log.e(TAG, "Exception creating OutputConfiguration from parcel", e); return null;
+ show +
640
641
642
643
644
645
646
647
648
649
} } @Override public OutputConfiguration[] newArray(int size) { return new OutputConfiguration[size]; } }; @Override

[CVE-2021-0928_1.diff] SessionConfiguration.java #1
- try { - SessionConfiguration sessionConfiguration = new SessionConfiguration(source); - return sessionConfiguration; - } catch (Exception e) { - Log.e(TAG, "Exception creating SessionConfiguration from parcel", e); - return null; - } + return new SessionConfiguration(source);
/media/esteban/ACOS/ResurrectionX/frameworks/base/core/java/android/hardware/camera2/params/SessionConfiguration.java
131
132
133
134
135
136
137
138
139
140
mInputConfig = new InputConfiguration(inputWidth, inputHeight, inputFormat); } mSessionType = sessionType; mOutputConfigurations = outConfigs; } public static final @android.annotation.NonNull Parcelable.Creator<SessionConfiguration> CREATOR = new Parcelable.Creator<SessionConfiguration> () { @Override public SessionConfiguration createFromParcel(Parcel source) {
+ show +
141
142
143
144
145
146
try { SessionConfiguration sessionConfiguration = new SessionConfiguration(source); return sessionConfiguration; } catch (Exception e) { Log.e(TAG, "Exception creating SessionConfiguration from parcel", e); return null;
+ show +
147
148
149
150
151
152
153
154
155
156
} } @Override public SessionConfiguration[] newArray(int size) { return new SessionConfiguration[size]; } }; @Override

[CVE-2021-0928_1.diff] VendorTagDescriptor.java #1
- try { - VendorTagDescriptor vendorDescriptor = new VendorTagDescriptor(source); - return vendorDescriptor; - } catch (Exception e) { - Log.e(TAG, "Exception creating VendorTagDescriptor from parcel", e); - return null; - } + return new VendorTagDescriptor(source);
/media/esteban/ACOS/ResurrectionX/frameworks/base/core/java/android/hardware/camera2/params/VendorTagDescriptor.java
29
30
31
32
33
34
35
36
37
38
*/ public final class VendorTagDescriptor implements Parcelable { private VendorTagDescriptor(Parcel source) { } public static final @android.annotation.NonNull Parcelable.Creator<VendorTagDescriptor> CREATOR = new Parcelable.Creator<VendorTagDescriptor>() { @Override public VendorTagDescriptor createFromParcel(Parcel source) {
+ show +
39
40
41
42
43
44
try { VendorTagDescriptor vendorDescriptor = new VendorTagDescriptor(source); return vendorDescriptor; } catch (Exception e) { Log.e(TAG, "Exception creating VendorTagDescriptor from parcel", e); return null;
+ show +
45
46
47
48
49
50
51
52
53
54
} } @Override public VendorTagDescriptor[] newArray(int size) { return new VendorTagDescriptor[size]; } }; @Override

[CVE-2022-20142_1.diff] GeofenceHardwareRequestParcelable.java #2
- if(geofenceType != GeofenceHardwareRequest.GEOFENCE_TYPE_CIRCLE) { - Log.e( - "GeofenceHardwareRequest", - String.format("Invalid Geofence type: %d", geofenceType)); - return null; + if (geofenceType != GeofenceHardwareRequest.GEOFENCE_TYPE_CIRCLE) { + throw new BadParcelableException("Invalid Geofence type: " + geofenceType);
/media/esteban/ACOS/ResurrectionX/frameworks/base/core/java/android/hardware/location/GeofenceHardwareRequestParcelable.java
132
133
134
135
136
137
138
139
140
141
} /** * Method definitions to support Parcelable operations. */ public static final @android.annotation.NonNull Parcelable.Creator<GeofenceHardwareRequestParcelable> CREATOR = new Parcelable.Creator<GeofenceHardwareRequestParcelable>() { @Override public GeofenceHardwareRequestParcelable createFromParcel(Parcel parcel) { int geofenceType = parcel.readInt();
+ show +
142
143
144
145
146
if(geofenceType != GeofenceHardwareRequest.GEOFENCE_TYPE_CIRCLE) { Log.e( "GeofenceHardwareRequest", String.format("Invalid Geofence type: %d", geofenceType)); return null;
+ show +
147
148
149
150
151
152
153
154
155
156
} GeofenceHardwareRequest request = GeofenceHardwareRequest.createCircularGeofence( parcel.readDouble(), parcel.readDouble(), parcel.readDouble()); request.setLastTransition(parcel.readInt()); request.setMonitorTransitions(parcel.readInt()); request.setUnknownTimer(parcel.readInt()); request.setNotificationResponsiveness(parcel.readInt());

[CVE-2023-21143_1.diff] AppWidgetHostView.java #2
+import android.graphics.Canvas; - removeViewInLayout(mView); - View child = getErrorView(); - prepareView(child); - addViewInLayout(child, 0, child.getLayoutParams()); - measureChild(child, MeasureSpec.makeMeasureSpec(getMeasuredWidth(), MeasureSpec.EXACTLY), - MeasureSpec.makeMeasureSpec(getMeasuredHeight(), MeasureSpec.EXACTLY)); - child.layout(0, 0, child.getMeasuredWidth() + mPaddingLeft + mPaddingRight, - child.getMeasuredHeight() + mPaddingTop + mPaddingBottom); - mView = child; - mViewMode = VIEW_MODE_ERROR; + handleViewError(); + * Remove bad view and replace with error message view + */ + private void handleViewError() { + removeViewInLayout(mView); + View child = getErrorView(); + prepareView(child); + addViewInLayout(child, 0, child.getLayoutParams()); + measureChild(child, MeasureSpec.makeMeasureSpec(getMeasuredWidth(), MeasureSpec.EXACTLY), + MeasureSpec.makeMeasureSpec(getMeasuredHeight(), MeasureSpec.EXACTLY)); + child.layout(0, 0, child.getMeasuredWidth() + mPaddingLeft + mPaddingRight, + child.getMeasuredHeight() + mPaddingTop + mPaddingBottom); + mView = child; + mViewMode = VIEW_MODE_ERROR; + } + + /**
/media/esteban/ACOS/ResurrectionX/frameworks/base/core/java/android/appwidget/AppWidgetHostView.java
243
244
245
246
247
248
249
250
251
252
+ (mInfo == null ? "null" : mInfo.provider), e); } } @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { try { super.onLayout(changed, left, top, right, bottom); } catch (final RuntimeException e) { Log.e(TAG, "Remote provider threw runtime exception, using error view instead.", e);
+ show +
253
254
255
256
257
258
259
260
261
262
removeViewInLayout(mView); View child = getErrorView(); prepareView(child); addViewInLayout(child, 0, child.getLayoutParams()); measureChild(child, MeasureSpec.makeMeasureSpec(getMeasuredWidth(), MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(getMeasuredHeight(), MeasureSpec.EXACTLY)); child.layout(0, 0, child.getMeasuredWidth() + mPaddingLeft + mPaddingRight, child.getMeasuredHeight() + mPaddingTop + mPaddingBottom); mView = child; mViewMode = VIEW_MODE_ERROR;
+ show +
263
264
265
266
267
268
269
270
271
272
} } /** * Provide guidance about the size of this widget to the AppWidgetManager. The widths and * heights should correspond to the full area the AppWidgetHostView is given. Padding added by * the framework will be accounted for automatically. This information gets embedded into the * AppWidget options and causes a callback to the AppWidgetProvider. * @see AppWidgetProvider#onAppWidgetOptionsChanged(Context, AppWidgetManager, int, Bundle) *

[CVE-2022-20493_1.diff] Condition.java #2
+ * The maximum string length for any string contained in this condition. + * @hide + */ + public static final int MAX_STRING_LENGTH = 1000; + + /** - this.id = id; - this.summary = summary; - this.line1 = line1; - this.line2 = line2; + this.id = getTrimmedUri(id); + this.summary = getTrimmedString(summary); + this.line1 = getTrimmedString(line1); + this.line2 = getTrimmedString(line2); + // This constructor passes all fields directly into the constructor that takes all the + // fields as arguments; that constructor will trim each of the input strings to + // max length if necessary.
/media/esteban/ACOS/ResurrectionX/frameworks/base/core/java/android/service/notification/Condition.java
96
97
98
99
100
101
102
103
104
105
*/ public Condition(Uri id, String summary, int state) { this(id, summary, "", "", -1, state, FLAG_RELEVANT_ALWAYS); } public Condition(Uri id, String summary, String line1, String line2, int icon, int state, int flags) { if (id == null) throw new IllegalArgumentException("id is required"); if (summary == null) throw new IllegalArgumentException("summary is required"); if (!isValidState(state)) throw new IllegalArgumentException("state is invalid: " + state);
+ show +
106
107
108
109
this.id = id; this.summary = summary; this.line1 = line1; this.line2 = line2;
+ show +
110
111
112
113
114
115
116
117
118
119
this.icon = icon; this.state = state; this.flags = flags; } public Condition(Parcel source) { this((Uri)source.readParcelable(Condition.class.getClassLoader()), source.readString(), source.readString(), source.readString(),

[CVE-2022-20494_1.diff] AutomaticZenRule.java #2
+ * The maximum string length for any string contained in this automatic zen rule. This pertains + * both to fields in the rule itself (such as its name) and items with sub-fields. + * @hide + */ + public static final int MAX_STRING_LENGTH = 1000; + + /** - this.name = name; - this.owner = owner; - this.configurationActivity = configurationActivity; - this.conditionId = conditionId; + this.name = getTrimmedString(name); + this.owner = getTrimmedComponentName(owner); + this.configurationActivity = getTrimmedComponentName(configurationActivity); + this.conditionId = getTrimmedUri(conditionId);
/media/esteban/ACOS/ResurrectionX/frameworks/base/core/java/android/app/AutomaticZenRule.java
85
86
87
88
89
90
91
92
93
94
* interrupt the user (e.g. via sound &amp; vibration) while this rule * is active. * @param policy The policy defines which notifications are allowed to interrupt the user * while this rule is active. This overrides the global policy while this rule is * action ({@link Condition#STATE_TRUE}). * @param enabled Whether the rule is enabled. */ public AutomaticZenRule(@NonNull String name, @Nullable ComponentName owner, @Nullable ComponentName configurationActivity, @NonNull Uri conditionId, @Nullable ZenPolicy policy, int interruptionFilter, boolean enabled) {
+ show +
95
96
97
98
this.name = name; this.owner = owner; this.configurationActivity = configurationActivity; this.conditionId = conditionId;
+ show +
99
100
101
102
103
104
105
106
107
108
this.interruptionFilter = interruptionFilter; this.enabled = enabled; this.mZenPolicy = policy; } /** * @hide */ public AutomaticZenRule(String name, ComponentName owner, ComponentName configurationActivity, Uri conditionId, ZenPolicy policy, int interruptionFilter, boolean enabled,

[CVE-2022-20456_1.diff] AutomaticZenRule.java #2
+ * The maximum string length for any string contained in this automatic zen rule. This pertains + * both to fields in the rule itself (such as its name) and items with sub-fields. + * @hide + */ + public static final int MAX_STRING_LENGTH = 1000; + + /** - this.name = name; - this.owner = owner; - this.configurationActivity = configurationActivity; - this.conditionId = conditionId; + this.name = getTrimmedString(name); + this.owner = getTrimmedComponentName(owner); + this.configurationActivity = getTrimmedComponentName(configurationActivity); + this.conditionId = getTrimmedUri(conditionId);
/media/esteban/ACOS/ResurrectionX/frameworks/base/core/java/android/app/AutomaticZenRule.java
85
86
87
88
89
90
91
92
93
94
* interrupt the user (e.g. via sound &amp; vibration) while this rule * is active. * @param policy The policy defines which notifications are allowed to interrupt the user * while this rule is active. This overrides the global policy while this rule is * action ({@link Condition#STATE_TRUE}). * @param enabled Whether the rule is enabled. */ public AutomaticZenRule(@NonNull String name, @Nullable ComponentName owner, @Nullable ComponentName configurationActivity, @NonNull Uri conditionId, @Nullable ZenPolicy policy, int interruptionFilter, boolean enabled) {
+ show +
95
96
97
98
this.name = name; this.owner = owner; this.configurationActivity = configurationActivity; this.conditionId = conditionId;
+ show +
99
100
101
102
103
104
105
106
107
108
this.interruptionFilter = interruptionFilter; this.enabled = enabled; this.mZenPolicy = policy; } /** * @hide */ public AutomaticZenRule(String name, ComponentName owner, ComponentName configurationActivity, Uri conditionId, ZenPolicy policy, int interruptionFilter, boolean enabled,

[CVE-2022-20490_1.diff] AutomaticZenRule.java #2
+ * The maximum string length for any string contained in this automatic zen rule. This pertains + * both to fields in the rule itself (such as its name) and items with sub-fields. + * @hide + */ + public static final int MAX_STRING_LENGTH = 1000; + + /** - this.name = name; - this.owner = owner; - this.configurationActivity = configurationActivity; - this.conditionId = conditionId; + this.name = getTrimmedString(name); + this.owner = getTrimmedComponentName(owner); + this.configurationActivity = getTrimmedComponentName(configurationActivity); + this.conditionId = getTrimmedUri(conditionId);
/media/esteban/ACOS/ResurrectionX/frameworks/base/core/java/android/app/AutomaticZenRule.java
85
86
87
88
89
90
91
92
93
94
* interrupt the user (e.g. via sound &amp; vibration) while this rule * is active. * @param policy The policy defines which notifications are allowed to interrupt the user * while this rule is active. This overrides the global policy while this rule is * action ({@link Condition#STATE_TRUE}). * @param enabled Whether the rule is enabled. */ public AutomaticZenRule(@NonNull String name, @Nullable ComponentName owner, @Nullable ComponentName configurationActivity, @NonNull Uri conditionId, @Nullable ZenPolicy policy, int interruptionFilter, boolean enabled) {
+ show +
95
96
97
98
this.name = name; this.owner = owner; this.configurationActivity = configurationActivity; this.conditionId = conditionId;
+ show +
99
100
101
102
103
104
105
106
107
108
this.interruptionFilter = interruptionFilter; this.enabled = enabled; this.mZenPolicy = policy; } /** * @hide */ public AutomaticZenRule(String name, ComponentName owner, ComponentName configurationActivity, Uri conditionId, ZenPolicy policy, int interruptionFilter, boolean enabled,

[CVE-2022-20492_1.diff] AutomaticZenRule.java #2
+ * The maximum string length for any string contained in this automatic zen rule. This pertains + * both to fields in the rule itself (such as its name) and items with sub-fields. + * @hide + */ + public static final int MAX_STRING_LENGTH = 1000; + + /** - this.name = name; - this.owner = owner; - this.configurationActivity = configurationActivity; - this.conditionId = conditionId; + this.name = getTrimmedString(name); + this.owner = getTrimmedComponentName(owner); + this.configurationActivity = getTrimmedComponentName(configurationActivity); + this.conditionId = getTrimmedUri(conditionId);
/media/esteban/ACOS/ResurrectionX/frameworks/base/core/java/android/app/AutomaticZenRule.java
85
86
87
88
89
90
91
92
93
94
* interrupt the user (e.g. via sound &amp; vibration) while this rule * is active. * @param policy The policy defines which notifications are allowed to interrupt the user * while this rule is active. This overrides the global policy while this rule is * action ({@link Condition#STATE_TRUE}). * @param enabled Whether the rule is enabled. */ public AutomaticZenRule(@NonNull String name, @Nullable ComponentName owner, @Nullable ComponentName configurationActivity, @NonNull Uri conditionId, @Nullable ZenPolicy policy, int interruptionFilter, boolean enabled) {
+ show +
95
96
97
98
this.name = name; this.owner = owner; this.configurationActivity = configurationActivity; this.conditionId = conditionId;
+ show +
99
100
101
102
103
104
105
106
107
108
this.interruptionFilter = interruptionFilter; this.enabled = enabled; this.mZenPolicy = policy; } /** * @hide */ public AutomaticZenRule(String name, ComponentName owner, ComponentName configurationActivity, Uri conditionId, ZenPolicy policy, int interruptionFilter, boolean enabled,

[CVE-2022-20489_1.diff] AutomaticZenRule.java #2
+ * The maximum string length for any string contained in this automatic zen rule. This pertains + * both to fields in the rule itself (such as its name) and items with sub-fields. + * @hide + */ + public static final int MAX_STRING_LENGTH = 1000; + + /** - this.name = name; - this.owner = owner; - this.configurationActivity = configurationActivity; - this.conditionId = conditionId; + this.name = getTrimmedString(name); + this.owner = getTrimmedComponentName(owner); + this.configurationActivity = getTrimmedComponentName(configurationActivity); + this.conditionId = getTrimmedUri(conditionId);
/media/esteban/ACOS/ResurrectionX/frameworks/base/core/java/android/app/AutomaticZenRule.java
85
86
87
88
89
90
91
92
93
94
* interrupt the user (e.g. via sound &amp; vibration) while this rule * is active. * @param policy The policy defines which notifications are allowed to interrupt the user * while this rule is active. This overrides the global policy while this rule is * action ({@link Condition#STATE_TRUE}). * @param enabled Whether the rule is enabled. */ public AutomaticZenRule(@NonNull String name, @Nullable ComponentName owner, @Nullable ComponentName configurationActivity, @NonNull Uri conditionId, @Nullable ZenPolicy policy, int interruptionFilter, boolean enabled) {
+ show +
95
96
97
98
this.name = name; this.owner = owner; this.configurationActivity = configurationActivity; this.conditionId = conditionId;
+ show +
99
100
101
102
103
104
105
106
107
108
this.interruptionFilter = interruptionFilter; this.enabled = enabled; this.mZenPolicy = policy; } /** * @hide */ public AutomaticZenRule(String name, ComponentName owner, ComponentName configurationActivity, Uri conditionId, ZenPolicy policy, int interruptionFilter, boolean enabled,

[CVE-2023-40121_1.diff] DatabaseUtils.java #1
- if (sqlString.indexOf('\'') != -1) { - int length = sqlString.length(); - for (int i = 0; i < length; i++) { - char c = sqlString.charAt(i); - if (c == '\'') { - sb.append('\''); + int length = sqlString.length(); + for (int i = 0; i < length; i++) { + char c = sqlString.charAt(i); + if (Character.isHighSurrogate(c)) { + if (i == length - 1) { + continue; - sb.append(c); + if (Character.isLowSurrogate(sqlString.charAt(i + 1))) { + // add them both + sb.append(c); + sb.append(sqlString.charAt(i + 1)); + continue; + } else { + // this is a lone surrogate, skip it + continue; + } - } else - sb.append(sqlString); + if (Character.isLowSurrogate(c)) { + continue; + } + if (c == '\'') { + sb.append('\''); + } + sb.append(c); + }
/media/esteban/ACOS/ResurrectionX/frameworks/base/core/java/android/database/DatabaseUtils.java
422
423
424
425
426
427
428
429
430
431
* internal bindings. In that case, it may be necessary to * construct a WHERE clause manually. This method is useful for * those cases. * * @param sb the StringBuilder that the SQL string will be appended to * @param sqlString the raw string to be appended, which may contain single * quotes */ public static void appendEscapedSQLString(StringBuilder sb, String sqlString) { sb.append('\'');
+ show +
432
433
434
435
436
437
438
439
440
441
442
if (sqlString.indexOf('\'') != -1) { int length = sqlString.length(); for (int i = 0; i < length; i++) { char c = sqlString.charAt(i); if (c == '\'') { sb.append('\''); } sb.append(c); } } else sb.append(sqlString);
+ show +
443
444
445
446
447
448
449
450
451
452
sb.append('\''); } /** * SQL-escape a string. */ public static String sqlEscapeString(String value) { StringBuilder escaper = new StringBuilder(); DatabaseUtils.appendEscapedSQLString(escaper, value);

[CVE-2021-0547_1.diff] NetInitiatedActivity.java #3
- /** Used to detect when NI request is received */ - private BroadcastReceiver mNetInitiatedReceiver = new BroadcastReceiver() { - @Override - public void onReceive(Context context, Intent intent) { - if (DEBUG) Log.d(TAG, "NetInitiatedReceiver onReceive: " + intent.getAction()); - if (intent.getAction() == GpsNetInitiatedHandler.ACTION_NI_VERIFY) { - handleNIVerify(intent); - } - } - }; -
/media/esteban/ACOS/ResurrectionX/frameworks/base/core/java/com/android/internal/app/NetInitiatedActivity.java
48
49
50
51
52
53
54
55
56
57
private static final int NEGATIVE_BUTTON = AlertDialog.BUTTON_NEGATIVE; private static final int GPS_NO_RESPONSE_TIME_OUT = 1; // Received ID from intent, -1 when no notification is in progress private int notificationId = -1; private int timeout = -1; private int default_response = -1; private int default_response_timeout = 6; /** Used to detect when NI request is received */
+ show +
58
59
60
61
62
63
64
65
66
private BroadcastReceiver mNetInitiatedReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (DEBUG) Log.d(TAG, "NetInitiatedReceiver onReceive: " + intent.getAction()); if (intent.getAction() == GpsNetInitiatedHandler.ACTION_NI_VERIFY) { handleNIVerify(intent); } } };
+ show +
67
68
69
70
71
72
73
74
75
76
private final Handler mHandler = new Handler() { public void handleMessage(Message msg) { switch (msg.what) { case GPS_NO_RESPONSE_TIME_OUT: { if (notificationId != -1) { sendUserResponse(default_response); } finish(); }

[CVE-2021-0970_1.diff] GpsNavigationMessage.java #1
- if (parcel.dataAvail() >= Integer.SIZE) { - int status = parcel.readInt(); - navigationMessage.setStatus((short) status); - } else { - navigationMessage.setStatus(STATUS_UNKNOWN); - } + int status = parcel.readInt(); + navigationMessage.setStatus((short) status);
/media/esteban/ACOS/ResurrectionX/frameworks/base/location/java/android/location/GpsNavigationMessage.java
252
253
254
255
256
257
258
259
260
261
navigationMessage.setType(parcel.readByte()); navigationMessage.setPrn(parcel.readByte()); navigationMessage.setMessageId((short) parcel.readInt()); navigationMessage.setSubmessageId((short) parcel.readInt()); int dataLength = parcel.readInt(); byte[] data = new byte[dataLength]; parcel.readByteArray(data); navigationMessage.setData(data);
+ show +
262
263
264
265
266
if (parcel.dataAvail() >= Integer.SIZE) { int status = parcel.readInt(); navigationMessage.setStatus((short) status); } else { navigationMessage.setStatus(STATUS_UNKNOWN);
+ show +
267
268
269
270
271
272
273
274
275
276
} return navigationMessage; } @Override public GpsNavigationMessage[] newArray(int size) { return new GpsNavigationMessage[size]; } };

[CVE-2022-20415_1.diff] NotificationInterruptStateProviderImpl.java #2
- boolean isDreaming = false; - try { - isDreaming = mDreamManager.isDreaming(); - } catch (RemoteException e) { - Log.e(TAG, "Failed to query dream manager.", e); - } - boolean inUse = mPowerManager.isScreenOn() && !isDreaming; + boolean inUse = mPowerManager.isScreenOn() && !isDreaming();
/media/esteban/ACOS/ResurrectionX/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationInterruptionStateProvider.java
284
285
286
287
288
289
290
291
292
293
return false; } if (!isMediaPlayerNotification && entry.importance < NotificationManager.IMPORTANCE_HIGH) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: unimportant notification: " + sbn.getKey()); } return false; }
+ show +
294
295
296
297
298
299
300
boolean isDreaming = false; try { isDreaming = mDreamManager.isDreaming(); } catch (RemoteException e) { Log.e(TAG, "Failed to query dream manager.", e); } boolean inUse = mPowerManager.isScreenOn() && !isDreaming;
+ show +
301
302
303
304
305
306
307
308
309
310
if (!inUse) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: not in use: " + sbn.getKey()); } return false; } if (!mHeadsUpSuppressor.canHeadsUp(entry, sbn)) { if (DEBUG_HEADS_UP) {

[CVE-2021-0571_1.diff] ActivityTaskManagerService.java #7
+ assertPackageMatchesCallingUid(callingPackage); + assertPackageMatchesCallingUid(callingPackage); + assertPackageMatchesCallingUid(callingPackage); + assertPackageMatchesCallingUid(callingPackage); - - if (!isSameApp(callingUid, callingPackage)) { - String msg = "Permission Denial: moveTaskToFrontLocked() from pid=" - + Binder.getCallingPid() + " as package " + callingPackage; - Slog.w(TAG, msg); - throw new SecurityException(msg); - } + assertPackageMatchesCallingUid(callingPackage);
/media/esteban/ACOS/ResurrectionX/frameworks/base/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
SafeActivityOptions.fromBundle(bOptions), false /* fromRecents */); } } void moveTaskToFrontLocked(@Nullable IApplicationThread appThread, @Nullable String callingPackage, int taskId, int flags, SafeActivityOptions options, boolean fromRecents) { final int callingPid = Binder.getCallingPid(); final int callingUid = Binder.getCallingUid();
+ show +
2404
2405
2406
2407
2408
if (!isSameApp(callingUid, callingPackage)) { String msg = "Permission Denial: moveTaskToFrontLocked() from pid=" + Binder.getCallingPid() + " as package " + callingPackage; Slog.w(TAG, msg); throw new SecurityException(msg);
+ show +
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
} if (!checkAppSwitchAllowedLocked(callingPid, callingUid, -1, -1, "Task to front")) { SafeActivityOptions.abort(options); return; } final long origId = Binder.clearCallingIdentity(); WindowProcessController callerApp = null; if (appThread != null) { callerApp = getProcessController(appThread); }

[CVE-2024-0036_1.diff] ActivityTaskManagerService.java #2
- Binder.restoreCallingIdentity(origId); - - r.finishing = wasFinishing; - if (res != ActivityManager.START_SUCCESS) { - return false; + r.finishing = wasFinishing; + return res == ActivityManager.START_SUCCESS; + } finally { + Binder.restoreCallingIdentity(origId); - return true;
/media/esteban/ACOS/ResurrectionX/frameworks/base/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
.setResultTo(resultTo != null ? resultTo.appToken : null) .setResultWho(resultWho) .setRequestCode(requestCode) .setCallingPid(-1) .setCallingUid(r.launchedFromUid) .setCallingPackage(r.launchedFromPackage) .setRealCallingPid(-1) .setRealCallingUid(r.launchedFromUid) .setActivityOptions(options) .execute();
+ show +
1208
1209
1210
1211
1212
1213
1214
Binder.restoreCallingIdentity(origId); r.finishing = wasFinishing; if (res != ActivityManager.START_SUCCESS) { return false; } return true;
+ show +
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
} } @Override public final WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage, Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle bOptions, int userId) { final WaitResult res = new WaitResult(); synchronized (mGlobalLock) { enforceNotIsolatedCaller("startActivityAndWait");

[CVE-2021-0442_1.diff] TaskPositioner.java #1
- mDragApplicationHandle = new InputApplicationHandle(new Binder()); - mDragApplicationHandle.name = TAG; - mDragApplicationHandle.dispatchingTimeoutNanos = - WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS; + mDragApplicationHandle = new InputApplicationHandle(new Binder(), TAG, + WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS);
/media/esteban/ACOS/ResurrectionX/frameworks/base/services/core/java/com/android/server/wm/TaskPositioner.java
259
260
261
262
263
264
265
266
267
268
display.getMetrics(mDisplayMetrics); final InputChannel[] channels = InputChannel.openInputChannelPair(TAG); mServerChannel = channels[0]; mClientChannel = channels[1]; mService.mInputManager.registerInputChannel(mServerChannel, null); mInputEventReceiver = new WindowPositionerEventReceiver( mClientChannel, mService.mAnimationHandler.getLooper(), mService.mAnimator.getChoreographer());
+ show +
269
270
271
272
mDragApplicationHandle = new InputApplicationHandle(new Binder()); mDragApplicationHandle.name = TAG; mDragApplicationHandle.dispatchingTimeoutNanos = WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS;
+ show +
273
274
275
276
277
278
279
280
281
282
mDragWindowHandle = new InputWindowHandle(mDragApplicationHandle, null, display.getDisplayId()); mDragWindowHandle.name = TAG; mDragWindowHandle.token = mServerChannel.getToken(); mDragWindowHandle.layer = mService.getDragLayerLocked(); mDragWindowHandle.layoutParamsFlags = 0; mDragWindowHandle.layoutParamsType = WindowManager.LayoutParams.TYPE_DRAG; mDragWindowHandle.dispatchingTimeoutNanos = WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS;

[CVE-2022-20543_1.diff] WindowManagerService.java #2
+import static android.view.WindowManager.fixScale; - mTransitionAnimationScaleSetting = Settings.Global.getFloat(resolver, - Settings.Global.TRANSITION_ANIMATION_SCALE, - context.getResources().getFloat( - R.dimen.config_appTransitionAnimationDurationScaleDefault)); + mTransitionAnimationScaleSetting = getTransitionAnimationScaleSetting();
/media/esteban/ACOS/ResurrectionX/frameworks/base/services/core/java/com/android/server/wm/WindowManagerService.java
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
Intent.ACTION_PACKAGES_SUSPENDED.equals(intent.getAction()); updateHiddenWhileSuspendedState(new ArraySet<>(Arrays.asList(affectedPackages)), suspended); } }, UserHandle.ALL, suspendPackagesFilter, null, null); final ContentResolver resolver = context.getContentResolver(); // Get persisted window scale setting mWindowAnimationScaleSetting = Settings.Global.getFloat(resolver, Settings.Global.WINDOW_ANIMATION_SCALE, mWindowAnimationScaleSetting);
+ show +
1143
1144
1145
1146
mTransitionAnimationScaleSetting = Settings.Global.getFloat(resolver, Settings.Global.TRANSITION_ANIMATION_SCALE, context.getResources().getFloat( R.dimen.config_appTransitionAnimationDurationScaleDefault));
+ show +
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
setAnimatorDurationScale(Settings.Global.getFloat(resolver, Settings.Global.ANIMATOR_DURATION_SCALE, mAnimatorDurationScaleSetting)); mForceDesktopModeOnExternalDisplays = Settings.Global.getInt(resolver, DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS, 0) != 0; IntentFilter filter = new IntentFilter(); // Track changes to DevicePolicyManager state so we can enable/disable keyguard. filter.addAction(ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED);

[CVE-2022-20543_1.diff] WindowManagerService.java #4
+ private float getTransitionAnimationScaleSetting() { + return fixScale(Settings.Global.getFloat(mContext.getContentResolver(), + Settings.Global.TRANSITION_ANIMATION_SCALE, mContext.getResources().getFloat( + R.dimen.config_appTransitionAnimationDurationScaleDefault))); + } + - static float fixScale(float scale) { - if (scale < 0) scale = 0; - else if (scale > 20) scale = 20; - return Math.abs(scale); - }
/media/esteban/ACOS/ResurrectionX/frameworks/base/services/core/java/com/android/server/wm/WindowManagerService.java
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
mPolicy.showGlobalActions(); } @Override public void closeSystemDialogs(String reason) { synchronized (mGlobalLock) { mRoot.closeSystemDialogs(reason); } }
+ show +
3021
3022
3023
3024
static float fixScale(float scale) { if (scale < 0) scale = 0; else if (scale > 20) scale = 20; return Math.abs(scale);
+ show +
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
} @Override public void setAnimationScale(int which, float scale) { if (!checkCallingPermission(android.Manifest.permission.SET_ANIMATION_SCALE, "setAnimationScale()")) { throw new SecurityException("Requires SET_ANIMATION_SCALE permission"); } scale = fixScale(scale);

[CVE-2022-20543_1.diff] WindowManagerService.java #5
- mTransitionAnimationScaleSetting = Settings.Global.getFloat( - mContext.getContentResolver(), - Settings.Global.TRANSITION_ANIMATION_SCALE, - mTransitionAnimationScaleSetting); + mTransitionAnimationScaleSetting = + getTransitionAnimationScaleSetting();
/media/esteban/ACOS/ResurrectionX/frameworks/base/services/core/java/com/android/server/wm/WindowManagerService.java
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
final int mode = msg.arg1; switch (mode) { case WINDOW_ANIMATION_SCALE: { mWindowAnimationScaleSetting = Settings.Global.getFloat( mContext.getContentResolver(), Settings.Global.WINDOW_ANIMATION_SCALE, mWindowAnimationScaleSetting); break; } case TRANSITION_ANIMATION_SCALE: {
+ show +
4749
4750
4751
4752
mTransitionAnimationScaleSetting = Settings.Global.getFloat( mContext.getContentResolver(), Settings.Global.TRANSITION_ANIMATION_SCALE, mTransitionAnimationScaleSetting);
+ show +
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
break; } case ANIMATION_DURATION_SCALE: { mAnimatorDurationScaleSetting = Settings.Global.getFloat( mContext.getContentResolver(), Settings.Global.ANIMATOR_DURATION_SCALE, mAnimatorDurationScaleSetting); dispatchNewAnimatorScaleLocked(null); break; }

[CVE-2021-0442_1.diff] InputMonitor.java #3
+ inputWindowHandle.inputApplicationHandle = child.mActivityRecord != null + ? child.mActivityRecord.getInputApplicationHandle(false /* update */) : null; - if (newApp == null) { - mService.mInputManager.setFocusedApplication(mDisplayId, null); - } else { - final InputApplicationHandle handle = newApp.mInputApplicationHandle; - handle.name = newApp.toString(); - handle.dispatchingTimeoutNanos = newApp.mInputDispatchingTimeoutNanos; - - mService.mInputManager.setFocusedApplication(mDisplayId, handle); - } + mService.mInputManager.setFocusedApplication(mDisplayId, + newApp != null ? newApp.getInputApplicationHandle(true /* update */) : null);
/media/esteban/ACOS/ResurrectionX/frameworks/base/services/core/java/com/android/server/wm/InputMonitor.java
352
353
354
355
356
357
358
359
360
361
setUpdateInputWindowsNeededLw(); if (updateInputWindows) { updateInputWindowsLw(false /*force*/); } } } public void setFocusedAppLw(AppWindowToken newApp) { // Focused app has changed.
+ show +
362
363
364
365
366
367
368
369
if (newApp == null) { mService.mInputManager.setFocusedApplication(mDisplayId, null); } else { final InputApplicationHandle handle = newApp.mInputApplicationHandle; handle.name = newApp.toString(); handle.dispatchingTimeoutNanos = newApp.mInputDispatchingTimeoutNanos; mService.mInputManager.setFocusedApplication(mDisplayId, handle);
+ show +
370
371
372
373
374
375
376
377
378
379
} } public void pauseDispatchingLw(WindowToken window) { if (! window.paused) { if (DEBUG_INPUT) { Slog.v(TAG_WM, "Pausing WindowToken " + window); } window.paused = true;

[CVE-2021-0442_1.diff] InputConsumerImpl.java #1
- mApplicationHandle = new InputApplicationHandle(new Binder()); - mApplicationHandle.name = name; - mApplicationHandle.dispatchingTimeoutNanos = - WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS; + mApplicationHandle = new InputApplicationHandle(new Binder(), name, + WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS);
/media/esteban/ACOS/ResurrectionX/frameworks/base/services/core/java/com/android/server/wm/InputConsumerImpl.java
60
61
62
63
64
65
66
67
68
69
mServerChannel = channels[0]; if (inputChannel != null) { channels[1].transferTo(inputChannel); channels[1].dispose(); mClientChannel = inputChannel; } else { mClientChannel = channels[1]; } mService.mInputManager.registerInputChannel(mServerChannel, null);
+ show +
70
71
72
73
mApplicationHandle = new InputApplicationHandle(new Binder()); mApplicationHandle.name = name; mApplicationHandle.dispatchingTimeoutNanos = WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS;
+ show +
74
75
76
77
78
79
80
81
82
83
mWindowHandle = new InputWindowHandle(mApplicationHandle, null, displayId); mWindowHandle.name = name; mWindowHandle.token = mServerChannel.getToken(); mWindowHandle.layoutParamsType = WindowManager.LayoutParams.TYPE_INPUT_CONSUMER; mWindowHandle.layer = getLayerLw(mWindowHandle.layoutParamsType); mWindowHandle.layoutParamsFlags = 0; mWindowHandle.dispatchingTimeoutNanos = WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS; mWindowHandle.visible = true;

[CVE-2021-0571_1.diff] AppTaskImpl.java #2
- if (!mService.isSameApp(callingUid, callingPackage)) { - String msg = "Permission Denial: moveToFront() from pid=" - + Binder.getCallingPid() + " as package " + callingPackage; - Slog.w(TAG, msg); - throw new SecurityException(msg); - } + mService.assertPackageMatchesCallingUid(callingPackage);
/media/esteban/ACOS/ResurrectionX/frameworks/base/services/core/java/com/android/server/wm/AppTaskImpl.java
90
91
92
93
94
95
96
97
98
99
} } } @Override public void moveToFront(IApplicationThread appThread, String callingPackage) { checkCaller(); // Will bring task to front if it already has a root activity. final int callingPid = Binder.getCallingPid(); final int callingUid = Binder.getCallingUid();
+ show +
100
101
102
103
104
if (!mService.isSameApp(callingUid, callingPackage)) { String msg = "Permission Denial: moveToFront() from pid=" + Binder.getCallingPid() + " as package " + callingPackage; Slog.w(TAG, msg); throw new SecurityException(msg);
+ show +
105
106
107
108
109
110
111
112
113
114
} final long origId = Binder.clearCallingIdentity(); try { synchronized (mService.mGlobalLock) { if (!mService.checkAppSwitchAllowedLocked(callingPid, callingUid, -1, -1, "Move to front")) { return; } WindowProcessController callerApp = null; if (appThread != null) {

[CVE-2023-21285_1.diff] MediaSessionRecord.java #6
+import android.content.ContentProvider; +import android.content.ContentResolver; +import com.android.server.LocalServices; +import com.android.server.uri.UriGrantsManagerInternal; + + private static final String[] ART_URIS = new String[] { + MediaMetadata.METADATA_KEY_ALBUM_ART_URI, + MediaMetadata.METADATA_KEY_ART_URI, + MediaMetadata.METADATA_KEY_DISPLAY_ICON_URI}; + private final UriGrantsManagerInternal mUgmInternal; + mUgmInternal = LocalServices.getService(UriGrantsManagerInternal.class); - MediaMetadata temp = metadata == null ? null : new MediaMetadata.Builder(metadata) - .build(); - // This is to guarantee that the underlying bundle is unparceled - // before we set it to prevent concurrent reads from throwing an - // exception - if (temp != null) { - temp.size(); - } - mMetadata = temp; + mMetadata = sanitizeMediaMetadata(metadata); + private MediaMetadata sanitizeMediaMetadata(MediaMetadata metadata) { + if (metadata == null) { + return null; + } + MediaMetadata.Builder metadataBuilder = new MediaMetadata.Builder(metadata); + for (String key: ART_URIS) { + String uriString = metadata.getString(key); + if (TextUtils.isEmpty(uriString)) { + continue; + } + Uri uri = Uri.parse(uriString); + if (!ContentResolver.SCHEME_CONTENT.equals(uri.getScheme())) { + continue; + } + try { + mUgmInternal.checkGrantUriPermission(getUid(), + getPackageName(), + ContentProvider.getUriWithoutUserId(uri), + Intent.FLAG_GRANT_READ_URI_PERMISSION, + ContentProvider.getUserIdFromUri(uri, getUserId())); + } catch (SecurityException e) { + metadataBuilder.putString(key, null); + } + } + MediaMetadata sanitizedMetadata = metadataBuilder.build(); + // sanitizedMetadata.size() guarantees that the underlying bundle is unparceled + // before we set it to prevent concurrent reads from throwing an + // exception + sanitizedMetadata.size(); + return sanitizedMetadata; + } +
/media/esteban/ACOS/ResurrectionX/frameworks/base/services/core/java/com/android/server/media/MediaSessionRecord.java
863
864
865
866
867
868
869
870
871
872
@Override public void setLaunchPendingIntent(PendingIntent pi) throws RemoteException { mLaunchIntent = pi; } @Override public void setMetadata(MediaMetadata metadata, long duration, String metadataDescription) throws RemoteException { synchronized (mLock) {
+ show +
873
874
875
876
877
878
879
880
881
MediaMetadata temp = metadata == null ? null : new MediaMetadata.Builder(metadata) .build(); // This is to guarantee that the underlying bundle is unparceled // before we set it to prevent concurrent reads from throwing an // exception if (temp != null) { temp.size(); } mMetadata = temp;
+ show +
882
883
884
885
886
887
888
889
890
891
mDuration = duration; mMetadataDescription = metadataDescription; } mHandler.post(MessageHandler.MSG_UPDATE_METADATA); } @Override public void setPlaybackState(PlaybackState state) throws RemoteException { int oldState = mPlaybackState == null ? PlaybackState.STATE_NONE : mPlaybackState.getState();

[CVE-2023-21131_1.diff] AccountManagerService.java #1
- intent.setFlags(intent.getFlags() & ~(Intent.FLAG_GRANT_READ_URI_PERMISSION - | Intent.FLAG_GRANT_WRITE_URI_PERMISSION - | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION - | Intent.FLAG_GRANT_PREFIX_URI_PERMISSION));
/media/esteban/ACOS/ResurrectionX/frameworks/base/services/core/java/com/android/server/accounts/AccountManagerService.java
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
/** * Checks Intents, supplied via KEY_INTENT, to make sure that they don't violate our * security policy. * * In particular we want to make sure that the Authenticator doesn't try to trick users * into launching arbitrary intents on the device via by tricking to click authenticator * supplied entries in the system Settings app. */ protected boolean checkKeyIntent(int authUid, Intent intent) {
+ show +
4779
4780
4781
4782
intent.setFlags(intent.getFlags() & ~(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION | Intent.FLAG_GRANT_PREFIX_URI_PERMISSION));
+ show +
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
long bid = Binder.clearCallingIdentity(); try { PackageManager pm = mContext.getPackageManager(); ResolveInfo resolveInfo = pm.resolveActivityAsUser(intent, 0, mAccounts.userId); if (resolveInfo == null) { return false; } ActivityInfo targetActivityInfo = resolveInfo.activityInfo; int targetUid = targetActivityInfo.applicationInfo.uid; PackageManagerInternal pmi = LocalServices.getService(PackageManagerInternal.class);

[CVE-2019-2219_1.diff] NotificationManagerService.java #18
- // tell the assistant service about the notification - if (mAssistants.isEnabled()) { - mAssistants.onNotificationEnqueuedLocked(r); - mHandler.postDelayed(new PostNotificationRunnable(r.getKey()), - DELAY_FOR_ASSISTANT_TIME); - } else { - mHandler.post(new PostNotificationRunnable(r.getKey())); - } + postPostNotificationRunnableMaybeDelayedLocked( + r, new PostNotificationRunnable(r.getKey())); + /** + * Mainly needed as a hook for tests which require setting up enqueued-but-not-posted + * notification records + */ + @GuardedBy("mNotificationLock") + protected void postPostNotificationRunnableMaybeDelayedLocked( + NotificationRecord r, + PostNotificationRunnable runnable) { + // tell the assistant service about the notification + if (mAssistants.isEnabled()) { + mAssistants.onNotificationEnqueuedLocked(r); + mHandler.postDelayed(runnable, DELAY_FOR_ASSISTANT_TIME); + } else { + mHandler.post(runnable); + } + } +
/media/esteban/ACOS/ResurrectionX/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
int enqueueStatus = EVENTLOG_ENQUEUE_STATUS_NEW; if (old != null) { enqueueStatus = EVENTLOG_ENQUEUE_STATUS_UPDATE; } EventLogTags.writeNotificationEnqueue(callingUid, callingPid, pkg, id, tag, userId, notification.toString(), enqueueStatus); } // tell the assistant service about the notification
+ show +
5646
5647
5648
5649
5650
5651
if (mAssistants.isEnabled()) { mAssistants.onNotificationEnqueuedLocked(r); mHandler.postDelayed(new PostNotificationRunnable(r.getKey()), DELAY_FOR_ASSISTANT_TIME); } else { mHandler.post(new PostNotificationRunnable(r.getKey()));
+ show +
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
} } } } @GuardedBy("mNotificationLock") boolean isPackagePausedOrSuspended(String pkg, int uid) { boolean isPaused; final PackageManagerInternal pmi = LocalServices.getService(

[CVE-2021-0923_1.diff] PermissionManagerService.java #3
- EventLog.writeEvent(0x534e4554, "154505240", uid, - "Revoking permission " + permName + " from package " - + packageName + " due to definition change"); - EventLog.writeEvent(0x534e4554, "168319670", uid, - "Revoking permission " + permName + " from package " - + packageName + " due to definition change"); + if (isInternalPermission) { + EventLog.writeEvent(0x534e4554, "195338390", uid, + "Revoking permission " + permName + " from package " + + packageName + " due to definition change"); + } else { + EventLog.writeEvent(0x534e4554, "154505240", uid, + "Revoking permission " + permName + " from package " + + packageName + " due to definition change"); + EventLog.writeEvent(0x534e4554, "168319670", uid, + "Revoking permission " + permName + " from package " + + packageName + " due to definition change"); + } + packageName + " due to definition change");
/media/esteban/ACOS/ResurrectionX/frameworks/base/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
759
760
761
762
763
764
765
766
767
768
} final int permissionState = checkPermission(permName, packageName, Binder.getCallingUid(), userId); final int flags = getPermissionFlags(permName, packageName, Binder.getCallingUid(), userId); final int flagMask = FLAG_PERMISSION_SYSTEM_FIXED | FLAG_PERMISSION_POLICY_FIXED | FLAG_PERMISSION_GRANTED_BY_DEFAULT; if (permissionState == PackageManager.PERMISSION_GRANTED && (flags & flagMask) == 0) {
+ show +
769
770
771
772
773
774
EventLog.writeEvent(0x534e4554, "154505240", uid, "Revoking permission " + permName + " from package " + packageName + " due to definition change"); EventLog.writeEvent(0x534e4554, "168319670", uid, "Revoking permission " + permName + " from package " + packageName + " due to definition change");
+ show +
775
776
777
778
779
780
781
782
783
784
Slog.e(TAG, "Revoking permission " + permName + " from package " + packageName + " due to definition change"); try { revokeRuntimePermission(permName, packageName, false, userId, permissionCallback); } catch (Exception e) { Slog.e(TAG, "Could not revoke " + permName + " from " + packageName, e); } }

[CVE-2021-0554_1.diff] DevicePolicyManagerService.java #1
- synchronized (getLockObject()) { - try { - IBackupManager ibm = mInjector.getIBackupManager(); - return ibm != null && ibm.isBackupServiceActive( - mInjector.userHandleGetCallingUserId()); - } catch (RemoteException e) { - throw new IllegalStateException("Failed requesting backup service state.", e); + final int userId = mInjector.userHandleGetCallingUserId(); + return mInjector.binderWithCleanCallingIdentity(() -> { + synchronized (getLockObject()) { + try { + IBackupManager ibm = mInjector.getIBackupManager(); + return ibm != null && ibm.isBackupServiceActive(userId); + } catch (RemoteException e) { + throw new IllegalStateException("Failed requesting backup service state.", e); + } - } + });
/media/esteban/ACOS/ResurrectionX/frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
} @Override public boolean isBackupServiceEnabled(ComponentName admin) { Preconditions.checkNotNull(admin); if (!mHasFeature) { return true; } enforceProfileOrDeviceOwner(admin);
+ show +
13026
13027
13028
13029
13030
13031
13032
synchronized (getLockObject()) { try { IBackupManager ibm = mInjector.getIBackupManager(); return ibm != null && ibm.isBackupServiceActive( mInjector.userHandleGetCallingUserId()); } catch (RemoteException e) { throw new IllegalStateException("Failed requesting backup service state.", e);
+ show +
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
} } } @Override public boolean bindDeviceAdminServiceAsUser( @NonNull ComponentName admin, @NonNull IApplicationThread caller, @Nullable IBinder activtiyToken, @NonNull Intent serviceIntent, @NonNull IServiceConnection connection, int flags, @UserIdInt int targetUserId) { if (!mHasFeature) {

[CVE-2024-31318_1.diff] CompanionDeviceManagerService.java #2
- public void onShellCommand(FileDescriptor in, FileDescriptor out, FileDescriptor err, - String[] args, ShellCallback callback, ResultReceiver resultReceiver) - throws RemoteException { - new ShellCmd().exec(this, in, out, err, args, callback, resultReceiver); + public int handleShellCommand(@NonNull ParcelFileDescriptor in, + @NonNull ParcelFileDescriptor out, @NonNull ParcelFileDescriptor err, + @NonNull String[] args) { + return new ShellCmd() + .exec(this, in.getFileDescriptor(), out.getFileDescriptor(), + err.getFileDescriptor(), args);
/media/esteban/ACOS/ResurrectionX/frameworks/base/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java
360
361
362
363
364
365
366
367
368
369
int numFeatures = ArrayUtils.size(reqFeatures); for (int i = 0; i < numFeatures; i++) { if (requiredFeature.equals(reqFeatures[i].name)) return; } throw new IllegalStateException("Must declare uses-feature " + requiredFeature + " in manifest to use this API"); } @Override
+ show +
370
371
372
373
public void onShellCommand(FileDescriptor in, FileDescriptor out, FileDescriptor err, String[] args, ShellCallback callback, ResultReceiver resultReceiver) throws RemoteException { new ShellCmd().exec(this, in, out, err, args, callback, resultReceiver);
+ show +
374
375
376
377
378
379
380
381
382
383
} } private static int getCallingUserId() { return UserHandle.getUserId(Binder.getCallingUid()); } private static boolean isCallerSystem() { return Binder.getCallingUid() == Process.SYSTEM_UID; }

[CVE-2016-3916_1.diff] camera_metadata.c #4
-size_t calculate_camera_metadata_entry_data_size(uint8_t type, - size_t data_count) { - if (type >= NUM_TYPES) return 0; - size_t data_bytes = data_count * - camera_metadata_type_size[type]; - return data_bytes <= 4 ? 0 : ALIGN_TO(data_bytes, DATA_ALIGNMENT); -} -
/media/esteban/ACOS/ResurrectionX/system/media/camera/src/camera_metadata.c
385
386
387
388
389
390
391
392
393
394
size_t data_bytes = data_count * camera_metadata_type_size[type]; if (data_size) { *data_size = data_bytes <= 4 ? 0 : ALIGN_TO(data_bytes, DATA_ALIGNMENT); } return OK; }
+ show +
395
396
397
398
399
400
401
402
size_t calculate_camera_metadata_entry_data_size(uint8_t type, size_t data_count) { if (type >= NUM_TYPES) return 0; size_t data_bytes = data_count * camera_metadata_type_size[type]; return data_bytes <= 4 ? 0 : ALIGN_TO(data_bytes, DATA_ALIGNMENT);
+ show +
403
404
405
406
407
408
409
410
411
412
} int validate_camera_metadata_structure(const camera_metadata_t *metadata, const size_t *expected_size) { if (metadata == NULL) { ALOGE("%s: metadata is null!", __FUNCTION__); return CAMERA_METADATA_VALIDATION_ERROR; }

[CVE-2018-9488_1.diff] crash_dump.te #1
+ +allow crash_dump { + domain + -bpfloader + -crash_dump + -init + -kernel + -keystore + -logd + -ueventd + -vendor_init + -vold +}:process { ptrace signal sigchld sigstop sigkill }; -allow crash_dump { - domain - -init - -crash_dump - -keystore - -logd -}:process { ptrace signal sigchld sigstop sigkill }; -
/media/esteban/ACOS/ResurrectionX/system/sepolicy/prebuilts/api/26.0/public/crash_dump.te
1
2
3
type crash_dump, domain; type crash_dump_exec, exec_type, file_type;
+ show +
4
5
6
7
8
9
10
allow crash_dump { domain -init -crash_dump -keystore -logd }:process { ptrace signal sigchld sigstop sigkill };
+ show +
11
12
13
14
15
16
17
18
19
20
# crash_dump might inherit CAP_SYS_PTRACE from a privileged process, # which will result in an audit log even when it's allowed to trace. dontaudit crash_dump self:capability { sys_ptrace }; userdebug_or_eng(` allow crash_dump logd:process { ptrace signal sigchld sigstop sigkill }; ') # Use inherited file descriptors
/media/esteban/ACOS/ResurrectionX/system/sepolicy/prebuilts/api/27.0/public/crash_dump.te
1
2
3
type crash_dump, domain; type crash_dump_exec, exec_type, file_type;
+ show +
4
5
6
7
8
9
10
allow crash_dump { domain -init -crash_dump -keystore -logd }:process { ptrace signal sigchld sigstop sigkill };
+ show +
11
12
13
14
15
16
17
18
19
20
# crash_dump might inherit CAP_SYS_PTRACE from a privileged process, # which will result in an audit log even when it's allowed to trace. dontaudit crash_dump self:capability { sys_ptrace }; userdebug_or_eng(` allow crash_dump logd:process { ptrace signal sigchld sigstop sigkill }; # Let crash_dump write to /dev/kmsg_debug crashes that happen before logd comes up. allow crash_dump kmsg_debug_device:chr_file { open append };

[CVE-2018-9488_1.diff] crash_dump.te #1
+ +allow crash_dump { + domain + -bpfloader + -crash_dump + -init + -kernel + -keystore + -logd + -ueventd + -vendor_init + -vold +}:process { ptrace signal sigchld sigstop sigkill }; -allow crash_dump { - domain - -init - -crash_dump - -keystore - -logd -}:process { ptrace signal sigchld sigstop sigkill }; -
/media/esteban/ACOS/ResurrectionX/system/sepolicy/prebuilts/api/26.0/public/crash_dump.te
1
2
3
type crash_dump, domain; type crash_dump_exec, exec_type, file_type;
+ show +
4
5
6
7
8
9
10
allow crash_dump { domain -init -crash_dump -keystore -logd }:process { ptrace signal sigchld sigstop sigkill };
+ show +
11
12
13
14
15
16
17
18
19
20
# crash_dump might inherit CAP_SYS_PTRACE from a privileged process, # which will result in an audit log even when it's allowed to trace. dontaudit crash_dump self:capability { sys_ptrace }; userdebug_or_eng(` allow crash_dump logd:process { ptrace signal sigchld sigstop sigkill }; ') # Use inherited file descriptors
/media/esteban/ACOS/ResurrectionX/system/sepolicy/prebuilts/api/27.0/public/crash_dump.te
1
2
3
type crash_dump, domain; type crash_dump_exec, exec_type, file_type;
+ show +
4
5
6
7
8
9
10
allow crash_dump { domain -init -crash_dump -keystore -logd }:process { ptrace signal sigchld sigstop sigkill };
+ show +
11
12
13
14
15
16
17
18
19
20
# crash_dump might inherit CAP_SYS_PTRACE from a privileged process, # which will result in an audit log even when it's allowed to trace. dontaudit crash_dump self:capability { sys_ptrace }; userdebug_or_eng(` allow crash_dump logd:process { ptrace signal sigchld sigstop sigkill }; # Let crash_dump write to /dev/kmsg_debug crashes that happen before logd comes up. allow crash_dump kmsg_debug_device:chr_file { open append };

[CVE-2021-39671_1.diff] aidl_const_expressions.cpp #1
-static bool isValidLiteralChar(char c) { - return !(c <= 0x1f || // control characters are < 0x20 - c >= 0x7f || // DEL is 0x7f - c == '\\'); // Disallow backslashes for future proofing. -} -
/media/esteban/ACOS/ResurrectionX/system/tools/aidl/aidl_language.cpp
331
332
333
334
335
336
337
338
339
340
const std::string& checked_value) : AidlNode(location), type_(type), value_(checked_value) { CHECK(!value_.empty() || type_ == Type::ERROR); CHECK(type_ != Type::ARRAY); } AidlConstantValue::AidlConstantValue(const AidlLocation& location, Type type, std::vector<std::unique_ptr<AidlConstantValue>>* values) : AidlNode(location), type_(type), values_(std::move(*values)) {}
+ show +
341
342
343
344
static bool isValidLiteralChar(char c) { return !(c <= 0x1f || // control characters are < 0x20 c >= 0x7f || // DEL is 0x7f c == '\\'); // Disallow backslashes for future proofing.
+ show +
345
346
347
348
349
350
351
352
353
354
} AidlConstantValue* AidlConstantValue::Boolean(const AidlLocation& location, bool value) { return new AidlConstantValue(location, Type::BOOLEAN, value ? "true" : "false"); } AidlConstantValue* AidlConstantValue::Character(const AidlLocation& location, char value) { if (!isValidLiteralChar(value)) { AIDL_ERROR(location) << "Invalid character literal " << value; return new AidlConstantValue(location, Type::ERROR, "");

[CVE-2023-40084_1.diff] MDnsSdListener.cpp #3
- switch (mPollFds[0].revents) { - case POLLIN: { - char readBuf[2]; - read(mCtrlSocketPair[0], &readBuf, 1); - if (DBG) ALOGD("MDnsSdListener::Monitor got %c", readBuf[0]); - if (memcmp(RESCAN, readBuf, 1) == 0) { - pollCount = rescan(); - } + if (mPollFds[0].revents & POLLHUP) { + free(mPollFds); + free(mPollRefs); + if (VDBG) ALOGD("Monitor thread leaving."); + return; + } + if (mPollFds[0].revents == POLLIN) { + char readBuf[2]; + read(mCtrlSocketPair[0], &readBuf, 1); + if (DBG) ALOGD("MDnsSdListener::Monitor got %c", readBuf[0]); + if (memcmp(RESCAN, readBuf, 1) == 0) { + pollCount = rescan();
/media/esteban/ACOS/ResurrectionX/system/netd/server/MDnsSdListener.cpp
604
605
606
607
608
609
610
611
612
613
if (VDBG) { ALOGD("Monitor found [%d].revents = %d - calling ProcessResults", i, mPollFds[i].revents); } std::lock_guard guard(mMutex); DNSServiceProcessResult(*(mPollRefs[i])); mPollFds[i].revents = 0; } } if (VDBG) ALOGD("controlSocket shows revent= %d", mPollFds[0].revents);
+ show +
614
615
616
617
618
619
620
switch (mPollFds[0].revents) { case POLLIN: { char readBuf[2]; read(mCtrlSocketPair[0], &readBuf, 1); if (DBG) ALOGD("MDnsSdListener::Monitor got %c", readBuf[0]); if (memcmp(RESCAN, readBuf, 1) == 0) { pollCount = rescan();
+ show +
621
622
623
624
625
626
627
628
629
630
} } } mPollFds[0].revents = 0; } else { if (VDBG) ALOGD("MDnsSdListener::Monitor poll timed out"); } } free(mPollFds); free(mPollRefs);